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,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
|
|
3
|
+
var chunk2NZADVP5_cjs = require('./chunk-2NZADVP5.cjs');
|
|
4
|
+
var chunk4NHFXDTQ_cjs = require('./chunk-4NHFXDTQ.cjs');
|
|
5
|
+
var chunkTNHDC2ZQ_cjs = require('./chunk-TNHDC2ZQ.cjs');
|
|
6
|
+
var chunk7K7JH3DF_cjs = require('./chunk-7K7JH3DF.cjs');
|
|
7
|
+
var chunkBQU53ZNB_cjs = require('./chunk-BQU53ZNB.cjs');
|
|
8
|
+
var chunkXW5TELHB_cjs = require('./chunk-XW5TELHB.cjs');
|
|
9
|
+
var chunkJA4HSQRN_cjs = require('./chunk-JA4HSQRN.cjs');
|
|
10
|
+
var chunk3OCI4TH7_cjs = require('./chunk-3OCI4TH7.cjs');
|
|
11
|
+
var chunkLPKZKRBW_cjs = require('./chunk-LPKZKRBW.cjs');
|
|
12
|
+
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
14
13
|
var types = require('@storm-software/config-tools/types');
|
|
15
14
|
var getWorkspaceRoot = require('@stryke/fs/get-workspace-root');
|
|
16
15
|
var bundleRequire = require('bundle-require');
|
|
16
|
+
var core = require('@babel/core');
|
|
17
17
|
var console = require('@storm-software/config-tools/logger/console');
|
|
18
18
|
var toArray = require('@stryke/convert/to-array');
|
|
19
19
|
var copyFile = require('@stryke/fs/copy-file');
|
|
@@ -22,6 +22,7 @@ var helpers = require('@stryke/fs/helpers');
|
|
|
22
22
|
var install = require('@stryke/fs/install');
|
|
23
23
|
var listFiles = require('@stryke/fs/list-files');
|
|
24
24
|
var packageFns = require('@stryke/fs/package-fns');
|
|
25
|
+
var resolve = require('@stryke/fs/resolve');
|
|
25
26
|
var joinPaths = require('@stryke/path/join-paths');
|
|
26
27
|
var replace = require('@stryke/path/replace');
|
|
27
28
|
var isError = require('@stryke/type-checks/is-error');
|
|
@@ -32,10 +33,11 @@ var isSet = require('@stryke/type-checks/is-set');
|
|
|
32
33
|
var isSetObject = require('@stryke/type-checks/is-set-object');
|
|
33
34
|
var isSetString = require('@stryke/type-checks/is-set-string');
|
|
34
35
|
var chalk4 = require('chalk');
|
|
36
|
+
var defu3 = require('defu');
|
|
35
37
|
var Handlebars = require('handlebars');
|
|
36
|
-
var
|
|
38
|
+
var helperPluginUtils = require('@babel/helper-plugin-utils');
|
|
39
|
+
var t = require('@babel/types');
|
|
37
40
|
var titleCase = require('@stryke/string-format/title-case');
|
|
38
|
-
var defu3 = require('defu');
|
|
39
41
|
var getEnvPaths = require('@stryke/env/get-env-paths');
|
|
40
42
|
var json = require('@stryke/fs/json');
|
|
41
43
|
var murmurhash = require('@stryke/hash/murmurhash');
|
|
@@ -49,22 +51,19 @@ var isNull = require('@stryke/type-checks/is-null');
|
|
|
49
51
|
var isString = require('@stryke/type-checks/is-string');
|
|
50
52
|
var uuid = require('@stryke/unique-id/uuid');
|
|
51
53
|
var oxcParser = require('oxc-parser');
|
|
54
|
+
var isUndefined = require('@stryke/type-checks/is-undefined');
|
|
52
55
|
var jiti = require('jiti');
|
|
53
56
|
var bufferToString = require('@stryke/convert/buffer-to-string');
|
|
54
57
|
var isParentPath = require('@stryke/path/is-parent-path');
|
|
55
58
|
var prettyBytes = require('@stryke/string-format/pretty-bytes');
|
|
56
59
|
var isBuffer = require('@stryke/type-checks/is-buffer');
|
|
57
|
-
var isUndefined = require('@stryke/type-checks/is-undefined');
|
|
58
60
|
var memfs = require('memfs');
|
|
59
61
|
var buffer = require('buffer');
|
|
60
62
|
var fs = require('fs');
|
|
61
63
|
var prettier = require('prettier');
|
|
62
64
|
var unionfs = require('unionfs');
|
|
63
65
|
var isObject = require('@stryke/type-checks/is-object');
|
|
64
|
-
var core = require('@babel/core');
|
|
65
66
|
var ts = require('typescript');
|
|
66
|
-
var helperPluginUtils = require('@babel/helper-plugin-utils');
|
|
67
|
-
var t = require('@babel/types');
|
|
68
67
|
var _package = require('@stryke/string-format/package');
|
|
69
68
|
var superdiff = require('@donedeal0/superdiff');
|
|
70
69
|
var tsconfig = require('@stryke/fs/tsconfig');
|
|
@@ -91,12 +90,113 @@ function _interopNamespace(e) {
|
|
|
91
90
|
}
|
|
92
91
|
|
|
93
92
|
var chalk4__default = /*#__PURE__*/_interopDefault(chalk4);
|
|
94
|
-
var Handlebars__default = /*#__PURE__*/_interopDefault(Handlebars);
|
|
95
93
|
var defu3__default = /*#__PURE__*/_interopDefault(defu3);
|
|
94
|
+
var Handlebars__default = /*#__PURE__*/_interopDefault(Handlebars);
|
|
95
|
+
var t__namespace = /*#__PURE__*/_interopNamespace(t);
|
|
96
96
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
97
97
|
var ts__default = /*#__PURE__*/_interopDefault(ts);
|
|
98
|
-
var t__namespace = /*#__PURE__*/_interopNamespace(t);
|
|
99
98
|
|
|
99
|
+
function resolveModulePath(nodePath, state) {
|
|
100
|
+
if (!t__namespace.isStringLiteral(nodePath.node)) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const sourcePath = nodePath.node.value;
|
|
104
|
+
const resolvedPath = state.context?.fs.resolve(sourcePath);
|
|
105
|
+
if (resolvedPath) {
|
|
106
|
+
nodePath.replaceWith(t__namespace.stringLiteral(
|
|
107
|
+
// Remove the file extension if it exists
|
|
108
|
+
resolvedPath.replace(/\.(?:ts|mts|cts)x?$/, "")
|
|
109
|
+
));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
chunkUSNT2KNT_cjs.__name(resolveModulePath, "resolveModulePath");
|
|
113
|
+
var TRANSFORM_FUNCTIONS = [
|
|
114
|
+
"require",
|
|
115
|
+
"require.resolve",
|
|
116
|
+
"System.import",
|
|
117
|
+
// Jest methods
|
|
118
|
+
"jest.genMockFromModule",
|
|
119
|
+
"jest.mock",
|
|
120
|
+
"jest.unmock",
|
|
121
|
+
"jest.doMock",
|
|
122
|
+
// eslint-disable-next-line @cspell/spellchecker
|
|
123
|
+
"jest.dontMock",
|
|
124
|
+
"jest.setMock",
|
|
125
|
+
"jest.requireActual",
|
|
126
|
+
"jest.requireMock",
|
|
127
|
+
// Older Jest methods
|
|
128
|
+
"require.requireActual",
|
|
129
|
+
"require.requireMock"
|
|
130
|
+
];
|
|
131
|
+
function matchesPattern(state, calleePath, pattern) {
|
|
132
|
+
const { node } = calleePath;
|
|
133
|
+
if (t__namespace.isMemberExpression(node)) {
|
|
134
|
+
return calleePath.matchesPattern(pattern);
|
|
135
|
+
}
|
|
136
|
+
if (!t__namespace.isIdentifier(node) || pattern.includes(".")) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
const name = pattern.split(".")[0];
|
|
140
|
+
return node.name === name;
|
|
141
|
+
}
|
|
142
|
+
chunkUSNT2KNT_cjs.__name(matchesPattern, "matchesPattern");
|
|
143
|
+
var importVisitors = {
|
|
144
|
+
CallExpression: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((nodePath, state) => {
|
|
145
|
+
if (state.moduleResolverVisited.has(nodePath)) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const calleePath = nodePath.get("callee");
|
|
149
|
+
if (calleePath && TRANSFORM_FUNCTIONS.some((pattern) => matchesPattern(state, calleePath, pattern)) || t__namespace.isImport(nodePath.node.callee)) {
|
|
150
|
+
state.moduleResolverVisited.add(nodePath);
|
|
151
|
+
resolveModulePath(nodePath.get("arguments.0"), state);
|
|
152
|
+
}
|
|
153
|
+
}, "CallExpression"),
|
|
154
|
+
// eslint-disable-next-line ts/naming-convention
|
|
155
|
+
"ImportDeclaration|ExportDeclaration|ExportAllDeclaration": /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((nodePath, state) => {
|
|
156
|
+
if (!nodePath || !nodePath.get("source") || state.moduleResolverVisited.has(nodePath)) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
state.moduleResolverVisited.add(nodePath);
|
|
160
|
+
resolveModulePath(nodePath.get("source"), state);
|
|
161
|
+
}, "ImportDeclaration|ExportDeclaration|ExportAllDeclaration")
|
|
162
|
+
};
|
|
163
|
+
var moduleResolverBabelPlugin = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((context) => {
|
|
164
|
+
return helperPluginUtils.declare(/* @__PURE__ */ chunkUSNT2KNT_cjs.__name(function builder(api) {
|
|
165
|
+
let moduleResolverVisited = /* @__PURE__ */ new Set();
|
|
166
|
+
return {
|
|
167
|
+
name: "powerlines:module-resolver",
|
|
168
|
+
manipulateOptions(opts) {
|
|
169
|
+
opts.filename ??= "unknown";
|
|
170
|
+
},
|
|
171
|
+
pre() {
|
|
172
|
+
moduleResolverVisited = /* @__PURE__ */ new Set();
|
|
173
|
+
},
|
|
174
|
+
visitor: {
|
|
175
|
+
Program: {
|
|
176
|
+
enter(programPath, state) {
|
|
177
|
+
programPath.traverse(importVisitors, {
|
|
178
|
+
...state,
|
|
179
|
+
context,
|
|
180
|
+
moduleResolverVisited,
|
|
181
|
+
api
|
|
182
|
+
});
|
|
183
|
+
},
|
|
184
|
+
exit(programPath, state) {
|
|
185
|
+
programPath.traverse(importVisitors, {
|
|
186
|
+
...state,
|
|
187
|
+
context,
|
|
188
|
+
moduleResolverVisited,
|
|
189
|
+
api
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
post() {
|
|
195
|
+
moduleResolverVisited.clear();
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
}, "builder"));
|
|
199
|
+
}, "moduleResolverBabelPlugin");
|
|
100
200
|
var DEFAULT_ENVIRONMENT = "default";
|
|
101
201
|
function createEnvironment(name, userConfig) {
|
|
102
202
|
return defu3__default.default(userConfig.environments?.[name] ?? {}, {
|
|
@@ -137,11 +237,79 @@ function createEnvironment(name, userConfig) {
|
|
|
137
237
|
} : void 0
|
|
138
238
|
}, userConfig);
|
|
139
239
|
}
|
|
140
|
-
|
|
240
|
+
chunkUSNT2KNT_cjs.__name(createEnvironment, "createEnvironment");
|
|
141
241
|
function createDefaultEnvironment(userConfig) {
|
|
142
242
|
return createEnvironment(DEFAULT_ENVIRONMENT, userConfig);
|
|
143
243
|
}
|
|
144
|
-
|
|
244
|
+
chunkUSNT2KNT_cjs.__name(createDefaultEnvironment, "createDefaultEnvironment");
|
|
245
|
+
|
|
246
|
+
// src/types/commands.ts
|
|
247
|
+
var SUPPORTED_COMMANDS = [
|
|
248
|
+
"new",
|
|
249
|
+
"clean",
|
|
250
|
+
"prepare",
|
|
251
|
+
"lint",
|
|
252
|
+
"test",
|
|
253
|
+
"build",
|
|
254
|
+
"docs",
|
|
255
|
+
"release",
|
|
256
|
+
"finalize"
|
|
257
|
+
];
|
|
258
|
+
|
|
259
|
+
// src/plugin-utils/helpers.ts
|
|
260
|
+
function isPlugin(value) {
|
|
261
|
+
return isSetObject.isSetObject(value) && "name" in value && isSetString.isSetString(value.name) && (isUndefined.isUndefined(value.applyToEnvironment) || "applyToEnvironment" in value && isFunction.isFunction(value.applyToEnvironment)) && (isUndefined.isUndefined(value.dedupe) || "dedupe" in value && isFunction.isFunction(value.dedupe)) && (isUndefined.isUndefined(value.dependsOn) || "dependsOn" in value && Array.isArray(value.dependsOn) && value.dependsOn.every(isPluginConfig)) && SUPPORTED_COMMANDS.every((command) => isUndefined.isUndefined(value[command]) || command in value && (isFunction.isFunction(value[command]) || isSetObject.isSetObject(value[command]) && "handler" in value[command] && isFunction.isFunction(value[command].handler)));
|
|
262
|
+
}
|
|
263
|
+
chunkUSNT2KNT_cjs.__name(isPlugin, "isPlugin");
|
|
264
|
+
function isPluginConfigObject(value) {
|
|
265
|
+
return isSetObject.isSetObject(value) && "plugin" in value && ((isSetString.isSetString(value.plugin) || isFunction.isFunction(value.plugin)) && "options" in value && isSetObject.isSetObject(value.options) || isPlugin(value.plugin));
|
|
266
|
+
}
|
|
267
|
+
chunkUSNT2KNT_cjs.__name(isPluginConfigObject, "isPluginConfigObject");
|
|
268
|
+
function isPluginConfigTuple(value) {
|
|
269
|
+
return Array.isArray(value) && (value.length === 1 || value.length === 2) && ((isSetString.isSetString(value[0]) || isFunction.isFunction(value[0])) && value.length > 1 && isSetObject.isSetObject(value[1]) || isPlugin(value[0]));
|
|
270
|
+
}
|
|
271
|
+
chunkUSNT2KNT_cjs.__name(isPluginConfigTuple, "isPluginConfigTuple");
|
|
272
|
+
function isPluginConfig(value) {
|
|
273
|
+
return isSetString.isSetString(value) || isFunction.isFunction(value) || isPlugin(value) || isPluginConfigObject(value) || isPluginConfigTuple(value);
|
|
274
|
+
}
|
|
275
|
+
chunkUSNT2KNT_cjs.__name(isPluginConfig, "isPluginConfig");
|
|
276
|
+
function isPluginHookFunction(value) {
|
|
277
|
+
return isFunction.isFunction(value) || isSetObject.isSetObject(value) && "handler" in value && isFunction.isFunction(value.handler);
|
|
278
|
+
}
|
|
279
|
+
chunkUSNT2KNT_cjs.__name(isPluginHookFunction, "isPluginHookFunction");
|
|
280
|
+
function isPluginHookObject(value) {
|
|
281
|
+
return isSetObject.isSetObject(value) && "handler" in value && isFunction.isFunction(value.handler);
|
|
282
|
+
}
|
|
283
|
+
chunkUSNT2KNT_cjs.__name(isPluginHookObject, "isPluginHookObject");
|
|
284
|
+
function isPluginHook(value) {
|
|
285
|
+
return isPluginHookFunction(value) || isPluginHookObject(value);
|
|
286
|
+
}
|
|
287
|
+
chunkUSNT2KNT_cjs.__name(isPluginHook, "isPluginHook");
|
|
288
|
+
function getHookHandler(pluginHook) {
|
|
289
|
+
return isFunction.isFunction(pluginHook) ? pluginHook : pluginHook.handler;
|
|
290
|
+
}
|
|
291
|
+
chunkUSNT2KNT_cjs.__name(getHookHandler, "getHookHandler");
|
|
292
|
+
function isHookExternal(hook) {
|
|
293
|
+
return hook.startsWith("vite:") || hook.startsWith("esbuild:") || hook.startsWith("rolldown:") || hook.startsWith("rollup:") || hook.startsWith("webpack:") || hook.startsWith("rspack:") || hook.startsWith("farm:");
|
|
294
|
+
}
|
|
295
|
+
chunkUSNT2KNT_cjs.__name(isHookExternal, "isHookExternal");
|
|
296
|
+
function checkDedupe(plugin, plugins) {
|
|
297
|
+
return plugin.dedupe === false || plugins.some((p) => p.dedupe !== false && (isFunction.isFunction(p.dedupe) && p.dedupe(plugin) || p.name === plugin.name));
|
|
298
|
+
}
|
|
299
|
+
chunkUSNT2KNT_cjs.__name(checkDedupe, "checkDedupe");
|
|
300
|
+
function addPluginHook(context, plugin, pluginHook, hooksList) {
|
|
301
|
+
if (!checkDedupe(plugin, hooksList.map((hook) => hook.plugin))) {
|
|
302
|
+
hooksList.push(isFunction.isFunction(pluginHook) ? {
|
|
303
|
+
plugin,
|
|
304
|
+
handler: getHookHandler(pluginHook).bind(context)
|
|
305
|
+
} : {
|
|
306
|
+
plugin,
|
|
307
|
+
...pluginHook,
|
|
308
|
+
handler: getHookHandler(pluginHook).bind(context)
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
chunkUSNT2KNT_cjs.__name(addPluginHook, "addPluginHook");
|
|
145
313
|
function resolveOptions(options) {
|
|
146
314
|
return defu3__default.default(options, {
|
|
147
315
|
interopDefault: true,
|
|
@@ -149,35 +317,35 @@ function resolveOptions(options) {
|
|
|
149
317
|
moduleCache: options.mode !== "development"
|
|
150
318
|
});
|
|
151
319
|
}
|
|
152
|
-
|
|
320
|
+
chunkUSNT2KNT_cjs.__name(resolveOptions, "resolveOptions");
|
|
153
321
|
function createPluginResolver(options) {
|
|
154
322
|
return jiti.createJiti(joinPaths.joinPaths(options.workspaceRoot, options.projectRoot), resolveOptions({
|
|
155
323
|
...options
|
|
156
324
|
}));
|
|
157
325
|
}
|
|
158
|
-
|
|
326
|
+
chunkUSNT2KNT_cjs.__name(createPluginResolver, "createPluginResolver");
|
|
159
327
|
function createResolver(options) {
|
|
160
328
|
const baseResolver = jiti.createJiti(joinPaths.joinPaths(options.workspaceRoot, options.projectRoot), resolveOptions(options));
|
|
161
329
|
baseResolver.plugin = createPluginResolver(options);
|
|
162
330
|
return baseResolver;
|
|
163
331
|
}
|
|
164
|
-
|
|
332
|
+
chunkUSNT2KNT_cjs.__name(createResolver, "createResolver");
|
|
165
333
|
function isBufferEncoding(options) {
|
|
166
334
|
return isSetString.isSetString(options) || options === null;
|
|
167
335
|
}
|
|
168
|
-
|
|
336
|
+
chunkUSNT2KNT_cjs.__name(isBufferEncoding, "isBufferEncoding");
|
|
169
337
|
function isPowerlinesWriteFileOptions(options) {
|
|
170
338
|
return !isBufferEncoding(options) && isSetObject.isSetObject(options) && ("skipFormat" in options || "mode" in options && (options.mode === "fs" || options.mode === "virtual"));
|
|
171
339
|
}
|
|
172
|
-
|
|
340
|
+
chunkUSNT2KNT_cjs.__name(isPowerlinesWriteFileOptions, "isPowerlinesWriteFileOptions");
|
|
173
341
|
function isNodeWriteFileOptions(options) {
|
|
174
342
|
return !isUndefined.isUndefined(options) && (isBufferEncoding(options) || !isPowerlinesWriteFileOptions(options));
|
|
175
343
|
}
|
|
176
|
-
|
|
344
|
+
chunkUSNT2KNT_cjs.__name(isNodeWriteFileOptions, "isNodeWriteFileOptions");
|
|
177
345
|
function isPowerLinesWriteFileData(data) {
|
|
178
346
|
return !!(isSetObject.isSetObject(data) && "code" in data && data.code);
|
|
179
347
|
}
|
|
180
|
-
|
|
348
|
+
chunkUSNT2KNT_cjs.__name(isPowerLinesWriteFileData, "isPowerLinesWriteFileData");
|
|
181
349
|
var FILE_PREFIX = "file://";
|
|
182
350
|
function toFilePath(pathOrUrl) {
|
|
183
351
|
if (!pathOrUrl) {
|
|
@@ -189,7 +357,7 @@ function toFilePath(pathOrUrl) {
|
|
|
189
357
|
}
|
|
190
358
|
return result;
|
|
191
359
|
}
|
|
192
|
-
|
|
360
|
+
chunkUSNT2KNT_cjs.__name(toFilePath, "toFilePath");
|
|
193
361
|
var FS_METHODS = [
|
|
194
362
|
"mkdir",
|
|
195
363
|
"mkdirSync",
|
|
@@ -253,7 +421,7 @@ function cloneFS(originalFS) {
|
|
|
253
421
|
}
|
|
254
422
|
return clonedFS;
|
|
255
423
|
}
|
|
256
|
-
|
|
424
|
+
chunkUSNT2KNT_cjs.__name(cloneFS, "cloneFS");
|
|
257
425
|
function patchFS(originalFS, vfs) {
|
|
258
426
|
const clonedFS = cloneFS(originalFS);
|
|
259
427
|
originalFS.mkdirSync = (file, options) => vfs.mkdirSync(toFilePath(file), options);
|
|
@@ -264,7 +432,7 @@ function patchFS(originalFS, vfs) {
|
|
|
264
432
|
originalFS.promises.unlink = async (file) => vfs.unlink(toFilePath(file));
|
|
265
433
|
originalFS.existsSync = (file) => vfs.existsSync(toFilePath(file));
|
|
266
434
|
Object.defineProperty(originalFS, "realpathSync", {
|
|
267
|
-
value: /* @__PURE__ */
|
|
435
|
+
value: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((file, options) => vfs.realpathSync(toFilePath(file), options), "value")
|
|
268
436
|
});
|
|
269
437
|
originalFS.writeFileSync = (file, data, options) => vfs.writeFileSync(toFilePath(file), data, options);
|
|
270
438
|
originalFS.promises.writeFile = async (file, data, options) => vfs.writeFile(toFilePath(file), data, options);
|
|
@@ -273,12 +441,12 @@ function patchFS(originalFS, vfs) {
|
|
|
273
441
|
originalFS.readdirSync = (file, options) => vfs.readdirSync(toFilePath(file), options);
|
|
274
442
|
originalFS.promises.readdir = (file, options) => vfs.readdir(toFilePath(file), options);
|
|
275
443
|
Object.defineProperty(originalFS, "statSync", {
|
|
276
|
-
value: /* @__PURE__ */
|
|
444
|
+
value: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((file, options) => vfs.statSync(toFilePath(file), options), "value")
|
|
277
445
|
});
|
|
278
446
|
originalFS.stat = (file, options) => vfs.statSync(toFilePath(file), options);
|
|
279
447
|
originalFS.promises.stat = (file, options) => vfs.stat(toFilePath(file), options);
|
|
280
448
|
Object.defineProperty(originalFS, "lstatSync", {
|
|
281
|
-
value: /* @__PURE__ */
|
|
449
|
+
value: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((file, options) => vfs.lstatSync(toFilePath(file), options), "value")
|
|
282
450
|
});
|
|
283
451
|
originalFS.lstat = (file, options) => vfs.lstatSync(toFilePath(file), options);
|
|
284
452
|
originalFS.promises.lstat = (file, options) => vfs.lstat(toFilePath(file), options);
|
|
@@ -309,10 +477,10 @@ function patchFS(originalFS, vfs) {
|
|
|
309
477
|
originalFS.promises.lstat = clonedFS.promises.lstat;
|
|
310
478
|
};
|
|
311
479
|
}
|
|
312
|
-
|
|
480
|
+
chunkUSNT2KNT_cjs.__name(patchFS, "patchFS");
|
|
313
481
|
var VirtualFileSystem = class {
|
|
314
482
|
static {
|
|
315
|
-
|
|
483
|
+
chunkUSNT2KNT_cjs.__name(this, "VirtualFileSystem");
|
|
316
484
|
}
|
|
317
485
|
/**
|
|
318
486
|
* The internal map of virtual files.
|
|
@@ -374,25 +542,25 @@ var VirtualFileSystem = class {
|
|
|
374
542
|
/**
|
|
375
543
|
* Exposes the internal VFS map for advanced usage.
|
|
376
544
|
*/
|
|
377
|
-
get [
|
|
545
|
+
get [chunkTNHDC2ZQ_cjs.__VFS_CACHE__]() {
|
|
378
546
|
return this.#cachedFS;
|
|
379
547
|
}
|
|
380
548
|
/**
|
|
381
549
|
* Exposes the internal VFS resolver cache for advanced usage.
|
|
382
550
|
*/
|
|
383
|
-
get [
|
|
551
|
+
get [chunkTNHDC2ZQ_cjs.__VFS_RESOLVER__]() {
|
|
384
552
|
return this.#cachedResolver;
|
|
385
553
|
}
|
|
386
554
|
/**
|
|
387
555
|
* Exposes the internal VFS map for advanced usage.
|
|
388
556
|
*/
|
|
389
|
-
get [
|
|
557
|
+
get [chunkTNHDC2ZQ_cjs.__VFS_VIRTUAL__]() {
|
|
390
558
|
return this.#virtualFS;
|
|
391
559
|
}
|
|
392
560
|
/**
|
|
393
561
|
* Exposes the internal UFS map for advanced usage.
|
|
394
562
|
*/
|
|
395
|
-
get [
|
|
563
|
+
get [chunkTNHDC2ZQ_cjs.__VFS_UNIFIED__]() {
|
|
396
564
|
return this.#unifiedFS;
|
|
397
565
|
}
|
|
398
566
|
/**
|
|
@@ -400,7 +568,7 @@ var VirtualFileSystem = class {
|
|
|
400
568
|
*/
|
|
401
569
|
get meta() {
|
|
402
570
|
return new Proxy(this.#meta, {
|
|
403
|
-
get: /* @__PURE__ */
|
|
571
|
+
get: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((target, prop) => {
|
|
404
572
|
if (target[prop]) {
|
|
405
573
|
return {
|
|
406
574
|
id: prop,
|
|
@@ -412,12 +580,12 @@ var VirtualFileSystem = class {
|
|
|
412
580
|
}
|
|
413
581
|
return void 0;
|
|
414
582
|
}, "get"),
|
|
415
|
-
set: /* @__PURE__ */
|
|
583
|
+
set: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((target, prop, value) => {
|
|
416
584
|
target[prop] = value;
|
|
417
585
|
this.#ids[value.id || prop] = prop;
|
|
418
586
|
return true;
|
|
419
587
|
}, "set"),
|
|
420
|
-
deleteProperty: /* @__PURE__ */
|
|
588
|
+
deleteProperty: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((target, prop) => {
|
|
421
589
|
delete this.#ids[target[prop]?.id || prop];
|
|
422
590
|
delete target[prop];
|
|
423
591
|
return true;
|
|
@@ -507,15 +675,15 @@ var VirtualFileSystem = class {
|
|
|
507
675
|
});
|
|
508
676
|
}
|
|
509
677
|
}
|
|
510
|
-
this.#log =
|
|
678
|
+
this.#log = chunkJA4HSQRN_cjs.extendLog(this.#context.log, "virtual-file-system");
|
|
511
679
|
}
|
|
512
|
-
[
|
|
680
|
+
[chunkTNHDC2ZQ_cjs.__VFS_INIT__]() {
|
|
513
681
|
if (!this.#isPatched && this.#context.config.output.mode !== "fs") {
|
|
514
682
|
this.#revert = patchFS(fs__default.default, this);
|
|
515
683
|
this.#isPatched = true;
|
|
516
684
|
}
|
|
517
685
|
}
|
|
518
|
-
[
|
|
686
|
+
[chunkTNHDC2ZQ_cjs.__VFS_REVERT__]() {
|
|
519
687
|
if (this.#isPatched && this.#context.config.output.mode !== "fs") {
|
|
520
688
|
if (!this.#revert) {
|
|
521
689
|
throw new Error("Attempting to revert File System patch prior to calling `__init__` function");
|
|
@@ -1403,14 +1571,14 @@ function createVfs(context) {
|
|
|
1403
1571
|
const vfs = new VirtualFileSystem(context);
|
|
1404
1572
|
return vfs;
|
|
1405
1573
|
}
|
|
1406
|
-
|
|
1574
|
+
chunkUSNT2KNT_cjs.__name(createVfs, "createVfs");
|
|
1407
1575
|
|
|
1408
1576
|
// src/internal/contexts/context.ts
|
|
1409
1577
|
var configCache = /* @__PURE__ */ new WeakMap();
|
|
1410
1578
|
var parseCache = /* @__PURE__ */ new WeakMap();
|
|
1411
1579
|
var PowerlinesContext = class _PowerlinesContext {
|
|
1412
1580
|
static {
|
|
1413
|
-
|
|
1581
|
+
chunkUSNT2KNT_cjs.__name(this, "PowerlinesContext");
|
|
1414
1582
|
}
|
|
1415
1583
|
#workspaceConfig;
|
|
1416
1584
|
#checksum = null;
|
|
@@ -1455,7 +1623,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1455
1623
|
* @returns A promise that resolves to the new context.
|
|
1456
1624
|
*/
|
|
1457
1625
|
static async from(workspaceRoot, config) {
|
|
1458
|
-
const context = new _PowerlinesContext(await
|
|
1626
|
+
const context = new _PowerlinesContext(await chunkXW5TELHB_cjs.loadWorkspaceConfig(workspaceRoot, config.root));
|
|
1459
1627
|
await context.withUserConfig(config);
|
|
1460
1628
|
context.powerlinesPath = await resolve.resolvePackage("powerlines");
|
|
1461
1629
|
if (!context.powerlinesPath) {
|
|
@@ -1495,7 +1663,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1495
1663
|
* The resolved entry type definitions for the project
|
|
1496
1664
|
*/
|
|
1497
1665
|
get entry() {
|
|
1498
|
-
return
|
|
1666
|
+
return chunkLPKZKRBW_cjs.resolveEntriesSync(this, toArray.toArray(this.config.entry));
|
|
1499
1667
|
}
|
|
1500
1668
|
/**
|
|
1501
1669
|
* The TypeScript configuration parsed from the tsconfig file
|
|
@@ -1542,10 +1710,10 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1542
1710
|
workspaceRoot: this.workspaceConfig?.workspaceRoot,
|
|
1543
1711
|
projectRoot: this.config?.projectRoot
|
|
1544
1712
|
}, {
|
|
1545
|
-
maxLength:
|
|
1713
|
+
maxLength: chunkTNHDC2ZQ_cjs.PROJECT_ROOT_HASH_LENGTH
|
|
1546
1714
|
}),
|
|
1547
1715
|
configHash: murmurhash.murmurhash(this.config, {
|
|
1548
|
-
maxLength:
|
|
1716
|
+
maxLength: chunkTNHDC2ZQ_cjs.CACHE_HASH_LENGTH
|
|
1549
1717
|
}),
|
|
1550
1718
|
builtinIdMap: {},
|
|
1551
1719
|
virtualFiles: {}
|
|
@@ -1607,7 +1775,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1607
1775
|
* Get the path to the data directory for the project
|
|
1608
1776
|
*/
|
|
1609
1777
|
get dataPath() {
|
|
1610
|
-
return join.joinPaths(this.envPaths.data, "projects",
|
|
1778
|
+
return join.joinPaths(this.envPaths.data, "projects", chunkTNHDC2ZQ_cjs.getPrefixedProjectRootHash(this.config.name, this.meta.projectRootHash));
|
|
1611
1779
|
}
|
|
1612
1780
|
/**
|
|
1613
1781
|
* Get the path to the cache directory for the project
|
|
@@ -1617,7 +1785,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1617
1785
|
checksum: this.#checksum,
|
|
1618
1786
|
config: this.meta.configHash
|
|
1619
1787
|
}, {
|
|
1620
|
-
maxLength:
|
|
1788
|
+
maxLength: chunkTNHDC2ZQ_cjs.CACHE_HASH_LENGTH
|
|
1621
1789
|
}));
|
|
1622
1790
|
}
|
|
1623
1791
|
/**
|
|
@@ -1755,7 +1923,7 @@ ${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.co
|
|
|
1755
1923
|
* @returns A logger function
|
|
1756
1924
|
*/
|
|
1757
1925
|
createLog(name = null) {
|
|
1758
|
-
return
|
|
1926
|
+
return chunkJA4HSQRN_cjs.createLog(name, {
|
|
1759
1927
|
...this.config,
|
|
1760
1928
|
logLevel: isNull.isNull(this.config.logLevel) ? "silent" : this.config.logLevel
|
|
1761
1929
|
});
|
|
@@ -1767,7 +1935,7 @@ ${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.co
|
|
|
1767
1935
|
* @returns A logger function
|
|
1768
1936
|
*/
|
|
1769
1937
|
extendLog(name) {
|
|
1770
|
-
return
|
|
1938
|
+
return chunkJA4HSQRN_cjs.extendLog(this.log, name);
|
|
1771
1939
|
}
|
|
1772
1940
|
/**
|
|
1773
1941
|
* Creates a new StormContext instance.
|
|
@@ -1803,6 +1971,7 @@ ${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.co
|
|
|
1803
1971
|
mode: (config.mode ?? this.config.mode) || this.workspaceConfig.mode,
|
|
1804
1972
|
skipCache: config.skipCache ?? this.config.skipCache ?? false,
|
|
1805
1973
|
configFile: config.configFile ?? this.config.configFile,
|
|
1974
|
+
framework: config.framework ?? this.config.framework ?? "powerlines",
|
|
1806
1975
|
command: this.config.inlineConfig?.command
|
|
1807
1976
|
};
|
|
1808
1977
|
if (configCache.has(cacheKey)) {
|
|
@@ -1821,7 +1990,7 @@ ${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.co
|
|
|
1821
1990
|
if (exists.existsSync(packageJsonPath)) {
|
|
1822
1991
|
this.packageJson = await json.readJsonFile(packageJsonPath);
|
|
1823
1992
|
}
|
|
1824
|
-
this.#checksum = await
|
|
1993
|
+
this.#checksum = await chunkTNHDC2ZQ_cjs.getChecksum(cacheKey.projectRoot);
|
|
1825
1994
|
this.resolver = createResolver({
|
|
1826
1995
|
workspaceRoot: this.workspaceConfig.workspaceRoot,
|
|
1827
1996
|
projectRoot: cacheKey.projectRoot,
|
|
@@ -1829,7 +1998,7 @@ ${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.co
|
|
|
1829
1998
|
mode: cacheKey.mode,
|
|
1830
1999
|
skipCache: cacheKey.skipCache
|
|
1831
2000
|
});
|
|
1832
|
-
const userConfig = await
|
|
2001
|
+
const userConfig = await chunkXW5TELHB_cjs.loadUserConfigFile(cacheKey.projectRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile, cacheKey.framework);
|
|
1833
2002
|
this.mergeUserConfig(userConfig.config);
|
|
1834
2003
|
configCache.set(cacheKey, {
|
|
1835
2004
|
projectJson: this.projectJson,
|
|
@@ -1901,7 +2070,7 @@ ${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.co
|
|
|
1901
2070
|
override: {}
|
|
1902
2071
|
});
|
|
1903
2072
|
}
|
|
1904
|
-
this.config.entry =
|
|
2073
|
+
this.config.entry = chunkLPKZKRBW_cjs.getUniqueEntries(this.config.entry);
|
|
1905
2074
|
if (this.config.name?.startsWith("@") && this.config.name.split("/").filter(Boolean).length > 1) {
|
|
1906
2075
|
this.config.name = this.config.name.split("/").filter(Boolean)[1];
|
|
1907
2076
|
}
|
|
@@ -1928,7 +2097,7 @@ ${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.co
|
|
|
1928
2097
|
};
|
|
1929
2098
|
}));
|
|
1930
2099
|
this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
|
|
1931
|
-
if (
|
|
2100
|
+
if (isPlugin(plugin) && checkDedupe(plugin, ret.filter((p) => isPlugin(p)))) {
|
|
1932
2101
|
return ret;
|
|
1933
2102
|
}
|
|
1934
2103
|
ret.push(plugin);
|
|
@@ -1947,7 +2116,7 @@ ${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.co
|
|
|
1947
2116
|
this.config.userConfig.output.format = getUnique.getUnique(toArray.toArray(this.config.userConfig.output?.format));
|
|
1948
2117
|
}
|
|
1949
2118
|
this.config.userConfig.plugins = (this.config.userConfig.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
|
|
1950
|
-
if (
|
|
2119
|
+
if (isPlugin(plugin) && checkDedupe(plugin, ret.filter((p) => isPlugin(p)))) {
|
|
1951
2120
|
return ret;
|
|
1952
2121
|
}
|
|
1953
2122
|
ret.push(plugin);
|
|
@@ -1998,15 +2167,15 @@ async function callHook(context, hook, options, ...args) {
|
|
|
1998
2167
|
}
|
|
1999
2168
|
return void 0;
|
|
2000
2169
|
}
|
|
2001
|
-
|
|
2170
|
+
chunkUSNT2KNT_cjs.__name(callHook, "callHook");
|
|
2002
2171
|
|
|
2003
2172
|
// src/internal/contexts/plugin-context.ts
|
|
2004
2173
|
function createPluginContext(plugin, environment) {
|
|
2005
|
-
const normalizeMessage = /* @__PURE__ */
|
|
2174
|
+
const normalizeMessage = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((message) => {
|
|
2006
2175
|
return isString.isString(message) ? message : message.message;
|
|
2007
2176
|
}, "normalizeMessage");
|
|
2008
2177
|
const log = environment.extendLog(plugin.name);
|
|
2009
|
-
const callHookFn = /* @__PURE__ */
|
|
2178
|
+
const callHookFn = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(async (hook, options, ...args) => {
|
|
2010
2179
|
return callHook(environment, hook, {
|
|
2011
2180
|
sequential: true,
|
|
2012
2181
|
...options
|
|
@@ -2057,12 +2226,12 @@ function createPluginContext(plugin, environment) {
|
|
|
2057
2226
|
}
|
|
2058
2227
|
});
|
|
2059
2228
|
}
|
|
2060
|
-
|
|
2229
|
+
chunkUSNT2KNT_cjs.__name(createPluginContext, "createPluginContext");
|
|
2061
2230
|
|
|
2062
2231
|
// src/internal/contexts/environment-context.ts
|
|
2063
2232
|
var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends PowerlinesContext {
|
|
2064
2233
|
static {
|
|
2065
|
-
|
|
2234
|
+
chunkUSNT2KNT_cjs.__name(this, "PowerlinesEnvironmentContext");
|
|
2066
2235
|
}
|
|
2067
2236
|
#hooks = {};
|
|
2068
2237
|
/**
|
|
@@ -2099,7 +2268,7 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends P
|
|
|
2099
2268
|
if (!result || isObject.isObject(result) && Object.keys(result).length === 0) {
|
|
2100
2269
|
return;
|
|
2101
2270
|
}
|
|
2102
|
-
resolvedPlugin =
|
|
2271
|
+
resolvedPlugin = isPlugin(result) ? result : plugin;
|
|
2103
2272
|
}
|
|
2104
2273
|
const context = createPluginContext(resolvedPlugin, this);
|
|
2105
2274
|
this.plugins.push({
|
|
@@ -2109,28 +2278,28 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends P
|
|
|
2109
2278
|
this.#hooks = Object.keys(resolvedPlugin).filter((key) => !PLUGIN_NON_HOOK_FIELDS.includes(key)).reduce((ret, key) => {
|
|
2110
2279
|
const hook = key;
|
|
2111
2280
|
const pluginHook = resolvedPlugin[hook];
|
|
2112
|
-
if (!
|
|
2281
|
+
if (!isPluginHook(pluginHook)) {
|
|
2113
2282
|
return ret;
|
|
2114
2283
|
}
|
|
2115
|
-
if (!
|
|
2284
|
+
if (!isHookExternal(hook)) {
|
|
2116
2285
|
ret[hook] ??= {};
|
|
2117
2286
|
if (resolvedPlugin.enforce) {
|
|
2118
2287
|
ret[hook][`${resolvedPlugin.enforce}Enforced`] ??= [];
|
|
2119
|
-
|
|
2288
|
+
addPluginHook(context, resolvedPlugin, pluginHook, ret[hook][`${resolvedPlugin.enforce}Enforced`]);
|
|
2120
2289
|
return ret;
|
|
2121
2290
|
}
|
|
2122
2291
|
if (isFunction.isFunction(pluginHook) || !pluginHook.order) {
|
|
2123
2292
|
ret[hook].normal ??= [];
|
|
2124
|
-
|
|
2293
|
+
addPluginHook(context, resolvedPlugin, pluginHook, ret[hook].normal);
|
|
2125
2294
|
return ret;
|
|
2126
2295
|
}
|
|
2127
2296
|
ret[hook][`${pluginHook.order}Ordered`] ??= [];
|
|
2128
|
-
|
|
2297
|
+
addPluginHook(context, resolvedPlugin, pluginHook, ret[hook][`${pluginHook.order}Ordered`]);
|
|
2129
2298
|
} else {
|
|
2130
2299
|
ret[hook] ??= [];
|
|
2131
2300
|
ret[hook].push({
|
|
2132
2301
|
plugin: resolvedPlugin,
|
|
2133
|
-
hook:
|
|
2302
|
+
hook: getHookHandler(pluginHook).bind(context)
|
|
2134
2303
|
});
|
|
2135
2304
|
}
|
|
2136
2305
|
return ret;
|
|
@@ -2142,7 +2311,7 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends P
|
|
|
2142
2311
|
selectHooks(hook, options) {
|
|
2143
2312
|
const handlers = [];
|
|
2144
2313
|
if (this.hooks[hook]) {
|
|
2145
|
-
if (!
|
|
2314
|
+
if (!isHookExternal(hook)) {
|
|
2146
2315
|
const hooks = this.hooks[hook];
|
|
2147
2316
|
if (options?.order) {
|
|
2148
2317
|
if (options?.order === "pre") {
|
|
@@ -2180,7 +2349,7 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends P
|
|
|
2180
2349
|
// src/internal/contexts/api-context.ts
|
|
2181
2350
|
var PowerlinesAPIContext = class _PowerlinesAPIContext extends PowerlinesContext {
|
|
2182
2351
|
static {
|
|
2183
|
-
|
|
2352
|
+
chunkUSNT2KNT_cjs.__name(this, "PowerlinesAPIContext");
|
|
2184
2353
|
}
|
|
2185
2354
|
#environments = {};
|
|
2186
2355
|
#plugins = [];
|
|
@@ -2193,7 +2362,7 @@ var PowerlinesAPIContext = class _PowerlinesAPIContext extends PowerlinesContext
|
|
|
2193
2362
|
* @returns A promise that resolves to the new context.
|
|
2194
2363
|
*/
|
|
2195
2364
|
static async from(workspaceRoot, config) {
|
|
2196
|
-
const context = new _PowerlinesAPIContext(await
|
|
2365
|
+
const context = new _PowerlinesAPIContext(await chunkXW5TELHB_cjs.loadWorkspaceConfig(workspaceRoot, config.root));
|
|
2197
2366
|
await context.withUserConfig(config);
|
|
2198
2367
|
context.powerlinesPath = await resolve.resolvePackage("powerlines");
|
|
2199
2368
|
if (!context.powerlinesPath) {
|
|
@@ -2285,187 +2454,25 @@ var PowerlinesAPIContext = class _PowerlinesAPIContext extends PowerlinesContext
|
|
|
2285
2454
|
}
|
|
2286
2455
|
}
|
|
2287
2456
|
};
|
|
2288
|
-
function
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
if (resolvedPath) {
|
|
2295
|
-
nodePath.replaceWith(t__namespace.stringLiteral(
|
|
2296
|
-
// Remove the file extension if it exists
|
|
2297
|
-
resolvedPath.replace(/\.(?:ts|mts|cts)x?$/, "")
|
|
2298
|
-
));
|
|
2299
|
-
}
|
|
2300
|
-
}
|
|
2301
|
-
chunkPK6SKIKE_cjs.__name(resolveModulePath, "resolveModulePath");
|
|
2302
|
-
var TRANSFORM_FUNCTIONS = [
|
|
2303
|
-
"require",
|
|
2304
|
-
"require.resolve",
|
|
2305
|
-
"System.import",
|
|
2306
|
-
// Jest methods
|
|
2307
|
-
"jest.genMockFromModule",
|
|
2308
|
-
"jest.mock",
|
|
2309
|
-
"jest.unmock",
|
|
2310
|
-
"jest.doMock",
|
|
2311
|
-
// eslint-disable-next-line @cspell/spellchecker
|
|
2312
|
-
"jest.dontMock",
|
|
2313
|
-
"jest.setMock",
|
|
2314
|
-
"jest.requireActual",
|
|
2315
|
-
"jest.requireMock",
|
|
2316
|
-
// Older Jest methods
|
|
2317
|
-
"require.requireActual",
|
|
2318
|
-
"require.requireMock"
|
|
2319
|
-
];
|
|
2320
|
-
function matchesPattern(state, calleePath, pattern) {
|
|
2321
|
-
const { node } = calleePath;
|
|
2322
|
-
if (t__namespace.isMemberExpression(node)) {
|
|
2323
|
-
return calleePath.matchesPattern(pattern);
|
|
2324
|
-
}
|
|
2325
|
-
if (!t__namespace.isIdentifier(node) || pattern.includes(".")) {
|
|
2326
|
-
return false;
|
|
2327
|
-
}
|
|
2328
|
-
const name = pattern.split(".")[0];
|
|
2329
|
-
return node.name === name;
|
|
2457
|
+
function formatTypes(code) {
|
|
2458
|
+
return code.replace(
|
|
2459
|
+
// eslint-disable-next-line regexp/no-super-linear-backtracking
|
|
2460
|
+
/import\s*(?:type\s*)?\{?[\w,\s]*(?:\}\s*)?from\s*(?:'|")@?[a-zA-Z0-9-\\/.]*(?:'|");?/g,
|
|
2461
|
+
""
|
|
2462
|
+
).replaceAll("#private;", "").replace(/__Ω/g, "");
|
|
2330
2463
|
}
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
CallExpression: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((nodePath, state) => {
|
|
2334
|
-
if (state.moduleResolverVisited.has(nodePath)) {
|
|
2335
|
-
return;
|
|
2336
|
-
}
|
|
2337
|
-
const calleePath = nodePath.get("callee");
|
|
2338
|
-
if (calleePath && TRANSFORM_FUNCTIONS.some((pattern) => matchesPattern(state, calleePath, pattern)) || t__namespace.isImport(nodePath.node.callee)) {
|
|
2339
|
-
state.moduleResolverVisited.add(nodePath);
|
|
2340
|
-
resolveModulePath(nodePath.get("arguments.0"), state);
|
|
2341
|
-
}
|
|
2342
|
-
}, "CallExpression"),
|
|
2343
|
-
// eslint-disable-next-line ts/naming-convention
|
|
2344
|
-
"ImportDeclaration|ExportDeclaration|ExportAllDeclaration": /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((nodePath, state) => {
|
|
2345
|
-
if (!nodePath || !nodePath.get("source") || state.moduleResolverVisited.has(nodePath)) {
|
|
2346
|
-
return;
|
|
2347
|
-
}
|
|
2348
|
-
state.moduleResolverVisited.add(nodePath);
|
|
2349
|
-
resolveModulePath(nodePath.get("source"), state);
|
|
2350
|
-
}, "ImportDeclaration|ExportDeclaration|ExportAllDeclaration")
|
|
2351
|
-
};
|
|
2352
|
-
var moduleResolverBabelPlugin = /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((context) => {
|
|
2353
|
-
return helperPluginUtils.declare(/* @__PURE__ */ chunkPK6SKIKE_cjs.__name(function builder(api) {
|
|
2354
|
-
let moduleResolverVisited = /* @__PURE__ */ new Set();
|
|
2355
|
-
return {
|
|
2356
|
-
name: "powerlines:module-resolver",
|
|
2357
|
-
manipulateOptions(opts) {
|
|
2358
|
-
opts.filename ??= "unknown";
|
|
2359
|
-
},
|
|
2360
|
-
pre() {
|
|
2361
|
-
moduleResolverVisited = /* @__PURE__ */ new Set();
|
|
2362
|
-
},
|
|
2363
|
-
visitor: {
|
|
2364
|
-
Program: {
|
|
2365
|
-
enter(programPath, state) {
|
|
2366
|
-
programPath.traverse(importVisitors, {
|
|
2367
|
-
...state,
|
|
2368
|
-
context,
|
|
2369
|
-
moduleResolverVisited,
|
|
2370
|
-
api
|
|
2371
|
-
});
|
|
2372
|
-
},
|
|
2373
|
-
exit(programPath, state) {
|
|
2374
|
-
programPath.traverse(importVisitors, {
|
|
2375
|
-
...state,
|
|
2376
|
-
context,
|
|
2377
|
-
moduleResolverVisited,
|
|
2378
|
-
api
|
|
2379
|
-
});
|
|
2380
|
-
}
|
|
2381
|
-
}
|
|
2382
|
-
},
|
|
2383
|
-
post() {
|
|
2384
|
-
moduleResolverVisited.clear();
|
|
2385
|
-
}
|
|
2386
|
-
};
|
|
2387
|
-
}, "builder"));
|
|
2388
|
-
}, "moduleResolverBabelPlugin");
|
|
2389
|
-
|
|
2390
|
-
// src/internal/helpers/generate-types.ts
|
|
2391
|
-
async function generateTypes(context) {
|
|
2392
|
-
context.log(types.LogLevelLabel.TRACE, `Preparing the TypeScript definitions for the Powerlines project.`);
|
|
2393
|
-
context.log(types.LogLevelLabel.TRACE, "Transforming built-ins runtime modules files.");
|
|
2394
|
-
const builtinFiles = await context.getBuiltins();
|
|
2395
|
-
const builtinFilePaths = await Promise.all(builtinFiles.map(async (file) => {
|
|
2396
|
-
const result = await core.transformAsync(file.code.toString(), {
|
|
2397
|
-
highlightCode: true,
|
|
2398
|
-
code: true,
|
|
2399
|
-
ast: false,
|
|
2400
|
-
cloneInputAst: false,
|
|
2401
|
-
comments: true,
|
|
2402
|
-
sourceType: "module",
|
|
2403
|
-
configFile: false,
|
|
2404
|
-
babelrc: false,
|
|
2405
|
-
envName: context.config.mode,
|
|
2406
|
-
caller: {
|
|
2407
|
-
name: "powerlines"
|
|
2408
|
-
},
|
|
2409
|
-
...context.config.transform.babel,
|
|
2410
|
-
filename: file.path,
|
|
2411
|
-
plugins: [
|
|
2412
|
-
[
|
|
2413
|
-
"@babel/plugin-syntax-typescript"
|
|
2414
|
-
],
|
|
2415
|
-
[
|
|
2416
|
-
moduleResolverBabelPlugin(context)
|
|
2417
|
-
]
|
|
2418
|
-
]
|
|
2419
|
-
});
|
|
2420
|
-
if (!result?.code) {
|
|
2421
|
-
throw new Error(`Powerlines - Generate Types failed to compile ${file.id}`);
|
|
2422
|
-
}
|
|
2423
|
-
context.log(types.LogLevelLabel.TRACE, `Writing transformed built-in runtime file ${file.id}.`);
|
|
2424
|
-
await context.writeBuiltin(result.code, file.id, file.path);
|
|
2425
|
-
return file.path;
|
|
2426
|
-
}));
|
|
2427
|
-
const typescriptPath = await resolve.resolvePackage("typescript");
|
|
2428
|
-
if (!typescriptPath) {
|
|
2429
|
-
throw new Error("Could not resolve TypeScript package location. Please ensure TypeScript is installed.");
|
|
2430
|
-
}
|
|
2431
|
-
const files = builtinFilePaths.reduce((ret, fileName) => {
|
|
2432
|
-
const formatted = replace.replacePath(fileName, context.workspaceConfig.workspaceRoot);
|
|
2433
|
-
if (!ret.includes(formatted)) {
|
|
2434
|
-
ret.push(formatted);
|
|
2435
|
-
}
|
|
2436
|
-
return ret;
|
|
2437
|
-
}, [
|
|
2438
|
-
joinPaths.joinPaths(typescriptPath, "lib", "lib.esnext.full.d.ts")
|
|
2439
|
-
]);
|
|
2440
|
-
context.log(types.LogLevelLabel.TRACE, "Parsing TypeScript configuration for the Powerlines project.");
|
|
2441
|
-
const resolvedTsconfig = chunkLJZEN4HP_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.tsconfig.tsconfigFilePath, defu3__default.default({
|
|
2442
|
-
compilerOptions: {
|
|
2443
|
-
strict: false,
|
|
2444
|
-
noEmit: false,
|
|
2445
|
-
declaration: true,
|
|
2446
|
-
declarationMap: false,
|
|
2447
|
-
emitDeclarationOnly: true,
|
|
2448
|
-
skipLibCheck: true
|
|
2449
|
-
},
|
|
2450
|
-
exclude: [
|
|
2451
|
-
"node_modules",
|
|
2452
|
-
"dist"
|
|
2453
|
-
],
|
|
2454
|
-
include: files
|
|
2455
|
-
}, context.config.tsconfigRaw ?? {}));
|
|
2456
|
-
resolvedTsconfig.options.configFilePath = joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.tsconfig.tsconfigFilePath);
|
|
2457
|
-
resolvedTsconfig.options.pathsBasePath = context.workspaceConfig.workspaceRoot;
|
|
2458
|
-
resolvedTsconfig.options.suppressOutputPathCheck = true;
|
|
2464
|
+
chunkUSNT2KNT_cjs.__name(formatTypes, "formatTypes");
|
|
2465
|
+
async function emitTypes(context, tsconfig, files) {
|
|
2459
2466
|
context.log(types.LogLevelLabel.TRACE, "Creating the TypeScript compiler host");
|
|
2460
|
-
const program = ts.createProgram(files,
|
|
2461
|
-
context.log(types.LogLevelLabel.TRACE, `Running TypeScript compiler
|
|
2467
|
+
const program = ts.createProgram(files, tsconfig.options, ts.createCompilerHost(tsconfig.options));
|
|
2468
|
+
context.log(types.LogLevelLabel.TRACE, `Running the TypeScript compiler for ${context.builtins.length} built-in runtime files.`);
|
|
2462
2469
|
let builtinModules = "";
|
|
2463
2470
|
const emitResult = program.emit(void 0, (fileName, text, _, __, sourceFiles, _data) => {
|
|
2464
|
-
const
|
|
2465
|
-
if (
|
|
2466
|
-
if (
|
|
2471
|
+
const sourceFile = sourceFiles?.[0];
|
|
2472
|
+
if (sourceFile?.fileName && !fileName.endsWith(".map")) {
|
|
2473
|
+
if (context.builtins.some((file) => file === sourceFile.fileName || context.fs.meta[file]?.id && context.fs.meta[file]?.id === sourceFile.fileName)) {
|
|
2467
2474
|
builtinModules += `
|
|
2468
|
-
declare module "${context.fs.resolve(
|
|
2475
|
+
declare module "${context.fs.resolve(sourceFile.fileName)}" {
|
|
2469
2476
|
${text.trim().replace(/^\s*export\s*declare\s*/gm, "export ").replace(/^\s*declare\s*/gm, "")}
|
|
2470
2477
|
}
|
|
2471
2478
|
`;
|
|
@@ -2490,25 +2497,9 @@ declare module "${context.fs.resolve(sourceFile2.fileName)}" {
|
|
|
2490
2497
|
|
|
2491
2498
|
${diagnosticMessage.length > 5e3 ? `${diagnosticMessage.slice(0, 5e3)}...` : diagnosticMessage}`);
|
|
2492
2499
|
}
|
|
2493
|
-
|
|
2494
|
-
const sourceFile = chunkUQJWVRRE_cjs.getSourceFile(String(context.config.output.dts), `/// <reference types="powerlines/shared" />${context.config.build.platform !== "neutral" ? `
|
|
2495
|
-
/// <reference types="powerlines/${context.config.build.platform}" />` : ""}
|
|
2496
|
-
|
|
2497
|
-
${chunkMFC7UJHT_cjs.getFileHeader(context, {
|
|
2498
|
-
directive: null,
|
|
2499
|
-
prettierIgnore: false
|
|
2500
|
-
})}
|
|
2501
|
-
|
|
2502
|
-
${builtinModules}`.replace(
|
|
2503
|
-
// eslint-disable-next-line regexp/no-super-linear-backtracking
|
|
2504
|
-
/import\s*(?:type\s*)?\{?[\w,\s]*(?:\}\s*)?from\s*(?:'|")@?[a-zA-Z0-9-\\/.]*(?:'|");?/g,
|
|
2505
|
-
""
|
|
2506
|
-
).replaceAll("#private;", "").replace(/__Ω/g, ""));
|
|
2507
|
-
await context.fs.writeFile(sourceFile.id, chunkUQJWVRRE_cjs.getString(sourceFile.code), {
|
|
2508
|
-
mode: "fs"
|
|
2509
|
-
});
|
|
2500
|
+
return formatTypes(builtinModules);
|
|
2510
2501
|
}
|
|
2511
|
-
|
|
2502
|
+
chunkUSNT2KNT_cjs.__name(emitTypes, "emitTypes");
|
|
2512
2503
|
async function installPackage(context, packageName, dev = false) {
|
|
2513
2504
|
if (!await packageFns.isPackageListed(_package.getPackageName(packageName), {
|
|
2514
2505
|
cwd: context.config.projectRoot
|
|
@@ -2538,13 +2529,18 @@ async function installPackage(context, packageName, dev = false) {
|
|
|
2538
2529
|
}
|
|
2539
2530
|
}
|
|
2540
2531
|
}
|
|
2541
|
-
|
|
2532
|
+
chunkUSNT2KNT_cjs.__name(installPackage, "installPackage");
|
|
2542
2533
|
|
|
2543
2534
|
// src/internal/helpers/install-dependencies.ts
|
|
2544
2535
|
async function installDependencies(context) {
|
|
2545
2536
|
context.log(types.LogLevelLabel.TRACE, `Checking and installing missing project dependencies.`);
|
|
2546
2537
|
context.dependencies ??= {};
|
|
2547
|
-
context.
|
|
2538
|
+
context.devDependencies ??= {};
|
|
2539
|
+
if (Object.keys(context.dependencies).length === 0 && Object.keys(context.devDependencies).length === 0) {
|
|
2540
|
+
context.log(types.LogLevelLabel.TRACE, `No dependencies or devDependencies to install. Skipping installation step.`);
|
|
2541
|
+
return;
|
|
2542
|
+
}
|
|
2543
|
+
context.log(types.LogLevelLabel.DEBUG, `The following packages are required:
|
|
2548
2544
|
Dependencies:
|
|
2549
2545
|
${Object.entries(context.dependencies).map(([name, version]) => `- ${name}@${String(version)}`).join(" \n")}
|
|
2550
2546
|
|
|
@@ -2555,10 +2551,10 @@ ${Object.entries(context.devDependencies).map(([name, version]) => `- ${name}@${
|
|
|
2555
2551
|
Promise.all(Object.entries(context.devDependencies).map(async ([name, version]) => installPackage(context, `${_package.getPackageName(name)}@${String(version)}`, true)))
|
|
2556
2552
|
]);
|
|
2557
2553
|
}
|
|
2558
|
-
|
|
2554
|
+
chunkUSNT2KNT_cjs.__name(installDependencies, "installDependencies");
|
|
2559
2555
|
async function resolveTsconfigChanges(context) {
|
|
2560
|
-
const tsconfig$1 =
|
|
2561
|
-
const tsconfigFilePath =
|
|
2556
|
+
const tsconfig$1 = chunkBQU53ZNB_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw);
|
|
2557
|
+
const tsconfigFilePath = chunkBQU53ZNB_cjs.getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
2562
2558
|
const tsconfigJson = await json.readJsonFile(tsconfigFilePath);
|
|
2563
2559
|
tsconfigJson.compilerOptions ??= {};
|
|
2564
2560
|
const extendedTsconfig = await tsconfig.loadTsConfig(tsconfigFilePath);
|
|
@@ -2575,7 +2571,7 @@ async function resolveTsconfigChanges(context) {
|
|
|
2575
2571
|
if (context.config.output.dts) {
|
|
2576
2572
|
const dtsFilePath = context.config.output.dts ? context.config.output.dts.startsWith(context.workspaceConfig.workspaceRoot) ? context.config.output.dts : joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.output.dts) : joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, "storm.d.ts");
|
|
2577
2573
|
const dtsRelativePath = joinPaths.joinPaths(filePathFns.relativePath(joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot), filePathFns.findFilePath(dtsFilePath)), filePathFns.findFileName(dtsFilePath));
|
|
2578
|
-
if (!tsconfigJson.include?.some((filePattern) =>
|
|
2574
|
+
if (!tsconfigJson.include?.some((filePattern) => chunkBQU53ZNB_cjs.isIncludeMatchFound(filePattern, [
|
|
2579
2575
|
dtsFilePath,
|
|
2580
2576
|
dtsRelativePath,
|
|
2581
2577
|
"storm.d.ts"
|
|
@@ -2661,21 +2657,21 @@ async function resolveTsconfigChanges(context) {
|
|
|
2661
2657
|
}
|
|
2662
2658
|
return tsconfigJson;
|
|
2663
2659
|
}
|
|
2664
|
-
|
|
2660
|
+
chunkUSNT2KNT_cjs.__name(resolveTsconfigChanges, "resolveTsconfigChanges");
|
|
2665
2661
|
async function initializeTsconfig(context) {
|
|
2666
2662
|
context.log(types.LogLevelLabel.TRACE, "Initializing TypeScript configuration (tsconfig.json) for the Powerlines project.");
|
|
2667
2663
|
if (!packageFns.isPackageExists("typescript")) {
|
|
2668
2664
|
throw new Error('The TypeScript package is not installed. Please install the package using the command: "npm install typescript --save-dev"');
|
|
2669
2665
|
}
|
|
2670
|
-
const tsconfigFilePath =
|
|
2666
|
+
const tsconfigFilePath = chunkBQU53ZNB_cjs.getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
2671
2667
|
context.tsconfig.originalTsconfigJson = await json.readJsonFile(tsconfigFilePath);
|
|
2672
2668
|
context.tsconfig.tsconfigJson = await resolveTsconfigChanges(context);
|
|
2673
2669
|
await context.fs.writeFile(tsconfigFilePath, stormJson.StormJSON.stringify(context.tsconfig.tsconfigJson), {
|
|
2674
2670
|
mode: "fs"
|
|
2675
2671
|
});
|
|
2676
|
-
context.tsconfig =
|
|
2672
|
+
context.tsconfig = chunkBQU53ZNB_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw, context.tsconfig.originalTsconfigJson);
|
|
2677
2673
|
}
|
|
2678
|
-
|
|
2674
|
+
chunkUSNT2KNT_cjs.__name(initializeTsconfig, "initializeTsconfig");
|
|
2679
2675
|
async function resolveTsconfig(context) {
|
|
2680
2676
|
const updateTsconfigJson = await json.readJsonFile(context.tsconfig.tsconfigFilePath);
|
|
2681
2677
|
if (updateTsconfigJson?.compilerOptions?.types && Array.isArray(updateTsconfigJson.compilerOptions.types) && !updateTsconfigJson.compilerOptions.types.length) {
|
|
@@ -2693,7 +2689,7 @@ async function resolveTsconfig(context) {
|
|
|
2693
2689
|
}
|
|
2694
2690
|
});
|
|
2695
2691
|
const changes = [];
|
|
2696
|
-
const getChanges = /* @__PURE__ */
|
|
2692
|
+
const getChanges = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((difference, property) => {
|
|
2697
2693
|
if (difference.status === "added" || difference.status === "deleted" || difference.status === "updated") {
|
|
2698
2694
|
if (difference.diff) {
|
|
2699
2695
|
for (const diff of difference.diff) {
|
|
@@ -2721,20 +2717,20 @@ async function resolveTsconfig(context) {
|
|
|
2721
2717
|
`).join("\n")}
|
|
2722
2718
|
`);
|
|
2723
2719
|
}
|
|
2724
|
-
await
|
|
2725
|
-
context.tsconfig =
|
|
2720
|
+
await chunk2NZADVP5_cjs.writeFile(context.log, context.tsconfig.tsconfigFilePath, stormJson.StormJSON.stringify(updateTsconfigJson));
|
|
2721
|
+
context.tsconfig = chunkBQU53ZNB_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
2726
2722
|
if (!context.tsconfig) {
|
|
2727
2723
|
throw new Error("Failed to parse the TypeScript configuration file.");
|
|
2728
2724
|
}
|
|
2729
2725
|
context.tsconfig.tsconfigJson.compilerOptions ??= {};
|
|
2730
2726
|
context.tsconfig.tsconfigJson.compilerOptions.strict = false;
|
|
2731
2727
|
}
|
|
2732
|
-
|
|
2728
|
+
chunkUSNT2KNT_cjs.__name(resolveTsconfig, "resolveTsconfig");
|
|
2733
2729
|
|
|
2734
|
-
// src/
|
|
2730
|
+
// src/api.ts
|
|
2735
2731
|
var PowerlinesAPI = class _PowerlinesAPI {
|
|
2736
2732
|
static {
|
|
2737
|
-
|
|
2733
|
+
chunkUSNT2KNT_cjs.__name(this, "PowerlinesAPI");
|
|
2738
2734
|
}
|
|
2739
2735
|
/**
|
|
2740
2736
|
* The Powerlines context
|
|
@@ -2796,8 +2792,8 @@ ${context.entry.map((entry) => `- ${entry.input.file || entry.file}${entry.outpu
|
|
|
2796
2792
|
context.log(types.LogLevelLabel.TRACE, `Powerlines configuration has been resolved:
|
|
2797
2793
|
|
|
2798
2794
|
${console.formatLogMessage(context.config)}`);
|
|
2799
|
-
context.fs[
|
|
2800
|
-
await
|
|
2795
|
+
context.fs[chunkTNHDC2ZQ_cjs.__VFS_INIT__]();
|
|
2796
|
+
await chunkTNHDC2ZQ_cjs.writeMetaFile(context);
|
|
2801
2797
|
context.persistedMeta = context.meta;
|
|
2802
2798
|
if (!exists.existsSync(context.cachePath)) {
|
|
2803
2799
|
await helpers.createDirectory(context.cachePath);
|
|
@@ -2806,20 +2802,129 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
2806
2802
|
await helpers.createDirectory(context.dataPath);
|
|
2807
2803
|
}
|
|
2808
2804
|
await this.callPreHook(context, "prepare");
|
|
2809
|
-
|
|
2810
|
-
context.log(types.LogLevelLabel.TRACE, "Generating built-in barrel file");
|
|
2811
|
-
}
|
|
2805
|
+
await this.callNormalHook(context, "prepare");
|
|
2812
2806
|
if (context.config.output.dts !== false) {
|
|
2813
|
-
|
|
2807
|
+
context.log(types.LogLevelLabel.TRACE, `Preparing the TypeScript definitions for the Powerlines project.`);
|
|
2808
|
+
context.log(types.LogLevelLabel.TRACE, "Transforming built-ins runtime modules files.");
|
|
2809
|
+
const builtinFilePaths = await Promise.all((await context.getBuiltins()).map(async (file) => {
|
|
2810
|
+
const result2 = await core.transformAsync(file.code.toString(), {
|
|
2811
|
+
highlightCode: true,
|
|
2812
|
+
code: true,
|
|
2813
|
+
ast: false,
|
|
2814
|
+
cloneInputAst: false,
|
|
2815
|
+
comments: true,
|
|
2816
|
+
sourceType: "module",
|
|
2817
|
+
configFile: false,
|
|
2818
|
+
babelrc: false,
|
|
2819
|
+
envName: context.config.mode,
|
|
2820
|
+
caller: {
|
|
2821
|
+
name: "powerlines"
|
|
2822
|
+
},
|
|
2823
|
+
...context.config.transform.babel,
|
|
2824
|
+
filename: file.path,
|
|
2825
|
+
plugins: [
|
|
2826
|
+
[
|
|
2827
|
+
"@babel/plugin-syntax-typescript"
|
|
2828
|
+
],
|
|
2829
|
+
[
|
|
2830
|
+
moduleResolverBabelPlugin(context)
|
|
2831
|
+
]
|
|
2832
|
+
]
|
|
2833
|
+
});
|
|
2834
|
+
if (!result2?.code) {
|
|
2835
|
+
throw new Error(`Powerlines - Generate Types failed to compile ${file.id}`);
|
|
2836
|
+
}
|
|
2837
|
+
context.log(types.LogLevelLabel.TRACE, `Writing transformed built-in runtime file ${file.id}.`);
|
|
2838
|
+
await context.writeBuiltin(result2.code, file.id, file.path);
|
|
2839
|
+
return file.path;
|
|
2840
|
+
}));
|
|
2841
|
+
const typescriptPath = await resolve.resolvePackage("typescript");
|
|
2842
|
+
if (!typescriptPath) {
|
|
2843
|
+
throw new Error("Could not resolve TypeScript package location. Please ensure TypeScript is installed.");
|
|
2844
|
+
}
|
|
2845
|
+
const files = builtinFilePaths.reduce((ret, fileName) => {
|
|
2846
|
+
const formatted = replace.replacePath(fileName, context.workspaceConfig.workspaceRoot);
|
|
2847
|
+
if (!ret.includes(formatted)) {
|
|
2848
|
+
ret.push(formatted);
|
|
2849
|
+
}
|
|
2850
|
+
return ret;
|
|
2851
|
+
}, [
|
|
2852
|
+
joinPaths.joinPaths(typescriptPath, "lib", "lib.esnext.full.d.ts")
|
|
2853
|
+
]);
|
|
2854
|
+
context.log(types.LogLevelLabel.TRACE, "Parsing TypeScript configuration for the Powerlines project.");
|
|
2855
|
+
const resolvedTsconfig = chunkBQU53ZNB_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.tsconfig.tsconfigFilePath, defu3__default.default({
|
|
2856
|
+
compilerOptions: {
|
|
2857
|
+
strict: false,
|
|
2858
|
+
noEmit: false,
|
|
2859
|
+
declaration: true,
|
|
2860
|
+
declarationMap: false,
|
|
2861
|
+
emitDeclarationOnly: true,
|
|
2862
|
+
skipLibCheck: true
|
|
2863
|
+
},
|
|
2864
|
+
exclude: [
|
|
2865
|
+
"node_modules",
|
|
2866
|
+
"dist"
|
|
2867
|
+
],
|
|
2868
|
+
include: files
|
|
2869
|
+
}, context.config.tsconfigRaw ?? {}));
|
|
2870
|
+
resolvedTsconfig.options.configFilePath = joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.tsconfig.tsconfigFilePath);
|
|
2871
|
+
resolvedTsconfig.options.pathsBasePath = context.workspaceConfig.workspaceRoot;
|
|
2872
|
+
resolvedTsconfig.options.suppressOutputPathCheck = true;
|
|
2873
|
+
let generatedTypes = await emitTypes(context, resolvedTsconfig, files);
|
|
2874
|
+
context.log(types.LogLevelLabel.TRACE, `Generating TypeScript declaration file in ${context.config.output.dts}.`);
|
|
2875
|
+
const directives = [];
|
|
2876
|
+
let result = await this.callPreHook(context, "generateTypes", generatedTypes);
|
|
2877
|
+
if (result) {
|
|
2878
|
+
if (isSetObject.isSetObject(result)) {
|
|
2879
|
+
generatedTypes = result.code;
|
|
2880
|
+
if (Array.isArray(result.directives) && result.directives.length > 0) {
|
|
2881
|
+
directives.push(...result.directives);
|
|
2882
|
+
}
|
|
2883
|
+
} else if (isSetString.isSetString(result)) {
|
|
2884
|
+
generatedTypes = result;
|
|
2885
|
+
}
|
|
2886
|
+
}
|
|
2887
|
+
result = await this.callNormalHook(context, "generateTypes", generatedTypes);
|
|
2888
|
+
if (result) {
|
|
2889
|
+
if (isSetObject.isSetObject(result)) {
|
|
2890
|
+
generatedTypes = result.code;
|
|
2891
|
+
if (Array.isArray(result.directives) && result.directives.length > 0) {
|
|
2892
|
+
directives.push(...result.directives);
|
|
2893
|
+
}
|
|
2894
|
+
} else if (isSetString.isSetString(result)) {
|
|
2895
|
+
generatedTypes = result;
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
result = await this.callPostHook(context, "generateTypes", generatedTypes);
|
|
2899
|
+
if (result) {
|
|
2900
|
+
if (isSetObject.isSetObject(result)) {
|
|
2901
|
+
generatedTypes = result.code;
|
|
2902
|
+
if (Array.isArray(result.directives) && result.directives.length > 0) {
|
|
2903
|
+
directives.push(...result.directives);
|
|
2904
|
+
}
|
|
2905
|
+
} else if (isSetString.isSetString(result)) {
|
|
2906
|
+
generatedTypes = result;
|
|
2907
|
+
}
|
|
2908
|
+
}
|
|
2909
|
+
await context.fs.writeFile(context.config.output.dts, `${directives ? `${directives.map((directive) => `/// <reference types="${directive}" />`).join("\n")}
|
|
2910
|
+
|
|
2911
|
+
` : ""}${chunk4NHFXDTQ_cjs.getFileHeader(context, {
|
|
2912
|
+
directive: null,
|
|
2913
|
+
prettierIgnore: false
|
|
2914
|
+
})}
|
|
2915
|
+
|
|
2916
|
+
${formatTypes(generatedTypes)}
|
|
2917
|
+
`, {
|
|
2918
|
+
mode: "fs"
|
|
2919
|
+
});
|
|
2814
2920
|
}
|
|
2815
|
-
|
|
2816
|
-
context.tsconfig = chunkLJZEN4HP_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
2921
|
+
context.tsconfig = chunkBQU53ZNB_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
2817
2922
|
if (!context.tsconfig) {
|
|
2818
2923
|
throw new Error("Failed to parse the TypeScript configuration file.");
|
|
2819
2924
|
}
|
|
2820
2925
|
await this.callPostHook(context, "prepare");
|
|
2821
|
-
await
|
|
2822
|
-
context.fs[
|
|
2926
|
+
await chunkTNHDC2ZQ_cjs.writeMetaFile(context);
|
|
2927
|
+
context.fs[chunkTNHDC2ZQ_cjs.__VFS_REVERT__]();
|
|
2823
2928
|
});
|
|
2824
2929
|
this.context.log(types.LogLevelLabel.INFO, "Powerlines API has been prepared successfully");
|
|
2825
2930
|
}
|
|
@@ -2842,7 +2947,7 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
2842
2947
|
for (const file of files) {
|
|
2843
2948
|
context.log(types.LogLevelLabel.TRACE, `Adding template file: ${file}`);
|
|
2844
2949
|
const template = Handlebars__default.default.compile(file);
|
|
2845
|
-
await
|
|
2950
|
+
await chunk2NZADVP5_cjs.writeFile(context.log, joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
|
|
2846
2951
|
}
|
|
2847
2952
|
await this.callNormalHook(context, "new");
|
|
2848
2953
|
if (context.config.projectType === "application") {
|
|
@@ -2850,14 +2955,14 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
2850
2955
|
for (const file of files2) {
|
|
2851
2956
|
context.log(types.LogLevelLabel.TRACE, `Adding application template file: ${file}`);
|
|
2852
2957
|
const template = Handlebars__default.default.compile(file);
|
|
2853
|
-
await
|
|
2958
|
+
await chunk2NZADVP5_cjs.writeFile(context.log, joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
|
|
2854
2959
|
}
|
|
2855
2960
|
} else {
|
|
2856
2961
|
const files2 = await listFiles.listFiles(joinPaths.joinPaths(context.powerlinesPath, "files/library/**/*.hbs"));
|
|
2857
2962
|
for (const file of files2) {
|
|
2858
2963
|
context.log(types.LogLevelLabel.TRACE, `Adding library template file: ${file}`);
|
|
2859
2964
|
const template = Handlebars__default.default.compile(file);
|
|
2860
|
-
await
|
|
2965
|
+
await chunk2NZADVP5_cjs.writeFile(context.log, joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
|
|
2861
2966
|
}
|
|
2862
2967
|
}
|
|
2863
2968
|
await this.callPostHook(context, "new");
|
|
@@ -2978,7 +3083,7 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
2978
3083
|
this.context.log(types.LogLevelLabel.TRACE, "Powerlines finalize execution started");
|
|
2979
3084
|
await this.#executeEnvironments(async (context) => {
|
|
2980
3085
|
await this.callHook(context, "finalize");
|
|
2981
|
-
context.fs[
|
|
3086
|
+
context.fs[chunkTNHDC2ZQ_cjs.__VFS_REVERT__]();
|
|
2982
3087
|
});
|
|
2983
3088
|
this.context.log(types.LogLevelLabel.TRACE, "Powerlines finalize execution completed");
|
|
2984
3089
|
}
|
|
@@ -3136,11 +3241,11 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
3136
3241
|
if (isPromise.isPromiseLike(config)) {
|
|
3137
3242
|
awaited = await Promise.resolve(config);
|
|
3138
3243
|
}
|
|
3139
|
-
if (!
|
|
3244
|
+
if (!isPluginConfig(awaited)) {
|
|
3140
3245
|
throw new Error(`Invalid plugin specified in the configuration - ${JSON.stringify(awaited)}. Please ensure the value is a plugin name, an object with the \`plugin\` and \`props\` properties, or an instance of \`Plugin\`.`);
|
|
3141
3246
|
}
|
|
3142
3247
|
let plugin;
|
|
3143
|
-
if (
|
|
3248
|
+
if (isPlugin(awaited)) {
|
|
3144
3249
|
plugin = awaited;
|
|
3145
3250
|
} else if (isFunction.isFunction(awaited)) {
|
|
3146
3251
|
plugin = await Promise.resolve(awaited());
|
|
@@ -3151,10 +3256,10 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
3151
3256
|
} else {
|
|
3152
3257
|
plugin = resolved;
|
|
3153
3258
|
}
|
|
3154
|
-
} else if (
|
|
3259
|
+
} else if (isPluginConfigTuple(awaited) || isPluginConfigObject(awaited)) {
|
|
3155
3260
|
let pluginConfig;
|
|
3156
3261
|
let pluginOptions;
|
|
3157
|
-
if (
|
|
3262
|
+
if (isPluginConfigTuple(awaited)) {
|
|
3158
3263
|
pluginConfig = awaited[0];
|
|
3159
3264
|
pluginOptions = awaited?.length === 2 ? awaited[1] : void 0;
|
|
3160
3265
|
} else {
|
|
@@ -3170,17 +3275,17 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
3170
3275
|
}
|
|
3171
3276
|
} else if (isFunction.isFunction(pluginConfig)) {
|
|
3172
3277
|
plugin = await Promise.resolve(pluginConfig(pluginOptions));
|
|
3173
|
-
} else if (
|
|
3278
|
+
} else if (isPlugin(pluginConfig)) {
|
|
3174
3279
|
plugin = pluginConfig;
|
|
3175
3280
|
}
|
|
3176
3281
|
}
|
|
3177
3282
|
if (!plugin) {
|
|
3178
3283
|
throw new Error(`The plugin configuration ${JSON.stringify(awaited)} is invalid. This configuration must point to a valid Powerlines plugin module.`);
|
|
3179
3284
|
}
|
|
3180
|
-
if (!
|
|
3285
|
+
if (!isPlugin(plugin)) {
|
|
3181
3286
|
throw new Error(`The plugin option ${JSON.stringify(plugin)} does not export a valid module. This configuration must point to a valid Powerlines plugin module.`);
|
|
3182
3287
|
}
|
|
3183
|
-
if (
|
|
3288
|
+
if (checkDedupe(plugin, this.context.plugins)) {
|
|
3184
3289
|
this.context.log(types.LogLevelLabel.TRACE, `Duplicate ${chalk4__default.default.bold.cyanBright(plugin.name)} plugin dependency detected - Skipping initialization.`);
|
|
3185
3290
|
return null;
|
|
3186
3291
|
}
|
|
@@ -3240,7 +3345,7 @@ Note: Please ensure the plugin package's default export is a class that extends
|
|
|
3240
3345
|
// src/lib/unplugin/factory.ts
|
|
3241
3346
|
function createUnpluginFactory(variant, decorate) {
|
|
3242
3347
|
return (config, meta) => {
|
|
3243
|
-
const log =
|
|
3348
|
+
const log = chunkJA4HSQRN_cjs.createLog("unplugin", config);
|
|
3244
3349
|
log(types.LogLevelLabel.DEBUG, "Initializing Unplugin");
|
|
3245
3350
|
try {
|
|
3246
3351
|
const userConfig = {
|
|
@@ -3262,11 +3367,11 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
3262
3367
|
command: "build"
|
|
3263
3368
|
});
|
|
3264
3369
|
}
|
|
3265
|
-
|
|
3370
|
+
chunkUSNT2KNT_cjs.__name(buildStart, "buildStart");
|
|
3266
3371
|
async function resolveId(id, importer, options = {
|
|
3267
3372
|
isEntry: false
|
|
3268
3373
|
}) {
|
|
3269
|
-
return
|
|
3374
|
+
return chunk7K7JH3DF_cjs.handleResolveId(api.context, {
|
|
3270
3375
|
id,
|
|
3271
3376
|
importer,
|
|
3272
3377
|
options
|
|
@@ -3277,7 +3382,7 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
3277
3382
|
resolvePatterns
|
|
3278
3383
|
});
|
|
3279
3384
|
}
|
|
3280
|
-
|
|
3385
|
+
chunkUSNT2KNT_cjs.__name(resolveId, "resolveId");
|
|
3281
3386
|
async function load(id) {
|
|
3282
3387
|
const environment = await api.context.getEnvironment();
|
|
3283
3388
|
if (id) {
|
|
@@ -3296,31 +3401,31 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
3296
3401
|
}
|
|
3297
3402
|
return api.callPostHook(environment, "load", id);
|
|
3298
3403
|
}
|
|
3299
|
-
|
|
3404
|
+
chunkUSNT2KNT_cjs.__name(load, "load");
|
|
3300
3405
|
async function transform(code, id) {
|
|
3301
3406
|
const environment = await api.context.getEnvironment();
|
|
3302
3407
|
let transformed = code;
|
|
3303
|
-
let result2 = await api.callPreHook(environment, "transform",
|
|
3408
|
+
let result2 = await api.callPreHook(environment, "transform", chunk3OCI4TH7_cjs.getString(transformed), id);
|
|
3304
3409
|
if (result2) {
|
|
3305
3410
|
transformed = result2;
|
|
3306
3411
|
}
|
|
3307
|
-
result2 = await api.callNormalHook(environment, "transform",
|
|
3412
|
+
result2 = await api.callNormalHook(environment, "transform", chunk3OCI4TH7_cjs.getString(transformed), id);
|
|
3308
3413
|
if (result2) {
|
|
3309
3414
|
transformed = result2;
|
|
3310
3415
|
}
|
|
3311
|
-
result2 = await api.callPostHook(environment, "transform",
|
|
3416
|
+
result2 = await api.callPostHook(environment, "transform", chunk3OCI4TH7_cjs.getString(transformed), id);
|
|
3312
3417
|
if (result2) {
|
|
3313
3418
|
transformed = result2;
|
|
3314
3419
|
}
|
|
3315
3420
|
return transformed;
|
|
3316
3421
|
}
|
|
3317
|
-
|
|
3422
|
+
chunkUSNT2KNT_cjs.__name(transform, "transform");
|
|
3318
3423
|
async function writeBundle() {
|
|
3319
3424
|
log(types.LogLevelLabel.DEBUG, "Finalizing Powerlines project output...");
|
|
3320
3425
|
const environment = await api.context.getEnvironment();
|
|
3321
3426
|
await api.callHook(environment, "writeBundle");
|
|
3322
3427
|
}
|
|
3323
|
-
|
|
3428
|
+
chunkUSNT2KNT_cjs.__name(writeBundle, "writeBundle");
|
|
3324
3429
|
const result = {
|
|
3325
3430
|
name: "powerlines",
|
|
3326
3431
|
resolveId: {
|
|
@@ -3355,8 +3460,6 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
3355
3460
|
}
|
|
3356
3461
|
};
|
|
3357
3462
|
}
|
|
3358
|
-
|
|
3463
|
+
chunkUSNT2KNT_cjs.__name(createUnpluginFactory, "createUnpluginFactory");
|
|
3359
3464
|
|
|
3360
3465
|
exports.createUnpluginFactory = createUnpluginFactory;
|
|
3361
|
-
//# sourceMappingURL=chunk-LYD5OTBI.cjs.map
|
|
3362
|
-
//# sourceMappingURL=chunk-LYD5OTBI.cjs.map
|