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,17 +1,17 @@
|
|
|
1
|
-
import { writeFile } from './chunk-
|
|
2
|
-
import { getFileHeader } from './chunk-
|
|
3
|
-
import { __VFS_CACHE__, __VFS_RESOLVER__, __VFS_VIRTUAL__, __VFS_UNIFIED__, __VFS_INIT__, __VFS_REVERT__, CACHE_HASH_LENGTH, PROJECT_ROOT_HASH_LENGTH, getPrefixedProjectRootHash, getChecksum, writeMetaFile } from './chunk-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { __name } from './chunk-7QVYU63E.js';
|
|
1
|
+
import { writeFile } from './chunk-TANQDHYY.js';
|
|
2
|
+
import { getFileHeader } from './chunk-GANVMM73.js';
|
|
3
|
+
import { __VFS_CACHE__, __VFS_RESOLVER__, __VFS_VIRTUAL__, __VFS_UNIFIED__, __VFS_INIT__, __VFS_REVERT__, CACHE_HASH_LENGTH, PROJECT_ROOT_HASH_LENGTH, getPrefixedProjectRootHash, getChecksum, writeMetaFile } from './chunk-GRJJZ5VJ.js';
|
|
4
|
+
import { handleResolveId } from './chunk-WFUO3YPK.js';
|
|
5
|
+
import { getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound } from './chunk-YOENMDZY.js';
|
|
6
|
+
import { loadWorkspaceConfig, loadUserConfigFile } from './chunk-ZPIKFR7Z.js';
|
|
7
|
+
import { extendLog, createLog } from './chunk-ENRLU4UR.js';
|
|
8
|
+
import { getString } from './chunk-M263EZ4F.js';
|
|
9
|
+
import { resolveEntriesSync, getUniqueEntries } from './chunk-NZLZLQX2.js';
|
|
10
|
+
import { __name } from './chunk-SHUYVCID.js';
|
|
12
11
|
import { LogLevelLabel } from '@storm-software/config-tools/types';
|
|
13
12
|
import { relativeToWorkspaceRoot, getWorkspaceRoot } from '@stryke/fs/get-workspace-root';
|
|
14
13
|
import { tsconfigPathsToRegExp } from 'bundle-require';
|
|
14
|
+
import { transformAsync } from '@babel/core';
|
|
15
15
|
import { formatLogMessage } from '@storm-software/config-tools/logger/console';
|
|
16
16
|
import { toArray } from '@stryke/convert/to-array';
|
|
17
17
|
import { copyFiles } from '@stryke/fs/copy-file';
|
|
@@ -20,6 +20,7 @@ import { createDirectory } from '@stryke/fs/helpers';
|
|
|
20
20
|
import { install } from '@stryke/fs/install';
|
|
21
21
|
import { listFiles } from '@stryke/fs/list-files';
|
|
22
22
|
import { isPackageExists, isPackageListed, doesPackageMatch, getPackageListing } from '@stryke/fs/package-fns';
|
|
23
|
+
import { resolvePackage } from '@stryke/fs/resolve';
|
|
23
24
|
import { joinPaths } from '@stryke/path/join-paths';
|
|
24
25
|
import { replacePath } from '@stryke/path/replace';
|
|
25
26
|
import { isError } from '@stryke/type-checks/is-error';
|
|
@@ -30,10 +31,11 @@ import { isSet } from '@stryke/type-checks/is-set';
|
|
|
30
31
|
import { isSetObject } from '@stryke/type-checks/is-set-object';
|
|
31
32
|
import { isSetString } from '@stryke/type-checks/is-set-string';
|
|
32
33
|
import chalk4 from 'chalk';
|
|
34
|
+
import defu3, { defu } from 'defu';
|
|
33
35
|
import Handlebars from 'handlebars';
|
|
34
|
-
import {
|
|
36
|
+
import { declare } from '@babel/helper-plugin-utils';
|
|
37
|
+
import * as t from '@babel/types';
|
|
35
38
|
import { titleCase } from '@stryke/string-format/title-case';
|
|
36
|
-
import defu3, { defu } from 'defu';
|
|
37
39
|
import { getEnvPaths } from '@stryke/env/get-env-paths';
|
|
38
40
|
import { readJsonFile } from '@stryke/fs/json';
|
|
39
41
|
import { murmurhash } from '@stryke/hash/murmurhash';
|
|
@@ -47,27 +49,125 @@ import { isNull } from '@stryke/type-checks/is-null';
|
|
|
47
49
|
import { isString } from '@stryke/type-checks/is-string';
|
|
48
50
|
import { uuid } from '@stryke/unique-id/uuid';
|
|
49
51
|
import { parseAsync } from 'oxc-parser';
|
|
52
|
+
import { isUndefined } from '@stryke/type-checks/is-undefined';
|
|
50
53
|
import { createJiti } from 'jiti';
|
|
51
54
|
import { bufferToString } from '@stryke/convert/buffer-to-string';
|
|
52
55
|
import { isParentPath } from '@stryke/path/is-parent-path';
|
|
53
56
|
import { prettyBytes } from '@stryke/string-format/pretty-bytes';
|
|
54
57
|
import { isBuffer } from '@stryke/type-checks/is-buffer';
|
|
55
|
-
import { isUndefined } from '@stryke/type-checks/is-undefined';
|
|
56
58
|
import { Volume } from 'memfs';
|
|
57
59
|
import { Blob } from 'node:buffer';
|
|
58
60
|
import fs from 'node:fs';
|
|
59
61
|
import { resolveConfig, format } from 'prettier';
|
|
60
62
|
import { Union } from 'unionfs';
|
|
61
63
|
import { isObject } from '@stryke/type-checks/is-object';
|
|
62
|
-
import { transformAsync } from '@babel/core';
|
|
63
64
|
import ts, { createProgram, createCompilerHost, getPreEmitDiagnostics, getLineAndCharacterOfPosition, flattenDiagnosticMessageText } from 'typescript';
|
|
64
|
-
import { declare } from '@babel/helper-plugin-utils';
|
|
65
|
-
import * as t from '@babel/types';
|
|
66
65
|
import { getPackageName, hasPackageVersion, getPackageVersion } from '@stryke/string-format/package';
|
|
67
66
|
import { getObjectDiff } from '@donedeal0/superdiff';
|
|
68
67
|
import { loadTsConfig } from '@stryke/fs/tsconfig';
|
|
69
68
|
import { StormJSON } from '@stryke/json/storm-json';
|
|
70
69
|
|
|
70
|
+
function resolveModulePath(nodePath, state) {
|
|
71
|
+
if (!t.isStringLiteral(nodePath.node)) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const sourcePath = nodePath.node.value;
|
|
75
|
+
const resolvedPath = state.context?.fs.resolve(sourcePath);
|
|
76
|
+
if (resolvedPath) {
|
|
77
|
+
nodePath.replaceWith(t.stringLiteral(
|
|
78
|
+
// Remove the file extension if it exists
|
|
79
|
+
resolvedPath.replace(/\.(?:ts|mts|cts)x?$/, "")
|
|
80
|
+
));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
__name(resolveModulePath, "resolveModulePath");
|
|
84
|
+
var TRANSFORM_FUNCTIONS = [
|
|
85
|
+
"require",
|
|
86
|
+
"require.resolve",
|
|
87
|
+
"System.import",
|
|
88
|
+
// Jest methods
|
|
89
|
+
"jest.genMockFromModule",
|
|
90
|
+
"jest.mock",
|
|
91
|
+
"jest.unmock",
|
|
92
|
+
"jest.doMock",
|
|
93
|
+
// eslint-disable-next-line @cspell/spellchecker
|
|
94
|
+
"jest.dontMock",
|
|
95
|
+
"jest.setMock",
|
|
96
|
+
"jest.requireActual",
|
|
97
|
+
"jest.requireMock",
|
|
98
|
+
// Older Jest methods
|
|
99
|
+
"require.requireActual",
|
|
100
|
+
"require.requireMock"
|
|
101
|
+
];
|
|
102
|
+
function matchesPattern(state, calleePath, pattern) {
|
|
103
|
+
const { node } = calleePath;
|
|
104
|
+
if (t.isMemberExpression(node)) {
|
|
105
|
+
return calleePath.matchesPattern(pattern);
|
|
106
|
+
}
|
|
107
|
+
if (!t.isIdentifier(node) || pattern.includes(".")) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
const name = pattern.split(".")[0];
|
|
111
|
+
return node.name === name;
|
|
112
|
+
}
|
|
113
|
+
__name(matchesPattern, "matchesPattern");
|
|
114
|
+
var importVisitors = {
|
|
115
|
+
CallExpression: /* @__PURE__ */ __name((nodePath, state) => {
|
|
116
|
+
if (state.moduleResolverVisited.has(nodePath)) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const calleePath = nodePath.get("callee");
|
|
120
|
+
if (calleePath && TRANSFORM_FUNCTIONS.some((pattern) => matchesPattern(state, calleePath, pattern)) || t.isImport(nodePath.node.callee)) {
|
|
121
|
+
state.moduleResolverVisited.add(nodePath);
|
|
122
|
+
resolveModulePath(nodePath.get("arguments.0"), state);
|
|
123
|
+
}
|
|
124
|
+
}, "CallExpression"),
|
|
125
|
+
// eslint-disable-next-line ts/naming-convention
|
|
126
|
+
"ImportDeclaration|ExportDeclaration|ExportAllDeclaration": /* @__PURE__ */ __name((nodePath, state) => {
|
|
127
|
+
if (!nodePath || !nodePath.get("source") || state.moduleResolverVisited.has(nodePath)) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
state.moduleResolverVisited.add(nodePath);
|
|
131
|
+
resolveModulePath(nodePath.get("source"), state);
|
|
132
|
+
}, "ImportDeclaration|ExportDeclaration|ExportAllDeclaration")
|
|
133
|
+
};
|
|
134
|
+
var moduleResolverBabelPlugin = /* @__PURE__ */ __name((context) => {
|
|
135
|
+
return declare(/* @__PURE__ */ __name(function builder(api) {
|
|
136
|
+
let moduleResolverVisited = /* @__PURE__ */ new Set();
|
|
137
|
+
return {
|
|
138
|
+
name: "powerlines:module-resolver",
|
|
139
|
+
manipulateOptions(opts) {
|
|
140
|
+
opts.filename ??= "unknown";
|
|
141
|
+
},
|
|
142
|
+
pre() {
|
|
143
|
+
moduleResolverVisited = /* @__PURE__ */ new Set();
|
|
144
|
+
},
|
|
145
|
+
visitor: {
|
|
146
|
+
Program: {
|
|
147
|
+
enter(programPath, state) {
|
|
148
|
+
programPath.traverse(importVisitors, {
|
|
149
|
+
...state,
|
|
150
|
+
context,
|
|
151
|
+
moduleResolverVisited,
|
|
152
|
+
api
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
exit(programPath, state) {
|
|
156
|
+
programPath.traverse(importVisitors, {
|
|
157
|
+
...state,
|
|
158
|
+
context,
|
|
159
|
+
moduleResolverVisited,
|
|
160
|
+
api
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
post() {
|
|
166
|
+
moduleResolverVisited.clear();
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}, "builder"));
|
|
170
|
+
}, "moduleResolverBabelPlugin");
|
|
71
171
|
var DEFAULT_ENVIRONMENT = "default";
|
|
72
172
|
function createEnvironment(name, userConfig) {
|
|
73
173
|
return defu3(userConfig.environments?.[name] ?? {}, {
|
|
@@ -113,6 +213,74 @@ function createDefaultEnvironment(userConfig) {
|
|
|
113
213
|
return createEnvironment(DEFAULT_ENVIRONMENT, userConfig);
|
|
114
214
|
}
|
|
115
215
|
__name(createDefaultEnvironment, "createDefaultEnvironment");
|
|
216
|
+
|
|
217
|
+
// src/types/commands.ts
|
|
218
|
+
var SUPPORTED_COMMANDS = [
|
|
219
|
+
"new",
|
|
220
|
+
"clean",
|
|
221
|
+
"prepare",
|
|
222
|
+
"lint",
|
|
223
|
+
"test",
|
|
224
|
+
"build",
|
|
225
|
+
"docs",
|
|
226
|
+
"release",
|
|
227
|
+
"finalize"
|
|
228
|
+
];
|
|
229
|
+
|
|
230
|
+
// src/plugin-utils/helpers.ts
|
|
231
|
+
function isPlugin(value) {
|
|
232
|
+
return isSetObject(value) && "name" in value && isSetString(value.name) && (isUndefined(value.applyToEnvironment) || "applyToEnvironment" in value && isFunction(value.applyToEnvironment)) && (isUndefined(value.dedupe) || "dedupe" in value && isFunction(value.dedupe)) && (isUndefined(value.dependsOn) || "dependsOn" in value && Array.isArray(value.dependsOn) && value.dependsOn.every(isPluginConfig)) && SUPPORTED_COMMANDS.every((command) => isUndefined(value[command]) || command in value && (isFunction(value[command]) || isSetObject(value[command]) && "handler" in value[command] && isFunction(value[command].handler)));
|
|
233
|
+
}
|
|
234
|
+
__name(isPlugin, "isPlugin");
|
|
235
|
+
function isPluginConfigObject(value) {
|
|
236
|
+
return isSetObject(value) && "plugin" in value && ((isSetString(value.plugin) || isFunction(value.plugin)) && "options" in value && isSetObject(value.options) || isPlugin(value.plugin));
|
|
237
|
+
}
|
|
238
|
+
__name(isPluginConfigObject, "isPluginConfigObject");
|
|
239
|
+
function isPluginConfigTuple(value) {
|
|
240
|
+
return Array.isArray(value) && (value.length === 1 || value.length === 2) && ((isSetString(value[0]) || isFunction(value[0])) && value.length > 1 && isSetObject(value[1]) || isPlugin(value[0]));
|
|
241
|
+
}
|
|
242
|
+
__name(isPluginConfigTuple, "isPluginConfigTuple");
|
|
243
|
+
function isPluginConfig(value) {
|
|
244
|
+
return isSetString(value) || isFunction(value) || isPlugin(value) || isPluginConfigObject(value) || isPluginConfigTuple(value);
|
|
245
|
+
}
|
|
246
|
+
__name(isPluginConfig, "isPluginConfig");
|
|
247
|
+
function isPluginHookFunction(value) {
|
|
248
|
+
return isFunction(value) || isSetObject(value) && "handler" in value && isFunction(value.handler);
|
|
249
|
+
}
|
|
250
|
+
__name(isPluginHookFunction, "isPluginHookFunction");
|
|
251
|
+
function isPluginHookObject(value) {
|
|
252
|
+
return isSetObject(value) && "handler" in value && isFunction(value.handler);
|
|
253
|
+
}
|
|
254
|
+
__name(isPluginHookObject, "isPluginHookObject");
|
|
255
|
+
function isPluginHook(value) {
|
|
256
|
+
return isPluginHookFunction(value) || isPluginHookObject(value);
|
|
257
|
+
}
|
|
258
|
+
__name(isPluginHook, "isPluginHook");
|
|
259
|
+
function getHookHandler(pluginHook) {
|
|
260
|
+
return isFunction(pluginHook) ? pluginHook : pluginHook.handler;
|
|
261
|
+
}
|
|
262
|
+
__name(getHookHandler, "getHookHandler");
|
|
263
|
+
function isHookExternal(hook) {
|
|
264
|
+
return hook.startsWith("vite:") || hook.startsWith("esbuild:") || hook.startsWith("rolldown:") || hook.startsWith("rollup:") || hook.startsWith("webpack:") || hook.startsWith("rspack:") || hook.startsWith("farm:");
|
|
265
|
+
}
|
|
266
|
+
__name(isHookExternal, "isHookExternal");
|
|
267
|
+
function checkDedupe(plugin, plugins) {
|
|
268
|
+
return plugin.dedupe === false || plugins.some((p) => p.dedupe !== false && (isFunction(p.dedupe) && p.dedupe(plugin) || p.name === plugin.name));
|
|
269
|
+
}
|
|
270
|
+
__name(checkDedupe, "checkDedupe");
|
|
271
|
+
function addPluginHook(context, plugin, pluginHook, hooksList) {
|
|
272
|
+
if (!checkDedupe(plugin, hooksList.map((hook) => hook.plugin))) {
|
|
273
|
+
hooksList.push(isFunction(pluginHook) ? {
|
|
274
|
+
plugin,
|
|
275
|
+
handler: getHookHandler(pluginHook).bind(context)
|
|
276
|
+
} : {
|
|
277
|
+
plugin,
|
|
278
|
+
...pluginHook,
|
|
279
|
+
handler: getHookHandler(pluginHook).bind(context)
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
__name(addPluginHook, "addPluginHook");
|
|
116
284
|
function resolveOptions(options) {
|
|
117
285
|
return defu3(options, {
|
|
118
286
|
interopDefault: true,
|
|
@@ -1774,6 +1942,7 @@ ${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.co
|
|
|
1774
1942
|
mode: (config.mode ?? this.config.mode) || this.workspaceConfig.mode,
|
|
1775
1943
|
skipCache: config.skipCache ?? this.config.skipCache ?? false,
|
|
1776
1944
|
configFile: config.configFile ?? this.config.configFile,
|
|
1945
|
+
framework: config.framework ?? this.config.framework ?? "powerlines",
|
|
1777
1946
|
command: this.config.inlineConfig?.command
|
|
1778
1947
|
};
|
|
1779
1948
|
if (configCache.has(cacheKey)) {
|
|
@@ -1800,7 +1969,7 @@ ${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.co
|
|
|
1800
1969
|
mode: cacheKey.mode,
|
|
1801
1970
|
skipCache: cacheKey.skipCache
|
|
1802
1971
|
});
|
|
1803
|
-
const userConfig = await loadUserConfigFile(cacheKey.projectRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile);
|
|
1972
|
+
const userConfig = await loadUserConfigFile(cacheKey.projectRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile, cacheKey.framework);
|
|
1804
1973
|
this.mergeUserConfig(userConfig.config);
|
|
1805
1974
|
configCache.set(cacheKey, {
|
|
1806
1975
|
projectJson: this.projectJson,
|
|
@@ -2256,187 +2425,25 @@ var PowerlinesAPIContext = class _PowerlinesAPIContext extends PowerlinesContext
|
|
|
2256
2425
|
}
|
|
2257
2426
|
}
|
|
2258
2427
|
};
|
|
2259
|
-
function
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
if (resolvedPath) {
|
|
2266
|
-
nodePath.replaceWith(t.stringLiteral(
|
|
2267
|
-
// Remove the file extension if it exists
|
|
2268
|
-
resolvedPath.replace(/\.(?:ts|mts|cts)x?$/, "")
|
|
2269
|
-
));
|
|
2270
|
-
}
|
|
2271
|
-
}
|
|
2272
|
-
__name(resolveModulePath, "resolveModulePath");
|
|
2273
|
-
var TRANSFORM_FUNCTIONS = [
|
|
2274
|
-
"require",
|
|
2275
|
-
"require.resolve",
|
|
2276
|
-
"System.import",
|
|
2277
|
-
// Jest methods
|
|
2278
|
-
"jest.genMockFromModule",
|
|
2279
|
-
"jest.mock",
|
|
2280
|
-
"jest.unmock",
|
|
2281
|
-
"jest.doMock",
|
|
2282
|
-
// eslint-disable-next-line @cspell/spellchecker
|
|
2283
|
-
"jest.dontMock",
|
|
2284
|
-
"jest.setMock",
|
|
2285
|
-
"jest.requireActual",
|
|
2286
|
-
"jest.requireMock",
|
|
2287
|
-
// Older Jest methods
|
|
2288
|
-
"require.requireActual",
|
|
2289
|
-
"require.requireMock"
|
|
2290
|
-
];
|
|
2291
|
-
function matchesPattern(state, calleePath, pattern) {
|
|
2292
|
-
const { node } = calleePath;
|
|
2293
|
-
if (t.isMemberExpression(node)) {
|
|
2294
|
-
return calleePath.matchesPattern(pattern);
|
|
2295
|
-
}
|
|
2296
|
-
if (!t.isIdentifier(node) || pattern.includes(".")) {
|
|
2297
|
-
return false;
|
|
2298
|
-
}
|
|
2299
|
-
const name = pattern.split(".")[0];
|
|
2300
|
-
return node.name === name;
|
|
2428
|
+
function formatTypes(code) {
|
|
2429
|
+
return code.replace(
|
|
2430
|
+
// eslint-disable-next-line regexp/no-super-linear-backtracking
|
|
2431
|
+
/import\s*(?:type\s*)?\{?[\w,\s]*(?:\}\s*)?from\s*(?:'|")@?[a-zA-Z0-9-\\/.]*(?:'|");?/g,
|
|
2432
|
+
""
|
|
2433
|
+
).replaceAll("#private;", "").replace(/__Ω/g, "");
|
|
2301
2434
|
}
|
|
2302
|
-
__name(
|
|
2303
|
-
|
|
2304
|
-
CallExpression: /* @__PURE__ */ __name((nodePath, state) => {
|
|
2305
|
-
if (state.moduleResolverVisited.has(nodePath)) {
|
|
2306
|
-
return;
|
|
2307
|
-
}
|
|
2308
|
-
const calleePath = nodePath.get("callee");
|
|
2309
|
-
if (calleePath && TRANSFORM_FUNCTIONS.some((pattern) => matchesPattern(state, calleePath, pattern)) || t.isImport(nodePath.node.callee)) {
|
|
2310
|
-
state.moduleResolverVisited.add(nodePath);
|
|
2311
|
-
resolveModulePath(nodePath.get("arguments.0"), state);
|
|
2312
|
-
}
|
|
2313
|
-
}, "CallExpression"),
|
|
2314
|
-
// eslint-disable-next-line ts/naming-convention
|
|
2315
|
-
"ImportDeclaration|ExportDeclaration|ExportAllDeclaration": /* @__PURE__ */ __name((nodePath, state) => {
|
|
2316
|
-
if (!nodePath || !nodePath.get("source") || state.moduleResolverVisited.has(nodePath)) {
|
|
2317
|
-
return;
|
|
2318
|
-
}
|
|
2319
|
-
state.moduleResolverVisited.add(nodePath);
|
|
2320
|
-
resolveModulePath(nodePath.get("source"), state);
|
|
2321
|
-
}, "ImportDeclaration|ExportDeclaration|ExportAllDeclaration")
|
|
2322
|
-
};
|
|
2323
|
-
var moduleResolverBabelPlugin = /* @__PURE__ */ __name((context) => {
|
|
2324
|
-
return declare(/* @__PURE__ */ __name(function builder(api) {
|
|
2325
|
-
let moduleResolverVisited = /* @__PURE__ */ new Set();
|
|
2326
|
-
return {
|
|
2327
|
-
name: "powerlines:module-resolver",
|
|
2328
|
-
manipulateOptions(opts) {
|
|
2329
|
-
opts.filename ??= "unknown";
|
|
2330
|
-
},
|
|
2331
|
-
pre() {
|
|
2332
|
-
moduleResolverVisited = /* @__PURE__ */ new Set();
|
|
2333
|
-
},
|
|
2334
|
-
visitor: {
|
|
2335
|
-
Program: {
|
|
2336
|
-
enter(programPath, state) {
|
|
2337
|
-
programPath.traverse(importVisitors, {
|
|
2338
|
-
...state,
|
|
2339
|
-
context,
|
|
2340
|
-
moduleResolverVisited,
|
|
2341
|
-
api
|
|
2342
|
-
});
|
|
2343
|
-
},
|
|
2344
|
-
exit(programPath, state) {
|
|
2345
|
-
programPath.traverse(importVisitors, {
|
|
2346
|
-
...state,
|
|
2347
|
-
context,
|
|
2348
|
-
moduleResolverVisited,
|
|
2349
|
-
api
|
|
2350
|
-
});
|
|
2351
|
-
}
|
|
2352
|
-
}
|
|
2353
|
-
},
|
|
2354
|
-
post() {
|
|
2355
|
-
moduleResolverVisited.clear();
|
|
2356
|
-
}
|
|
2357
|
-
};
|
|
2358
|
-
}, "builder"));
|
|
2359
|
-
}, "moduleResolverBabelPlugin");
|
|
2360
|
-
|
|
2361
|
-
// src/internal/helpers/generate-types.ts
|
|
2362
|
-
async function generateTypes(context) {
|
|
2363
|
-
context.log(LogLevelLabel.TRACE, `Preparing the TypeScript definitions for the Powerlines project.`);
|
|
2364
|
-
context.log(LogLevelLabel.TRACE, "Transforming built-ins runtime modules files.");
|
|
2365
|
-
const builtinFiles = await context.getBuiltins();
|
|
2366
|
-
const builtinFilePaths = await Promise.all(builtinFiles.map(async (file) => {
|
|
2367
|
-
const result = await transformAsync(file.code.toString(), {
|
|
2368
|
-
highlightCode: true,
|
|
2369
|
-
code: true,
|
|
2370
|
-
ast: false,
|
|
2371
|
-
cloneInputAst: false,
|
|
2372
|
-
comments: true,
|
|
2373
|
-
sourceType: "module",
|
|
2374
|
-
configFile: false,
|
|
2375
|
-
babelrc: false,
|
|
2376
|
-
envName: context.config.mode,
|
|
2377
|
-
caller: {
|
|
2378
|
-
name: "powerlines"
|
|
2379
|
-
},
|
|
2380
|
-
...context.config.transform.babel,
|
|
2381
|
-
filename: file.path,
|
|
2382
|
-
plugins: [
|
|
2383
|
-
[
|
|
2384
|
-
"@babel/plugin-syntax-typescript"
|
|
2385
|
-
],
|
|
2386
|
-
[
|
|
2387
|
-
moduleResolverBabelPlugin(context)
|
|
2388
|
-
]
|
|
2389
|
-
]
|
|
2390
|
-
});
|
|
2391
|
-
if (!result?.code) {
|
|
2392
|
-
throw new Error(`Powerlines - Generate Types failed to compile ${file.id}`);
|
|
2393
|
-
}
|
|
2394
|
-
context.log(LogLevelLabel.TRACE, `Writing transformed built-in runtime file ${file.id}.`);
|
|
2395
|
-
await context.writeBuiltin(result.code, file.id, file.path);
|
|
2396
|
-
return file.path;
|
|
2397
|
-
}));
|
|
2398
|
-
const typescriptPath = await resolvePackage("typescript");
|
|
2399
|
-
if (!typescriptPath) {
|
|
2400
|
-
throw new Error("Could not resolve TypeScript package location. Please ensure TypeScript is installed.");
|
|
2401
|
-
}
|
|
2402
|
-
const files = builtinFilePaths.reduce((ret, fileName) => {
|
|
2403
|
-
const formatted = replacePath(fileName, context.workspaceConfig.workspaceRoot);
|
|
2404
|
-
if (!ret.includes(formatted)) {
|
|
2405
|
-
ret.push(formatted);
|
|
2406
|
-
}
|
|
2407
|
-
return ret;
|
|
2408
|
-
}, [
|
|
2409
|
-
joinPaths(typescriptPath, "lib", "lib.esnext.full.d.ts")
|
|
2410
|
-
]);
|
|
2411
|
-
context.log(LogLevelLabel.TRACE, "Parsing TypeScript configuration for the Powerlines project.");
|
|
2412
|
-
const resolvedTsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.tsconfig.tsconfigFilePath, defu3({
|
|
2413
|
-
compilerOptions: {
|
|
2414
|
-
strict: false,
|
|
2415
|
-
noEmit: false,
|
|
2416
|
-
declaration: true,
|
|
2417
|
-
declarationMap: false,
|
|
2418
|
-
emitDeclarationOnly: true,
|
|
2419
|
-
skipLibCheck: true
|
|
2420
|
-
},
|
|
2421
|
-
exclude: [
|
|
2422
|
-
"node_modules",
|
|
2423
|
-
"dist"
|
|
2424
|
-
],
|
|
2425
|
-
include: files
|
|
2426
|
-
}, context.config.tsconfigRaw ?? {}));
|
|
2427
|
-
resolvedTsconfig.options.configFilePath = joinPaths(context.workspaceConfig.workspaceRoot, context.tsconfig.tsconfigFilePath);
|
|
2428
|
-
resolvedTsconfig.options.pathsBasePath = context.workspaceConfig.workspaceRoot;
|
|
2429
|
-
resolvedTsconfig.options.suppressOutputPathCheck = true;
|
|
2435
|
+
__name(formatTypes, "formatTypes");
|
|
2436
|
+
async function emitTypes(context, tsconfig, files) {
|
|
2430
2437
|
context.log(LogLevelLabel.TRACE, "Creating the TypeScript compiler host");
|
|
2431
|
-
const program = createProgram(files,
|
|
2432
|
-
context.log(LogLevelLabel.TRACE, `Running TypeScript compiler
|
|
2438
|
+
const program = createProgram(files, tsconfig.options, createCompilerHost(tsconfig.options));
|
|
2439
|
+
context.log(LogLevelLabel.TRACE, `Running the TypeScript compiler for ${context.builtins.length} built-in runtime files.`);
|
|
2433
2440
|
let builtinModules = "";
|
|
2434
2441
|
const emitResult = program.emit(void 0, (fileName, text, _, __, sourceFiles, _data) => {
|
|
2435
|
-
const
|
|
2436
|
-
if (
|
|
2437
|
-
if (
|
|
2442
|
+
const sourceFile = sourceFiles?.[0];
|
|
2443
|
+
if (sourceFile?.fileName && !fileName.endsWith(".map")) {
|
|
2444
|
+
if (context.builtins.some((file) => file === sourceFile.fileName || context.fs.meta[file]?.id && context.fs.meta[file]?.id === sourceFile.fileName)) {
|
|
2438
2445
|
builtinModules += `
|
|
2439
|
-
declare module "${context.fs.resolve(
|
|
2446
|
+
declare module "${context.fs.resolve(sourceFile.fileName)}" {
|
|
2440
2447
|
${text.trim().replace(/^\s*export\s*declare\s*/gm, "export ").replace(/^\s*declare\s*/gm, "")}
|
|
2441
2448
|
}
|
|
2442
2449
|
`;
|
|
@@ -2461,25 +2468,9 @@ declare module "${context.fs.resolve(sourceFile2.fileName)}" {
|
|
|
2461
2468
|
|
|
2462
2469
|
${diagnosticMessage.length > 5e3 ? `${diagnosticMessage.slice(0, 5e3)}...` : diagnosticMessage}`);
|
|
2463
2470
|
}
|
|
2464
|
-
|
|
2465
|
-
const sourceFile = getSourceFile(String(context.config.output.dts), `/// <reference types="powerlines/shared" />${context.config.build.platform !== "neutral" ? `
|
|
2466
|
-
/// <reference types="powerlines/${context.config.build.platform}" />` : ""}
|
|
2467
|
-
|
|
2468
|
-
${getFileHeader(context, {
|
|
2469
|
-
directive: null,
|
|
2470
|
-
prettierIgnore: false
|
|
2471
|
-
})}
|
|
2472
|
-
|
|
2473
|
-
${builtinModules}`.replace(
|
|
2474
|
-
// eslint-disable-next-line regexp/no-super-linear-backtracking
|
|
2475
|
-
/import\s*(?:type\s*)?\{?[\w,\s]*(?:\}\s*)?from\s*(?:'|")@?[a-zA-Z0-9-\\/.]*(?:'|");?/g,
|
|
2476
|
-
""
|
|
2477
|
-
).replaceAll("#private;", "").replace(/__Ω/g, ""));
|
|
2478
|
-
await context.fs.writeFile(sourceFile.id, getString(sourceFile.code), {
|
|
2479
|
-
mode: "fs"
|
|
2480
|
-
});
|
|
2471
|
+
return formatTypes(builtinModules);
|
|
2481
2472
|
}
|
|
2482
|
-
__name(
|
|
2473
|
+
__name(emitTypes, "emitTypes");
|
|
2483
2474
|
async function installPackage(context, packageName, dev = false) {
|
|
2484
2475
|
if (!await isPackageListed(getPackageName(packageName), {
|
|
2485
2476
|
cwd: context.config.projectRoot
|
|
@@ -2515,7 +2506,12 @@ __name(installPackage, "installPackage");
|
|
|
2515
2506
|
async function installDependencies(context) {
|
|
2516
2507
|
context.log(LogLevelLabel.TRACE, `Checking and installing missing project dependencies.`);
|
|
2517
2508
|
context.dependencies ??= {};
|
|
2518
|
-
context.
|
|
2509
|
+
context.devDependencies ??= {};
|
|
2510
|
+
if (Object.keys(context.dependencies).length === 0 && Object.keys(context.devDependencies).length === 0) {
|
|
2511
|
+
context.log(LogLevelLabel.TRACE, `No dependencies or devDependencies to install. Skipping installation step.`);
|
|
2512
|
+
return;
|
|
2513
|
+
}
|
|
2514
|
+
context.log(LogLevelLabel.DEBUG, `The following packages are required:
|
|
2519
2515
|
Dependencies:
|
|
2520
2516
|
${Object.entries(context.dependencies).map(([name, version]) => `- ${name}@${String(version)}`).join(" \n")}
|
|
2521
2517
|
|
|
@@ -2702,7 +2698,7 @@ async function resolveTsconfig(context) {
|
|
|
2702
2698
|
}
|
|
2703
2699
|
__name(resolveTsconfig, "resolveTsconfig");
|
|
2704
2700
|
|
|
2705
|
-
// src/
|
|
2701
|
+
// src/api.ts
|
|
2706
2702
|
var PowerlinesAPI = class _PowerlinesAPI {
|
|
2707
2703
|
static {
|
|
2708
2704
|
__name(this, "PowerlinesAPI");
|
|
@@ -2777,13 +2773,122 @@ ${formatLogMessage(context.config)}`);
|
|
|
2777
2773
|
await createDirectory(context.dataPath);
|
|
2778
2774
|
}
|
|
2779
2775
|
await this.callPreHook(context, "prepare");
|
|
2780
|
-
|
|
2781
|
-
context.log(LogLevelLabel.TRACE, "Generating built-in barrel file");
|
|
2782
|
-
}
|
|
2776
|
+
await this.callNormalHook(context, "prepare");
|
|
2783
2777
|
if (context.config.output.dts !== false) {
|
|
2784
|
-
|
|
2778
|
+
context.log(LogLevelLabel.TRACE, `Preparing the TypeScript definitions for the Powerlines project.`);
|
|
2779
|
+
context.log(LogLevelLabel.TRACE, "Transforming built-ins runtime modules files.");
|
|
2780
|
+
const builtinFilePaths = await Promise.all((await context.getBuiltins()).map(async (file) => {
|
|
2781
|
+
const result2 = await transformAsync(file.code.toString(), {
|
|
2782
|
+
highlightCode: true,
|
|
2783
|
+
code: true,
|
|
2784
|
+
ast: false,
|
|
2785
|
+
cloneInputAst: false,
|
|
2786
|
+
comments: true,
|
|
2787
|
+
sourceType: "module",
|
|
2788
|
+
configFile: false,
|
|
2789
|
+
babelrc: false,
|
|
2790
|
+
envName: context.config.mode,
|
|
2791
|
+
caller: {
|
|
2792
|
+
name: "powerlines"
|
|
2793
|
+
},
|
|
2794
|
+
...context.config.transform.babel,
|
|
2795
|
+
filename: file.path,
|
|
2796
|
+
plugins: [
|
|
2797
|
+
[
|
|
2798
|
+
"@babel/plugin-syntax-typescript"
|
|
2799
|
+
],
|
|
2800
|
+
[
|
|
2801
|
+
moduleResolverBabelPlugin(context)
|
|
2802
|
+
]
|
|
2803
|
+
]
|
|
2804
|
+
});
|
|
2805
|
+
if (!result2?.code) {
|
|
2806
|
+
throw new Error(`Powerlines - Generate Types failed to compile ${file.id}`);
|
|
2807
|
+
}
|
|
2808
|
+
context.log(LogLevelLabel.TRACE, `Writing transformed built-in runtime file ${file.id}.`);
|
|
2809
|
+
await context.writeBuiltin(result2.code, file.id, file.path);
|
|
2810
|
+
return file.path;
|
|
2811
|
+
}));
|
|
2812
|
+
const typescriptPath = await resolvePackage("typescript");
|
|
2813
|
+
if (!typescriptPath) {
|
|
2814
|
+
throw new Error("Could not resolve TypeScript package location. Please ensure TypeScript is installed.");
|
|
2815
|
+
}
|
|
2816
|
+
const files = builtinFilePaths.reduce((ret, fileName) => {
|
|
2817
|
+
const formatted = replacePath(fileName, context.workspaceConfig.workspaceRoot);
|
|
2818
|
+
if (!ret.includes(formatted)) {
|
|
2819
|
+
ret.push(formatted);
|
|
2820
|
+
}
|
|
2821
|
+
return ret;
|
|
2822
|
+
}, [
|
|
2823
|
+
joinPaths(typescriptPath, "lib", "lib.esnext.full.d.ts")
|
|
2824
|
+
]);
|
|
2825
|
+
context.log(LogLevelLabel.TRACE, "Parsing TypeScript configuration for the Powerlines project.");
|
|
2826
|
+
const resolvedTsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.tsconfig.tsconfigFilePath, defu3({
|
|
2827
|
+
compilerOptions: {
|
|
2828
|
+
strict: false,
|
|
2829
|
+
noEmit: false,
|
|
2830
|
+
declaration: true,
|
|
2831
|
+
declarationMap: false,
|
|
2832
|
+
emitDeclarationOnly: true,
|
|
2833
|
+
skipLibCheck: true
|
|
2834
|
+
},
|
|
2835
|
+
exclude: [
|
|
2836
|
+
"node_modules",
|
|
2837
|
+
"dist"
|
|
2838
|
+
],
|
|
2839
|
+
include: files
|
|
2840
|
+
}, context.config.tsconfigRaw ?? {}));
|
|
2841
|
+
resolvedTsconfig.options.configFilePath = joinPaths(context.workspaceConfig.workspaceRoot, context.tsconfig.tsconfigFilePath);
|
|
2842
|
+
resolvedTsconfig.options.pathsBasePath = context.workspaceConfig.workspaceRoot;
|
|
2843
|
+
resolvedTsconfig.options.suppressOutputPathCheck = true;
|
|
2844
|
+
let generatedTypes = await emitTypes(context, resolvedTsconfig, files);
|
|
2845
|
+
context.log(LogLevelLabel.TRACE, `Generating TypeScript declaration file in ${context.config.output.dts}.`);
|
|
2846
|
+
const directives = [];
|
|
2847
|
+
let result = await this.callPreHook(context, "generateTypes", generatedTypes);
|
|
2848
|
+
if (result) {
|
|
2849
|
+
if (isSetObject(result)) {
|
|
2850
|
+
generatedTypes = result.code;
|
|
2851
|
+
if (Array.isArray(result.directives) && result.directives.length > 0) {
|
|
2852
|
+
directives.push(...result.directives);
|
|
2853
|
+
}
|
|
2854
|
+
} else if (isSetString(result)) {
|
|
2855
|
+
generatedTypes = result;
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
result = await this.callNormalHook(context, "generateTypes", generatedTypes);
|
|
2859
|
+
if (result) {
|
|
2860
|
+
if (isSetObject(result)) {
|
|
2861
|
+
generatedTypes = result.code;
|
|
2862
|
+
if (Array.isArray(result.directives) && result.directives.length > 0) {
|
|
2863
|
+
directives.push(...result.directives);
|
|
2864
|
+
}
|
|
2865
|
+
} else if (isSetString(result)) {
|
|
2866
|
+
generatedTypes = result;
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2869
|
+
result = await this.callPostHook(context, "generateTypes", generatedTypes);
|
|
2870
|
+
if (result) {
|
|
2871
|
+
if (isSetObject(result)) {
|
|
2872
|
+
generatedTypes = result.code;
|
|
2873
|
+
if (Array.isArray(result.directives) && result.directives.length > 0) {
|
|
2874
|
+
directives.push(...result.directives);
|
|
2875
|
+
}
|
|
2876
|
+
} else if (isSetString(result)) {
|
|
2877
|
+
generatedTypes = result;
|
|
2878
|
+
}
|
|
2879
|
+
}
|
|
2880
|
+
await context.fs.writeFile(context.config.output.dts, `${directives ? `${directives.map((directive) => `/// <reference types="${directive}" />`).join("\n")}
|
|
2881
|
+
|
|
2882
|
+
` : ""}${getFileHeader(context, {
|
|
2883
|
+
directive: null,
|
|
2884
|
+
prettierIgnore: false
|
|
2885
|
+
})}
|
|
2886
|
+
|
|
2887
|
+
${formatTypes(generatedTypes)}
|
|
2888
|
+
`, {
|
|
2889
|
+
mode: "fs"
|
|
2890
|
+
});
|
|
2785
2891
|
}
|
|
2786
|
-
await this.callNormalHook(context, "prepare");
|
|
2787
2892
|
context.tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
2788
2893
|
if (!context.tsconfig) {
|
|
2789
2894
|
throw new Error("Failed to parse the TypeScript configuration file.");
|
|
@@ -3329,5 +3434,3 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
3329
3434
|
__name(createUnpluginFactory, "createUnpluginFactory");
|
|
3330
3435
|
|
|
3331
3436
|
export { createUnpluginFactory };
|
|
3332
|
-
//# sourceMappingURL=chunk-6BRTJXZ2.js.map
|
|
3333
|
-
//# sourceMappingURL=chunk-6BRTJXZ2.js.map
|