powerlines 0.14.0 → 0.15.0
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/api.cjs +14 -0
- package/dist/{internal/api.d.cts → api.d.cts} +14 -14
- package/dist/{internal/api.d.ts → api.d.ts} +14 -14
- package/dist/api.js +5 -0
- package/dist/astro.cjs +12 -14
- package/dist/astro.d.cts +6 -6
- package/dist/astro.d.ts +6 -6
- package/dist/astro.js +9 -11
- package/dist/chunk-22MUBUHP.cjs +10 -0
- package/dist/chunk-2NO7N5OW.cjs +2 -0
- package/dist/chunk-3AEMPMJA.js +29 -0
- package/dist/{chunk-BHP6KBGK.js → chunk-53SIK3PC.js} +2 -4
- package/dist/chunk-7464OF2J.cjs +10 -0
- package/dist/chunk-7GYTTM4M.cjs +2 -0
- package/dist/{chunk-SY7N6FC3.js → chunk-7TKF67GW.js} +1 -3
- package/dist/chunk-AENPRFWJ.cjs +2 -0
- package/dist/chunk-AWZEALXL.cjs +32 -0
- package/dist/chunk-BUR2JQ6G.cjs +11 -0
- package/dist/{chunk-RU6BHTIP.cjs → chunk-C3O6OZ75.cjs} +4 -6
- package/dist/{chunk-BOIEJ5I6.js → chunk-CEMWMWEY.js} +3 -5
- package/dist/chunk-CJSGAITR.js +9 -0
- package/dist/{chunk-6TJGZR5X.js → chunk-CWCEYGLM.js} +1 -4
- package/dist/chunk-DRXFQCNC.js +1 -0
- package/dist/{chunk-V7LXFIGK.js → chunk-DTVAXYH7.js} +19 -4
- package/dist/{chunk-APVMN2H7.cjs → chunk-ETKZMGLN.cjs} +0 -2
- package/dist/{chunk-UZQYBO6Z.cjs → chunk-F5NKLRZD.cjs} +2 -5
- package/dist/{chunk-5VPVJHJO.cjs → chunk-FCTNMPJF.cjs} +0 -2
- package/dist/chunk-FNZDWE4L.js +1 -0
- package/dist/{chunk-WCTOTE3T.cjs → chunk-FSZEVJIL.cjs} +31 -16
- package/dist/chunk-FUXITWBD.cjs +10 -0
- package/dist/{chunk-A3BBPLTY.js → chunk-G45EBQMJ.js} +1 -3
- package/dist/chunk-GHJU2KGP.cjs +2 -0
- package/dist/chunk-H26QYGLD.cjs +10 -0
- package/dist/chunk-HQFZ64VC.cjs +2 -0
- package/dist/chunk-J4BQZHTQ.js +1 -0
- package/dist/chunk-JGB5YQ2U.js +1 -0
- package/dist/{chunk-EBMELFCF.js → chunk-JQCWV4DT.js} +0 -2
- package/dist/chunk-KALR2O2F.cjs +2 -0
- package/dist/chunk-KIKTWMI3.cjs +2 -0
- package/dist/{chunk-ZP5QLZQ2.js → chunk-KQPL2ZMU.js} +2 -4
- package/dist/{chunk-ELHJY5WG.cjs → chunk-KZMYPV7R.cjs} +7 -9
- package/dist/{chunk-RBRFT2R6.js → chunk-LQEDMNSD.js} +1 -3
- package/dist/{chunk-FANQC345.cjs → chunk-LZM7R4YU.cjs} +6 -8
- package/dist/{chunk-L3DAMAEC.js → chunk-MQXT2JKH.js} +2 -4
- package/dist/{chunk-4HGQJ4KR.js → chunk-OBYFBPPO.js} +0 -2
- package/dist/chunk-OO3YXM72.js +1 -0
- package/dist/chunk-P3BPRVO6.cjs +22 -0
- package/dist/chunk-QE3WGMAP.js +1 -0
- package/dist/{chunk-P4BOYWXT.js → chunk-REW4ZSBN.js} +522 -507
- package/dist/{chunk-22K72CJ5.cjs → chunk-RF6RSWD4.cjs} +0 -2
- package/dist/{chunk-7QVYU63E.js → chunk-SHUYVCID.js} +0 -2
- package/dist/chunk-SMNKPH4T.js +1 -0
- package/dist/{chunk-PK6SKIKE.cjs → chunk-USNT2KNT.cjs} +0 -2
- package/dist/chunk-V3MLQDZQ.js +1 -0
- package/dist/{chunk-ZQ7U35QZ.js → chunk-VBAXXI72.js} +1 -3
- package/dist/{chunk-7UIYU6SC.js → chunk-VIRLWSS6.js} +2 -4
- package/dist/{chunk-SIZKRND7.js → chunk-W5X3ZEZ5.js} +0 -2
- package/dist/{chunk-LO77RPRV.js → chunk-WJ4CZKXY.js} +0 -2
- package/dist/chunk-WWJBVH7C.cjs +17 -0
- package/dist/chunk-XLRMX2NL.cjs +10 -0
- package/dist/{chunk-YIWHO6SW.cjs → chunk-XP7OML7S.cjs} +0 -2
- package/dist/chunk-XVLT2RQ2.js +1 -0
- package/dist/{chunk-V5D5NVV7.cjs → chunk-XWSGD2C3.cjs} +4 -6
- package/dist/chunk-YRJ4MLVL.cjs +2 -0
- package/dist/{chunk-MAEKW52U.js → chunk-YWJMO2CR.js} +3 -5
- package/dist/chunk-ZC43PZXS.cjs +2 -0
- package/dist/{chunk-NGKWITCO.js → chunk-ZCO7TMWP.js} +1 -3
- package/dist/{chunk-PJRHRDLS.cjs → chunk-ZJSWJ27U.cjs} +591 -578
- package/dist/config.cjs +11 -0
- package/dist/{define-config.d.cts → config.d.cts} +4 -4
- package/dist/{define-config.d.ts → config.d.ts} +4 -4
- package/dist/config.js +2 -0
- package/dist/esbuild.cjs +11 -13
- package/dist/esbuild.d.cts +6 -6
- package/dist/esbuild.d.ts +6 -6
- package/dist/esbuild.js +8 -10
- package/dist/farm.cjs +7 -9
- package/dist/farm.d.cts +6 -6
- package/dist/farm.d.ts +6 -6
- package/dist/farm.js +6 -8
- package/dist/{hooks-q1Az_C64.d.ts → hooks-ByM-4_UN.d.ts} +1 -1
- package/dist/{hooks-Wrj1dKJ9.d.cts → hooks-DcH9z5L5.d.cts} +1 -1
- package/dist/index.cjs +43 -51
- package/dist/index.d.cts +11 -12
- package/dist/index.d.ts +11 -12
- package/dist/index.js +31 -35
- package/dist/lib/build/esbuild.cjs +6 -8
- package/dist/lib/build/esbuild.d.cts +3 -2
- package/dist/lib/build/esbuild.d.ts +3 -2
- package/dist/lib/build/esbuild.js +3 -5
- package/dist/lib/build/index.cjs +27 -29
- package/dist/lib/build/index.d.cts +4 -3
- package/dist/lib/build/index.d.ts +4 -3
- package/dist/lib/build/index.js +11 -13
- package/dist/lib/build/rolldown.cjs +4 -6
- package/dist/lib/build/rolldown.d.cts +3 -2
- package/dist/lib/build/rolldown.d.ts +3 -2
- package/dist/lib/build/rolldown.js +3 -5
- package/dist/lib/build/rollup.cjs +4 -6
- package/dist/lib/build/rollup.d.cts +3 -2
- package/dist/lib/build/rollup.d.ts +3 -2
- package/dist/lib/build/rollup.js +2 -4
- package/dist/lib/build/rspack.cjs +3 -5
- package/dist/lib/build/rspack.d.cts +3 -2
- package/dist/lib/build/rspack.d.ts +3 -2
- package/dist/lib/build/rspack.js +2 -4
- package/dist/lib/build/tsup.cjs +7 -9
- package/dist/lib/build/tsup.d.cts +3 -2
- package/dist/lib/build/tsup.d.ts +3 -2
- package/dist/lib/build/tsup.js +4 -6
- package/dist/lib/build/unbuild.cjs +7 -9
- package/dist/lib/build/unbuild.d.cts +4 -3
- package/dist/lib/build/unbuild.d.ts +4 -3
- package/dist/lib/build/unbuild.js +4 -6
- package/dist/lib/build/vite.cjs +6 -8
- package/dist/lib/build/vite.d.cts +3 -2
- package/dist/lib/build/vite.d.ts +3 -2
- package/dist/lib/build/vite.js +4 -6
- package/dist/lib/build/webpack.cjs +3 -5
- package/dist/lib/build/webpack.d.cts +3 -2
- package/dist/lib/build/webpack.d.ts +3 -2
- package/dist/lib/build/webpack.js +2 -4
- package/dist/lib/{chunk-RQICHHZM.cjs → chunk-2NZADVP5.cjs} +2 -4
- package/dist/lib/{chunk-UQJWVRRE.cjs → chunk-3OCI4TH7.cjs} +4 -6
- package/dist/lib/{chunk-MFC7UJHT.cjs → chunk-4NHFXDTQ.cjs} +3 -5
- package/dist/lib/{chunk-LBMMBFQE.js → chunk-4ZOJG7G7.js} +20 -10
- package/dist/lib/{chunk-V2T4H24I.js → chunk-54XNJQTH.js} +1 -3
- package/dist/lib/{chunk-JTUL3477.cjs → chunk-5EXW3ZRC.cjs} +3 -5
- package/dist/lib/{chunk-LEIOWD2W.js → chunk-633SP5HS.js} +2 -4
- package/dist/lib/{chunk-YVDJCVE5.cjs → chunk-67IBLMW6.cjs} +10 -12
- package/dist/lib/{chunk-3I2YOM2E.js → chunk-6BEYR6PG.js} +4 -7
- package/dist/lib/{chunk-GWYTWFZE.cjs → chunk-6G7CP6RO.cjs} +4 -6
- package/dist/lib/{chunk-MAHHHINV.js → chunk-6RLV3FIS.js} +2 -4
- package/dist/lib/{chunk-MVQSM5WM.cjs → chunk-7JTHFA7I.cjs} +23 -13
- package/dist/lib/{chunk-7EAV6Q7B.cjs → chunk-7K7JH3DF.cjs} +2 -4
- package/dist/lib/{chunk-VJN72T2O.js → chunk-7OHD3BD4.js} +1 -3
- package/dist/lib/{chunk-Q3KJZ3B5.js → chunk-7Y5MJRWF.js} +8 -10
- package/dist/lib/{chunk-Q2L3FNJO.js → chunk-ADKYAHF5.js} +2 -4
- package/dist/lib/{chunk-XZD7S5TU.cjs → chunk-AOKLB4V2.cjs} +2 -4
- package/dist/lib/{chunk-LJZEN4HP.cjs → chunk-BQU53ZNB.cjs} +7 -9
- package/dist/lib/{chunk-6IJTWIVJ.cjs → chunk-CGYAL3S2.cjs} +3 -5
- package/dist/lib/{chunk-ESYYL5UH.js → chunk-CXRSMYEX.js} +1 -3
- package/dist/lib/{chunk-7LLECRBP.cjs → chunk-DQ5JBYIN.cjs} +6 -8
- package/dist/lib/chunk-EJ25PQEL.cjs +2 -0
- package/dist/lib/{chunk-35EO5Y7R.js → chunk-ENRLU4UR.js} +1 -3
- package/dist/lib/{chunk-KSBESEOF.js → chunk-EQKS6CLU.js} +2 -4
- package/dist/lib/{chunk-V5OY4ALI.cjs → chunk-F7IDAYLH.cjs} +2 -4
- package/dist/lib/{chunk-5PNLONNN.cjs → chunk-FOC3UTXQ.cjs} +4 -6
- package/dist/lib/{chunk-7R23HVGQ.js → chunk-GANVMM73.js} +1 -3
- package/dist/lib/{chunk-KOCDKJDJ.js → chunk-GRJJZ5VJ.js} +1 -3
- package/dist/lib/chunk-H5JWMXTZ.js +1 -0
- package/dist/lib/{chunk-62ZJYXT3.cjs → chunk-H7A5QVLY.cjs} +5 -7
- package/dist/lib/chunk-HMO3LAYL.js +1 -0
- package/dist/lib/{chunk-RLMEYZ5I.cjs → chunk-IBPA3VN5.cjs} +15 -17
- package/dist/lib/{chunk-6BRTJXZ2.js → chunk-IPOD734M.js} +324 -221
- package/dist/lib/{chunk-LYD5OTBI.cjs → chunk-ISLUSDCG.cjs} +422 -319
- package/dist/lib/{chunk-632PWWU7.cjs → chunk-JA4HSQRN.cjs} +3 -5
- package/dist/lib/{chunk-IK3ABDPP.cjs → chunk-JG4IL7XL.cjs} +2 -4
- package/dist/lib/{chunk-OF5IJ4WG.js → chunk-JU4J5H6E.js} +2 -4
- package/dist/lib/{chunk-LTVWU4J2.js → chunk-KXCEN6Y4.js} +1 -3
- package/dist/lib/{chunk-W4OMKQ7W.cjs → chunk-LJ4WO7TW.cjs} +5 -7
- package/dist/lib/{chunk-BEKLDCTV.cjs → chunk-LPKZKRBW.cjs} +26 -14
- package/dist/lib/{chunk-PXSRMP4E.js → chunk-M263EZ4F.js} +1 -3
- package/dist/lib/{chunk-4XUVP2LL.cjs → chunk-MZJWK36Q.cjs} +2 -4
- package/dist/lib/{chunk-367E23MI.js → chunk-NDYKRNPQ.js} +1 -3
- package/dist/lib/{chunk-NE46WXNJ.js → chunk-NST5TNW6.js} +1 -3
- package/dist/lib/{chunk-ODJBZ6PS.js → chunk-NUDYDRYO.js} +3 -5
- package/dist/lib/{chunk-RXQWNSZX.js → chunk-NWAD7K4D.js} +1 -3
- package/dist/lib/{chunk-STAKGAWR.js → chunk-NZLZLQX2.js} +19 -7
- package/dist/lib/{chunk-GJNFAFKR.cjs → chunk-P3ZIYYSC.cjs} +6 -9
- package/dist/lib/{chunk-CAPN4FSS.js → chunk-Q3ERHHXJ.js} +3 -5
- package/dist/lib/chunk-RJ4277VZ.cjs +2 -0
- package/dist/lib/{chunk-7QVYU63E.js → chunk-SHUYVCID.js} +0 -2
- package/dist/lib/{chunk-YF3YHK4X.js → chunk-SYHVP3OW.js} +1 -3
- package/dist/lib/{chunk-NANLYIUO.cjs → chunk-T6KEXFRH.cjs} +8 -10
- package/dist/lib/{chunk-HQ6TGY34.js → chunk-TANQDHYY.js} +1 -3
- package/dist/lib/{chunk-BW3VFCTS.cjs → chunk-TNHDC2ZQ.cjs} +7 -9
- package/dist/lib/{chunk-ZP7PDTVE.cjs → chunk-UDJ37BEE.cjs} +17 -19
- package/dist/lib/{chunk-PK6SKIKE.cjs → chunk-USNT2KNT.cjs} +0 -2
- package/dist/lib/{chunk-U36VZLW6.cjs → chunk-VQ7CXQLT.cjs} +10 -12
- package/dist/lib/chunk-VVSEE3JE.cjs +2 -0
- package/dist/lib/{chunk-YBIWVB66.js → chunk-WFUO3YPK.js} +1 -3
- package/dist/lib/{chunk-MGEZC2RV.cjs → chunk-XW5TELHB.cjs} +6 -8
- package/dist/lib/{chunk-OO4BIM7N.js → chunk-YOENMDZY.js} +1 -3
- package/dist/lib/chunk-ZBLDAREE.js +1 -0
- package/dist/lib/{chunk-56LQSSQ3.js → chunk-ZPIKFR7Z.js} +4 -6
- package/dist/lib/{config-Ro14HmyO.d.cts → config-AKuoTngV.d.cts} +57 -13
- package/dist/lib/{config-DnifzkPt.d.ts → config-BxVBOnAV.d.ts} +57 -13
- package/dist/lib/config-file.cjs +4 -6
- package/dist/lib/config-file.d.cts +7 -5
- package/dist/lib/config-file.d.ts +7 -5
- package/dist/lib/config-file.js +2 -4
- package/dist/lib/create-program.cjs +3 -5
- package/dist/lib/create-program.d.cts +3 -2
- package/dist/lib/create-program.d.ts +3 -2
- package/dist/lib/create-program.js +2 -4
- package/dist/lib/entry.cjs +10 -12
- package/dist/lib/entry.d.cts +3 -2
- package/dist/lib/entry.d.ts +3 -2
- package/dist/lib/entry.js +2 -4
- package/dist/lib/{hooks-B6Ow5MtE.d.ts → hooks-BKZwFaZD.d.ts} +1 -1
- package/dist/lib/{hooks-CM-BbMzz.d.cts → hooks-D3P6aPKT.d.cts} +1 -1
- package/dist/lib/index.cjs +74 -129
- package/dist/lib/index.d.cts +13 -15
- package/dist/lib/index.d.ts +13 -15
- package/dist/lib/index.js +25 -28
- package/dist/lib/logger.cjs +4 -6
- package/dist/lib/logger.d.cts +4 -4
- package/dist/lib/logger.d.ts +4 -4
- package/dist/lib/logger.js +2 -4
- package/dist/lib/typescript/compiler-host.cjs +21 -23
- package/dist/lib/typescript/compiler-host.d.cts +4 -5
- package/dist/lib/typescript/compiler-host.d.ts +4 -5
- package/dist/lib/typescript/compiler-host.js +3 -5
- package/dist/lib/typescript/import-transformer.cjs +4 -6
- package/dist/lib/typescript/import-transformer.d.cts +3 -2
- package/dist/lib/typescript/import-transformer.d.ts +3 -2
- package/dist/lib/typescript/import-transformer.js +1 -3
- package/dist/lib/typescript/index.cjs +17 -19
- package/dist/lib/typescript/index.d.cts +5 -4
- package/dist/lib/typescript/index.d.ts +5 -4
- package/dist/lib/typescript/index.js +5 -7
- package/dist/lib/typescript/isolated-decl.cjs +3 -5
- package/dist/lib/typescript/isolated-decl.d.cts +1 -2
- package/dist/lib/typescript/isolated-decl.d.ts +1 -2
- package/dist/lib/typescript/isolated-decl.js +2 -4
- package/dist/lib/typescript/program.cjs +7 -9
- package/dist/lib/typescript/program.d.cts +4 -5
- package/dist/lib/typescript/program.d.ts +4 -5
- package/dist/lib/typescript/program.js +2 -4
- package/dist/lib/typescript/tsconfig.cjs +8 -10
- package/dist/lib/typescript/tsconfig.js +2 -4
- package/dist/lib/unplugin/factory.cjs +12 -15
- package/dist/lib/unplugin/factory.d.cts +10 -9
- package/dist/lib/unplugin/factory.d.ts +10 -9
- package/dist/lib/unplugin/factory.js +11 -14
- package/dist/lib/unplugin/index.cjs +16 -19
- package/dist/lib/unplugin/index.d.cts +6 -5
- package/dist/lib/unplugin/index.d.ts +6 -5
- package/dist/lib/unplugin/index.js +13 -16
- package/dist/lib/unplugin/plugin.cjs +6 -8
- package/dist/lib/unplugin/plugin.d.cts +4 -4
- package/dist/lib/unplugin/plugin.d.ts +4 -4
- package/dist/lib/unplugin/plugin.js +5 -7
- package/dist/lib/unplugin/resolve-id.cjs +3 -5
- package/dist/lib/unplugin/resolve-id.d.cts +4 -5
- package/dist/lib/unplugin/resolve-id.d.ts +4 -5
- package/dist/lib/unplugin/resolve-id.js +2 -4
- package/dist/lib/utilities/bundle.cjs +6 -8
- package/dist/lib/utilities/bundle.d.cts +3 -2
- package/dist/lib/utilities/bundle.d.ts +3 -2
- package/dist/lib/utilities/bundle.js +5 -7
- package/dist/lib/utilities/cache.cjs +5 -7
- package/dist/lib/utilities/cache.d.cts +32 -1
- package/dist/lib/utilities/cache.d.ts +32 -1
- package/dist/lib/utilities/cache.js +3 -5
- package/dist/lib/utilities/file-header.cjs +4 -6
- package/dist/lib/utilities/file-header.d.cts +4 -4
- package/dist/lib/utilities/file-header.d.ts +4 -4
- package/dist/lib/utilities/file-header.js +2 -4
- package/dist/lib/utilities/index.cjs +36 -91
- package/dist/lib/utilities/index.d.cts +6 -8
- package/dist/lib/utilities/index.d.ts +6 -8
- package/dist/lib/utilities/index.js +15 -18
- package/dist/lib/utilities/meta.cjs +9 -11
- package/dist/lib/utilities/meta.d.cts +4 -4
- package/dist/lib/utilities/meta.d.ts +4 -4
- package/dist/lib/utilities/meta.js +2 -4
- package/dist/lib/utilities/resolve-path.cjs +3 -5
- package/dist/lib/utilities/resolve-path.d.cts +3 -2
- package/dist/lib/utilities/resolve-path.d.ts +3 -2
- package/dist/lib/utilities/resolve-path.js +2 -4
- package/dist/lib/utilities/resolve.cjs +7 -9
- package/dist/lib/utilities/resolve.d.cts +3 -2
- package/dist/lib/utilities/resolve.d.ts +3 -2
- package/dist/lib/utilities/resolve.js +6 -8
- package/dist/lib/utilities/source-file.cjs +5 -7
- package/dist/lib/utilities/source-file.d.cts +31 -1
- package/dist/lib/utilities/source-file.d.ts +31 -1
- package/dist/lib/utilities/source-file.js +2 -4
- package/dist/lib/utilities/source-map.cjs +3 -5
- package/dist/lib/utilities/source-map.d.cts +33 -2
- package/dist/lib/utilities/source-map.d.ts +33 -2
- package/dist/lib/utilities/source-map.js +2 -4
- package/dist/lib/utilities/worker.cjs +5 -7
- package/dist/lib/utilities/worker.d.cts +4 -4
- package/dist/lib/utilities/worker.d.ts +4 -4
- package/dist/lib/utilities/worker.js +3 -5
- package/dist/lib/utilities/write-file.cjs +3 -5
- package/dist/lib/utilities/write-file.d.cts +3 -2
- package/dist/lib/utilities/write-file.d.ts +3 -2
- package/dist/lib/utilities/write-file.js +2 -4
- package/dist/next.cjs +11 -13
- package/dist/next.js +8 -10
- package/dist/nuxt.cjs +13 -15
- package/dist/nuxt.d.cts +2 -2
- package/dist/nuxt.d.ts +2 -2
- package/dist/nuxt.js +10 -12
- package/dist/{chunk-KMLFL4CW.js → plugin-utils/chunk-3G5FJKN2.js} +1 -3
- package/dist/plugin-utils/chunk-HHFA3IEZ.js +51 -0
- package/dist/{chunk-4AKYOJXA.cjs → plugin-utils/chunk-MIKPJJNG.cjs} +2 -4
- package/dist/{lib/chunk-RK2VVGL6.cjs → plugin-utils/chunk-MQOW6ENT.cjs} +15 -17
- package/dist/{lib/chunk-UGRFAVAJ.js → plugin-utils/chunk-PK6PYFWY.js} +2 -4
- package/dist/plugin-utils/chunk-SHUYVCID.js +4 -0
- package/dist/plugin-utils/chunk-USNT2KNT.cjs +6 -0
- package/dist/plugin-utils/chunk-YKIS7BLU.cjs +53 -0
- package/dist/plugin-utils/config-ClPkPCYC.d.cts +1309 -0
- package/dist/plugin-utils/config-ClPkPCYC.d.ts +1309 -0
- package/dist/plugin-utils/extend.cjs +11 -0
- package/dist/{extend-plugin.d.ts → plugin-utils/extend.d.cts} +6 -23
- package/dist/{extend-plugin.d.cts → plugin-utils/extend.d.ts} +6 -23
- package/dist/plugin-utils/extend.js +2 -0
- package/dist/plugin-utils/get-config-path.cjs +11 -0
- package/dist/plugin-utils/get-config-path.d.cts +32 -0
- package/dist/plugin-utils/get-config-path.d.ts +32 -0
- package/dist/plugin-utils/get-config-path.js +2 -0
- package/dist/{lib/utilities/plugin-helpers.cjs → plugin-utils/helpers.cjs} +15 -17
- package/dist/{lib/utilities/plugin-helpers.d.ts → plugin-utils/helpers.d.cts} +13 -14
- package/dist/{lib/utilities/plugin-helpers.d.cts → plugin-utils/helpers.d.ts} +13 -14
- package/dist/{lib/utilities/plugin-helpers.js → plugin-utils/helpers.js} +2 -4
- package/dist/plugin-utils/index.cjs +69 -0
- package/dist/plugin-utils/index.d.cts +24 -0
- package/dist/plugin-utils/index.d.ts +24 -0
- package/dist/plugin-utils/index.js +4 -0
- package/dist/{resolved-DtY60yLh.d.cts → resolved-CugLn_3B.d.cts} +52 -251
- package/dist/{resolved-wPXZS7aW.d.ts → resolved-DnI1mqEb.d.ts} +52 -251
- package/dist/rolldown.cjs +10 -12
- package/dist/rolldown.d.cts +6 -6
- package/dist/rolldown.d.ts +6 -6
- package/dist/rolldown.js +7 -9
- package/dist/rollup.cjs +10 -12
- package/dist/rollup.d.cts +6 -6
- package/dist/rollup.d.ts +6 -6
- package/dist/rollup.js +7 -9
- package/dist/rspack.cjs +10 -12
- package/dist/rspack.d.cts +6 -6
- package/dist/rspack.d.ts +6 -6
- package/dist/rspack.js +7 -9
- package/dist/tsup.cjs +12 -14
- package/dist/tsup.js +9 -11
- package/dist/types/babel.cjs +1 -3
- package/dist/types/babel.d.cts +4 -4
- package/dist/types/babel.d.ts +4 -4
- package/dist/types/babel.js +1 -3
- package/dist/types/build.cjs +1 -3
- package/dist/types/build.d.cts +4 -29
- package/dist/types/build.d.ts +4 -29
- package/dist/types/build.js +1 -3
- package/dist/types/commands.cjs +3 -5
- package/dist/types/commands.d.cts +3 -3
- package/dist/types/commands.d.ts +3 -3
- package/dist/types/commands.js +2 -4
- package/dist/types/config.cjs +1 -3
- package/dist/types/config.d.cts +3 -3
- package/dist/types/config.d.ts +3 -3
- package/dist/types/config.js +1 -3
- package/dist/types/context.cjs +3 -5
- package/dist/types/context.d.cts +3 -3
- package/dist/types/context.d.ts +3 -3
- package/dist/types/context.js +2 -4
- package/dist/types/hooks.cjs +1 -3
- package/dist/types/hooks.d.cts +4 -4
- package/dist/types/hooks.d.ts +4 -4
- package/dist/types/hooks.js +1 -3
- package/dist/types/index.cjs +23 -26
- package/dist/types/index.d.cts +8 -8
- package/dist/types/index.d.ts +8 -8
- package/dist/types/index.js +14 -17
- package/dist/types/internal.cjs +0 -2
- package/dist/types/internal.d.cts +6 -8
- package/dist/types/internal.d.ts +6 -8
- package/dist/types/internal.js +0 -2
- package/dist/types/plugin.cjs +3 -5
- package/dist/types/plugin.d.cts +3 -3
- package/dist/types/plugin.d.ts +3 -3
- package/dist/types/plugin.js +2 -4
- package/dist/types/resolved.cjs +1 -3
- package/dist/types/resolved.d.cts +4 -4
- package/dist/types/resolved.d.ts +4 -4
- package/dist/types/resolved.js +1 -3
- package/dist/types/tsconfig.cjs +1 -3
- package/dist/types/tsconfig.d.cts +1 -8
- package/dist/types/tsconfig.d.ts +1 -8
- package/dist/types/tsconfig.js +1 -3
- package/dist/types/typedoc.cjs +1 -3
- package/dist/types/typedoc.d.cts +1 -3
- package/dist/types/typedoc.d.ts +1 -3
- package/dist/types/typedoc.js +1 -3
- package/dist/types/unplugin.cjs +1 -3
- package/dist/types/unplugin.d.cts +5 -8
- package/dist/types/unplugin.d.ts +5 -8
- package/dist/types/unplugin.js +1 -3
- package/dist/types/vfs.cjs +8 -10
- package/dist/types/vfs.d.cts +1 -14
- package/dist/types/vfs.d.ts +1 -14
- package/dist/types/vfs.js +2 -4
- package/dist/unloader.cjs +10 -12
- package/dist/unloader.d.cts +6 -6
- package/dist/unloader.d.ts +6 -6
- package/dist/unloader.js +7 -9
- package/dist/unplugin.cjs +22 -24
- package/dist/unplugin.d.cts +6 -6
- package/dist/unplugin.d.ts +6 -6
- package/dist/unplugin.js +19 -21
- package/dist/vite.cjs +11 -13
- package/dist/vite.d.cts +6 -6
- package/dist/vite.d.ts +6 -6
- package/dist/vite.js +8 -10
- package/dist/webpack.cjs +10 -12
- package/dist/webpack.d.cts +6 -6
- package/dist/webpack.d.ts +6 -6
- package/dist/webpack.js +7 -9
- package/package.json +59 -54
- package/dist/chunk-2VIXD2XB.js +0 -3
- package/dist/chunk-4JCNAKOE.cjs +0 -4
- package/dist/chunk-6ZGIV2SU.cjs +0 -4
- package/dist/chunk-7BZQBW77.cjs +0 -4
- package/dist/chunk-7MTW3KR2.cjs +0 -12
- package/dist/chunk-7WMWRX2S.cjs +0 -12
- package/dist/chunk-AFJCY3R6.js +0 -3
- package/dist/chunk-AXIRZAL7.js +0 -3
- package/dist/chunk-DELRP3WY.js +0 -31
- package/dist/chunk-DFLNRC3B.cjs +0 -4
- package/dist/chunk-DS7OM4NX.cjs +0 -4
- package/dist/chunk-DURCSSLV.js +0 -3
- package/dist/chunk-GC3BRYAK.cjs +0 -13
- package/dist/chunk-GIE6OE3X.js +0 -3
- package/dist/chunk-GV3S7ZR3.cjs +0 -34
- package/dist/chunk-HJW7OH6E.js +0 -3
- package/dist/chunk-IHUNA3MO.cjs +0 -4
- package/dist/chunk-LC6FLEJS.cjs +0 -12
- package/dist/chunk-MXJWCZDP.cjs +0 -12
- package/dist/chunk-OC7CCD5M.cjs +0 -19
- package/dist/chunk-OYASPHNL.js +0 -3
- package/dist/chunk-Q7EJVZVI.cjs +0 -4
- package/dist/chunk-SNARILEC.cjs +0 -24
- package/dist/chunk-TLHFXGYV.js +0 -3
- package/dist/chunk-VNRXLY2T.js +0 -3
- package/dist/chunk-VQCQRLGM.cjs +0 -4
- package/dist/chunk-WD4363UW.cjs +0 -12
- package/dist/chunk-XBF43VLE.cjs +0 -4
- package/dist/chunk-XZO6ZJQP.cjs +0 -4
- package/dist/chunk-YZCTXGFH.js +0 -11
- package/dist/chunk-Z5H7LD6W.js +0 -3
- package/dist/define-config.cjs +0 -13
- package/dist/define-config.js +0 -4
- package/dist/extend-plugin.cjs +0 -13
- package/dist/extend-plugin.js +0 -4
- package/dist/internal/api.cjs +0 -16
- package/dist/internal/api.cjs.map +0 -1
- package/dist/internal/api.js +0 -7
- package/dist/internal/api.js.map +0 -1
- package/dist/lib/build/esbuild.cjs.map +0 -1
- package/dist/lib/build/esbuild.js.map +0 -1
- package/dist/lib/build/index.cjs.map +0 -1
- package/dist/lib/build/index.js.map +0 -1
- package/dist/lib/build/rolldown.cjs.map +0 -1
- package/dist/lib/build/rolldown.js.map +0 -1
- package/dist/lib/build/rollup.cjs.map +0 -1
- package/dist/lib/build/rollup.js.map +0 -1
- package/dist/lib/build/rspack.cjs.map +0 -1
- package/dist/lib/build/rspack.js.map +0 -1
- package/dist/lib/build/tsup.cjs.map +0 -1
- package/dist/lib/build/tsup.js.map +0 -1
- package/dist/lib/build/unbuild.cjs.map +0 -1
- package/dist/lib/build/unbuild.js.map +0 -1
- package/dist/lib/build/vite.cjs.map +0 -1
- package/dist/lib/build/vite.js.map +0 -1
- package/dist/lib/build/webpack.cjs.map +0 -1
- package/dist/lib/build/webpack.js.map +0 -1
- package/dist/lib/chunk-35EO5Y7R.js.map +0 -1
- package/dist/lib/chunk-367E23MI.js.map +0 -1
- package/dist/lib/chunk-3GMJQ5G3.cjs +0 -4
- package/dist/lib/chunk-3GMJQ5G3.cjs.map +0 -1
- package/dist/lib/chunk-3I2YOM2E.js.map +0 -1
- package/dist/lib/chunk-4BPHC6QQ.js +0 -3
- package/dist/lib/chunk-4BPHC6QQ.js.map +0 -1
- package/dist/lib/chunk-4XUVP2LL.cjs.map +0 -1
- package/dist/lib/chunk-56LQSSQ3.js.map +0 -1
- package/dist/lib/chunk-5PNLONNN.cjs.map +0 -1
- package/dist/lib/chunk-62ZJYXT3.cjs.map +0 -1
- package/dist/lib/chunk-632PWWU7.cjs.map +0 -1
- package/dist/lib/chunk-6BRTJXZ2.js.map +0 -1
- package/dist/lib/chunk-6IJTWIVJ.cjs.map +0 -1
- package/dist/lib/chunk-7EAV6Q7B.cjs.map +0 -1
- package/dist/lib/chunk-7LLECRBP.cjs.map +0 -1
- package/dist/lib/chunk-7QVYU63E.js.map +0 -1
- package/dist/lib/chunk-7R23HVGQ.js.map +0 -1
- package/dist/lib/chunk-BEKLDCTV.cjs.map +0 -1
- package/dist/lib/chunk-BW3VFCTS.cjs.map +0 -1
- package/dist/lib/chunk-CAPN4FSS.js.map +0 -1
- package/dist/lib/chunk-ESYYL5UH.js.map +0 -1
- package/dist/lib/chunk-GJNFAFKR.cjs.map +0 -1
- package/dist/lib/chunk-GWYTWFZE.cjs.map +0 -1
- package/dist/lib/chunk-HJWJNSSZ.js +0 -3
- package/dist/lib/chunk-HJWJNSSZ.js.map +0 -1
- package/dist/lib/chunk-HQ6TGY34.js.map +0 -1
- package/dist/lib/chunk-IK3ABDPP.cjs.map +0 -1
- package/dist/lib/chunk-JTUL3477.cjs.map +0 -1
- package/dist/lib/chunk-KOCDKJDJ.js.map +0 -1
- package/dist/lib/chunk-KSBESEOF.js.map +0 -1
- package/dist/lib/chunk-LBMMBFQE.js.map +0 -1
- package/dist/lib/chunk-LEIOWD2W.js.map +0 -1
- package/dist/lib/chunk-LJZEN4HP.cjs.map +0 -1
- package/dist/lib/chunk-LTVWU4J2.js.map +0 -1
- package/dist/lib/chunk-LYD5OTBI.cjs.map +0 -1
- package/dist/lib/chunk-MAHHHINV.js.map +0 -1
- package/dist/lib/chunk-MFC7UJHT.cjs.map +0 -1
- package/dist/lib/chunk-MGEZC2RV.cjs.map +0 -1
- package/dist/lib/chunk-MVQSM5WM.cjs.map +0 -1
- package/dist/lib/chunk-NANLYIUO.cjs.map +0 -1
- package/dist/lib/chunk-NE46WXNJ.js.map +0 -1
- package/dist/lib/chunk-ODJBZ6PS.js.map +0 -1
- package/dist/lib/chunk-OF5IJ4WG.js.map +0 -1
- package/dist/lib/chunk-OO4BIM7N.js.map +0 -1
- package/dist/lib/chunk-PEZXLKQD.cjs +0 -4
- package/dist/lib/chunk-PEZXLKQD.cjs.map +0 -1
- package/dist/lib/chunk-PK6SKIKE.cjs.map +0 -1
- package/dist/lib/chunk-PXSRMP4E.js.map +0 -1
- package/dist/lib/chunk-Q2L3FNJO.js.map +0 -1
- package/dist/lib/chunk-Q3KJZ3B5.js.map +0 -1
- package/dist/lib/chunk-RK2VVGL6.cjs.map +0 -1
- package/dist/lib/chunk-RLMEYZ5I.cjs.map +0 -1
- package/dist/lib/chunk-RQICHHZM.cjs.map +0 -1
- package/dist/lib/chunk-RXQWNSZX.js.map +0 -1
- package/dist/lib/chunk-STAKGAWR.js.map +0 -1
- package/dist/lib/chunk-U36VZLW6.cjs.map +0 -1
- package/dist/lib/chunk-UGRFAVAJ.js.map +0 -1
- package/dist/lib/chunk-UQJWVRRE.cjs.map +0 -1
- package/dist/lib/chunk-V2T4H24I.js.map +0 -1
- package/dist/lib/chunk-V5OY4ALI.cjs.map +0 -1
- package/dist/lib/chunk-VJN72T2O.js.map +0 -1
- package/dist/lib/chunk-W4OMKQ7W.cjs.map +0 -1
- package/dist/lib/chunk-XGH6JWRO.js +0 -3
- package/dist/lib/chunk-XGH6JWRO.js.map +0 -1
- package/dist/lib/chunk-XQMVE2NH.cjs +0 -4
- package/dist/lib/chunk-XQMVE2NH.cjs.map +0 -1
- package/dist/lib/chunk-XZD7S5TU.cjs.map +0 -1
- package/dist/lib/chunk-YBIWVB66.js.map +0 -1
- package/dist/lib/chunk-YF3YHK4X.js.map +0 -1
- package/dist/lib/chunk-YVDJCVE5.cjs.map +0 -1
- package/dist/lib/chunk-ZP7PDTVE.cjs.map +0 -1
- package/dist/lib/compiler-CuQLTmTB.d.cts +0 -32
- package/dist/lib/compiler-CuQLTmTB.d.ts +0 -32
- package/dist/lib/config-file.cjs.map +0 -1
- package/dist/lib/config-file.js.map +0 -1
- package/dist/lib/create-program.cjs.map +0 -1
- package/dist/lib/create-program.js.map +0 -1
- package/dist/lib/entry.cjs.map +0 -1
- package/dist/lib/entry.js.map +0 -1
- package/dist/lib/index.cjs.map +0 -1
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/logger.cjs.map +0 -1
- package/dist/lib/logger.js.map +0 -1
- package/dist/lib/typescript/compiler-host.cjs.map +0 -1
- package/dist/lib/typescript/compiler-host.js.map +0 -1
- package/dist/lib/typescript/import-transformer.cjs.map +0 -1
- package/dist/lib/typescript/import-transformer.js.map +0 -1
- package/dist/lib/typescript/index.cjs.map +0 -1
- package/dist/lib/typescript/index.js.map +0 -1
- package/dist/lib/typescript/isolated-decl.cjs.map +0 -1
- package/dist/lib/typescript/isolated-decl.js.map +0 -1
- package/dist/lib/typescript/program.cjs.map +0 -1
- package/dist/lib/typescript/program.js.map +0 -1
- package/dist/lib/typescript/tsconfig.cjs.map +0 -1
- package/dist/lib/typescript/tsconfig.js.map +0 -1
- package/dist/lib/unplugin/factory.cjs.map +0 -1
- package/dist/lib/unplugin/factory.js.map +0 -1
- package/dist/lib/unplugin/index.cjs.map +0 -1
- package/dist/lib/unplugin/index.js.map +0 -1
- package/dist/lib/unplugin/plugin.cjs.map +0 -1
- package/dist/lib/unplugin/plugin.js.map +0 -1
- package/dist/lib/unplugin/resolve-id.cjs.map +0 -1
- package/dist/lib/unplugin/resolve-id.js.map +0 -1
- package/dist/lib/utilities/bundle.cjs.map +0 -1
- package/dist/lib/utilities/bundle.js.map +0 -1
- package/dist/lib/utilities/cache.cjs.map +0 -1
- package/dist/lib/utilities/cache.js.map +0 -1
- package/dist/lib/utilities/file-header.cjs.map +0 -1
- package/dist/lib/utilities/file-header.js.map +0 -1
- package/dist/lib/utilities/index.cjs.map +0 -1
- package/dist/lib/utilities/index.js.map +0 -1
- package/dist/lib/utilities/meta.cjs.map +0 -1
- package/dist/lib/utilities/meta.js.map +0 -1
- package/dist/lib/utilities/plugin-helpers.cjs.map +0 -1
- package/dist/lib/utilities/plugin-helpers.js.map +0 -1
- package/dist/lib/utilities/resolve-path.cjs.map +0 -1
- package/dist/lib/utilities/resolve-path.js.map +0 -1
- package/dist/lib/utilities/resolve.cjs.map +0 -1
- package/dist/lib/utilities/resolve.js.map +0 -1
- package/dist/lib/utilities/source-file.cjs.map +0 -1
- package/dist/lib/utilities/source-file.js.map +0 -1
- package/dist/lib/utilities/source-map.cjs.map +0 -1
- package/dist/lib/utilities/source-map.js.map +0 -1
- package/dist/lib/utilities/worker.cjs.map +0 -1
- package/dist/lib/utilities/worker.js.map +0 -1
- package/dist/lib/utilities/write-file.cjs.map +0 -1
- package/dist/lib/utilities/write-file.js.map +0 -1
- package/dist/types/babel.cjs.map +0 -1
- package/dist/types/babel.js.map +0 -1
- package/dist/types/build.cjs.map +0 -1
- package/dist/types/build.js.map +0 -1
- package/dist/types/commands.cjs.map +0 -1
- package/dist/types/commands.js.map +0 -1
- package/dist/types/compiler.cjs +0 -6
- package/dist/types/compiler.cjs.map +0 -1
- package/dist/types/compiler.d.cts +0 -38
- package/dist/types/compiler.d.ts +0 -38
- package/dist/types/compiler.js +0 -3
- package/dist/types/compiler.js.map +0 -1
- package/dist/types/config.cjs.map +0 -1
- package/dist/types/config.js.map +0 -1
- package/dist/types/context.cjs.map +0 -1
- package/dist/types/context.js.map +0 -1
- package/dist/types/hooks.cjs.map +0 -1
- package/dist/types/hooks.js.map +0 -1
- package/dist/types/index.cjs.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/internal.cjs.map +0 -1
- package/dist/types/internal.js.map +0 -1
- package/dist/types/plugin.cjs.map +0 -1
- package/dist/types/plugin.js.map +0 -1
- package/dist/types/resolved.cjs.map +0 -1
- package/dist/types/resolved.js.map +0 -1
- package/dist/types/tsconfig.cjs.map +0 -1
- package/dist/types/tsconfig.js.map +0 -1
- package/dist/types/typedoc.cjs.map +0 -1
- package/dist/types/typedoc.js.map +0 -1
- package/dist/types/unplugin.cjs.map +0 -1
- package/dist/types/unplugin.js.map +0 -1
- package/dist/types/vfs.cjs.map +0 -1
- package/dist/types/vfs.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/create-program.ts"],"names":["VirtualFileSystemHost","InMemoryFileSystemHost","fs","deleteSync","path","rmSync","readDirSync","dirPath","readdirSync","reduce","ret","entry","fullPath","resolve","joinPaths","push","name","isDirectory","isFile","isSymlink","readFile","filePath","existsSync","Error","readFileSync","writeFile","fileText","writeFileSync","mkdir","mkdirSync","move","srcPath","destPath","moveSync","copy","copySync","fileExists","fileExistsSync","directoryExists","directoryExistsSync","realpathSync","getCurrentDirectory","glob","patterns","globSync","createProgram","context","Project","compilerOptions","tsconfig","options","tsConfigFilePath","tsconfigFilePath","fileSystem"],"mappings":";;;;;;AA4BA,IAAMA,qBAAAA,GAAN,MAAMA,sBAAAA,SACIC,8BAAAA,CAAAA;EA7BV;;;AAgCE,EAAA,GAAA;AAEA,EAAA,WAAA,CAAmBC,EAAAA,EAAgC;AACjD,IAAA,KAAA,EAAK;AACL,IAAA,IAAA,CAAK,GAAA,GAAMA,EAAAA;AACb,EAAA;AAEgBC,EAAAA,UAAAA,CAAWC,IAAAA,EAAc;AACvC,IAAA,IAAA,CAAK,GAAA,CAAIC,OAAOD,IAAAA,CAAAA;AAClB,EAAA;AAEgBE,EAAAA,WAAAA,CAAYC,OAAAA,EAAoC;AAC9D,IAAA,OAAO,IAAA,CAAK,IAAIC,WAAAA,CAAYD,OAAAA,EAASE,MAAAA,CAAO,CAACC,KAAKC,KAAAA,KAAAA;AAChD,MAAA,MAAMC,WAAW,IAAA,CAAK,GAAA,CAAIC,QAAQC,cAAAA,CAAUP,OAAAA,EAASI,KAAAA,CAAAA,CAAAA;AACrD,MAAA,IAAIC,QAAAA,EAAU;AACZF,QAAAA,GAAAA,CAAIK,IAAAA,CAAK;UACPC,IAAAA,EAAML,KAAAA;UACNM,WAAAA,EAAa,IAAA,CAAK,GAAA,CAAIA,WAAAA,CAAYL,QAAAA,CAAAA;UAClCM,MAAAA,EAAQ,IAAA,CAAK,GAAA,CAAIA,MAAAA,CAAON,QAAAA,CAAAA;UACxBO,SAAAA,EAAW;SACb,CAAA;AACF,MAAA;AAEA,MAAA,OAAOT,GAAAA;AACT,IAAA,CAAA,EAAG,EAAE,CAAA;AACP,EAAA;AAEA,EAAA,MAAsBU,SAASC,QAAAA,EAAkB;AAC/C,IAAA,IAAI,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,EAAA,MAAsBC,KACpBC,QAAAA,EACmB;AACnB,IAAA,OAAO,IAAA,CAAK,GAAA,CAAID,IAAAA,CAAKC,QAAAA,CAAAA;AACvB,EAAA;AAEgBC,EAAAA,QAAAA,CAASD,QAAAA,EAA2C;AAClE,IAAA,OAAO,IAAA,CAAK,GAAA,CAAIC,QAAAA,CAASD,QAAAA,CAAAA;AAC3B,EAAA;AACF,CAAA;AAOO,SAASE,cAAcC,OAAAA,EAAgB;AAC5C,EAAA,OAAO,IAAIC,eAAAA,CAAQ;IACjBC,eAAAA,EAAiB;AACf,MAAA,GAAGF,QAAQG,QAAAA,CAASC;AACtB,KAAA;AACAC,IAAAA,gBAAAA,EAAkBL,QAAQG,QAAAA,CAASG,gBAAAA;IACnCC,UAAAA,EAAY,IAAIrD,qBAAAA,CAAsB8C,OAAAA,CAAQ5C,EAAE;GAClD,CAAA;AACF;AARgB2C,wBAAAA,CAAAA,aAAAA,EAAAA,eAAAA,CAAAA","file":"chunk-6IJTWIVJ.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport {\n FileSystemHost,\n InMemoryFileSystemHost,\n Project,\n RuntimeDirEntry\n} from \"ts-morph\";\nimport { Context } from \"../types/context\";\nimport { VirtualFileSystemInterface } from \"../types/vfs\";\n\nclass VirtualFileSystemHost\n extends InMemoryFileSystemHost\n implements FileSystemHost\n{\n #fs: VirtualFileSystemInterface;\n\n public constructor(fs: VirtualFileSystemInterface) {\n super();\n this.#fs = fs;\n }\n\n public override deleteSync(path: string) {\n this.#fs.rmSync(path);\n }\n\n public override readDirSync(dirPath: string): RuntimeDirEntry[] {\n return this.#fs.readdirSync(dirPath).reduce((ret, entry) => {\n const fullPath = this.#fs.resolve(joinPaths(dirPath, entry));\n if (fullPath) {\n ret.push({\n name: entry,\n isDirectory: this.#fs.isDirectory(fullPath),\n isFile: this.#fs.isFile(fullPath),\n isSymlink: false\n });\n }\n\n return ret;\n }, [] as RuntimeDirEntry[]);\n }\n\n public override async readFile(filePath: string) {\n if (!this.#fs.existsSync(filePath)) {\n throw new Error(\n `File not found: '${filePath}'. Please check the path and try again.`\n );\n }\n\n return (await this.#fs.readFile(filePath))!;\n }\n\n public override readFileSync(filePath: string) {\n if (!this.#fs.existsSync(filePath)) {\n throw new Error(\n `File not found: '${filePath}'. Please check the path and try again.`\n );\n }\n\n return this.#fs.readFileSync(filePath)!;\n }\n\n public override async writeFile(filePath: string, fileText: string) {\n return this.#fs.writeFile(filePath, fileText);\n }\n\n public override writeFileSync(filePath: string, fileText: string) {\n this.#fs.writeFileSync(filePath, fileText);\n }\n\n public override async mkdir(dirPath: string) {\n await this.#fs.mkdir(dirPath);\n }\n\n public override mkdirSync(dirPath: string) {\n this.#fs.mkdirSync(dirPath);\n }\n\n public override async move(srcPath: string, destPath: string) {\n await this.#fs.move(srcPath, destPath);\n }\n\n public override moveSync(srcPath: string, destPath: string) {\n this.#fs.moveSync(srcPath, destPath);\n }\n\n public override async copy(srcPath: string, destPath: string) {\n await this.#fs.copy(srcPath, destPath);\n }\n\n public override copySync(srcPath: string, destPath: string) {\n this.#fs.copySync(srcPath, destPath);\n }\n\n public override async fileExists(filePath: string) {\n return this.#fs.isFile(filePath);\n }\n\n public override fileExistsSync(filePath: string) {\n return this.#fs.isFile(filePath);\n }\n\n public override async directoryExists(dirPath: string) {\n return this.#fs.isDirectory(dirPath);\n }\n\n public override directoryExistsSync(dirPath: string): boolean {\n return this.#fs.isDirectory(dirPath);\n }\n\n public override realpathSync(path: string) {\n return this.#fs.resolve(path) || path;\n }\n\n public override getCurrentDirectory() {\n return \"/\";\n }\n\n public override async glob(\n patterns: ReadonlyArray<string>\n ): Promise<string[]> {\n return this.#fs.glob(patterns as string[]);\n }\n\n public override globSync(patterns: ReadonlyArray<string>): string[] {\n return this.#fs.globSync(patterns as string[]);\n }\n}\n\n/**\n * Create a ts-morph {@link Project} instance used for type reflection and module manipulation during processing\n *\n * @returns A ts-morph {@link Project} instance\n */\nexport function createProgram(context: Context): Project {\n return new Project({\n compilerOptions: {\n ...context.tsconfig.options\n },\n tsConfigFilePath: context.tsconfig.tsconfigFilePath,\n fileSystem: new VirtualFileSystemHost(context.fs)\n });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/unplugin/resolve-id.ts"],"names":["NON_NODE_MODULE_REGEX","handleResolveId","context","args","options","id","fs","isVirtual","importer","paths","resolvedPath","resolve","external","config","projectType","isTsconfigPath","tsconfigPath","resolveTsconfigPath","tsconfigPathPackage","resolveTsconfigPathPackage","Boolean","noExternal","includes","skipResolve","undefined","skipNodeModulesBundle","match","resolvePatterns","startsWith","test","meta","variant"],"mappings":";;;;;AAuBA,IAAMA,qBAAAA,GAAwB,mCAAA;AA0B9B,eAAsBC,eAAAA,CACpBC,OAAAA,EACAC,IAAAA,EACAC,OAAAA,GAAqC,EAAC,EAAC;AAEvC,EAAA,IAAID,KAAKE,EAAAA,EAAI;AACX,IAAA,IACEH,OAAAA,CAAQI,EAAAA,CAAGC,SAAAA,CAAUJ,IAAAA,CAAKE,EAAE,CAAA,IAC3BF,IAAAA,CAAKK,QAAAA,IACJN,OAAAA,CAAQI,EAAAA,CAAGC,SAAAA,CAAUJ,IAAAA,CAAKE,EAAAA,EAAI;MAC5BI,KAAAA,EAAO;QAACN,IAAAA,CAAKK;;AACf,KAAA,CAAA,EACF;AACA,MAAA,MAAME,eAAeP,IAAAA,CAAKK,QAAAA,GACtBN,QAAQI,EAA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,CAAW,OAAA,CAAA,EAAU;AACnE,QAAA,OAAO;AAAEvB,UAAAA,EAAAA,EAAIF,IAAAA,CAAKE,EAAAA;UAAIO,QAAAA,EAAU;AAAK,SAAA;AACvC,MAAA;AACF,IAAA;AACF,EAAA;AAEA,EAAA,OAAOY,MAAAA;AACT;AAtFsBvB,wBAAAA,CAAAA,eAAAA,EAAAA,iBAAAA,CAAAA","file":"chunk-7EAV6Q7B.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { match } from \"bundle-require\";\nimport type { ExternalIdResult } from \"unplugin\";\nimport type { Context } from \"../../types/context\";\n\n// Must not start with \"/\" or \"./\" or \"../\" or \"C:\\\" or be the exact strings \"..\" or \".\"\nconst NON_NODE_MODULE_REGEX = /^[A-Z]:[/\\\\]|^\\.{0,2}\\/|^\\.{1,2}$/;\n\nexport interface ResolveIdArgs {\n id: string;\n importer: string | undefined;\n options: {\n isEntry: boolean;\n };\n}\n\nexport interface ResolveIdOptions {\n skipResolve?: boolean;\n skipNodeModulesBundle?: boolean;\n external: (string | RegExp)[];\n noExternal: (string | RegExp)[];\n resolvePatterns: (string | RegExp)[];\n}\n\n/**\n * Handle the resolveId hook for the unplugin.\n *\n * @param context - The plugin context.\n * @param args - The arguments for the hook.\n * @param options - The options for the hook.\n * @returns The resolved id or null if not found.\n */\nexport async function handleResolveId(\n context: Context,\n args: ResolveIdArgs,\n options: Partial<ResolveIdOptions> = {}\n): Promise<ExternalIdResult | null | undefined> {\n if (args.id) {\n if (\n context.fs.isVirtual(args.id) ||\n (args.importer &&\n context.fs.isVirtual(args.id, {\n paths: [args.importer]\n }))\n ) {\n const resolvedPath = args.importer\n ? context.fs.resolve(args.id, {\n paths: [args.importer]\n })\n : context.fs.resolve(args.id);\n if (resolvedPath) {\n return {\n id: resolvedPath,\n external: context.config.projectType !== \"application\"\n };\n }\n }\n\n if (context.fs.isTsconfigPath(args.id)) {\n const tsconfigPath = context.fs.resolveTsconfigPath(args.id);\n const tsconfigPathPackage = context.fs.resolveTsconfigPathPackage(\n args.id\n );\n if (tsconfigPath && tsconfigPathPackage) {\n return {\n id: tsconfigPath,\n external: Boolean(\n !options.noExternal?.includes(tsconfigPathPackage) &&\n (options.external?.includes(tsconfigPathPackage) ??\n context.config.projectType !== \"application\")\n )\n };\n }\n }\n\n if (options.skipResolve) {\n return undefined;\n }\n\n if (options.skipNodeModulesBundle) {\n if (\n match(args.id, options.resolvePatterns) ||\n match(args.id, options.noExternal) ||\n args.id.startsWith(\"internal:\") ||\n args.id.startsWith(\"virtual:\")\n ) {\n return undefined;\n }\n\n if (match(args.id, options.external) || args.id.startsWith(\"node:\")) {\n return { id: args.id, external: true };\n }\n\n // Exclude any other import that looks like a Node module\n if (!NON_NODE_MODULE_REGEX.test(args.id)) {\n return {\n id: args.id,\n external: true\n };\n }\n } else {\n const resolvedPath = context.fs.resolve(args.id, {\n paths: args.importer ? [args.importer] : []\n });\n if (\n match(args.id, options.noExternal) ||\n (resolvedPath && context.fs.meta[resolvedPath]?.variant === \"builtin\")\n ) {\n return undefined;\n }\n\n if (match(args.id, options.external) || args.id.startsWith(\"node:\")) {\n return { id: args.id, external: true };\n }\n }\n }\n\n return undefined;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utilities/bundle.ts"],"names":["bundle","context","file","overrides","path","resolvePath","fs","existsSync","Error","result","build","extractESBuildConfig","entry","write","sourcemap","splitting","treeShaking","errors","length","map","error","text","join","warnings","log","LogLevelLabel","W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AWA,OAAAA,CAAQN,IAAI,EAC3BC,IAAAA,CAAK,IAAA,CAAA,CAAA,CAAO,CAAA;AAEnB,EAAA;AACA,EAAA,IAAI,CAACb,OAAOmB,WAAAA,IAAenB,MAAAA,CAAOmB,YAAYC,MAAAA,CAAOC,OAAAA,CAAAA,CAASZ,MAAAA,KAAW,CAAA,EAAG;AAC1E,IAAA,MAAM,IAAIV,KAAAA,CACR,CAAA,8BAAA,EACEN,IAAAA,CAAAA,+CAAAA,CAC+C,CAAA;AAErD,EAAA;AAEA,EAAA,OAAOO,MAAAA,CAAOmB,WAAAA,CAAYC,MAAAA,CAAOC,OAAAA,EAAS,CAAA,CAAA;AAC5C;AA9CsB9B,wBAAAA,CAAAA,MAAAA,EAAAA,QAAAA,CAAAA","file":"chunk-7LLECRBP.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { build, BuildOptions, OutputFile } from \"esbuild\";\nimport { ESBuildResolvedBuildConfig } from \"../../types/build\";\nimport { Context } from \"../../types/context\";\nimport { extractESBuildConfig } from \"../build/esbuild\";\nimport { resolvePath } from \"./resolve-path\";\n\n/**\n * Bundle a type definition to a module.\n *\n * @param context - The context object containing the environment paths.\n * @param file - The file path to bundle.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the bundled module.\n */\nexport async function bundle(\n context: Context,\n file: string,\n overrides: Partial<ESBuildResolvedBuildConfig> = {}\n): Promise<OutputFile> {\n const path = await resolvePath(context, file);\n if (!path || !context.fs.existsSync(path)) {\n throw new Error(\n `Module not found: \"${file}\". Please check the path and try again.`\n );\n }\n\n const result = await build({\n ...extractESBuildConfig(context),\n entry: [path],\n write: false,\n sourcemap: false,\n splitting: false,\n treeShaking: false,\n bundle: true,\n ...overrides\n } as BuildOptions);\n if (result.errors.length > 0) {\n throw new Error(\n `Failed to transpile ${file}: ${result.errors\n .map(error => error.text)\n .join(\", \")}`\n );\n }\n if (result.warnings.length > 0) {\n context.log(\n LogLevelLabel.WARN,\n `Warnings while transpiling ${file}: ${result.warnings\n .map(warning => warning.text)\n .join(\", \")}`\n );\n }\n if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) {\n throw new Error(\n `No output files generated for ${\n file\n }. Please check the configuration and try again.`\n );\n }\n\n return result.outputFiles.filter(Boolean)[0]!;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-7QVYU63E.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utilities/file-header.ts"],"names":["getBaseFileHeader","context","titleCase","config","framework","getFileHeader","options","directive","prettierIgnore"],"mappings":";;;AA0BO,SAASA,kBAAkBC,OAAAA,EAAgB;AAChD,EAAA,OAAO;oBACWC,SAAAA,CAAUD,OAAAA,CAAQE,MAAAA,CAAOC,SAAS,CAAA;;;AAGtD;AALgBJ,MAAAA,CAAAA,iBAAAA,EAAAA,mBAAAA,CAAAA;AAOT,SAASK,aAAAA,CACdJ,OAAAA,EACAK,OAAAA,GAA6B,EAAC,EAAC;AAE/B,EAAA,MAAM,EAAEC,SAAAA,GAAY,IAAA,EAAMC,cAAAA,GAAiB,OAAK,GAAKF,OAAAA;AAErD,EAAA,OAAO,CAAA;;EAEPE,cAAAA,GAAiB,CAAA,kBAAA,CAAA,GAAuB,EAAA,CAAA,EAAKD,SAAAA,GAAY;;EAAOA,SAAAA;IAAgB,IAAA;AAChFP,EAAAA,iBAAAA,CAAkBC,OAAAA,CAAAA;;;AAGpB;AAZgBI,MAAAA,CAAAA,aAAAA,EAAAA,eAAAA,CAAAA","file":"chunk-7R23HVGQ.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { Context } from \"../../types/context\";\n\nexport interface FileHeaderOptions {\n directive?: string | null;\n prettierIgnore?: boolean;\n}\n\nexport function getBaseFileHeader(context: Context): string {\n return `\n// Generated with ${titleCase(context.config.framework)}\n// Note: Do not edit this file manually - it will be overwritten automatically\n`;\n}\n\nexport function getFileHeader(\n context: Context,\n options: FileHeaderOptions = {}\n): string {\n const { directive = null, prettierIgnore = false } = options;\n\n return `/* eslint-disable */\n// biome-ignore lint: disable\n${prettierIgnore ? `// prettier-ignore` : \"\"}${directive ? `\\n\\n${directive}\\n` : \"\\n\"}\n${getBaseFileHeader(context)}\n\n`;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/entry.ts"],"names":["resolveEntryInputFile","context","typeDefinition","replacePath","file","joinPaths","workspaceConfig","workspaceRoot","config","projectRoot","resolveEntryInput","name","resolveEntryOutput","sourceRoot","replace","findFileExtensionSafe","resolveEntry","input","output","resolveEntries","typeDefinitions","Promise","all","map","parsed","parseTypeDefinition","listFiles","appendPath","flat","filter","Boolean","resolveEntriesSync","listFilesSync","resolveVirtualEntry","resolved","artifactsPath","murmurhash","maxLength","replaceAll","getUniqueEntries","entries","getUniq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A,GAAQA,IAAAA,GAAOP,qBAAAA,CAAWO,IAAAA,IAAQ,EAAC,EAAG;IAAEN,SAAAA,EAAW;AAAG,GAAA,CAAA,CAAA;AAEtE;AANgBE,wBAAAA,CAAAA,gBAAAA,EAAAA,kBAAAA,CAAAA","file":"chunk-BEKLDCTV.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { listFiles, listFilesSync } from \"@stryke/fs/list-files\";\nimport { murmurhash } from \"@stryke/hash/murmurhash\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { findFileExtensionSafe } from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport type {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport type { Context } from \"../types/context\";\nimport { ResolvedEntryTypeDefinition } from \"../types/resolved\";\n\nexport function resolveEntryInputFile(\n context: Context,\n typeDefinition: TypeDefinition\n): string {\n return replacePath(\n typeDefinition.file,\n joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot)\n );\n}\n\nexport function resolveEntryInput(\n context: Context,\n typeDefinition: TypeDefinition\n): TypeDefinition {\n return {\n file: resolveEntryInputFile(context, typeDefinition),\n name: typeDefinition.name\n };\n}\n\nexport function resolveEntryOutput(\n context: Context,\n typeDefinition: TypeDefinition\n): string {\n return joinPaths(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n typeDefinition.file,\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.sourceRoot\n )\n ),\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot\n )\n ),\n context.config.sourceRoot\n ),\n context.config.projectRoot\n )\n ).replace(`.${findFileExtensionSafe(typeDefinition.file)}`, \"\");\n}\n\nexport function resolveEntry(\n context: Context,\n typeDefinition: TypeDefinition\n): ResolvedEntryTypeDefinition {\n const input = resolveEntryInput(context, typeDefinition);\n\n return {\n ...input,\n input,\n output: resolveEntryOutput(context, typeDefinition)\n };\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport async function resolveEntries(\n context: Context,\n typeDefinitions: TypeDefinitionParameter[]\n): Promise<ResolvedEntryTypeDefinition[]> {\n return (\n await Promise.all(\n typeDefinitions.map(async typeDefinition => {\n const parsed = parseTypeDefinition(typeDefinition)!;\n\n return (\n await listFiles(appendPath(parsed.file, context.config.projectRoot))\n ).map(file =>\n resolveEntry(context, {\n file,\n name: parsed.name\n })\n );\n })\n )\n )\n .flat()\n .filter(Boolean);\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport function resolveEntriesSync(\n context: Context,\n typeDefinitions: TypeDefinitionParameter[]\n): ResolvedEntryTypeDefinition[] {\n return typeDefinitions\n .map(typeDefinition => {\n const parsed = parseTypeDefinition(typeDefinition)!;\n\n return listFilesSync(\n appendPath(parsed.file, context.config.projectRoot)\n ).map(file =>\n resolveEntry(context, {\n file,\n name: parsed.name\n })\n );\n })\n .flat()\n .filter(Boolean);\n}\n\n/** Resolve a virtual entry point by generating a unique file path in the artifacts directory.\n *\n * @param context - The current context\n * @param typeDefinition - The type definition to resolve.\n * @returns The resolved entry type definition with a unique virtual file path.\n */\nexport function resolveVirtualEntry(\n context: Context,\n typeDefinition: TypeDefinitionParameter\n): ResolvedEntryTypeDefinition {\n const parsed = parseTypeDefinition(typeDefinition)!;\n const resolved = resolveEntry(context, parsed);\n const file = joinPaths(\n context.artifactsPath,\n `entry-${murmurhash(\n { file: resolved.file, name: resolved.name },\n { maxLength: 24 }\n )\n .replaceAll(\"-\", \"0\")\n .replaceAll(\"_\", \"1\")}.ts`\n );\n\n return {\n file,\n name: resolved.name,\n input: {\n file,\n name: resolved.name\n },\n output: file\n };\n}\n\n/**\n * Get unique entries from the provided list.\n *\n * @param entries - The entries to process.\n * @returns An array of unique entries (by file path or content hash).\n */\nexport function getUniqueEntries(\n entries: TypeDefinitionParameter | TypeDefinitionParameter[] = []\n): TypeDefinitionParameter[] {\n return getUniqueBy(toArray(entries), (item: TypeDefinitionParameter) =>\n isSetString(item) ? item : murmurhash(item ?? {}, { maxLength: 24 })\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/vfs.ts","../../src/lib/utilities/meta.ts"],"names":["__VFS_INIT__","__VFS_REVERT__","__VFS_CACHE__","__VFS_RESOLVER__","__VFS_VIRTUAL__","__VFS_UNIFIED__","PROJECT_ROOT_HASH_LENGTH","CACHE_HASH_LENGTH","getPrefixedProjectRootHash","name","projectRootHash","combined","kebabCase","length","slice","discoverTemplatePath","path","Promise","all","resolve","test","includes","hasFileExtension","joinPaths","listFiles","flat","filter","Boolean","discoverTemplates","context","paths","getUnique","map","config","sourceRoot","envPaths","projectRoot","reduce","ret","existsSync","push","getChecksum","hashDirectory","ignore","getPersistedMeta","metaFilePath","dataPath","readJsonFile","log","LogLevelLabel","WARN","removeFile","persistedMeta","undefined","writeMetaFile","DEBUG","fs","writeFile","JSON","stringify","me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,IAAAA,YAAAA,EAAchC,QAAQ2B,EAAAA,CAAGpD,eAAAA,CAAAA,CAAiB0D,MAAAA,CAAOjC,QAAQkC,aAAa,CAAA;IACtEC,gBAAAA,EAAkBnC,OAAAA,CAAQ2B,GAAGS,cAAAA;GAC/B,EACA,IAAA,EACA,CAAA,CAAA,EAEF;IACEC,IAAAA,EAAM;GACR,CAAA;AAEJ;AAvBsBZ,wBAAAA,CAAAA,aAAAA,EAAAA,eAAAA,CAAAA","file":"chunk-BW3VFCTS.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { PrimitiveJsonValue } from \"@stryke/json/types\";\nimport type { Volume } from \"memfs\";\nimport type {\n MakeDirectoryOptions as FsMakeDirectoryOptions,\n WriteFileOptions as FsWriteFileOptions,\n Mode,\n PathLike,\n PathOrFileDescriptor,\n RmDirOptions,\n RmOptions,\n Stats,\n StatSyncOptions\n} from \"node:fs\";\nimport type { IUnionFs } from \"unionfs\";\n\nexport type VirtualFileExtension = \"js\" | \"ts\" | \"jsx\" | \"tsx\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_INIT__ = \"__VFS_INIT__\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_REVERT__ = \"__VFS_REVERT__\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_CACHE__ = \"__VFS_CACHE__\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_RESOLVER__ = \"__VFS_RESOLVER__\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_VIRTUAL__ = \"__VFS_VIRTUAL__\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_UNIFIED__ = \"__VFS_UNIFIED__\";\n\nexport type OutputModeType = \"fs\" | \"virtual\";\n\nexport interface VirtualFile {\n /**\n * The unique identifier for the virtual file.\n *\n * @remarks\n * If no specific id is provided, it defaults to the file's {@link path}.\n */\n id: string;\n\n /**\n * Additional metadata associated with the virtual file.\n */\n details: Record<string, PrimitiveJsonValue>;\n\n /**\n * The variant of the file.\n *\n * @remarks\n * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:\n * - `builtin`: Indicates that the file is a built-in module provided by the system.\n * - `entry`: Indicates that the file is an entry point for execution.\n * - `normal`: Indicates that the file is a standard file without any special role.\n */\n variant: string;\n\n /**\n * The output mode of the file.\n *\n * @remarks\n * This indicates whether the file is intended to be written to the actual file system (`fs`) or kept in the virtual file system (`virtual`).\n */\n mode: OutputModeType;\n\n /**\n * A virtual (or actual) path to the file in the file system.\n */\n path: string;\n\n /**\n * The contents of the file.\n */\n code: string | NodeJS.ArrayBufferView;\n}\n\nexport type VirtualFileSystemMetadata = Pick<\n VirtualFile,\n \"id\" | \"details\" | \"variant\" | \"mode\"\n>;\n\nexport interface ResolveFSOptions {\n mode?: OutputModeType;\n}\n\nexport type MakeDirectoryOptions = (Mode | FsMakeDirectoryOptions) &\n ResolveFSOptions;\n\nexport interface PowerlinesWriteFileOptions extends ResolveFSOptions {\n skipFormat?: boolean;\n}\n\nexport type NodeWriteFileOptions = FsWriteFileOptions;\n\nexport type WriteFileOptions =\n | NodeWriteFileOptions\n | PowerlinesWriteFileOptions;\n\nexport type PowerLinesWriteFileData = Partial<\n Omit<VirtualFile, \"path\" | \"mode\" | \"code\">\n> &\n Pick<VirtualFile, \"code\">;\n\nexport type WriteFileData =\n | string\n | NodeJS.ArrayBufferView\n | PowerLinesWriteFileData;\n\nexport interface ResolvePathOptions extends ResolveFSOptions {\n /**\n * Should the resolved path include the file extension?\n *\n * @defaultValue true\n */\n withExtension?: boolean;\n\n /**\n * The paths to search for the file.\n */\n paths?: string[];\n\n /**\n * The type of the path to resolve.\n */\n type?: \"file\" | \"directory\";\n}\n\nexport interface VirtualFileSystemInterface {\n [__VFS_INIT__]: () => void;\n [__VFS_REVERT__]: () => void;\n\n /**\n * The underlying file metadata.\n */\n meta: Record<string, VirtualFileSystemMetadata | undefined>;\n\n /**\n * A map of module ids to their file paths.\n */\n ids: Record<string, string>;\n\n /**\n * Check if a path or id corresponds to a virtual file **(does not actually exists on disk)**.\n *\n * @param pathOrId - The path or id to check.\n * @param options - Optional parameters for resolving the path.\n * @returns Whether the path or id corresponds to a virtual file **(does not actually exists on disk)**.\n */\n isVirtual: (pathOrId: string, options?: ResolvePathOptions) => boolean;\n\n /**\n * Check if a path or id corresponds to a file written to the file system **(actually exists on disk)**.\n *\n * @param pathOrId - The path or id to check.\n * @param options - Optional parameters for resolving the path.\n * @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.\n */\n isFs: (pathOrId: string, options?: ResolvePathOptions) => boolean;\n\n /**\n * Checks if a file exists in the virtual file system (VFS).\n *\n * @param path - The path of the file to check.\n * @returns `true` if the file exists, otherwise `false`.\n */\n isFile: (path: string) => boolean;\n\n /**\n * Checks if a directory exists in the virtual file system (VFS).\n *\n * @param path - The path of the directory to check.\n * @returns `true` if the directory exists, otherwise `false`.\n */\n isDirectory: (path: string) => boolean;\n\n /**\n * Check if a path exists within one of the directories specified in the tsconfig.json's `path` field.\n *\n * @see https://www.typescriptlang.org/tsconfig#paths\n *\n * @param pathOrId - The path or id to check.\n * @returns Whether the path or id corresponds to a virtual file.\n */\n isTsconfigPath: (pathOrId: string) => boolean;\n\n /**\n * Checks if a file exists in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @returns `true` if the file exists, otherwise `false`.\n */\n existsSync: (pathOrId: string) => boolean;\n\n /**\n * Gets the metadata of a file in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @returns The metadata of the file if it exists, otherwise undefined.\n */\n getMetadata: (pathOrId: PathLike) => VirtualFileSystemMetadata | undefined;\n\n /**\n * Gets the stats of a file in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @param options - Optional parameters for getting the stats.\n * @returns The stats of the file if it exists, otherwise undefined.\n */\n lstat: (\n pathOrId: string,\n options?: StatSyncOptions & {\n bigint?: false | undefined;\n throwIfNoEntry: false;\n }\n ) => Promise<Stats>;\n\n /**\n * Gets the stats of a file in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @param options - Optional parameters for getting the stats.\n * @returns The stats of the file if it exists, otherwise undefined.\n */\n lstatSync: (\n pathOrId: string,\n options?: StatSyncOptions & {\n bigint?: false | undefined;\n throwIfNoEntry: false;\n }\n ) => Stats | undefined;\n\n /**\n * Gets the stats of a file in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @returns The stats of the file if it exists, otherwise false.\n */\n stat: (\n pathOrId: string,\n options?: StatSyncOptions & {\n bigint?: false | undefined;\n throwIfNoEntry: false;\n }\n ) => Promise<Stats>;\n\n /**\n * Gets the stats of a file in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @returns The stats of the file if it exists, otherwise false.\n */\n statSync: (\n pathOrId: string,\n options?: StatSyncOptions & {\n bigint?: false | undefined;\n throwIfNoEntry: false;\n }\n ) => Stats | undefined;\n\n /**\n * Lists files in a given path.\n *\n * @param path - The path to list files from.\n * @param options - Options for listing files, such as encoding and recursion.\n * @returns An array of file names in the specified path.\n */\n readdirSync: (\n path: string,\n options?:\n | {\n encoding: BufferEncoding | null;\n withFileTypes?: false | undefined;\n recursive?: boolean | undefined;\n }\n | BufferEncoding\n ) => string[];\n\n /**\n * Lists files in a given path.\n *\n * @param path - The path to list files from.\n * @param options - Options for listing files, such as encoding and recursion.\n * @returns An array of file names in the specified path.\n */\n readdir: (\n path: string,\n options?:\n | {\n encoding: BufferEncoding | null;\n withFileTypes?: false | undefined;\n recursive?: boolean | undefined;\n }\n | BufferEncoding\n ) => Promise<string[]>;\n\n /**\n * Removes a file or symbolic link in the virtual file system (VFS).\n *\n * @param path - The path to the file to remove.\n * @returns A promise that resolves when the file is removed.\n */\n unlinkSync: (path: PathLike, options?: ResolveFSOptions) => void;\n\n /**\n * Asynchronously removes a file or symbolic link in the virtual file system (VFS).\n *\n * @param path - The path to the file to remove.\n * @returns A promise that resolves when the file is removed.\n */\n unlink: (path: string, options?: ResolveFSOptions) => Promise<void>;\n\n /**\n * Removes a directory in the virtual file system (VFS).\n *\n * @param path - The path to create the directory at.\n * @param options - Options for creating the directory.\n */\n rmdirSync: (path: PathLike, options?: RmDirOptions & ResolveFSOptions) => any;\n\n /**\n * Removes a directory in the virtual file system (VFS).\n *\n * @param path - The path to create the directory at.\n * @param options - Options for creating the directory.\n * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.\n */\n rmdir: (\n path: PathLike,\n options?: RmDirOptions & ResolveFSOptions\n ) => Promise<void>;\n\n /**\n * Removes a file or directory in the virtual file system (VFS).\n *\n * @param path - The path to the file or directory to remove.\n * @param options - Options for removing the file or directory.\n * @returns A promise that resolves when the file or directory is removed.\n */\n rm: (path: PathLike, options?: RmOptions & ResolveFSOptions) => Promise<void>;\n\n /**\n * Synchronously removes a file or directory in the virtual file system (VFS).\n *\n * @param path - The path to the file or directory to remove.\n * @param options - Options for removing the file or directory.\n */\n rmSync: (path: PathLike, options?: RmOptions & ResolveFSOptions) => void;\n\n /**\n * Creates a directory in the virtual file system (VFS).\n *\n * @param path - The path to create the directory at.\n * @param options - Options for creating the directory.\n * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.\n */\n mkdirSync: (\n path: PathLike,\n options?: MakeDirectoryOptions\n ) => string | undefined;\n\n /**\n * Creates a directory in the virtual file system (VFS).\n *\n * @param path - The path to create the directory at.\n * @param options - Options for creating the directory.\n * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.\n */\n mkdir: (\n path: PathLike,\n options?: MakeDirectoryOptions\n ) => Promise<string | undefined>;\n\n /**\n * Reads a file from the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @returns The contents of the file if it exists, otherwise undefined.\n */\n readFile: (pathOrId: string) => Promise<string | undefined>;\n\n /**\n * Reads a file from the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n */\n readFileSync: (pathOrId: string) => string | undefined;\n\n /**\n * Writes a file to the virtual file system (VFS).\n *\n * @param path - The path to the file.\n * @param data - The contents of the file.\n * @param options - Optional parameters for writing the file.\n * @returns A promise that resolves when the file is written.\n */\n writeFile: (\n path: PathOrFileDescriptor,\n data?: WriteFileData,\n options?: WriteFileOptions\n ) => Promise<void>;\n\n /**\n * Writes a file to the virtual file system (VFS).\n *\n * @param path - The path to the file.\n * @param data - The contents of the file.\n * @param options - Optional parameters for writing the file.\n */\n writeFileSync: (\n path: PathOrFileDescriptor,\n data?: WriteFileData,\n options?: WriteFileOptions\n ) => void;\n\n /**\n * Moves a file from one path to another in the virtual file system (VFS).\n *\n * @param srcPath - The source path to move\n * @param destPath - The destination path to move to\n */\n move: (srcPath: string, destPath: string) => Promise<void>;\n\n /**\n * Synchronously moves a file from one path to another in the virtual file system (VFS).\n *\n * @param srcPath - The source path to move\n * @param destPath - The destination path to move to\n */\n moveSync: (srcPath: string, destPath: string) => void;\n\n /**\n * Copies a file from one path to another in the virtual file system (VFS).\n *\n * @param srcPath - The source path to copy\n * @param destPath - The destination path to copy to\n */\n copy: (srcPath: string, destPath: string) => Promise<void>;\n\n /**\n * Synchronously copies a file from one path to another in the virtual file system (VFS).\n *\n * @param srcPath - The source path to copy\n * @param destPath - The destination path to copy to\n */\n copySync: (srcPath: string, destPath: string) => void;\n\n /**\n * Glob files in the virtual file system (VFS) based on the provided pattern(s).\n *\n * @param pattern - A pattern (or multiple patterns) to use to determine the file paths to return\n * @returns An array of file paths matching the provided pattern(s)\n */\n glob: (pattern: string | string[]) => Promise<string[]>;\n\n /**\n * Synchronously glob files in the virtual file system (VFS) based on the provided pattern(s).\n *\n * @param pattern - A pattern (or multiple patterns) to use to determine the file paths to return\n * @returns An array of file paths matching the provided pattern(s)\n */\n globSync: (pattern: string | string[]) => string[];\n\n /**\n * Resolves a path or id to a file path in the virtual file system.\n *\n * @param pathOrId - The path or id of the file to resolve.\n * @param options - Optional parameters for resolving the path.\n * @returns The resolved path of the file if it exists, otherwise false.\n */\n resolve: (pathOrId: string, options?: ResolvePathOptions) => string | false;\n\n /**\n * Resolves a path based on TypeScript's `tsconfig.json` paths.\n *\n * @see https://www.typescriptlang.org/tsconfig#paths\n *\n * @param path - The path to check.\n * @returns The resolved file path if it exists, otherwise undefined.\n */\n resolveTsconfigPath: (path: string) => string | false;\n\n /**\n * Resolves a package name based on TypeScript's `tsconfig.json` paths.\n *\n * @see https://www.typescriptlang.org/tsconfig#paths\n *\n * @param path - The path to check.\n * @returns The resolved package name if it exists, otherwise undefined.\n */\n resolveTsconfigPathPackage: (path: string) => string | false;\n\n /**\n * Resolves a path or id to a file path in the virtual file system.\n *\n * @param pathOrId - The path or id of the file to resolve.\n * @returns The resolved path of the file if it exists, otherwise false.\n */\n realpathSync: (pathOrId: string) => string;\n\n /**\n * Retrieves a partial metadata mapping of all files in the virtual file system (VFS).\n *\n * @returns A record mapping file paths to their partial metadata.\n */\n getPartialMeta: () => Record<string, Partial<VirtualFileSystemMetadata>>;\n\n /**\n * A map of cached file paths to their underlying file content.\n */\n [__VFS_CACHE__]: Map<string, string>;\n\n /**\n * A reference to the underlying virtual file system.\n */\n [__VFS_VIRTUAL__]: Volume;\n\n /**\n * A reference to the underlying unified file system.\n */\n [__VFS_UNIFIED__]: IUnionFs;\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { readJsonFile } from \"@stryke/fs/json\";\nimport { listFiles } from \"@stryke/fs/list-files\";\nimport { removeFile } from \"@stryke/fs/remove-file\";\nimport { hashDirectory } from \"@stryke/hash/hash-files\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { Context, MetaInfo } from \"../../types/context\";\nimport { __VFS_VIRTUAL__ } from \"../../types/vfs\";\n\nexport interface CreateContextOptions {\n name?: string;\n}\n\nexport const PROJECT_ROOT_HASH_LENGTH = 45;\nexport const CACHE_HASH_LENGTH = 62;\n\n/**\n * Generates a prefixed project root hash object.\n *\n * @remarks\n * This function returns a string where the project root hash is prefixed with the project name plus a hyphen. If the total length of this string combination exceeds 45 characters, it will truncate the hash.\n *\n * @param name - The name of the project.\n * @param projectRootHash - The hash of the project root.\n * @returns An object containing the name and project root hash.\n */\nexport function getPrefixedProjectRootHash(\n name: string,\n projectRootHash: string\n): string {\n const combined = `${kebabCase(name)}_${projectRootHash}`;\n\n return combined.length > PROJECT_ROOT_HASH_LENGTH\n ? combined.slice(0, PROJECT_ROOT_HASH_LENGTH)\n : combined;\n}\n\nasync function discoverTemplatePath(path: string): Promise<string[]> {\n return (\n await Promise.all([\n Promise.resolve(/.tsx?$/.test(path) && !path.includes(\"*\") && path),\n Promise.resolve(!hasFileExtension(path) && joinPaths(path, \".ts\")),\n Promise.resolve(!hasFileExtension(path) && joinPaths(path, \".tsx\")),\n Promise.resolve(\n !hasFileExtension(path) && listFiles(joinPaths(path, \"**/*.ts\"))\n ),\n Promise.resolve(\n !hasFileExtension(path) && listFiles(joinPaths(path, \"**/*.tsx\"))\n )\n ])\n )\n .flat()\n .filter(Boolean) as string[];\n}\n\nexport async function discoverTemplates(\n context: Context,\n paths: string[] = []\n): Promise<string[]> {\n return getUnique(\n (\n await Promise.all([\n ...paths.map(discoverTemplatePath),\n discoverTemplatePath(joinPaths(context.config.sourceRoot, \"plugin\")),\n discoverTemplatePath(joinPaths(context.envPaths.config, \"templates\")),\n discoverTemplatePath(joinPaths(context.config.projectRoot, \"templates\"))\n ])\n )\n .flat()\n .reduce((ret, path) => {\n if (existsSync(path)) {\n ret.push(path);\n }\n\n return ret;\n }, [] as string[])\n );\n}\n\nexport async function getChecksum(path: string): Promise<string> {\n return hashDirectory(path, {\n ignore: [\"node_modules\", \".git\", \".nx\", \".cache\", \".storm\", \"tmp\", \"dist\"]\n });\n}\n\n/**\n * Retrieves the persisted meta information from the context's data path.\n *\n * @param context - The build context.\n * @returns A promise that resolves to the persisted meta information, or undefined if not found.\n */\nexport async function getPersistedMeta(\n context: Context\n): Promise<MetaInfo | undefined> {\n const metaFilePath = joinPaths(context.dataPath, \"meta.json\");\n if (existsSync(metaFilePath)) {\n try {\n return await readJsonFile<MetaInfo>(metaFilePath);\n } catch {\n context.log(\n LogLevelLabel.WARN,\n `Failed to read meta file at ${metaFilePath}. It may be corrupted.`\n );\n await removeFile(metaFilePath);\n\n context.persistedMeta = undefined;\n }\n }\n\n return undefined;\n}\n\n/**\n * Writes the meta file for the context.\n *\n * @param context - The context to write the meta file for.\n * @returns A promise that resolves when the meta file has been written.\n */\nexport async function writeMetaFile(context: Context): Promise<void> {\n const metaFilePath = joinPaths(context.dataPath, \"meta.json\");\n\n context.log(\n LogLevelLabel.DEBUG,\n `Writing runtime metadata to ${metaFilePath}`\n );\n\n await context.fs.writeFile(\n metaFilePath,\n JSON.stringify(\n {\n ...context.meta,\n virtualFiles: context.fs[__VFS_VIRTUAL__].toJSON(context.artifactsPath),\n virtualFilesMeta: context.fs.getPartialMeta()\n },\n null,\n 2\n ),\n {\n mode: \"fs\"\n }\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/build/unbuild.ts"],"names":["DEFAULT_UNBUILD_CONFIG","dts","clean","includeSrc","treeShaking","splitting","stub","watchOptions","outputPath","generatePackageJson","banner","rollup","emitCJS","replace","resolve","json","esbuild","target","commonjs","alias","unbuildLoader","context","input","options","test","path","output","contents","getContents","declaration","srcPath","match","cm","extension","push","transformed","result","$$internal","callHook","sequential","order","getString","includes","transform","Object","fromEntries","entries","filter","key","loader","then","r","code","isCjs","format","resolver","source","retainLines","ext","startsWith","extractUnbuildConfig","defu","builtins","reduce","ret","id","fs","ids","config","build","variant","override","projectName","name","orgName","isObject","workspaceConfig","organization","sourceRoot","projectRoot","platform","external","loaders","jiti","interopDefault","fsCache","joinPaths","envPaths","cache","moduleCache","extractRollupConfig","debug","mode","minify","sourcemap"],"mappings":";;;;;;;;AAiCO,IAAMA,sBAAAA,GAAyB;EACpCC,GAAAA,EAAK,IAAA;EACLC,KAAAA,EAAO,KAAA;EACPC,UAAAA,EAAY,KAAA;EACZC,WAAAA,EAAa,IAAA;EACbC,SAAAA,EAAW,IAAA;EACXC,IAAAA,EAAM,KAAA;AACNC,EAAAA,YAAAA,EAAc,EAAC;EACfC,UAAAA,EAAY,MAAA;EACZC,mBAAAA,EAAqB,IAAA;EACrBC,MAAAA,EAAQ,GAAA;EACRC,MAAAA,EAAQ;AACNV,IAAAA,GAAAA,EAAK,EAAC;IACNW,OAAAA,EAAS,IAAA;AACTC,IAAAA,OAAAA,EAAS,EAAC;AACVC,IAAAA,OAAAA,EAAS,EAAC;AACVC,IAAAA,IAAAA,EAAM,EAAC;IACPC,OAAAA,EAAS;MAAEC,MAAAA,EAAQ;AAAS,KAAA;AAC5BC,IAAAA,QAAAA,EAAU,EAAC;AACXC,IAAAA,KAAAA,EAAO;AACT;AACF;AAE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,KAAAA;AACtC,MAAA,IAAI,CAACD,GAAAA,CAAItB,QAAAA,CAASuB,EAAAA,CAAAA,EAAK;AACrBD,QAAAA,GAAAA,CAAI9B,KAAK+B,EAAAA,CAAAA;AACX,MAAA;AAEA,MAAA,OAAOD,GAAAA;AACT,IAAA,CAAA,EAAG3C,OAAAA,CAAQ+C,MAAAA,CAAOC,KAAAA,CAAMY,QAAAA,IAAY,EAAE,CAAA;IAEtCC,OAAAA,EAAS;AAAC9D,MAAAA,aAAAA,CAAcC,OAAAA;;IACxB8D,IAAAA,EAAM;MACJC,cAAAA,EAAgB,IAAA;AAChBC,MAAAA,OAAAA,EAASC,SAAAA,CAAUjE,OAAAA,CAAQkE,QAAAA,CAASC,KAAAA,EAAO,MAAA,CAAA;MAC3CC,WAAAA,EAAa;AACf,KAAA;AACA9E,IAAAA,MAAAA,EAAQ+E,oBAAoBrE,OAAAA;GAC9B,EACAA,OAAAA,CAAQ+C,OAAOC,KAAAA,CAAMC,OAAAA,KAAY,YAAYjD,OAAAA,CAAQ+C,MAAAA,CAAOC,KAAAA,GAAQ,EAAC,EACrE;IACEsB,KAAAA,EAAOtE,OAAAA,CAAQ+C,OAAOwB,IAAAA,KAAS,aAAA;IAC/BC,MAAAA,EAAQxE,OAAAA,CAAQ+C,OAAOwB,IAAAA,KAAS,aAAA;IAChCE,SAAAA,EAAWzE,OAAAA,CAAQ+C,OAAOwB,IAAAA,KAAS;AACrC,GAAA,EACA5F,sBAAAA,CAAAA;AAEJ;AApDgB4D,MAAAA,CAAAA,oBAAAA,EAAAA,sBAAAA,CAAAA","file":"chunk-CAPN4FSS.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Loader, LoaderResult } from \"@storm-software/unbuild/types\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport defu from \"defu\";\nimport { transform } from \"esbuild\";\nimport { TransformResult } from \"unplugin\";\nimport {\n UnbuildBuildConfig,\n UnbuildResolvedBuildConfig\n} from \"../../types/build\";\nimport { Context } from \"../../types/context\";\nimport { UNSAFE_PluginContext } from \"../../types/internal\";\nimport { getString } from \"../utilities/source-file\";\nimport { extractRollupConfig } from \"./rollup\";\n\nexport const DEFAULT_UNBUILD_CONFIG = {\n dts: true,\n clean: false,\n includeSrc: false,\n treeShaking: true,\n splitting: true,\n stub: false,\n watchOptions: {},\n outputPath: \"dist\",\n generatePackageJson: true,\n banner: \" \",\n rollup: {\n dts: {},\n emitCJS: true,\n replace: {},\n resolve: {},\n json: {},\n esbuild: { target: \"es2020\" },\n commonjs: {},\n alias: {}\n }\n} as Partial<UnbuildBuildConfig>;\n\nexport const unbuildLoader = (context: UNSAFE_PluginContext): Loader => {\n return async (input, { options }) => {\n if (\n !/\\.(?:c|m)?[jt]sx?$/.test(input.path) ||\n /\\.d\\.[cm]?ts$/.test(input.path)\n ) {\n return;\n }\n\n const output: LoaderResult = [];\n\n let contents = await input.getContents();\n\n // declaration\n if (options.declaration && !input.srcPath?.match(/\\.d\\.[cm]?ts$/)) {\n const cm = input.srcPath?.match(/(?<=\\.)(?:c|m)(?=[jt]s$)/)?.[0] || \"\";\n const extension = `.d.${cm}ts`;\n output.push({\n contents,\n srcPath: input.srcPath,\n path: input.path,\n extension,\n declaration: true\n });\n }\n\n let transformed: TransformResult | string = contents;\n\n let result = await context.$$internal.callHook(\n \"transform\",\n {\n sequential: true,\n order: \"pre\"\n },\n transformed,\n input.path\n );\n if (result) {\n transformed = result;\n }\n\n result = await context.$$internal.callHook(\n \"transform\",\n {\n sequential: true,\n order: \"normal\"\n },\n getString(transformed),\n input.path\n );\n if (result) {\n transformed = result;\n }\n\n result = await context.$$internal.callHook(\n \"transform\",\n {\n sequential: true,\n order: \"post\"\n },\n getString(transformed),\n input.path\n );\n if (result) {\n transformed = result;\n }\n\n // typescript => js\n if ([\".ts\", \".mts\", \".cts\"].includes(input.extension)) {\n contents = await transform(getString(transformed), {\n ...Object.fromEntries(\n Object.entries(options.esbuild ?? {}).filter(\n ([key]) => key !== \"absPaths\"\n )\n ),\n loader: \"ts\"\n }).then(r => r.code);\n } else if ([\".tsx\", \".jsx\"].includes(input.extension)) {\n contents = await transform(getString(transformed), {\n loader: input.extension === \".tsx\" ? \"tsx\" : \"jsx\",\n ...Object.fromEntries(\n Object.entries(options.esbuild ?? {}).filter(\n ([key]) => key !== \"absPaths\"\n )\n )\n }).then(r => r.code);\n }\n\n // esm => cjs\n const isCjs = options.format === \"cjs\";\n if (isCjs) {\n contents = context.resolver\n .transform({\n source: contents,\n retainLines: false\n })\n .replace(/^exports.default = /gm, \"module.exports = \")\n .replace(/^var _default = exports.default = /gm, \"module.exports = \")\n .replace(\"module.exports = void 0;\", \"\");\n }\n\n let extension = isCjs ? \".js\" : \".mjs\"; // TODO: Default to .cjs in next major version\n if (options.ext) {\n extension = options.ext.startsWith(\".\") ? options.ext : `.${options.ext}`;\n }\n\n output.push({\n contents,\n path: input.path,\n extension\n });\n\n return output;\n };\n};\n\n/**\n * Extracts the unbuild configuration from the context.\n *\n * @param context - The build context.\n * @returns The resolved unbuild configuration.\n */\nexport function extractUnbuildConfig(\n context: Context\n): UnbuildResolvedBuildConfig {\n return defu(\n {\n alias: context.builtins.reduce(\n (ret, id) => {\n const path = context.fs.ids[id];\n if (path) {\n ret[id] = path;\n }\n\n return ret;\n },\n {} as Record<string, string>\n )\n },\n context.config.build.variant === \"unbuild\" ? context.config.override : {},\n {\n projectName: context.config.name,\n name: context.config.name,\n orgName: isObject(context.workspaceConfig.organization)\n ? context.workspaceConfig.organization.name\n : context.workspaceConfig.organization,\n sourceRoot: context.config.sourceRoot,\n projectRoot: context.config.projectRoot,\n outputPath: context.config.output.outputPath || \"dist\",\n platform: context.config.build.platform,\n external: context.builtins.reduce((ret, id) => {\n if (!ret.includes(id)) {\n ret.push(id);\n }\n\n return ret;\n }, context.config.build.external ?? []) as string[],\n\n loaders: [unbuildLoader(context as UNSAFE_PluginContext)],\n jiti: {\n interopDefault: true,\n fsCache: joinPaths(context.envPaths.cache, \"jiti\"),\n moduleCache: true\n },\n rollup: extractRollupConfig(context) as any\n },\n context.config.build.variant === \"unbuild\" ? context.config.build : {},\n {\n debug: context.config.mode === \"development\",\n minify: context.config.mode !== \"development\",\n sourcemap: context.config.mode === \"development\"\n },\n DEFAULT_UNBUILD_CONFIG\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/create-program.ts"],"names":["VirtualFileSystemHost","InMemoryFileSystemHost","fs","deleteSync","path","rmSync","readDirSync","dirPath","readdirSync","reduce","ret","entry","fullPath","resolve","joinPaths","push","name","isDirectory","isFile","isSymlink","readFile","filePath","existsSync","Error","readFileSync","writeFile","fileText","writeFileSync","mkdir","mkdirSync","move","srcPath","destPath","moveSync","copy","copySync","fileExists","fileExistsSync","directoryExists","directoryExistsSync","realpathSync","getCurrentDirectory","glob","patterns","globSync","createProgram","context","Project","compilerOptions","tsconfig","options","tsConfigFilePath","tsconfigFilePath","fileSystem"],"mappings":";;;;AA4BA,IAAMA,qBAAAA,GAAN,MAAMA,sBAAAA,SACIC,sBAAAA,CAAAA;EA7BV;;;AAgCE,EAAA,GAAA;AAEA,EAAA,WAAA,CAAmBC,EAAAA,EAAgC;AACjD,IAAA,KAAA,EAAK;AACL,IAAA,IAAA,CAAK,GAAA,GAAMA,EAAAA;AACb,EAAA;AAEgBC,EAAAA,UAAAA,CAAWC,IAAAA,EAAc;AACvC,IAAA,IAAA,CAAK,GAAA,CAAIC,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CAAQ5C,EAAE;GAClD,CAAA;AACF;AARgB2C,MAAAA,CAAAA,aAAAA,EAAAA,eAAAA,CAAAA","file":"chunk-ESYYL5UH.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport {\n FileSystemHost,\n InMemoryFileSystemHost,\n Project,\n RuntimeDirEntry\n} from \"ts-morph\";\nimport { Context } from \"../types/context\";\nimport { VirtualFileSystemInterface } from \"../types/vfs\";\n\nclass VirtualFileSystemHost\n extends InMemoryFileSystemHost\n implements FileSystemHost\n{\n #fs: VirtualFileSystemInterface;\n\n public constructor(fs: VirtualFileSystemInterface) {\n super();\n this.#fs = fs;\n }\n\n public override deleteSync(path: string) {\n this.#fs.rmSync(path);\n }\n\n public override readDirSync(dirPath: string): RuntimeDirEntry[] {\n return this.#fs.readdirSync(dirPath).reduce((ret, entry) => {\n const fullPath = this.#fs.resolve(joinPaths(dirPath, entry));\n if (fullPath) {\n ret.push({\n name: entry,\n isDirectory: this.#fs.isDirectory(fullPath),\n isFile: this.#fs.isFile(fullPath),\n isSymlink: false\n });\n }\n\n return ret;\n }, [] as RuntimeDirEntry[]);\n }\n\n public override async readFile(filePath: string) {\n if (!this.#fs.existsSync(filePath)) {\n throw new Error(\n `File not found: '${filePath}'. Please check the path and try again.`\n );\n }\n\n return (await this.#fs.readFile(filePath))!;\n }\n\n public override readFileSync(filePath: string) {\n if (!this.#fs.existsSync(filePath)) {\n throw new Error(\n `File not found: '${filePath}'. Please check the path and try again.`\n );\n }\n\n return this.#fs.readFileSync(filePath)!;\n }\n\n public override async writeFile(filePath: string, fileText: string) {\n return this.#fs.writeFile(filePath, fileText);\n }\n\n public override writeFileSync(filePath: string, fileText: string) {\n this.#fs.writeFileSync(filePath, fileText);\n }\n\n public override async mkdir(dirPath: string) {\n await this.#fs.mkdir(dirPath);\n }\n\n public override mkdirSync(dirPath: string) {\n this.#fs.mkdirSync(dirPath);\n }\n\n public override async move(srcPath: string, destPath: string) {\n await this.#fs.move(srcPath, destPath);\n }\n\n public override moveSync(srcPath: string, destPath: string) {\n this.#fs.moveSync(srcPath, destPath);\n }\n\n public override async copy(srcPath: string, destPath: string) {\n await this.#fs.copy(srcPath, destPath);\n }\n\n public override copySync(srcPath: string, destPath: string) {\n this.#fs.copySync(srcPath, destPath);\n }\n\n public override async fileExists(filePath: string) {\n return this.#fs.isFile(filePath);\n }\n\n public override fileExistsSync(filePath: string) {\n return this.#fs.isFile(filePath);\n }\n\n public override async directoryExists(dirPath: string) {\n return this.#fs.isDirectory(dirPath);\n }\n\n public override directoryExistsSync(dirPath: string): boolean {\n return this.#fs.isDirectory(dirPath);\n }\n\n public override realpathSync(path: string) {\n return this.#fs.resolve(path) || path;\n }\n\n public override getCurrentDirectory() {\n return \"/\";\n }\n\n public override async glob(\n patterns: ReadonlyArray<string>\n ): Promise<string[]> {\n return this.#fs.glob(patterns as string[]);\n }\n\n public override globSync(patterns: ReadonlyArray<string>): string[] {\n return this.#fs.globSync(patterns as string[]);\n }\n}\n\n/**\n * Create a ts-morph {@link Project} instance used for type reflection and module manipulation during processing\n *\n * @returns A ts-morph {@link Project} instance\n */\nexport function createProgram(context: Context): Project {\n return new Project({\n compilerOptions: {\n ...context.tsconfig.options\n },\n tsConfigFilePath: context.tsconfig.tsconfigFilePath,\n fileSystem: new VirtualFileSystemHost(context.fs)\n });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/build/esbuild.ts"],"names":["DEFAULT_ESBUILD_CONFIG","target","platform","format","write","minify","sourcemap","bundle","treeShaking","keepNames","splitting","logLevel","resolveESBuildEntry","context","entryPoints","reduce","ret","entry","isString","replacePath","config","sourceRoot","projectRoot","replace","findFileExtensionSafe","output","resolveEntryOutput","input","resolveEntryInputFile","extractESBuildConfig","defu","alias","builtins","id","path","fs","ids","build","variant","override","Array","isArray","Boolean","treeshake","outdir","outputPath","tsconfig","tsconfigFilePath","tsconfigRaw","tsconfigJson","mode","metafile"],"mappings":";;;;;;;;;;;;;AAqFO,IAAMA,sBAAAA,GAA8D;EACzEC,MAAAA,EAAQ,QAAA;EACRC,QAAAA,EAAU,SAAA;EACVC,MAAAA,EAAQ,KAAA;EACRC,KAAAA,EAAO,IAAA;EACPC,MAAAA,EAAQ,IAAA;EACRC,SAAAA,EAAW,KAAA;EACXC,MAAAA,EAAQ,IAAA;EACRC,WAAAA,EAAa,IAAA;EACbC,SAAAA,EAAW,IAAA;EACXC,SAAAA,EAAW,IAAA;EACXC,QAAAA,EAAU;AACZ;AASO,SAASC,mBAAAA,CACdC,OAAAA,EACAC,WAAAA,GAAwD,EAAA,EAAE;AAE1D,EAAA,OAAOA,WAAAA,CAAYC,MAAAA,CACjB,CAACC,GAAAA,EAAKC,KAAAA,KAAAA;AACJ,IAAA,IAAIC,iBAAAA,CAASD,KAAAA,CAAAA,EAAQ;AACnBD,MAAAA,GAAAA,CACEG,mBAAAA,CACEF,KAAAA,EACAJ,OAAAA,CAAQO,MAAAA,CAAOC,UAAAA,IAAcR,QAAQO,MAAAA,CAAOE,WAAW,CAAA,CACvDC,OAAAA,CAAQ,CAAA,CAAA,EAAIC,iCAAAA,CAAsBP,KAAAA,CAAAA,CAAAA,CAAAA,EAAU,EAAA,CAAA,CAAA,GAC5CE,mBAAAA,CACFF,KAAAA,EACAJ,OAAAA,CAAQO,MAAAA,CAAOC,UAAAA,IAAcR,OAAAA,CAAQO,MAAAA,CAAOE,WAAW,CAAA;IAE3D,CAAA,MAAO;AACLN,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B,QAAQO,MAAAA,CAAOiB,KAAAA,EAA2BM,SAAAA,CAAAA,IAClD9B,OAAAA,CAAQO,OAAOiB,KAAAA,EAA8B7B,WAAAA;IAChDoC,MAAAA,EAAQ/B,OAAAA,CAAQO,OAAOK,MAAAA,CAAOoB,UAAAA;AAC9BC,IAAAA,QAAAA,EAAUjC,QAAQiC,QAAAA,CAASC,gBAAAA;AAC3BC,IAAAA,WAAAA,EAAanC,QAAQiC,QAAAA,CAASG;GAChC,EACApC,OAAAA,CAAQO,OAAOiB,KAAAA,CAAMC,OAAAA,KAAY,YAAYzB,OAAAA,CAAQO,MAAAA,CAAOiB,KAAAA,GAAQ,EAAC,EACrE;IACEhC,MAAAA,EAAQQ,OAAAA,CAAQO,OAAO8B,IAAAA,KAAS,aAAA;IAChCC,QAAAA,EAAUtC,OAAAA,CAAQO,OAAO8B,IAAAA,KAAS,aAAA;IAClC5C,SAAAA,EAAWO,OAAAA,CAAQO,OAAO8B,IAAAA,KAAS;AACrC,GAAA,EACAlD,sBAAAA,CAAAA;AAEJ;AAtCgB6B,wBAAAA,CAAAA,oBAAAA,EAAAA,sBAAAA,CAAAA","file":"chunk-GJNFAFKR.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { findFileExtensionSafe } from \"@stryke/path/file-path-fns\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport defu from \"defu\";\nimport { Format, LogLevel, Platform } from \"esbuild\";\nimport {\n ESBuildBuildConfig,\n ESBuildResolvedBuildConfig,\n TsupBuildConfig\n} from \"../../types/build\";\nimport { Context } from \"../../types/context\";\nimport type { ResolvedEntryTypeDefinition } from \"../../types/resolved\";\nimport { resolveEntryInputFile, resolveEntryOutput } from \"../entry\";\n\n// const resolverPlugin = (\n// context: Context,\n// options: Pick<\n// BuildResolvedConfig,\n// \"external\" | \"noExternal\" | \"skipNodeModulesBundle\"\n// > = {}\n// ): Plugin => {\n// return {\n// name: \"powerlines:resolver\",\n// setup(build) {\n// const skipNodeModulesBundle =\n// options.skipNodeModulesBundle ??\n// context.config.build.skipNodeModulesBundle;\n// const external = options.external ?? context.config.build.external ?? [];\n// const noExternal =\n// options.noExternal ?? context.config.build.noExternal ?? [];\n// const resolvePatterns = skipNodeModulesBundle\n// ? tsconfigPathsToRegExp(context.tsconfig.options.paths ?? [])\n// : [];\n\n// const handle = async (args: OnResolveArgs) => {\n// const result = await handleResolveId(\n// context,\n// {\n// id: args.path,\n// importer: args.importer,\n// options: {\n// isEntry: false\n// }\n// },\n// {\n// skipNodeModulesBundle,\n// external,\n// noExternal,\n// resolvePatterns\n// }\n// );\n// if (!result) {\n// return;\n// }\n\n// return {\n// path: result?.id,\n// external: result?.external\n// };\n// };\n\n// build.onResolve({ filter: /.*/ }, handle);\n// build.onResolve({ filter: /^storm:/ }, handle);\n// }\n// };\n// };\n\nexport const DEFAULT_ESBUILD_CONFIG: Partial<ESBuildResolvedBuildConfig> = {\n target: \"esnext\",\n platform: \"neutral\" as Platform,\n format: \"esm\" as Format,\n write: true,\n minify: true,\n sourcemap: false,\n bundle: true,\n treeShaking: true,\n keepNames: true,\n splitting: true,\n logLevel: \"silent\" as LogLevel\n};\n\n/**\n * Resolves the entry options for esbuild.\n *\n * @param context - The build context.\n * @param entryPoints - The entry points to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveESBuildEntry(\n context: Context,\n entryPoints: ResolvedEntryTypeDefinition[] | string[] = []\n): ESBuildResolvedBuildConfig[\"entryPoints\"] {\n return entryPoints.reduce(\n (ret, entry) => {\n if (isString(entry)) {\n ret[\n replacePath(\n entry,\n context.config.sourceRoot || context.config.projectRoot\n ).replace(`.${findFileExtensionSafe(entry)}`, \"\")\n ] = replacePath(\n entry,\n context.config.sourceRoot || context.config.projectRoot\n );\n } else {\n ret[entry.output || resolveEntryOutput(context, entry.input || entry)] =\n resolveEntryInputFile(context, entry.input || entry);\n }\n\n return ret;\n },\n {} as Record<string, string>\n );\n}\n\n/**\n * Resolves the esbuild options.\n *\n * @param context - The build context.\n * @returns The resolved esbuild options.\n */\nexport function extractESBuildConfig(\n context: Context\n): ESBuildResolvedBuildConfig {\n return defu(\n {\n alias: context.builtins.reduce(\n (ret, id) => {\n const path = context.fs.ids[id];\n if (path) {\n ret[id] = path;\n }\n\n return ret;\n },\n {} as Record<string, string>\n )\n },\n context.config.build.variant === \"esbuild\" ? context.config.override : {},\n {\n format: (Array.isArray(context.config.output.format)\n ? context.config.output.format[0]\n : context.config.output.format) as Format,\n platform: context.config.build.platform,\n treeShaking:\n Boolean((context.config.build as TsupBuildConfig)?.treeshake) ||\n (context.config.build as ESBuildBuildConfig)?.treeShaking,\n outdir: context.config.output.outputPath,\n tsconfig: context.tsconfig.tsconfigFilePath,\n tsconfigRaw: context.tsconfig.tsconfigJson\n },\n context.config.build.variant === \"esbuild\" ? context.config.build : {},\n {\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\"\n },\n DEFAULT_ESBUILD_CONFIG\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/build/vite.ts"],"names":["DEFAULT_VITE_CONFIG","resolve","extensions","json","stringify","logLevel","clearScreen","extractViteConfig","context","defu","alias","builtins","reduce","ret","id","path","fs","ids","config","build","variant","override","external","noExternal","skipNodeModulesBundle","rootDir","sourceRoot","platform","mode","cacheDir","joinPaths","cachePath","outDir","output","outputPath","tsconfig","tsconfigFilePath","tsconfigRaw","t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AAAA,CAAQU,OAAOC,KAAAA,CAAMQ,QAAAA;AAC/BC,IAAAA,IAAAA,EACEpB,OAAAA,CAAQU,MAAAA,CAAOU,IAAAA,KAAS,aAAA,GAAgB,aAAA,GAAgB,YAAA;IAC1DC,QAAAA,EAAUC,mBAAAA,CAAUtB,OAAAA,CAAQuB,SAAAA,EAAW,MAAA,CAAA;IACvCZ,KAAAA,EAAO;MACLa,MAAAA,EAAQxB,OAAAA,CAAQU,OAAOe,MAAAA,CAAOC,UAAAA;AAC9BC,MAAAA,QAAAA,EAAU3B,QAAQ2B,QAAAA,CAASC,gBAAAA;AAC3BC,MAAAA,WAAAA,EAAa7B,QAAQ2B,QAAAA,CAASG;AAChC,KAAA;AACAC,IAAAA,OAAAA,EAASC,uCAAqBhC,OAAAA,CAAAA;IAC9BH,QAAAA,EAAUG,OAAAA,CAAQU,OAAOb,QAAAA,IAAYoC,MAAAA;AACrCC,IAAAA,MAAAA,EAAQlC,QAAQU,MAAAA,CAAOyB,WAAAA;AACvBpB,IAAAA,UAAAA,EAAYf,OAAAA,CAAQG;GACtB,EACAH,OAAAA,CAAQU,OAAOC,KAAAA,CAAMC,OAAAA,KAAY,SAASZ,OAAAA,CAAQU,MAAAA,CAAOC,KAAAA,GAAQ,EAAC,EAClE;IACEA,KAAAA,EAAO;MACLyB,MAAAA,EAAQpC,OAAAA,CAAQU,OAAOU,IAAAA,KAAS,aAAA;MAChCiB,QAAAA,EAAUrC,OAAAA,CAAQU,OAAOU,IAAAA,KAAS,aAAA;MAClCkB,SAAAA,EAAWtC,OAAAA,CAAQU,OAAOU,IAAAA,KAAS;AACrC;AACF,GAAA,EACA5B,mBAAAA,CAAAA;AAEJ;AAjDgBO,wBAAAA,CAAAA,iBAAAA,EAAAA,mBAAAA,CAAAA","file":"chunk-GWYTWFZE.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { ESBuildOptions } from \"vite\";\nimport { ViteResolvedBuildConfig } from \"../../types/build\";\nimport { Context } from \"../../types/context\";\nimport { extractESBuildConfig } from \"./esbuild\";\n\nexport const DEFAULT_VITE_CONFIG: Partial<ViteResolvedBuildConfig> = {\n resolve: {\n extensions: [\".mjs\", \".js\", \".mts\", \".ts\", \".jsx\", \".tsx\", \".json\"]\n },\n json: {\n stringify: true\n },\n logLevel: \"silent\",\n clearScreen: true\n};\n\n/**\n * Resolves the options for [vite](https://vitejs.dev/).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function extractViteConfig(context: Context): ViteResolvedBuildConfig {\n return defu(\n {\n resolve: {\n alias: context.builtins.reduce(\n (ret, id) => {\n const path = context.fs.ids[id];\n if (path) {\n ret[id] = path;\n }\n\n return ret;\n },\n {} as Record<string, string>\n )\n }\n },\n context.config.build.variant === \"vite\" ? context.config.override : {},\n {\n external: context.config.build.external,\n noExternal: context.config.build.noExternal,\n skipNodeModulesBundle: context.config.build.skipNodeModulesBundle\n },\n {\n rootDir: context.config.sourceRoot,\n platform: context.config.build.platform,\n mode:\n context.config.mode === \"development\" ? \"development\" : \"production\",\n cacheDir: joinPaths(context.cachePath, \"vite\"),\n build: {\n outDir: context.config.output.outputPath,\n tsconfig: context.tsconfig.tsconfigFilePath,\n tsconfigRaw: context.tsconfig.tsconfigJson\n },\n esbuild: extractESBuildConfig(context) as ESBuildOptions,\n logLevel: context.config.logLevel ?? undefined,\n envDir: context.config.projectRoot,\n noExternal: context.builtins\n },\n context.config.build.variant === \"vite\" ? context.config.build : {},\n {\n build: {\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\"\n }\n },\n DEFAULT_VITE_CONFIG\n ) as ViteResolvedBuildConfig;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-HJWJNSSZ.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utilities/write-file.ts"],"names":["writeFile","log","filepath","content","skipFormat","writeFileBase","config","resolveConfig","formatted","format","error","LogLevelLabel","ERROR","message"],"mappings":";;;;;AA+BA,eAAsBA,SAAAA,CACpBC,GAAAA,EACAC,QAAAA,EACAC,OAAAA,EACAC,aAAa,KAAA,EAAK;AAElB,EAAA,IAAI;AACF,IAAA,IAAIA,UAAAA,EAAY;AACd,MAAA,MAAMC,WAAAA,CAAcH,UAAUC,OAAAA,CAAAA;IAChC,CAAA,MAAO;AACL,MAAA,MAAMG,MAAAA,GAAS,MAAMC,aAAAA,CAAcL,QAAAA,CAAAA;AACnC,MAAA,MAAMM,SAAAA,GAAY,MAAMC,MAAAA,CAAON,OAAAA,EAAS;AACtC,QAAA,GAAIG,UAAU,EAAC;AACfJ,QAAAA;OACF,CAAA;AAEA,MAAA,MAAMG,WAAAA,CAAcH,QAAAA,EAAUM,SAAAA,IAAa,EAAA,CAAA;AAC7C,IAAA;AACF,EAAA,CAAA,CAAA,OAASE,KAAAA,EAAO;AACdT,IAAAA,GAAAA,CACEU,aAAAA,CAAcC,KAAAA,EACd,CAAA,qBAAA,EAAwBV,QAAAA,CAAAA;AAAuBQ,EAAAA,KAAAA,EAAiBG,OAAAA,GAAWH,KAAAA,CAAgBG,OAAAA,GAAU,EAAA,CAAA,CAAI,CAAA;AAE7G,EAAA;AACF;AAxBsBb,MAAAA,CAAAA,SAAAA,EAAAA,WAAAA,CAAAA","file":"chunk-HQ6TGY34.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { writeFile as writeFileBase } from \"@stryke/fs/write-file\";\nimport { format, resolveConfig } from \"prettier\";\nimport type { LogFn } from \"../../types/config\";\n\n/**\n * Writes and formats a file to the file system\n *\n * @param log - The logging function to use for logging errors\n * @param filepath - The file path to write the file\n * @param content - The content to write to the file\n * @param skipFormat - Should the plugin skip formatting the `content` string with Prettier\n */\nexport async function writeFile(\n log: LogFn,\n filepath: string,\n content: string,\n skipFormat = false\n) {\n try {\n if (skipFormat) {\n await writeFileBase(filepath, content);\n } else {\n const config = await resolveConfig(filepath);\n const formatted = await format(content, {\n ...(config ?? {}),\n filepath\n });\n\n await writeFileBase(filepath, formatted || \"\");\n }\n } catch (error) {\n log(\n LogLevelLabel.ERROR,\n `Failed to write file ${filepath} to disk \\n${(error as Error)?.message ? (error as Error).message : \"\"}`\n );\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utilities/source-map.ts"],"names":["dmp","Diff","generateSourceMap","code","id","transpiled","diff","diff_main","toString","diff_cleanupSemantic","offset","index","length","type","text","textLength","prependLeft","next","at","replaceText","firstNonWhitespaceIndexOfText","search","offsetStart","Math","max","update","remove","hasChanged","map","generateMap","source","file","includeContent"],"mappings":";;;;;;;;;AAsBA,IAAMA,GAAAA,GAAM,IAAIC,qBAAAA,EAAAA;AAUT,SAASC,iBAAAA,CACdC,IAAAA,EACAC,EAAAA,EACAC,UAAAA,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,MAAAA,CAAOH,WAAAA,EAAaZ,MAAAA,GAASK,UAAAA,EAAYI,WAAAA,CAAAA;AAC9CR,YAAAA,KAAAA,IAAS,CAAA;UACX,CAAA,MAAO;AACLR,YAAAA,IAAAA,CAAKuB,MAAAA,CAAOhB,MAAAA,EAAQA,MAAAA,GAASK,UAAAA,CAAAA;AAC/B,UAAA;AAEAL,UAAAA,MAAAA,IAAUK,UAAAA;AAEV,UAAA;AACF,QAAA;AACF;AACF,IAAA;AACF,EAAA;AAEA,EAAA,IAAI,CAACZ,IAAAA,CAAKwB,UAAAA,EAAU,EAAI;AACtB,IAAA;AACF,EAAA;AAEA,EAAA,OAAO;AACLxB,IAAAA,IAAAA,EAAMA,KAAKK,QAAAA,EAAQ;AACnBoB,IAAAA,GAAAA,EAAKzB,KAAK0B,WAAAA,CAAY;MACpBC,MAAAA,EAAQ1B,EAAAA;AACR2B,MAAAA,IAAAA,EAAM,GAAG3B,EAAAA,CAAAA,IAAAA,CAAAA;MACT4B,cAAAA,EAAgB;KAClB;AACF,GAAA;AACF;AAhEgB9B,wBAAAA,CAAAA,iBAAAA,EAAAA,mBAAAA,CAAAA","file":"chunk-IK3ABDPP.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport Diff from \"diff-match-patch\";\nimport type MagicString from \"magic-string\";\nimport type { CompilerResult } from \"../../types/compiler\";\n\nconst dmp = new Diff();\n\n/**\n * Generate code with source map.\n *\n * @param code - The source code.\n * @param id - The file name.\n * @param transpiled - The transpiled code.\n * @returns The compiler result.\n */\nexport function generateSourceMap(\n code: MagicString,\n id: string,\n transpiled?: string\n): CompilerResult {\n if (!transpiled) {\n return;\n }\n\n const diff = dmp.diff_main(code.toString(), transpiled);\n dmp.diff_cleanupSemantic(diff);\n\n let offset = 0;\n\n for (let index = 0; index < diff.length; index++) {\n if (diff[index]) {\n const [type, text] = diff[index]!;\n const textLength = text.length;\n\n switch (type) {\n case 0: {\n offset += textLength;\n break;\n }\n case 1: {\n code.prependLeft(offset, text);\n break;\n }\n case -1: {\n const next = diff.at(index + 1);\n\n if (next && next[0] === 1) {\n const replaceText = next[1];\n\n const firstNonWhitespaceIndexOfText = text.search(/\\S/);\n const offsetStart =\n offset + Math.max(firstNonWhitespaceIndexOfText, 0);\n\n code.update(offsetStart, offset + textLength, replaceText);\n index += 1;\n } else {\n code.remove(offset, offset + textLength);\n }\n\n offset += textLength;\n\n break;\n }\n }\n }\n }\n\n if (!code.hasChanged()) {\n return;\n }\n\n return {\n code: code.toString(),\n map: code.generateMap({\n source: id,\n file: `${id}.map`,\n includeContent: true\n })\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/build/rollup.ts"],"names":["dtsBundlePlugin","name","generateBundle","_opts","bundle","file","Object","entries","type","isEntry","facadeModuleId","dtsFileName","fileName","replace","relativeSourceDtsName","JSON","stringify","emitFile","source","exports","includes","extractRollupConfig","context","result","defu","input","globSync","toArray","config","entry","map","isString","flat","external","__name","importer","isResolved","externalFn","build","variant","override","isFunction","id","rollupOptions","undefined","noExternal","builtins","projectType","skipNodeModulesBundle","plugins","typescriptPlugin","check","tsconfig","tsconfigFilePath","alias","reduce","ret","find","e","path","fs","ids","push","replacement","getBabelInputPlugin","transform","babel","caller","supportsStaticESM","cwd","projectRoot","babelrc","extensions","babelHelpers","skipPreflightCheck","exclude","resolve","moduleDirectories","preferBuiltins","cache","skipCache","joinPaths","cachePath","output","dir","outputPath","logLevel","sourcemap","mode","format","entryFileNames","preser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AAA;QACEM,MAAAA,EAAQ,IAAA;QACRC,cAAAA,EAAgB,WAAA;QAChBC,eAAAA,EAAiB;AACnB,OAAA;AACA,MAAA;QACEF,MAAAA,EAAQ,KAAA;QACRC,cAAAA,EAAgB,YAAA;QAChBC,eAAAA,EAAiB;AACnB;;GAEJ,CAAA;AAGF,EAAA,OAAOpE,MAAAA;AACT;AA7KgBF,wBAAAA,CAAAA,mBAAAA,EAAAA,qBAAAA,CAAAA","file":"chunk-JTUL3477.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport alias from \"@rollup/plugin-alias\";\nimport {\n getBabelInputPlugin,\n RollupBabelInputPluginOptions\n} from \"@rollup/plugin-babel\";\nimport resolve from \"@rollup/plugin-node-resolve\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport defu from \"defu\";\nimport { globSync } from \"node:fs\";\nimport { Plugin } from \"rollup\";\nimport typescriptPlugin from \"rollup-plugin-typescript2\";\nimport {\n RollupResolvedBuildConfig,\n ViteBuildConfig,\n ViteResolvedBuildConfig\n} from \"../../types/build\";\nimport { Context } from \"../../types/context\";\n\n/**\n * A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.\n *\n * @remarks\n * This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.\n */\nexport const dtsBundlePlugin: Plugin = {\n name: \"powerlines:dts-bundle\",\n async generateBundle(_opts, bundle) {\n for (const [, file] of Object.entries(bundle)) {\n if (\n file.type === \"asset\" ||\n !file.isEntry ||\n file.facadeModuleId == null\n ) {\n continue;\n }\n\n // Replace various JavaScript file extensions (e.g., .js, .cjs, .mjs, .cjs.js, .mjs.js) with .d.ts for generating type definition file names.\n const dtsFileName = file.fileName.replace(\n /(?:\\.cjs|\\.mjs|\\.esm\\.js|\\.cjs\\.js|\\.mjs\\.js|\\.js)$/,\n \".d.ts\"\n );\n\n const relativeSourceDtsName = JSON.stringify(\n `./${file.facadeModuleId.replace(/\\.[cm]?[jt]sx?$/, \"\")}`\n );\n\n this.emitFile({\n type: \"asset\",\n fileName: dtsFileName,\n source: file.exports.includes(\"default\")\n ? `export * from ${relativeSourceDtsName};\\nexport { default } from ${relativeSourceDtsName};\\n`\n : `export * from ${relativeSourceDtsName};\\n`\n });\n }\n }\n};\n\n/**\n * Resolves the options for [rollup](https://rollupjs.org).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function extractRollupConfig(\n context: Context\n): RollupResolvedBuildConfig {\n const result = defu(\n {\n input: globSync(\n toArray(context.config.entry).map(entry =>\n isString(entry) ? entry : entry.file\n )\n ).flat(),\n external: (\n source: string,\n importer: string | undefined,\n isResolved: boolean\n ) => {\n const externalFn =\n context.config.build.variant === \"rollup\" &&\n context.config.override.external\n ? isFunction(context.config.override.external)\n ? context.config.override.external\n : (id: string) =>\n toArray(\n (\n context.config\n .override as Partial<RollupResolvedBuildConfig>\n ).external\n ).includes(id)\n : context.config.build.variant === \"vite\" &&\n (context.config.override as ViteResolvedBuildConfig).build\n ?.rollupOptions?.external\n ? isFunction(\n (context.config.override as ViteResolvedBuildConfig).build\n ?.rollupOptions?.external\n )\n ? (context.config.override as ViteResolvedBuildConfig).build\n ?.rollupOptions?.external\n : (id: string) =>\n toArray(\n (context.config.build as ViteResolvedBuildConfig)?.build\n ?.rollupOptions?.external\n ).includes(id)\n : context.config.build.variant === \"rollup\" &&\n context.config.build.external\n ? isFunction(context.config.build.external)\n ? context.config.build.external\n : (id: string) =>\n toArray(\n (context.config.build as RollupResolvedBuildConfig)\n .external\n ).includes(id)\n : context.config.build.variant === \"vite\" &&\n (context.config.build as ViteBuildConfig).build\n ?.rollupOptions?.external\n ? isFunction(\n (context.config.build as ViteBuildConfig).build\n ?.rollupOptions?.external\n )\n ? (context.config.build as ViteBuildConfig).build\n ?.rollupOptions?.external\n : (id: string) =>\n toArray(\n (context.config.build as ViteBuildConfig)?.build\n ?.rollupOptions?.external\n ).includes(id)\n : undefined;\n if (\n isFunction(externalFn) &&\n externalFn(source, importer, isResolved)\n ) {\n return true;\n }\n\n if (\n context.config.build.external &&\n toArray(context.config.build.external).includes(source)\n ) {\n return true;\n }\n\n if (\n context.config.build.noExternal &&\n toArray(context.config.build.noExternal).includes(source)\n ) {\n return false;\n }\n\n if (context.builtins.includes(source)) {\n return context.config.projectType !== \"application\";\n }\n\n return !context.config.build.skipNodeModulesBundle;\n },\n plugins: [\n typescriptPlugin({\n check: false,\n tsconfig: context.tsconfig.tsconfigFilePath\n }),\n alias({\n entries: context.builtins.reduce(\n (ret, id) => {\n if (!ret.find(e => e.find === id)) {\n const path = context.fs.ids[id];\n if (path) {\n ret.push({ find: id, replacement: path });\n }\n }\n\n return ret;\n },\n [] as { find: string; replacement: string }[]\n )\n }),\n getBabelInputPlugin(\n defu(context.config.transform.babel, {\n caller: {\n name: \"powerlines\",\n supportsStaticESM: true\n },\n cwd: context.config.projectRoot,\n babelrc: false,\n extensions: [\".js\", \".jsx\", \".ts\", \".tsx\"],\n babelHelpers: \"bundled\",\n skipPreflightCheck: true,\n exclude: /node_modules/\n }) as RollupBabelInputPluginOptions\n ),\n resolve({\n moduleDirectories: [\"node_modules\"],\n preferBuiltins: true\n }),\n dtsBundlePlugin\n ]\n },\n context.config.build.variant === \"rollup\" ? context.config.override : {},\n context.config.build.variant === \"vite\"\n ? (context.config.override as ViteBuildConfig).build?.rollupOptions\n : {},\n {\n cache: !context.config.skipCache\n ? joinPaths(context.cachePath, \"rollup\")\n : false,\n output: {\n dir: context.config.output.outputPath\n },\n logLevel: context.config.logLevel\n },\n context.config.build.variant === \"rollup\" ? context.config.build : {},\n context.config.build.variant === \"vite\"\n ? (context.config.build as ViteBuildConfig).build?.rollupOptions\n : {},\n {\n output: {\n sourcemap: context.config.mode === \"development\"\n }\n },\n {\n logLevel: \"silent\",\n output: [\n {\n format: \"es\",\n entryFileNames: \"[name].js\",\n preserveModules: true\n },\n {\n format: \"cjs\",\n entryFileNames: \"[name].cjs\",\n preserveModules: true\n }\n ]\n }\n ) as RollupResolvedBuildConfig;\n\n return result;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/vfs.ts","../../src/lib/utilities/meta.ts"],"names":["__VFS_INIT__","__VFS_REVERT__","__VFS_CACHE__","__VFS_RESOLVER__","__VFS_VIRTUAL__","__VFS_UNIFIED__","PROJECT_ROOT_HASH_LENGTH","CACHE_HASH_LENGTH","getPrefixedProjectRootHash","name","projectRootHash","combined","kebabCase","length","slice","discoverTemplatePath","path","Promise","all","resolve","test","includes","hasFileExtension","joinPaths","listFiles","flat","filter","Boolean","discoverTemplates","context","paths","getUnique","map","config","sourceRoot","envPaths","projectRoot","reduce","ret","existsSync","push","getChecksum","hashDirectory","ignore","getPersistedMeta","metaFilePath","dataPath","readJsonFile","log","LogLevelLabel","WARN","removeFile","persistedMeta","undefined","writeMetaFile","DEBUG","fs","writeFile","JSON","stringify","meta","virtualFiles","toJSON","artifactsPath","virtualFilesMeta","getPartialMeta","mode"],"mappings":";;;;;;;;;;;;;AAoCO,IAAMA,YAAAA,GAAe;AAGrB,IAAMC,cAAAA,GAAiB;AAGvB,IAAMC,aAAAA,GAAgB;AAGtB,IAAMC,gBAAAA,GAAmB;AAGzB,IAAMC,eAAAA,GAAkB;AAGxB,IAAMC,eAAAA,GAAkB;;;AChBxB,IAAMC,wBAAAA,GAA2B;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JDJ.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { PrimitiveJsonValue } from \"@stryke/json/types\";\nimport type { Volume } from \"memfs\";\nimport type {\n MakeDirectoryOptions as FsMakeDirectoryOptions,\n WriteFileOptions as FsWriteFileOptions,\n Mode,\n PathLike,\n PathOrFileDescriptor,\n RmDirOptions,\n RmOptions,\n Stats,\n StatSyncOptions\n} from \"node:fs\";\nimport type { IUnionFs } from \"unionfs\";\n\nexport type VirtualFileExtension = \"js\" | \"ts\" | \"jsx\" | \"tsx\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_INIT__ = \"__VFS_INIT__\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_REVERT__ = \"__VFS_REVERT__\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_CACHE__ = \"__VFS_CACHE__\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_RESOLVER__ = \"__VFS_RESOLVER__\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_VIRTUAL__ = \"__VFS_VIRTUAL__\";\n\n// eslint-disable-next-line ts/naming-convention\nexport const __VFS_UNIFIED__ = \"__VFS_UNIFIED__\";\n\nexport type OutputModeType = \"fs\" | \"virtual\";\n\nexport interface VirtualFile {\n /**\n * The unique identifier for the virtual file.\n *\n * @remarks\n * If no specific id is provided, it defaults to the file's {@link path}.\n */\n id: string;\n\n /**\n * Additional metadata associated with the virtual file.\n */\n details: Record<string, PrimitiveJsonValue>;\n\n /**\n * The variant of the file.\n *\n * @remarks\n * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:\n * - `builtin`: Indicates that the file is a built-in module provided by the system.\n * - `entry`: Indicates that the file is an entry point for execution.\n * - `normal`: Indicates that the file is a standard file without any special role.\n */\n variant: string;\n\n /**\n * The output mode of the file.\n *\n * @remarks\n * This indicates whether the file is intended to be written to the actual file system (`fs`) or kept in the virtual file system (`virtual`).\n */\n mode: OutputModeType;\n\n /**\n * A virtual (or actual) path to the file in the file system.\n */\n path: string;\n\n /**\n * The contents of the file.\n */\n code: string | NodeJS.ArrayBufferView;\n}\n\nexport type VirtualFileSystemMetadata = Pick<\n VirtualFile,\n \"id\" | \"details\" | \"variant\" | \"mode\"\n>;\n\nexport interface ResolveFSOptions {\n mode?: OutputModeType;\n}\n\nexport type MakeDirectoryOptions = (Mode | FsMakeDirectoryOptions) &\n ResolveFSOptions;\n\nexport interface PowerlinesWriteFileOptions extends ResolveFSOptions {\n skipFormat?: boolean;\n}\n\nexport type NodeWriteFileOptions = FsWriteFileOptions;\n\nexport type WriteFileOptions =\n | NodeWriteFileOptions\n | PowerlinesWriteFileOptions;\n\nexport type PowerLinesWriteFileData = Partial<\n Omit<VirtualFile, \"path\" | \"mode\" | \"code\">\n> &\n Pick<VirtualFile, \"code\">;\n\nexport type WriteFileData =\n | string\n | NodeJS.ArrayBufferView\n | PowerLinesWriteFileData;\n\nexport interface ResolvePathOptions extends ResolveFSOptions {\n /**\n * Should the resolved path include the file extension?\n *\n * @defaultValue true\n */\n withExtension?: boolean;\n\n /**\n * The paths to search for the file.\n */\n paths?: string[];\n\n /**\n * The type of the path to resolve.\n */\n type?: \"file\" | \"directory\";\n}\n\nexport interface VirtualFileSystemInterface {\n [__VFS_INIT__]: () => void;\n [__VFS_REVERT__]: () => void;\n\n /**\n * The underlying file metadata.\n */\n meta: Record<string, VirtualFileSystemMetadata | undefined>;\n\n /**\n * A map of module ids to their file paths.\n */\n ids: Record<string, string>;\n\n /**\n * Check if a path or id corresponds to a virtual file **(does not actually exists on disk)**.\n *\n * @param pathOrId - The path or id to check.\n * @param options - Optional parameters for resolving the path.\n * @returns Whether the path or id corresponds to a virtual file **(does not actually exists on disk)**.\n */\n isVirtual: (pathOrId: string, options?: ResolvePathOptions) => boolean;\n\n /**\n * Check if a path or id corresponds to a file written to the file system **(actually exists on disk)**.\n *\n * @param pathOrId - The path or id to check.\n * @param options - Optional parameters for resolving the path.\n * @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.\n */\n isFs: (pathOrId: string, options?: ResolvePathOptions) => boolean;\n\n /**\n * Checks if a file exists in the virtual file system (VFS).\n *\n * @param path - The path of the file to check.\n * @returns `true` if the file exists, otherwise `false`.\n */\n isFile: (path: string) => boolean;\n\n /**\n * Checks if a directory exists in the virtual file system (VFS).\n *\n * @param path - The path of the directory to check.\n * @returns `true` if the directory exists, otherwise `false`.\n */\n isDirectory: (path: string) => boolean;\n\n /**\n * Check if a path exists within one of the directories specified in the tsconfig.json's `path` field.\n *\n * @see https://www.typescriptlang.org/tsconfig#paths\n *\n * @param pathOrId - The path or id to check.\n * @returns Whether the path or id corresponds to a virtual file.\n */\n isTsconfigPath: (pathOrId: string) => boolean;\n\n /**\n * Checks if a file exists in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @returns `true` if the file exists, otherwise `false`.\n */\n existsSync: (pathOrId: string) => boolean;\n\n /**\n * Gets the metadata of a file in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @returns The metadata of the file if it exists, otherwise undefined.\n */\n getMetadata: (pathOrId: PathLike) => VirtualFileSystemMetadata | undefined;\n\n /**\n * Gets the stats of a file in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @param options - Optional parameters for getting the stats.\n * @returns The stats of the file if it exists, otherwise undefined.\n */\n lstat: (\n pathOrId: string,\n options?: StatSyncOptions & {\n bigint?: false | undefined;\n throwIfNoEntry: false;\n }\n ) => Promise<Stats>;\n\n /**\n * Gets the stats of a file in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @param options - Optional parameters for getting the stats.\n * @returns The stats of the file if it exists, otherwise undefined.\n */\n lstatSync: (\n pathOrId: string,\n options?: StatSyncOptions & {\n bigint?: false | undefined;\n throwIfNoEntry: false;\n }\n ) => Stats | undefined;\n\n /**\n * Gets the stats of a file in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @returns The stats of the file if it exists, otherwise false.\n */\n stat: (\n pathOrId: string,\n options?: StatSyncOptions & {\n bigint?: false | undefined;\n throwIfNoEntry: false;\n }\n ) => Promise<Stats>;\n\n /**\n * Gets the stats of a file in the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @returns The stats of the file if it exists, otherwise false.\n */\n statSync: (\n pathOrId: string,\n options?: StatSyncOptions & {\n bigint?: false | undefined;\n throwIfNoEntry: false;\n }\n ) => Stats | undefined;\n\n /**\n * Lists files in a given path.\n *\n * @param path - The path to list files from.\n * @param options - Options for listing files, such as encoding and recursion.\n * @returns An array of file names in the specified path.\n */\n readdirSync: (\n path: string,\n options?:\n | {\n encoding: BufferEncoding | null;\n withFileTypes?: false | undefined;\n recursive?: boolean | undefined;\n }\n | BufferEncoding\n ) => string[];\n\n /**\n * Lists files in a given path.\n *\n * @param path - The path to list files from.\n * @param options - Options for listing files, such as encoding and recursion.\n * @returns An array of file names in the specified path.\n */\n readdir: (\n path: string,\n options?:\n | {\n encoding: BufferEncoding | null;\n withFileTypes?: false | undefined;\n recursive?: boolean | undefined;\n }\n | BufferEncoding\n ) => Promise<string[]>;\n\n /**\n * Removes a file or symbolic link in the virtual file system (VFS).\n *\n * @param path - The path to the file to remove.\n * @returns A promise that resolves when the file is removed.\n */\n unlinkSync: (path: PathLike, options?: ResolveFSOptions) => void;\n\n /**\n * Asynchronously removes a file or symbolic link in the virtual file system (VFS).\n *\n * @param path - The path to the file to remove.\n * @returns A promise that resolves when the file is removed.\n */\n unlink: (path: string, options?: ResolveFSOptions) => Promise<void>;\n\n /**\n * Removes a directory in the virtual file system (VFS).\n *\n * @param path - The path to create the directory at.\n * @param options - Options for creating the directory.\n */\n rmdirSync: (path: PathLike, options?: RmDirOptions & ResolveFSOptions) => any;\n\n /**\n * Removes a directory in the virtual file system (VFS).\n *\n * @param path - The path to create the directory at.\n * @param options - Options for creating the directory.\n * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.\n */\n rmdir: (\n path: PathLike,\n options?: RmDirOptions & ResolveFSOptions\n ) => Promise<void>;\n\n /**\n * Removes a file or directory in the virtual file system (VFS).\n *\n * @param path - The path to the file or directory to remove.\n * @param options - Options for removing the file or directory.\n * @returns A promise that resolves when the file or directory is removed.\n */\n rm: (path: PathLike, options?: RmOptions & ResolveFSOptions) => Promise<void>;\n\n /**\n * Synchronously removes a file or directory in the virtual file system (VFS).\n *\n * @param path - The path to the file or directory to remove.\n * @param options - Options for removing the file or directory.\n */\n rmSync: (path: PathLike, options?: RmOptions & ResolveFSOptions) => void;\n\n /**\n * Creates a directory in the virtual file system (VFS).\n *\n * @param path - The path to create the directory at.\n * @param options - Options for creating the directory.\n * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.\n */\n mkdirSync: (\n path: PathLike,\n options?: MakeDirectoryOptions\n ) => string | undefined;\n\n /**\n * Creates a directory in the virtual file system (VFS).\n *\n * @param path - The path to create the directory at.\n * @param options - Options for creating the directory.\n * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.\n */\n mkdir: (\n path: PathLike,\n options?: MakeDirectoryOptions\n ) => Promise<string | undefined>;\n\n /**\n * Reads a file from the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n * @returns The contents of the file if it exists, otherwise undefined.\n */\n readFile: (pathOrId: string) => Promise<string | undefined>;\n\n /**\n * Reads a file from the virtual file system (VFS).\n *\n * @param pathOrId - The path or id of the file.\n */\n readFileSync: (pathOrId: string) => string | undefined;\n\n /**\n * Writes a file to the virtual file system (VFS).\n *\n * @param path - The path to the file.\n * @param data - The contents of the file.\n * @param options - Optional parameters for writing the file.\n * @returns A promise that resolves when the file is written.\n */\n writeFile: (\n path: PathOrFileDescriptor,\n data?: WriteFileData,\n options?: WriteFileOptions\n ) => Promise<void>;\n\n /**\n * Writes a file to the virtual file system (VFS).\n *\n * @param path - The path to the file.\n * @param data - The contents of the file.\n * @param options - Optional parameters for writing the file.\n */\n writeFileSync: (\n path: PathOrFileDescriptor,\n data?: WriteFileData,\n options?: WriteFileOptions\n ) => void;\n\n /**\n * Moves a file from one path to another in the virtual file system (VFS).\n *\n * @param srcPath - The source path to move\n * @param destPath - The destination path to move to\n */\n move: (srcPath: string, destPath: string) => Promise<void>;\n\n /**\n * Synchronously moves a file from one path to another in the virtual file system (VFS).\n *\n * @param srcPath - The source path to move\n * @param destPath - The destination path to move to\n */\n moveSync: (srcPath: string, destPath: string) => void;\n\n /**\n * Copies a file from one path to another in the virtual file system (VFS).\n *\n * @param srcPath - The source path to copy\n * @param destPath - The destination path to copy to\n */\n copy: (srcPath: string, destPath: string) => Promise<void>;\n\n /**\n * Synchronously copies a file from one path to another in the virtual file system (VFS).\n *\n * @param srcPath - The source path to copy\n * @param destPath - The destination path to copy to\n */\n copySync: (srcPath: string, destPath: string) => void;\n\n /**\n * Glob files in the virtual file system (VFS) based on the provided pattern(s).\n *\n * @param pattern - A pattern (or multiple patterns) to use to determine the file paths to return\n * @returns An array of file paths matching the provided pattern(s)\n */\n glob: (pattern: string | string[]) => Promise<string[]>;\n\n /**\n * Synchronously glob files in the virtual file system (VFS) based on the provided pattern(s).\n *\n * @param pattern - A pattern (or multiple patterns) to use to determine the file paths to return\n * @returns An array of file paths matching the provided pattern(s)\n */\n globSync: (pattern: string | string[]) => string[];\n\n /**\n * Resolves a path or id to a file path in the virtual file system.\n *\n * @param pathOrId - The path or id of the file to resolve.\n * @param options - Optional parameters for resolving the path.\n * @returns The resolved path of the file if it exists, otherwise false.\n */\n resolve: (pathOrId: string, options?: ResolvePathOptions) => string | false;\n\n /**\n * Resolves a path based on TypeScript's `tsconfig.json` paths.\n *\n * @see https://www.typescriptlang.org/tsconfig#paths\n *\n * @param path - The path to check.\n * @returns The resolved file path if it exists, otherwise undefined.\n */\n resolveTsconfigPath: (path: string) => string | false;\n\n /**\n * Resolves a package name based on TypeScript's `tsconfig.json` paths.\n *\n * @see https://www.typescriptlang.org/tsconfig#paths\n *\n * @param path - The path to check.\n * @returns The resolved package name if it exists, otherwise undefined.\n */\n resolveTsconfigPathPackage: (path: string) => string | false;\n\n /**\n * Resolves a path or id to a file path in the virtual file system.\n *\n * @param pathOrId - The path or id of the file to resolve.\n * @returns The resolved path of the file if it exists, otherwise false.\n */\n realpathSync: (pathOrId: string) => string;\n\n /**\n * Retrieves a partial metadata mapping of all files in the virtual file system (VFS).\n *\n * @returns A record mapping file paths to their partial metadata.\n */\n getPartialMeta: () => Record<string, Partial<VirtualFileSystemMetadata>>;\n\n /**\n * A map of cached file paths to their underlying file content.\n */\n [__VFS_CACHE__]: Map<string, string>;\n\n /**\n * A reference to the underlying virtual file system.\n */\n [__VFS_VIRTUAL__]: Volume;\n\n /**\n * A reference to the underlying unified file system.\n */\n [__VFS_UNIFIED__]: IUnionFs;\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { readJsonFile } from \"@stryke/fs/json\";\nimport { listFiles } from \"@stryke/fs/list-files\";\nimport { removeFile } from \"@stryke/fs/remove-file\";\nimport { hashDirectory } from \"@stryke/hash/hash-files\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { Context, MetaInfo } from \"../../types/context\";\nimport { __VFS_VIRTUAL__ } from \"../../types/vfs\";\n\nexport interface CreateContextOptions {\n name?: string;\n}\n\nexport const PROJECT_ROOT_HASH_LENGTH = 45;\nexport const CACHE_HASH_LENGTH = 62;\n\n/**\n * Generates a prefixed project root hash object.\n *\n * @remarks\n * This function returns a string where the project root hash is prefixed with the project name plus a hyphen. If the total length of this string combination exceeds 45 characters, it will truncate the hash.\n *\n * @param name - The name of the project.\n * @param projectRootHash - The hash of the project root.\n * @returns An object containing the name and project root hash.\n */\nexport function getPrefixedProjectRootHash(\n name: string,\n projectRootHash: string\n): string {\n const combined = `${kebabCase(name)}_${projectRootHash}`;\n\n return combined.length > PROJECT_ROOT_HASH_LENGTH\n ? combined.slice(0, PROJECT_ROOT_HASH_LENGTH)\n : combined;\n}\n\nasync function discoverTemplatePath(path: string): Promise<string[]> {\n return (\n await Promise.all([\n Promise.resolve(/.tsx?$/.test(path) && !path.includes(\"*\") && path),\n Promise.resolve(!hasFileExtension(path) && joinPaths(path, \".ts\")),\n Promise.resolve(!hasFileExtension(path) && joinPaths(path, \".tsx\")),\n Promise.resolve(\n !hasFileExtension(path) && listFiles(joinPaths(path, \"**/*.ts\"))\n ),\n Promise.resolve(\n !hasFileExtension(path) && listFiles(joinPaths(path, \"**/*.tsx\"))\n )\n ])\n )\n .flat()\n .filter(Boolean) as string[];\n}\n\nexport async function discoverTemplates(\n context: Context,\n paths: string[] = []\n): Promise<string[]> {\n return getUnique(\n (\n await Promise.all([\n ...paths.map(discoverTemplatePath),\n discoverTemplatePath(joinPaths(context.config.sourceRoot, \"plugin\")),\n discoverTemplatePath(joinPaths(context.envPaths.config, \"templates\")),\n discoverTemplatePath(joinPaths(context.config.projectRoot, \"templates\"))\n ])\n )\n .flat()\n .reduce((ret, path) => {\n if (existsSync(path)) {\n ret.push(path);\n }\n\n return ret;\n }, [] as string[])\n );\n}\n\nexport async function getChecksum(path: string): Promise<string> {\n return hashDirectory(path, {\n ignore: [\"node_modules\", \".git\", \".nx\", \".cache\", \".storm\", \"tmp\", \"dist\"]\n });\n}\n\n/**\n * Retrieves the persisted meta information from the context's data path.\n *\n * @param context - The build context.\n * @returns A promise that resolves to the persisted meta information, or undefined if not found.\n */\nexport async function getPersistedMeta(\n context: Context\n): Promise<MetaInfo | undefined> {\n const metaFilePath = joinPaths(context.dataPath, \"meta.json\");\n if (existsSync(metaFilePath)) {\n try {\n return await readJsonFile<MetaInfo>(metaFilePath);\n } catch {\n context.log(\n LogLevelLabel.WARN,\n `Failed to read meta file at ${metaFilePath}. It may be corrupted.`\n );\n await removeFile(metaFilePath);\n\n context.persistedMeta = undefined;\n }\n }\n\n return undefined;\n}\n\n/**\n * Writes the meta file for the context.\n *\n * @param context - The context to write the meta file for.\n * @returns A promise that resolves when the meta file has been written.\n */\nexport async function writeMetaFile(context: Context): Promise<void> {\n const metaFilePath = joinPaths(context.dataPath, \"meta.json\");\n\n context.log(\n LogLevelLabel.DEBUG,\n `Writing runtime metadata to ${metaFilePath}`\n );\n\n await context.fs.writeFile(\n metaFilePath,\n JSON.stringify(\n {\n ...context.meta,\n virtualFiles: context.fs[__VFS_VIRTUAL__].toJSON(context.artifactsPath),\n virtualFilesMeta: context.fs.getPartialMeta()\n },\n null,\n 2\n ),\n {\n mode: \"fs\"\n }\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utilities/worker.ts"],"names":["RESTARTED","Symbol","cleanupWorkers","worker","curWorker","_workerPool","_workers","_child","kill","Worker","workerPath","options","timeout","onRestart","name","context","farmOptions","createLog","restartPromise","resolveRestartPromise","activeTasks","undefined","process","on","close","createWorker","JestWorker","forkOptions","env","POWERLINES_LOCAL","maxRetries","Promise","resolve","enableWorkerThreads","code","signal","LogLevelLabel","ERROR","exit","data","type","onActivity","aborted","onActivityAbort","abortActivityStreamOnLog","Transform","transform","_chunk","_encoding","callback","getStdout","pipe","getStderr","stdout","stderr","onHanging","WARN","end","then","hangingTimer","clearTimeout","setTimeout","method","exposedMethods","startsWith","args","attempts","params","defu","length","result","race","bind","Error","numWorkers","findFileName","withExtension"],"mappings":";;;;;;;;AAuCA,IAAMA,SAAAA,GAAYC,OAAO,WAAA,CAAA;AAEzB,IAAMC,cAAAA,2BAAkBC,MAAAA,KAAAA;AACtB,EAAA,KAAA,MAAWC,SAAAA,IAAeD,MAAAA,CAAeE,WAAAA,EAAaC,QAAAA,IAAY,EAAA,EAE7D;AACHF,IAAAA,SAAAA,CAAUG,MAAAA,EAAQC,KAAK,QAAA,CAAA;AACzB,EAAA;AACF,CAAA,EANuB,gBAAA,CAAA;AAQhB,IAAMC,SAAN,MAAMA;EAjDb;;;;;AAkDE,EAAA,OAAA;AAEA,EAAA,IAAA;AAEA,EAAA,WAAA,CACYC,YACAC,OAAAA,EACV;SAFUD,UAAAA,GAAAA,UAAAA;SACAC,OAAAA,GAAAA,OAAAA;AAEV,IAAA,MAAM,EAAEC,SAASC,SAAAA,EAAWC,IAAAA,EAAMC,SAAS,GAAGC,WAAAA,KAAgB,IAAA,CAAKL,OAAAA;AAEnE,IAAA,IAAA,CAAK,IAAA,GAAOM,SAAAA,CAAUH,IAAAA,IAAQJ,UAAAA,CAAAA;AAE9B,IAAA,IAAIQ,cAAAA;AACJ,IAAA,IAAIC,qBAAAA;AACJ,IAAA,IAAIC,WAAAA,GAAc,CAAA;AAElB,IAAA,IAAA,CAAK,OAAA,GAAUC,MAAAA;AAGfC,IAAAA,OAAAA,CAAQC,EAAAA,CAAG,QAAQ,MAAA;AACjB,MAAA,IAAA,CAAKC,KAAAA,EAAK;IACZ,CAAA,CAAA;AAEA,IAAA,MAAMC,gCAAe,MAAA,CAA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AAA,CAAK,QAAQuD,GAAAA,EAAG;AACvB,IAAA;AACF,EAAA;AACF;AAEO,SAAShC,YAAAA,CAGdf,UAAAA,EACAqD,cAAAA,EACAW,UAAAA,GAAa,CAAA,EAAC;AAEd,EAAA,OAAO,IAAIjE,OAAOC,UAAAA,EAAY;AAC5BI,IAAAA,IAAAA,EAAM6D,aAAajE,UAAAA,EAAY;MAC7BkE,aAAAA,EAAe;KACjB,CAAA;AACAb,IAAAA,cAAAA;AACAW,IAAAA;GACF,CAAA;AACF;AAdgBjD,MAAAA,CAAAA,YAAAA,EAAAA,cAAAA,CAAAA","file":"chunk-KSBESEOF.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport { defu } from \"defu\";\nimport { Worker as JestWorker } from \"jest-worker\";\nimport type { ChildProcess } from \"node:child_process\";\nimport { Transform } from \"node:stream\";\nimport { LogFn } from \"../../types/config\";\nimport { WorkerProcess } from \"../../types/context\";\nimport { createLog } from \"../logger\";\n\nexport type WorkerOptions = ConstructorParameters<typeof JestWorker>[1] & {\n name?: string;\n timeout?: number;\n onActivity?: () => void;\n onActivityAbort?: () => void;\n onRestart?: (method: string, args: any[], attempts: number) => void;\n exposedMethods: ReadonlyArray<string>;\n enableWorkerThreads?: boolean;\n context?: Record<string, any>;\n};\n\nconst RESTARTED = Symbol(\"restarted\");\n\nconst cleanupWorkers = (worker: JestWorker) => {\n for (const curWorker of ((worker as any)._workerPool?._workers || []) as {\n _child?: ChildProcess;\n }[]) {\n curWorker._child?.kill(\"SIGINT\");\n }\n};\n\nexport class Worker {\n #worker: JestWorker | undefined;\n\n #log: LogFn;\n\n public constructor(\n protected workerPath: string,\n protected options: WorkerOptions\n ) {\n const { timeout, onRestart, name, context, ...farmOptions } = this.options;\n\n this.#log = createLog(name || workerPath);\n\n let restartPromise: Promise<typeof RESTARTED>;\n let resolveRestartPromise: (arg: typeof RESTARTED) => void;\n let activeTasks = 0;\n\n this.#worker = undefined;\n\n // ensure we end workers if they weren't before exit\n process.on(\"exit\", () => {\n this.close();\n });\n\n const createWorker = () => {\n this.#worker = new JestWorker(workerPath, {\n ...farmOptions,\n forkOptions: {\n ...farmOptions.forkOptions,\n env: {\n ...((farmOptions.forkOptions?.env ?? {}) as any),\n ...process.env,\n POWERLINES_LOCAL: process.env.POWERLINES_LOCAL || \"0\"\n }\n },\n maxRetries: 0\n });\n restartPromise = new Promise(resolve => {\n resolveRestartPromise = resolve;\n });\n\n /**\n * Jest Worker has two worker types, ChildProcessWorker (uses child_process) and NodeThreadWorker (uses worker_threads)\n * Powerlines uses ChildProcessWorker by default, but it can be switched to NodeThreadWorker with an experimental flag\n *\n * We only want to handle ChildProcessWorker's orphan process issue, so we access the private property \"_child\":\n * https://github.com/facebook/jest/blob/b38d7d345a81d97d1dc3b68b8458b1837fbf19be/packages/jest-worker/src/workers/ChildProcessWorker.ts\n *\n * But this property is not available in NodeThreadWorker, so we need to check if we are using ChildProcessWorker\n */\n if (!farmOptions.enableWorkerThreads) {\n for (const worker of ((this.#worker as any)._workerPool?._workers ||\n []) as {\n _child?: ChildProcess;\n }[]) {\n worker._child?.on(\"exit\", (code, signal) => {\n if ((code || (signal && signal !== \"SIGINT\")) && this.#worker) {\n this.#log(\n LogLevelLabel.ERROR,\n `${this.options.name} worker exited with code: ${code} and signal: ${signal}`\n );\n\n // if a child process doesn't exit gracefully, we want to bubble up the exit code to the parent process\n process.exit(code ?? 1);\n }\n });\n\n // if a child process emits a particular message, we track that as activity\n // so the parent process can keep track of progress\n worker._child?.on(\"message\", ([, data]: [number, unknown]) => {\n if (\n data &&\n typeof data === \"object\" &&\n \"type\" in data &&\n data.type === \"activity\"\n ) {\n // eslint-disable-next-line ts/no-use-before-define\n onActivity();\n }\n });\n }\n }\n\n let aborted = false;\n const onActivityAbort = () => {\n if (!aborted) {\n this.options.onActivityAbort?.();\n aborted = true;\n }\n };\n\n // Listen to the worker's stdout and stderr, if there's any thing logged, abort the activity first\n const abortActivityStreamOnLog = new Transform({\n transform(_chunk, _encoding, callback) {\n onActivityAbort();\n callback();\n }\n });\n // Stop the activity if there's any output from the worker\n this.#worker.getStdout().pipe(abortActivityStreamOnLog);\n this.#worker.getStderr().pipe(abortActivityStreamOnLog);\n\n // Pipe the worker's stdout and stderr to the parent process\n this.#worker.getStdout().pipe(process.stdout);\n this.#worker.getStderr().pipe(process.stderr);\n };\n createWorker();\n\n const onHanging = () => {\n const worker = this.#worker;\n if (!worker) {\n return;\n }\n\n const resolve = resolveRestartPromise;\n createWorker();\n\n this.#log(\n LogLevelLabel.WARN,\n `Sending SIGTERM signal to static worker due to timeout${\n timeout ? ` of ${timeout / 1000} seconds` : \"\"\n }. Subsequent errors may be a result of the worker exiting.`\n );\n\n void worker.end().then(() => {\n resolve(RESTARTED);\n });\n };\n\n let hangingTimer: NodeJS.Timeout | false = false;\n\n const onActivity = () => {\n if (hangingTimer) {\n clearTimeout(hangingTimer);\n }\n if (this.options.onActivity) {\n this.options.onActivity();\n }\n\n hangingTimer = activeTasks > 0 && setTimeout(onHanging, timeout);\n };\n\n for (const method of farmOptions.exposedMethods) {\n if (method.startsWith(\"_\")) {\n continue;\n }\n\n (this as any)[method] = timeout\n ? async (...args: any[]) => {\n activeTasks++;\n try {\n let attempts = 0;\n for (;;) {\n onActivity();\n\n const params = defu(\n args.length > 0 && args[0] ? args[0] : {},\n context ?? {}\n );\n\n const result = await Promise.race([\n // eslint-disable-next-line ts/no-unsafe-call\n (this.#worker as any)[method](...params),\n restartPromise\n ]);\n if (result !== RESTARTED) {\n return result;\n }\n if (onRestart) {\n onRestart(method, args, ++attempts);\n }\n }\n } finally {\n activeTasks--;\n onActivity();\n }\n }\n : // eslint-disable-next-line ts/no-unsafe-call\n (this.#worker as any)[method].bind(this.#worker);\n }\n }\n\n public async end(): ReturnType<JestWorker[\"end\"]> {\n const worker = this.#worker;\n if (!worker) {\n throw new Error(\"Farm is ended, no more calls can be done to it\");\n }\n\n cleanupWorkers(worker);\n this.#worker = undefined;\n return worker.end();\n }\n\n /**\n * Quietly end the worker if it exists\n */\n public close(): void {\n if (this.#worker) {\n cleanupWorkers(this.#worker);\n void this.#worker.end();\n }\n }\n}\n\nexport function createWorker<\n TExposedMethods extends ReadonlyArray<string> = ReadonlyArray<string>\n>(\n workerPath: string,\n exposedMethods: TExposedMethods,\n numWorkers = 1\n): WorkerProcess<TExposedMethods> {\n return new Worker(workerPath, {\n name: findFileName(workerPath, {\n withExtension: false\n }),\n exposedMethods,\n numWorkers\n }) as WorkerProcess<TExposedMethods>;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/build/tsup.ts"],"names":["DEFAULT_TSUP_CONFIG","DEFAULT_BUILD_OPTIONS","platform","target","config","clean","minify","sourcemap","cjsInterop","bundle","dts","shims","silent","treeshake","keepNames","splitting","banner","resolveTsupEntry","context","entryPoints","resolveESBuildEntry","extractTsupConfig","defu","alias","builtins","reduce","ret","id","path","fs","ids","noExternal","build","variant","override","name","assets","output","external","skipNodeModulesBundle","outputPath","projectRoot","tsconfig","tsconfigFilePath","tsconfigRaw","tsconfigJson","format","mode","treeShaking","undefined","metafile","projectType","logLevel","verbose"],"mappings":";;;;;AA8BO,IAAMA,mBAAAA,GAAgD;EAC3D,GAAGC,qBAAAA;EACHC,QAAAA,EAAU,SAAA;EACVC,MAAAA,EAAQ,QAAA;EACRC,MAAAA,EAAQ,KAAA;EACRC,K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O+C,WAAAA,KAAgB,aAAA;AACpCvC,IAAAA,MAAAA,EACEM,QAAQd,MAAAA,CAAOgD,QAAAA,KAAa,IAAA,IAC5BlC,OAAAA,CAAQd,OAAO2C,IAAAA,KAAS,YAAA;IAC1BM,OAAAA,EACEnC,OAAAA,CAAQd,MAAAA,CAAOgD,QAAAA,KAAa,IAAA,IAC5BlC,OAAAA,CAAQd,OAAOgD,QAAAA,KAAa,OAAA,IAC5BlC,OAAAA,CAAQd,MAAAA,CAAO2C,IAAAA,KAAS;AAC5B,GAAA,EACA/C,mBAAAA,CAAAA;AAEJ;AArDgBqB,MAAAA,CAAAA,iBAAAA,EAAAA,mBAAAA,CAAAA","file":"chunk-LBMMBFQE.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { AssetGlob, Entry } from \"@storm-software/build-tools/types\";\nimport { DEFAULT_BUILD_OPTIONS } from \"@storm-software/tsup/constants\";\nimport defu from \"defu\";\nimport {\n ESBuildBuildConfig,\n TsupBuildConfig,\n TsupResolvedBuildConfig\n} from \"../../types/build\";\nimport { Context } from \"../../types/context\";\nimport { ResolvedEntryTypeDefinition } from \"../../types/resolved\";\nimport { resolveESBuildEntry } from \"./esbuild\";\n\nexport const DEFAULT_TSUP_CONFIG: Partial<TsupBuildConfig> = {\n ...DEFAULT_BUILD_OPTIONS,\n platform: \"neutral\",\n target: \"esnext\",\n config: false,\n clean: false,\n minify: true,\n sourcemap: false,\n cjsInterop: true,\n bundle: true,\n dts: true,\n shims: true,\n silent: true,\n treeshake: true,\n keepNames: true,\n splitting: true,\n banner: {}\n};\n\n/**\n * Resolves the entry options for [tsup](https://github.com/egoist/tsup).\n *\n * @param context - The build context.\n * @param entryPoints - The entry points to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveTsupEntry(\n context: Context,\n entryPoints: ResolvedEntryTypeDefinition[] | string[]\n): Entry {\n return resolveESBuildEntry(context, entryPoints) as Entry;\n}\n\n/**\n * Resolves the options for [tsup](https://github.com/egoist/tsup).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function extractTsupConfig(context: Context): TsupResolvedBuildConfig {\n return defu(\n {\n alias: context.builtins.reduce(\n (ret, id) => {\n const path = context.fs.ids[id];\n if (path) {\n ret[id] = path;\n }\n\n return ret;\n },\n {} as Record<string, string>\n ),\n noExternal: context.builtins\n },\n context.config.build.variant === \"tsup\" ? context.config.override : {},\n {\n name: context.config.name,\n assets: context.config.output.assets as (string | AssetGlob)[],\n external: context.config.build.external,\n noExternal: context.config.build.noExternal,\n skipNodeModulesBundle: context.config.build.skipNodeModulesBundle,\n outputPath: context.config.output.outputPath,\n projectRoot: context.config.projectRoot,\n tsconfig: context.tsconfig.tsconfigFilePath,\n tsconfigRaw: context.tsconfig.tsconfigJson,\n format: context.config.output.format,\n mode: context.config.mode,\n platform: context.config.build.platform,\n treeshake:\n context.config.build.variant === \"tsup\"\n ? (context.config.build as TsupBuildConfig)?.treeshake\n : context.config.build.variant === \"tsup\"\n ? (context.config.build as ESBuildBuildConfig)?.treeShaking\n : undefined\n },\n context.config.build.variant === \"tsup\" ? context.config.build : {},\n {\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\",\n dts: context.config.projectType !== \"application\",\n silent:\n context.config.logLevel === null ||\n context.config.mode === \"production\",\n verbose:\n context.config.logLevel === null ||\n context.config.logLevel === \"trace\" ||\n context.config.mode === \"development\"\n },\n DEFAULT_TSUP_CONFIG\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utilities/resolve.ts"],"names":["resolve","context","type","overrides","typeDefinition","isSetString","parseTypeDefinition","result","bundle","file","resolved","resolver","evalModule","text","filename","path","forceTranspile","exportName","name"],"mappings":";;;;;AAoCA,eAAsBA,OAAAA,CACpBC,OAAAA,EACAC,IAAAA,EACAC,SAAAA,GAAiD,EAAC,EAAC;AAEnD,EAAA,IAAIC,cAAAA;AACJ,EAAA,IAAIC,WAAAA,CAAYH,IAAAA,CAAAA,EAAO;AACrBE,IAAAA,cAAAA,GAAiBE,oBAAoBJ,IAAAA,CAAAA;EACvC,CAAA,MAAO;AACLE,IAAAA,cAAAA,GAAiBF,IAAAA;AACnB,EAAA;AAEA,EAAA,MAAMK,SAAS,MAAMC,MAAAA,CAAOP,OAAAA,EAASG,cAAAA,CAAeK,MAAMN,SAAAA,CAAAA;AAE1D,EAAA,MAAMO,WAAY,MAAMT,OAAAA,CAAQU,QAAAA,CAASC,UAAAA,CAAWL,OAAOM,IAAAA,EAAM;AAC/DC,IAAAA,QAAAA,EAAUP,MAAAA,CAAOQ,IAAAA;IACjBC,cAAAA,EAAgB;GAClB,CAAA;AAEA,EAAA,IAAIC,aAAab,cAAAA,CAAec,IAAAA;AAChC,EAAA,IAAI,CAACD,UAAAA,EAAY;AACfA,IAAAA,UAAAA,GAAa,SAAA;AACf,EAAA;AAEA,EAAA,OAAOP,SAASO,UAAAA,CAAAA,IAAeP,QAAAA,CAAS,CAAA,QAAA,EAAMO,UAAAA,CAAAA,CAAY,CAAA;AAC5D;AAzBsBjB,MAAAA,CAAAA,OAAAA,EAAAA,SAAAA,CAAAA","file":"chunk-LEIOWD2W.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport { ESBuildResolvedBuildConfig } from \"../../types/build\";\nimport { Context } from \"../../types/context\";\nimport { bundle } from \"./bundle\";\n\n/**\n * Compiles a type definition to a module.\n *\n * @param context - The context object containing the environment paths.\n * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolve<TResult = any>(\n context: Context,\n type: TypeDefinitionParameter,\n overrides: Partial<ESBuildResolvedBuildConfig> = {}\n): Promise<TResult> {\n let typeDefinition!: TypeDefinition;\n if (isSetString(type)) {\n typeDefinition = parseTypeDefinition(type) as TypeDefinition;\n } else {\n typeDefinition = type;\n }\n\n const result = await bundle(context, typeDefinition.file, overrides);\n\n const resolved = (await context.resolver.evalModule(result.text, {\n filename: result.path,\n forceTranspile: true\n })) as Record<string, any>;\n\n let exportName = typeDefinition.name;\n if (!exportName) {\n exportName = \"default\";\n }\n\n return resolved[exportName] ?? resolved[`__Ω${exportName}`];\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/typescript/tsconfig.ts"],"names":["getTsconfigFilePath","workspaceRoot","projectRoot","tsconfig","tsconfigFilePath","existsSync","appendPath","joinPaths","Error","findMatch","tsconfigType","types","extensions","find","type","toString","toLowerCase","some","ext","findIncludeMatch","isMatchFound","undefined","isIncludeMatchFound","getParsedTypeScriptConfig","tsconfigRaw","originalTsconfigJson","host","ts","sys","tsconfigJson","readJsonFileSync","parsedCommandLine","parseJsonConfigFileContent","defu","err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,CACpC,CAAA,CAEL2B,IAAAA,CAAK,IAAA,CAAA;;AAGJ,IAAA,MAAM,IAAIlC,MAAM4B,YAAAA,CAAAA;AAClB,EAAA;AAEA,EAAA,OAAO;IACL,GAAGL,iBAAAA;AACHN,IAAAA,oBAAAA,EAAuBA,oBAAAA,IACrBI,YAAAA;AACFA,IAAAA,YAAAA;AACAzB,IAAAA;AACF,GAAA;AACF;AApDgBmB,wBAAAA,CAAAA,yBAAAA,EAAAA,2BAAAA,CAAAA","file":"chunk-LJZEN4HP.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { readJsonFileSync } from \"@stryke/fs/json\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { FilterPattern } from \"@stryke/types/file\";\nimport { TsConfigJson } from \"@stryke/types/tsconfig\";\nimport defu from \"defu\";\nimport ts from \"typescript\";\nimport { ParsedTypeScriptConfig, TSConfig } from \"../../types/tsconfig\";\n\n/**\n * Get the path to the tsconfig.json file.\n *\n * @param workspaceRoot - The root directory of the workspace.\n * @param projectRoot - The root directory of the project.\n * @param tsconfig - The path to the tsconfig.json file.\n * @returns The absolute path to the tsconfig.json file.\n * @throws If the tsconfig.json file does not exist.\n */\nexport function getTsconfigFilePath(\n workspaceRoot: string,\n projectRoot: string,\n tsconfig = \"tsconfig.json\"\n): string {\n let tsconfigFilePath = tsconfig;\n if (!existsSync(tsconfigFilePath)) {\n tsconfigFilePath = appendPath(tsconfig, projectRoot);\n if (!existsSync(tsconfigFilePath)) {\n tsconfigFilePath = appendPath(tsconfig, workspaceRoot);\n if (!existsSync(tsconfigFilePath)) {\n tsconfigFilePath = appendPath(\n tsconfig,\n joinPaths(workspaceRoot, projectRoot)\n );\n if (!existsSync(tsconfigFilePath)) {\n throw new Error(\n `Cannot find the \\`tsconfig.json\\` configuration file at ${\n tsconfig\n }, ${appendPath(tsconfig, projectRoot)}, ${appendPath(\n tsconfig,\n workspaceRoot\n )}, or ${tsconfigFilePath}`\n );\n }\n }\n }\n }\n\n return tsconfigFilePath;\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function findMatch(\n tsconfigType: string | RegExp | null,\n types: (string | RegExp | null)[],\n extensions: string[] = [\".ts\", \".tsx\", \".d.ts\"]\n): string | RegExp | null | undefined {\n return types.find(\n type =>\n tsconfigType?.toString().toLowerCase() ===\n type?.toString().toLowerCase() ||\n tsconfigType?.toString().toLowerCase() ===\n `./${type?.toString().toLowerCase()}` ||\n `./${tsconfigType?.toString().toLowerCase()}` ===\n type?.toString().toLowerCase() ||\n extensions.some(\n ext =>\n `${tsconfigType?.toString().toLowerCase()}${ext}` ===\n type?.toString().toLowerCase() ||\n `${tsconfigType?.toString().toLowerCase()}${ext}` ===\n `./${type?.toString().toLowerCase()}` ||\n `${type?.toString().toLowerCase()}${ext}` ===\n `./${tsconfigType?.toString().toLowerCase()}` ||\n tsconfigType?.toString().toLowerCase() ===\n `${type?.toString().toLowerCase()}${ext}` ||\n tsconfigType?.toString().toLowerCase() ===\n `./${type?.toString().toLowerCase()}${ext}` ||\n type?.toString().toLowerCase() ===\n `./${tsconfigType?.toString().toLowerCase()}${ext}`\n )\n );\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function findIncludeMatch(\n tsconfigType: string | RegExp | null,\n types: (string | RegExp | null)[]\n): string | RegExp | null | undefined {\n return findMatch(tsconfigType, types, [\n \".ts\",\n \".tsx\",\n \".d.ts\",\n \".js\",\n \".jsx\",\n \".mjs\",\n \".cjs\",\n \".mts\",\n \".cts\",\n \"/*.ts\",\n \"/*.tsx\",\n \"/*.d.ts\",\n \"/*.js\",\n \"/*.jsx\",\n \"/*.mjs\",\n \"/*.cjs\",\n \"/*.mts\",\n \"/*.cts\",\n \"/**/*.ts\",\n \"/**/*.tsx\",\n \"/**/*.d.ts\",\n \"/**/*.js\",\n \"/**/*.jsx\",\n \"/**/*.mjs\",\n \"/**/*.cjs\",\n \"/**/*.mts\",\n \"/**/*.cts\"\n ]);\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function isMatchFound(\n tsconfigType: string | RegExp | null,\n types: (string | RegExp | null)[]\n): boolean {\n return findMatch(tsconfigType, types) !== undefined;\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function isIncludeMatchFound(\n tsconfigType: FilterPattern,\n types: FilterPattern[]\n): boolean {\n return (\n findIncludeMatch(\n tsconfigType as string | RegExp | null,\n types as (string | RegExp | null)[]\n ) !== undefined\n );\n}\n\n/**\n * Get the parsed TypeScript configuration.\n *\n * @param workspaceRoot - The root directory of the workspace.\n * @param projectRoot - The root directory of the project.\n * @param tsconfig - The path to the tsconfig.json file.\n * @param tsconfigRaw - The raw tsconfig.json content.\n * @param originalTsconfigJson - The original tsconfig.json content.\n * @param host - The TypeScript parse config host.\n * @returns The resolved TypeScript configuration.\n */\nexport function getParsedTypeScriptConfig(\n workspaceRoot: string,\n projectRoot: string,\n tsconfig?: string,\n tsconfigRaw: TSConfig = {},\n originalTsconfigJson?: TSConfig,\n host: ts.ParseConfigHost = ts.sys\n): ParsedTypeScriptConfig {\n const tsconfigFilePath = getTsconfigFilePath(\n workspaceRoot,\n projectRoot,\n tsconfig\n );\n const tsconfigJson = readJsonFileSync<TSConfig>(tsconfigFilePath);\n if (!tsconfigJson) {\n throw new Error(\n `Cannot find the \\`tsconfig.json\\` configuration file at ${joinPaths(\n projectRoot,\n tsconfig ?? \"tsconfig.json\"\n )}`\n );\n }\n\n const parsedCommandLine = ts.parseJsonConfigFileContent(\n defu(tsconfigRaw ?? {}, tsconfigJson),\n host,\n appendPath(projectRoot, workspaceRoot)\n );\n if (parsedCommandLine.errors.length > 0) {\n const errorMessage = `Cannot parse the TypeScript compiler options. Please investigate the following issues:\n${parsedCommandLine.errors\n .map(\n error =>\n `- ${\n (error.category !== undefined && error.code\n ? `[${error.category}-${error.code}]: `\n : \"\") + error.messageText.toString()\n }`\n )\n .join(\"\\n\")}\n `;\n\n throw new Error(errorMessage);\n }\n\n return {\n ...parsedCommandLine,\n originalTsconfigJson: (originalTsconfigJson ??\n tsconfigJson) as TsConfigJson,\n tsconfigJson,\n tsconfigFilePath\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/build/rspack.ts"],"names":["extractRspackConfig","context","defu","resolve","alias","builtins","reduce","ret","id","path","fs","ids","config","build","variant","override","external","noExternal","skipNodeModulesBundle","output","joinPaths","workspaceConfig","workspaceRoot","outputPath","name","node","platform","__dirname","__filename","global","mode","recordsInputPath","cachePath","recordsOutputPath","projectRoot","cache","devtool","optimization","minimize"],"mappings":";;;;AAgCO,SAASA,oBAAoBC,OAAAA,EAAgB;AAClD,EAAA,OAAOC,IAAAA,CACL;IACEC,OAAAA,EAAS;AACPC,MAAAA,KAA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EACA,sBAAA,CAAA;AAEFC,IAAAA,iBAAAA,EAAmBb,SAAAA,CACjBnB,OAAAA,CAAQ+B,SAAAA,EACR,QAAA,EACA,sBAAA,CAAA;AAEF/B,IAAAA,OAAAA,EAASmB,UACPnB,OAAAA,CAAQoB,eAAAA,CAAgBC,aAAAA,EACxBrB,OAAAA,CAAQW,OAAOsB,WAAW,CAAA;AAE5BjB,IAAAA,UAAAA,EAAYhB,OAAAA,CAAQI;GACtB,EACAJ,OAAAA,CAAQW,OAAOC,KAAAA,CAAMC,OAAAA,KAAY,WAAWb,OAAAA,CAAQW,MAAAA,CAAOC,KAAAA,GAAQ,EAAC,EACpE;IACEsB,KAAAA,EAAOlC,OAAAA,CAAQW,OAAOkB,IAAAA,KAAS,aAAA;AAC/BM,IAAAA,OAAAA,EAAUnC,OAAAA,CAAQW,MAAAA,CAAOkB,IAAAA,KAAS,aAAA,GAC9B,KAAA,GACA,YAAA;IACJO,YAAAA,EAAc;MACZC,QAAAA,EAAUrC,OAAAA,CAAQW,OAAOkB,IAAAA,KAAS;AACpC;GACF,CAAA;AAEJ;AAtEgB9B,MAAAA,CAAAA,mBAAAA,EAAAA,qBAAAA,CAAAA","file":"chunk-LTVWU4J2.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type {\n DevTool,\n Configuration as ExternalRspackOptions\n} from \"@rspack/core\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { Context } from \"../../types/context\";\n\n/**\n * Resolves the options for [rspack](https://rspack.rs/).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function extractRspackConfig(context: Context): ExternalRspackOptions {\n return defu(\n {\n resolve: {\n alias: context.builtins.reduce(\n (ret, id) => {\n const path = context.fs.ids[id];\n if (path) {\n ret[id] = path;\n }\n\n return ret;\n },\n {} as Record<string, string>\n )\n }\n },\n context.config.build.variant === \"rspack\" ? context.config.override : {},\n {\n external: context.config.build.external,\n noExternal: context.config.build.noExternal,\n skipNodeModulesBundle: context.config.build.skipNodeModulesBundle\n },\n {\n output: {\n path: joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.output.outputPath\n )\n },\n name: context.config.name,\n node:\n context.config.build.platform === \"node\"\n ? ({\n __dirname: true,\n __filename: true,\n global: true\n } as ExternalRspackOptions[\"node\"])\n : false,\n mode:\n context.config.mode === \"development\"\n ? (\"development\" as const)\n : (\"production\" as const),\n recordsInputPath: joinPaths(\n context.cachePath,\n \"rspack\",\n \".rspack-records.json\"\n ),\n recordsOutputPath: joinPaths(\n context.cachePath,\n \"rspack\",\n \".rspack-records.json\"\n ),\n context: joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot\n ),\n noExternal: context.builtins\n },\n context.config.build.variant === \"rspack\" ? context.config.build : {},\n {\n cache: context.config.mode === \"development\",\n devtool: (context.config.mode !== \"development\"\n ? false\n : \"source-map\") as DevTool | false,\n optimization: {\n minimize: context.config.mode !== \"development\"\n }\n }\n );\n}\n"]}
|