powerlines 0.14.1 → 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 +4 -4
- package/dist/astro.d.ts +4 -4
- 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-7GVRTQLJ.js → chunk-53SIK3PC.js} +2 -4
- package/dist/chunk-7464OF2J.cjs +10 -0
- package/dist/chunk-7GYTTM4M.cjs +2 -0
- package/dist/{chunk-M6XRJI44.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-7HF3SEKY.cjs → chunk-C3O6OZ75.cjs} +4 -6
- package/dist/{chunk-WA6IOZHV.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-7QQZH7V2.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-2OGPXWHG.js → chunk-KQPL2ZMU.js} +2 -4
- package/dist/{chunk-MW2CYPK5.cjs → chunk-KZMYPV7R.cjs} +7 -9
- package/dist/{chunk-5S33UKRI.js → chunk-LQEDMNSD.js} +1 -3
- package/dist/{chunk-O7GICJVN.cjs → chunk-LZM7R4YU.cjs} +6 -8
- package/dist/{chunk-N6L2CYXV.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-YFP5GQWW.js → chunk-VBAXXI72.js} +1 -3
- package/dist/{chunk-NVNMK4CE.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-UFEM5JTE.cjs → chunk-XWSGD2C3.cjs} +4 -6
- package/dist/chunk-YRJ4MLVL.cjs +2 -0
- package/dist/{chunk-5A5AK6JI.js → chunk-YWJMO2CR.js} +3 -5
- package/dist/chunk-ZC43PZXS.cjs +2 -0
- package/dist/{chunk-N2RUZCWA.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 +4 -4
- package/dist/esbuild.d.ts +4 -4
- package/dist/esbuild.js +8 -10
- package/dist/farm.cjs +7 -9
- package/dist/farm.d.cts +4 -4
- package/dist/farm.d.ts +4 -4
- 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.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 +4 -4
- package/dist/rolldown.d.ts +4 -4
- package/dist/rolldown.js +7 -9
- package/dist/rollup.cjs +10 -12
- package/dist/rollup.d.cts +4 -4
- package/dist/rollup.d.ts +4 -4
- package/dist/rollup.js +7 -9
- package/dist/rspack.cjs +10 -12
- package/dist/rspack.d.cts +4 -4
- package/dist/rspack.d.ts +4 -4
- 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 +4 -4
- package/dist/unloader.d.ts +4 -4
- 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 +4 -4
- package/dist/vite.d.ts +4 -4
- package/dist/vite.js +8 -10
- package/dist/webpack.cjs +10 -12
- package/dist/webpack.d.cts +4 -4
- package/dist/webpack.d.ts +4 -4
- package/dist/webpack.js +7 -9
- package/package.json +59 -54
- package/dist/chunk-2VIXD2XB.js +0 -3
- package/dist/chunk-3IM6CTCB.cjs +0 -12
- package/dist/chunk-4FZTGBHW.cjs +0 -12
- package/dist/chunk-4JCNAKOE.cjs +0 -4
- package/dist/chunk-6ZGIV2SU.cjs +0 -4
- package/dist/chunk-7BZQBW77.cjs +0 -4
- package/dist/chunk-AFJCY3R6.js +0 -3
- package/dist/chunk-AXIRZAL7.js +0 -3
- 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-HJW7OH6E.js +0 -3
- package/dist/chunk-IHUNA3MO.cjs +0 -4
- package/dist/chunk-OYASPHNL.js +0 -3
- package/dist/chunk-Q7EJVZVI.cjs +0 -4
- package/dist/chunk-RIOZPUCZ.cjs +0 -34
- package/dist/chunk-TLHFXGYV.js +0 -3
- package/dist/chunk-TLRPAJU2.cjs +0 -12
- package/dist/chunk-TSWMWZ4U.cjs +0 -12
- package/dist/chunk-VNRXLY2T.js +0 -3
- package/dist/chunk-VQCQRLGM.cjs +0 -4
- package/dist/chunk-XBF43VLE.cjs +0 -4
- package/dist/chunk-XZO6ZJQP.cjs +0 -4
- package/dist/chunk-Y5CDUGSN.cjs +0 -12
- package/dist/chunk-YQXNZNGK.js +0 -31
- package/dist/chunk-YTOIG4CV.cjs +0 -24
- package/dist/chunk-YZCTXGFH.js +0 -11
- package/dist/chunk-Z5H7LD6W.js +0 -3
- package/dist/chunk-ZEJHPSLK.cjs +0 -19
- 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,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunkETKZMGLN_cjs = require('./chunk-ETKZMGLN.cjs');
|
|
4
|
+
var chunkRF6RSWD4_cjs = require('./chunk-RF6RSWD4.cjs');
|
|
5
|
+
var chunkFCTNMPJF_cjs = require('./chunk-FCTNMPJF.cjs');
|
|
6
|
+
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
7
|
+
var core = require('@babel/core');
|
|
7
8
|
var console = require('@storm-software/config-tools/logger/console');
|
|
8
9
|
var types = require('@storm-software/config-tools/types');
|
|
9
10
|
var toArray = require('@stryke/convert/to-array');
|
|
@@ -13,6 +14,7 @@ var helpers = require('@stryke/fs/helpers');
|
|
|
13
14
|
var install = require('@stryke/fs/install');
|
|
14
15
|
var listFiles = require('@stryke/fs/list-files');
|
|
15
16
|
var packageFns = require('@stryke/fs/package-fns');
|
|
17
|
+
var resolve = require('@stryke/fs/resolve');
|
|
16
18
|
var joinPaths = require('@stryke/path/join-paths');
|
|
17
19
|
var replace = require('@stryke/path/replace');
|
|
18
20
|
var isError = require('@stryke/type-checks/is-error');
|
|
@@ -23,27 +25,21 @@ var isSet = require('@stryke/type-checks/is-set');
|
|
|
23
25
|
var isSetObject = require('@stryke/type-checks/is-set-object');
|
|
24
26
|
var isSetString = require('@stryke/type-checks/is-set-string');
|
|
25
27
|
var chalk5 = require('chalk');
|
|
28
|
+
var defu4 = require('defu');
|
|
26
29
|
var Handlebars = require('handlebars');
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var defu5 = require('defu');
|
|
30
|
-
var ts2 = require('typescript');
|
|
31
|
-
require('@stryke/fs/remove-file');
|
|
32
|
-
var hashFiles = require('@stryke/hash/hash-files');
|
|
33
|
-
var getUnique = require('@stryke/helpers/get-unique');
|
|
34
|
-
var filePathFns = require('@stryke/path/file-path-fns');
|
|
35
|
-
var kebabCase = require('@stryke/string-format/kebab-case');
|
|
36
|
-
var isUndefined = require('@stryke/type-checks/is-undefined');
|
|
37
|
-
var writeFile$1 = require('@stryke/fs/write-file');
|
|
38
|
-
var prettier = require('prettier');
|
|
39
|
-
var resolve = require('@stryke/fs/resolve');
|
|
30
|
+
var helperPluginUtils = require('@babel/helper-plugin-utils');
|
|
31
|
+
var t = require('@babel/types');
|
|
40
32
|
var getConfig = require('@storm-software/config-tools/get-config');
|
|
41
33
|
var c12 = require('c12');
|
|
42
34
|
var titleCase = require('@stryke/string-format/title-case');
|
|
43
35
|
var getEnvPaths = require('@stryke/env/get-env-paths');
|
|
44
36
|
var getWorkspaceRoot = require('@stryke/fs/get-workspace-root');
|
|
37
|
+
var json = require('@stryke/fs/json');
|
|
45
38
|
var murmurhash = require('@stryke/hash/murmurhash');
|
|
39
|
+
var getUnique = require('@stryke/helpers/get-unique');
|
|
46
40
|
var omit = require('@stryke/helpers/omit');
|
|
41
|
+
var append = require('@stryke/path/append');
|
|
42
|
+
var filePathFns = require('@stryke/path/file-path-fns');
|
|
47
43
|
var isType = require('@stryke/path/is-type');
|
|
48
44
|
var join = require('@stryke/path/join');
|
|
49
45
|
var isNull = require('@stryke/type-checks/is-null');
|
|
@@ -51,9 +47,14 @@ var isString = require('@stryke/type-checks/is-string');
|
|
|
51
47
|
var uuid = require('@stryke/unique-id/uuid');
|
|
52
48
|
var oxcParser = require('oxc-parser');
|
|
53
49
|
var parseTypeDefinition = require('@stryke/convert/parse-type-definition');
|
|
50
|
+
var isFile = require('@stryke/fs/is-file');
|
|
54
51
|
var logger = require('@storm-software/config-tools/logger');
|
|
55
52
|
var colors = require('@storm-software/config-tools/utilities/colors');
|
|
56
53
|
var noop = require('@stryke/helpers/noop');
|
|
54
|
+
require('@stryke/fs/remove-file');
|
|
55
|
+
var hashFiles = require('@stryke/hash/hash-files');
|
|
56
|
+
var kebabCase = require('@stryke/string-format/kebab-case');
|
|
57
|
+
var isUndefined = require('@stryke/type-checks/is-undefined');
|
|
57
58
|
var jiti = require('jiti');
|
|
58
59
|
var bufferToString = require('@stryke/convert/buffer-to-string');
|
|
59
60
|
var isParentPath = require('@stryke/path/is-parent-path');
|
|
@@ -62,17 +63,15 @@ var isBuffer = require('@stryke/type-checks/is-buffer');
|
|
|
62
63
|
var memfs = require('memfs');
|
|
63
64
|
var buffer = require('buffer');
|
|
64
65
|
var fs = require('fs');
|
|
66
|
+
var prettier = require('prettier');
|
|
65
67
|
var unionfs = require('unionfs');
|
|
66
68
|
var isObject = require('@stryke/type-checks/is-object');
|
|
67
|
-
var
|
|
68
|
-
var readFile = require('@stryke/fs/read-file');
|
|
69
|
-
var MagicString = require('magic-string');
|
|
70
|
-
var helperPluginUtils = require('@babel/helper-plugin-utils');
|
|
71
|
-
var t = require('@babel/types');
|
|
69
|
+
var ts2 = require('typescript');
|
|
72
70
|
var _package = require('@stryke/string-format/package');
|
|
73
71
|
var superdiff = require('@donedeal0/superdiff');
|
|
74
72
|
var tsconfig = require('@stryke/fs/tsconfig');
|
|
75
73
|
var stormJson = require('@stryke/json/storm-json');
|
|
74
|
+
var writeFile$1 = require('@stryke/fs/write-file');
|
|
76
75
|
|
|
77
76
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
78
77
|
|
|
@@ -95,201 +94,115 @@ function _interopNamespace(e) {
|
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
var chalk5__default = /*#__PURE__*/_interopDefault(chalk5);
|
|
97
|
+
var defu4__default = /*#__PURE__*/_interopDefault(defu4);
|
|
98
98
|
var Handlebars__default = /*#__PURE__*/_interopDefault(Handlebars);
|
|
99
|
-
var defu5__default = /*#__PURE__*/_interopDefault(defu5);
|
|
100
|
-
var ts2__default = /*#__PURE__*/_interopDefault(ts2);
|
|
101
|
-
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
102
|
-
var MagicString__default = /*#__PURE__*/_interopDefault(MagicString);
|
|
103
99
|
var t__namespace = /*#__PURE__*/_interopNamespace(t);
|
|
100
|
+
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
101
|
+
var ts2__default = /*#__PURE__*/_interopDefault(ts2);
|
|
104
102
|
|
|
105
|
-
function
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
tsconfigFilePath = append.appendPath(tsconfig, projectRoot);
|
|
109
|
-
if (!exists.existsSync(tsconfigFilePath)) {
|
|
110
|
-
tsconfigFilePath = append.appendPath(tsconfig, workspaceRoot);
|
|
111
|
-
if (!exists.existsSync(tsconfigFilePath)) {
|
|
112
|
-
tsconfigFilePath = append.appendPath(tsconfig, joinPaths.joinPaths(workspaceRoot, projectRoot));
|
|
113
|
-
if (!exists.existsSync(tsconfigFilePath)) {
|
|
114
|
-
throw new Error(`Cannot find the \`tsconfig.json\` configuration file at ${tsconfig}, ${append.appendPath(tsconfig, projectRoot)}, ${append.appendPath(tsconfig, workspaceRoot)}, or ${tsconfigFilePath}`);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return tsconfigFilePath;
|
|
120
|
-
}
|
|
121
|
-
chunkPK6SKIKE_cjs.__name(getTsconfigFilePath, "getTsconfigFilePath");
|
|
122
|
-
function findMatch(tsconfigType, types, extensions = [
|
|
123
|
-
".ts",
|
|
124
|
-
".tsx",
|
|
125
|
-
".d.ts"
|
|
126
|
-
]) {
|
|
127
|
-
return types.find((type) => tsconfigType?.toString().toLowerCase() === type?.toString().toLowerCase() || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}` || `./${tsconfigType?.toString().toLowerCase()}` === type?.toString().toLowerCase() || extensions.some((ext) => `${tsconfigType?.toString().toLowerCase()}${ext}` === type?.toString().toLowerCase() || `${tsconfigType?.toString().toLowerCase()}${ext}` === `./${type?.toString().toLowerCase()}` || `${type?.toString().toLowerCase()}${ext}` === `./${tsconfigType?.toString().toLowerCase()}` || tsconfigType?.toString().toLowerCase() === `${type?.toString().toLowerCase()}${ext}` || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}${ext}` || type?.toString().toLowerCase() === `./${tsconfigType?.toString().toLowerCase()}${ext}`));
|
|
128
|
-
}
|
|
129
|
-
chunkPK6SKIKE_cjs.__name(findMatch, "findMatch");
|
|
130
|
-
function findIncludeMatch(tsconfigType, types) {
|
|
131
|
-
return findMatch(tsconfigType, types, [
|
|
132
|
-
".ts",
|
|
133
|
-
".tsx",
|
|
134
|
-
".d.ts",
|
|
135
|
-
".js",
|
|
136
|
-
".jsx",
|
|
137
|
-
".mjs",
|
|
138
|
-
".cjs",
|
|
139
|
-
".mts",
|
|
140
|
-
".cts",
|
|
141
|
-
"/*.ts",
|
|
142
|
-
"/*.tsx",
|
|
143
|
-
"/*.d.ts",
|
|
144
|
-
"/*.js",
|
|
145
|
-
"/*.jsx",
|
|
146
|
-
"/*.mjs",
|
|
147
|
-
"/*.cjs",
|
|
148
|
-
"/*.mts",
|
|
149
|
-
"/*.cts",
|
|
150
|
-
"/**/*.ts",
|
|
151
|
-
"/**/*.tsx",
|
|
152
|
-
"/**/*.d.ts",
|
|
153
|
-
"/**/*.js",
|
|
154
|
-
"/**/*.jsx",
|
|
155
|
-
"/**/*.mjs",
|
|
156
|
-
"/**/*.cjs",
|
|
157
|
-
"/**/*.mts",
|
|
158
|
-
"/**/*.cts"
|
|
159
|
-
]);
|
|
160
|
-
}
|
|
161
|
-
chunkPK6SKIKE_cjs.__name(findIncludeMatch, "findIncludeMatch");
|
|
162
|
-
function isIncludeMatchFound(tsconfigType, types) {
|
|
163
|
-
return findIncludeMatch(tsconfigType, types) !== void 0;
|
|
164
|
-
}
|
|
165
|
-
chunkPK6SKIKE_cjs.__name(isIncludeMatchFound, "isIncludeMatchFound");
|
|
166
|
-
function getParsedTypeScriptConfig(workspaceRoot, projectRoot, tsconfig, tsconfigRaw = {}, originalTsconfigJson, host = ts2__default.default.sys) {
|
|
167
|
-
const tsconfigFilePath = getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig);
|
|
168
|
-
const tsconfigJson = json.readJsonFileSync(tsconfigFilePath);
|
|
169
|
-
if (!tsconfigJson) {
|
|
170
|
-
throw new Error(`Cannot find the \`tsconfig.json\` configuration file at ${joinPaths.joinPaths(projectRoot, tsconfig ?? "tsconfig.json")}`);
|
|
103
|
+
function resolveModulePath(nodePath, state) {
|
|
104
|
+
if (!t__namespace.isStringLiteral(nodePath.node)) {
|
|
105
|
+
return;
|
|
171
106
|
}
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
107
|
+
const sourcePath = nodePath.node.value;
|
|
108
|
+
const resolvedPath = state.context?.fs.resolve(sourcePath);
|
|
109
|
+
if (resolvedPath) {
|
|
110
|
+
nodePath.replaceWith(t__namespace.stringLiteral(
|
|
111
|
+
// Remove the file extension if it exists
|
|
112
|
+
resolvedPath.replace(/\.(?:ts|mts|cts)x?$/, "")
|
|
113
|
+
));
|
|
178
114
|
}
|
|
179
|
-
return {
|
|
180
|
-
...parsedCommandLine,
|
|
181
|
-
originalTsconfigJson: originalTsconfigJson ?? tsconfigJson,
|
|
182
|
-
tsconfigJson,
|
|
183
|
-
tsconfigFilePath
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
chunkPK6SKIKE_cjs.__name(getParsedTypeScriptConfig, "getParsedTypeScriptConfig");
|
|
187
|
-
var PROJECT_ROOT_HASH_LENGTH = 45;
|
|
188
|
-
var CACHE_HASH_LENGTH = 62;
|
|
189
|
-
function getPrefixedProjectRootHash(name, projectRootHash) {
|
|
190
|
-
const combined = `${kebabCase.kebabCase(name)}_${projectRootHash}`;
|
|
191
|
-
return combined.length > PROJECT_ROOT_HASH_LENGTH ? combined.slice(0, PROJECT_ROOT_HASH_LENGTH) : combined;
|
|
192
|
-
}
|
|
193
|
-
chunkPK6SKIKE_cjs.__name(getPrefixedProjectRootHash, "getPrefixedProjectRootHash");
|
|
194
|
-
async function getChecksum(path) {
|
|
195
|
-
return hashFiles.hashDirectory(path, {
|
|
196
|
-
ignore: [
|
|
197
|
-
"node_modules",
|
|
198
|
-
".git",
|
|
199
|
-
".nx",
|
|
200
|
-
".cache",
|
|
201
|
-
".storm",
|
|
202
|
-
"tmp",
|
|
203
|
-
"dist"
|
|
204
|
-
]
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
chunkPK6SKIKE_cjs.__name(getChecksum, "getChecksum");
|
|
208
|
-
async function writeMetaFile(context) {
|
|
209
|
-
const metaFilePath = joinPaths.joinPaths(context.dataPath, "meta.json");
|
|
210
|
-
context.log(types.LogLevelLabel.DEBUG, `Writing runtime metadata to ${metaFilePath}`);
|
|
211
|
-
await context.fs.writeFile(metaFilePath, JSON.stringify({
|
|
212
|
-
...context.meta,
|
|
213
|
-
virtualFiles: context.fs[chunk22K72CJ5_cjs.__VFS_VIRTUAL__].toJSON(context.artifactsPath),
|
|
214
|
-
virtualFilesMeta: context.fs.getPartialMeta()
|
|
215
|
-
}, null, 2), {
|
|
216
|
-
mode: "fs"
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
chunkPK6SKIKE_cjs.__name(writeMetaFile, "writeMetaFile");
|
|
220
|
-
function isPlugin(value) {
|
|
221
|
-
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)) && chunk5VPVJHJO_cjs.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)));
|
|
222
|
-
}
|
|
223
|
-
chunkPK6SKIKE_cjs.__name(isPlugin, "isPlugin");
|
|
224
|
-
function isPluginConfigObject(value) {
|
|
225
|
-
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));
|
|
226
|
-
}
|
|
227
|
-
chunkPK6SKIKE_cjs.__name(isPluginConfigObject, "isPluginConfigObject");
|
|
228
|
-
function isPluginConfigTuple(value) {
|
|
229
|
-
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]));
|
|
230
|
-
}
|
|
231
|
-
chunkPK6SKIKE_cjs.__name(isPluginConfigTuple, "isPluginConfigTuple");
|
|
232
|
-
function isPluginConfig(value) {
|
|
233
|
-
return isSetString.isSetString(value) || isFunction.isFunction(value) || isPlugin(value) || isPluginConfigObject(value) || isPluginConfigTuple(value);
|
|
234
|
-
}
|
|
235
|
-
chunkPK6SKIKE_cjs.__name(isPluginConfig, "isPluginConfig");
|
|
236
|
-
function isPluginHookFunction(value) {
|
|
237
|
-
return isFunction.isFunction(value) || isSetObject.isSetObject(value) && "handler" in value && isFunction.isFunction(value.handler);
|
|
238
115
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
hooksList.push(isFunction.isFunction(pluginHook) ? {
|
|
263
|
-
plugin,
|
|
264
|
-
handler: getHookHandler(pluginHook).bind(context)
|
|
265
|
-
} : {
|
|
266
|
-
plugin,
|
|
267
|
-
...pluginHook,
|
|
268
|
-
handler: getHookHandler(pluginHook).bind(context)
|
|
269
|
-
});
|
|
116
|
+
chunkUSNT2KNT_cjs.__name(resolveModulePath, "resolveModulePath");
|
|
117
|
+
var TRANSFORM_FUNCTIONS = [
|
|
118
|
+
"require",
|
|
119
|
+
"require.resolve",
|
|
120
|
+
"System.import",
|
|
121
|
+
// Jest methods
|
|
122
|
+
"jest.genMockFromModule",
|
|
123
|
+
"jest.mock",
|
|
124
|
+
"jest.unmock",
|
|
125
|
+
"jest.doMock",
|
|
126
|
+
// eslint-disable-next-line @cspell/spellchecker
|
|
127
|
+
"jest.dontMock",
|
|
128
|
+
"jest.setMock",
|
|
129
|
+
"jest.requireActual",
|
|
130
|
+
"jest.requireMock",
|
|
131
|
+
// Older Jest methods
|
|
132
|
+
"require.requireActual",
|
|
133
|
+
"require.requireMock"
|
|
134
|
+
];
|
|
135
|
+
function matchesPattern(state, calleePath, pattern) {
|
|
136
|
+
const { node } = calleePath;
|
|
137
|
+
if (t__namespace.isMemberExpression(node)) {
|
|
138
|
+
return calleePath.matchesPattern(pattern);
|
|
270
139
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
async function writeFile(log, filepath, content, skipFormat = false) {
|
|
274
|
-
try {
|
|
275
|
-
if (skipFormat) {
|
|
276
|
-
await writeFile$1.writeFile(filepath, content);
|
|
277
|
-
} else {
|
|
278
|
-
const config = await prettier.resolveConfig(filepath);
|
|
279
|
-
const formatted = await prettier.format(content, {
|
|
280
|
-
...config ?? {},
|
|
281
|
-
filepath
|
|
282
|
-
});
|
|
283
|
-
await writeFile$1.writeFile(filepath, formatted || "");
|
|
284
|
-
}
|
|
285
|
-
} catch (error) {
|
|
286
|
-
log(types.LogLevelLabel.ERROR, `Failed to write file ${filepath} to disk
|
|
287
|
-
${error?.message ? error.message : ""}`);
|
|
140
|
+
if (!t__namespace.isIdentifier(node) || pattern.includes(".")) {
|
|
141
|
+
return false;
|
|
288
142
|
}
|
|
143
|
+
const name = pattern.split(".")[0];
|
|
144
|
+
return node.name === name;
|
|
289
145
|
}
|
|
290
|
-
|
|
146
|
+
chunkUSNT2KNT_cjs.__name(matchesPattern, "matchesPattern");
|
|
147
|
+
var importVisitors = {
|
|
148
|
+
CallExpression: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((nodePath, state) => {
|
|
149
|
+
if (state.moduleResolverVisited.has(nodePath)) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const calleePath = nodePath.get("callee");
|
|
153
|
+
if (calleePath && TRANSFORM_FUNCTIONS.some((pattern) => matchesPattern(state, calleePath, pattern)) || t__namespace.isImport(nodePath.node.callee)) {
|
|
154
|
+
state.moduleResolverVisited.add(nodePath);
|
|
155
|
+
resolveModulePath(nodePath.get("arguments.0"), state);
|
|
156
|
+
}
|
|
157
|
+
}, "CallExpression"),
|
|
158
|
+
// eslint-disable-next-line ts/naming-convention
|
|
159
|
+
"ImportDeclaration|ExportDeclaration|ExportAllDeclaration": /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((nodePath, state) => {
|
|
160
|
+
if (!nodePath || !nodePath.get("source") || state.moduleResolverVisited.has(nodePath)) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
state.moduleResolverVisited.add(nodePath);
|
|
164
|
+
resolveModulePath(nodePath.get("source"), state);
|
|
165
|
+
}, "ImportDeclaration|ExportDeclaration|ExportAllDeclaration")
|
|
166
|
+
};
|
|
167
|
+
var moduleResolverBabelPlugin = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((context) => {
|
|
168
|
+
return helperPluginUtils.declare(/* @__PURE__ */ chunkUSNT2KNT_cjs.__name(function builder(api) {
|
|
169
|
+
let moduleResolverVisited = /* @__PURE__ */ new Set();
|
|
170
|
+
return {
|
|
171
|
+
name: "powerlines:module-resolver",
|
|
172
|
+
manipulateOptions(opts) {
|
|
173
|
+
opts.filename ??= "unknown";
|
|
174
|
+
},
|
|
175
|
+
pre() {
|
|
176
|
+
moduleResolverVisited = /* @__PURE__ */ new Set();
|
|
177
|
+
},
|
|
178
|
+
visitor: {
|
|
179
|
+
Program: {
|
|
180
|
+
enter(programPath, state) {
|
|
181
|
+
programPath.traverse(importVisitors, {
|
|
182
|
+
...state,
|
|
183
|
+
context,
|
|
184
|
+
moduleResolverVisited,
|
|
185
|
+
api
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
exit(programPath, state) {
|
|
189
|
+
programPath.traverse(importVisitors, {
|
|
190
|
+
...state,
|
|
191
|
+
context,
|
|
192
|
+
moduleResolverVisited,
|
|
193
|
+
api
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
post() {
|
|
199
|
+
moduleResolverVisited.clear();
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
}, "builder"));
|
|
203
|
+
}, "moduleResolverBabelPlugin");
|
|
291
204
|
async function loadWorkspaceConfig(workspaceRoot, cwd) {
|
|
292
|
-
return
|
|
205
|
+
return defu4__default.default({
|
|
293
206
|
workspaceRoot
|
|
294
207
|
}, await getConfig.getWorkspaceConfig(true, {
|
|
295
208
|
cwd,
|
|
@@ -297,10 +210,10 @@ async function loadWorkspaceConfig(workspaceRoot, cwd) {
|
|
|
297
210
|
useDefault: true
|
|
298
211
|
}));
|
|
299
212
|
}
|
|
300
|
-
|
|
301
|
-
async function loadUserConfigFile(projectRoot, jiti, command, mode, configFile) {
|
|
213
|
+
chunkUSNT2KNT_cjs.__name(loadWorkspaceConfig, "loadWorkspaceConfig");
|
|
214
|
+
async function loadUserConfigFile(projectRoot, jiti, command, mode, configFile, framework = "powerlines") {
|
|
302
215
|
let resolvedUserConfig = {};
|
|
303
|
-
const resolvedUserConfigFile = configFile && exists.existsSync(configFile) ? configFile : configFile && exists.existsSync(joinPaths.joinPaths(projectRoot, configFile)) ? joinPaths.joinPaths(projectRoot, configFile) : exists.existsSync(joinPaths.joinPaths(projectRoot,
|
|
216
|
+
const resolvedUserConfigFile = configFile && exists.existsSync(configFile) ? configFile : configFile && exists.existsSync(joinPaths.joinPaths(projectRoot, configFile)) ? joinPaths.joinPaths(projectRoot, configFile) : exists.existsSync(joinPaths.joinPaths(projectRoot, `${framework}.config.ts`)) ? joinPaths.joinPaths(projectRoot, `${framework}.config.ts`) : exists.existsSync(joinPaths.joinPaths(projectRoot, `${framework}.config.js`)) ? joinPaths.joinPaths(projectRoot, `${framework}.config.js`) : exists.existsSync(joinPaths.joinPaths(projectRoot, `${framework}.config.mts`)) ? joinPaths.joinPaths(projectRoot, `${framework}.config.mts`) : exists.existsSync(joinPaths.joinPaths(projectRoot, `${framework}.config.mjs`)) ? joinPaths.joinPaths(projectRoot, `${framework}.config.mjs`) : void 0;
|
|
304
217
|
if (resolvedUserConfigFile) {
|
|
305
218
|
const resolved = await jiti.import(jiti.esmResolve(resolvedUserConfigFile));
|
|
306
219
|
if (resolved) {
|
|
@@ -324,22 +237,22 @@ async function loadUserConfigFile(projectRoot, jiti, command, mode, configFile)
|
|
|
324
237
|
}
|
|
325
238
|
const result = await c12.loadConfig({
|
|
326
239
|
cwd: projectRoot,
|
|
327
|
-
name:
|
|
240
|
+
name: framework,
|
|
328
241
|
envName: mode,
|
|
329
242
|
globalRc: true,
|
|
330
243
|
packageJson: true,
|
|
331
244
|
dotenv: true,
|
|
332
245
|
jiti
|
|
333
246
|
});
|
|
334
|
-
return
|
|
247
|
+
return defu4__default.default(resolvedUserConfig, isSetObject.isSetObject(result?.config) ? {
|
|
335
248
|
...result.config,
|
|
336
249
|
...result
|
|
337
250
|
} : {});
|
|
338
251
|
}
|
|
339
|
-
|
|
252
|
+
chunkUSNT2KNT_cjs.__name(loadUserConfigFile, "loadUserConfigFile");
|
|
340
253
|
var DEFAULT_ENVIRONMENT = "default";
|
|
341
254
|
function createEnvironment(name, userConfig) {
|
|
342
|
-
return
|
|
255
|
+
return defu4__default.default(userConfig.environments?.[name] ?? {}, {
|
|
343
256
|
name,
|
|
344
257
|
title: userConfig.title || titleCase.titleCase(userConfig.name),
|
|
345
258
|
ssr: false,
|
|
@@ -377,26 +290,26 @@ function createEnvironment(name, userConfig) {
|
|
|
377
290
|
} : void 0
|
|
378
291
|
}, userConfig);
|
|
379
292
|
}
|
|
380
|
-
|
|
293
|
+
chunkUSNT2KNT_cjs.__name(createEnvironment, "createEnvironment");
|
|
381
294
|
function createDefaultEnvironment(userConfig) {
|
|
382
295
|
return createEnvironment(DEFAULT_ENVIRONMENT, userConfig);
|
|
383
296
|
}
|
|
384
|
-
|
|
297
|
+
chunkUSNT2KNT_cjs.__name(createDefaultEnvironment, "createDefaultEnvironment");
|
|
385
298
|
function resolveEntryInputFile(context, typeDefinition) {
|
|
386
299
|
return replace.replacePath(typeDefinition.file, joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot));
|
|
387
300
|
}
|
|
388
|
-
|
|
301
|
+
chunkUSNT2KNT_cjs.__name(resolveEntryInputFile, "resolveEntryInputFile");
|
|
389
302
|
function resolveEntryInput(context, typeDefinition) {
|
|
390
303
|
return {
|
|
391
304
|
file: resolveEntryInputFile(context, typeDefinition),
|
|
392
305
|
name: typeDefinition.name
|
|
393
306
|
};
|
|
394
307
|
}
|
|
395
|
-
|
|
308
|
+
chunkUSNT2KNT_cjs.__name(resolveEntryInput, "resolveEntryInput");
|
|
396
309
|
function resolveEntryOutput(context, typeDefinition) {
|
|
397
|
-
return joinPaths.joinPaths(replace.replacePath(replace.replacePath(replace.replacePath(replace.replacePath(typeDefinition.file, joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.sourceRoot)), joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot)), context.config.sourceRoot), context.config.projectRoot))
|
|
310
|
+
return replace.replaceExtension(joinPaths.joinPaths(replace.replacePath(replace.replacePath(replace.replacePath(replace.replacePath(typeDefinition.file, joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.sourceRoot)), joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot)), context.config.sourceRoot), context.config.projectRoot)));
|
|
398
311
|
}
|
|
399
|
-
|
|
312
|
+
chunkUSNT2KNT_cjs.__name(resolveEntryOutput, "resolveEntryOutput");
|
|
400
313
|
function resolveEntry(context, typeDefinition) {
|
|
401
314
|
const input = resolveEntryInput(context, typeDefinition);
|
|
402
315
|
return {
|
|
@@ -405,24 +318,31 @@ function resolveEntry(context, typeDefinition) {
|
|
|
405
318
|
output: resolveEntryOutput(context, typeDefinition)
|
|
406
319
|
};
|
|
407
320
|
}
|
|
408
|
-
|
|
321
|
+
chunkUSNT2KNT_cjs.__name(resolveEntry, "resolveEntry");
|
|
409
322
|
function resolveEntriesSync(context, typeDefinitions) {
|
|
410
323
|
return typeDefinitions.map((typeDefinition) => {
|
|
411
324
|
const parsed = parseTypeDefinition.parseTypeDefinition(typeDefinition);
|
|
412
|
-
|
|
325
|
+
const filePath = append.appendPath(parsed.file, context.config.projectRoot);
|
|
326
|
+
if (isFile.isFile(filePath)) {
|
|
327
|
+
return resolveEntry(context, {
|
|
328
|
+
file: replace.replacePath(filePath, context.config.projectRoot),
|
|
329
|
+
name: parsed.name
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
return listFiles.listFilesSync(filePath).map((file) => resolveEntry(context, {
|
|
413
333
|
file,
|
|
414
334
|
name: parsed.name
|
|
415
335
|
}));
|
|
416
336
|
}).flat().filter(Boolean);
|
|
417
337
|
}
|
|
418
|
-
|
|
338
|
+
chunkUSNT2KNT_cjs.__name(resolveEntriesSync, "resolveEntriesSync");
|
|
419
339
|
function getUniqueEntries(entries = []) {
|
|
420
340
|
return getUnique.getUniqueBy(toArray.toArray(entries), (item) => isSetString.isSetString(item) ? item : murmurhash.murmurhash(item ?? {}, {
|
|
421
341
|
maxLength: 24
|
|
422
342
|
}));
|
|
423
343
|
}
|
|
424
|
-
|
|
425
|
-
var createLog = /* @__PURE__ */
|
|
344
|
+
chunkUSNT2KNT_cjs.__name(getUniqueEntries, "getUniqueEntries");
|
|
345
|
+
var createLog = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((name, options = {}) => {
|
|
426
346
|
const logLevel = options.logLevel === null ? types.LogLevelLabel.SILENT : options.logLevel || types.LogLevelLabel.INFO;
|
|
427
347
|
if (logLevel === types.LogLevelLabel.SILENT) {
|
|
428
348
|
return noop.noop;
|
|
@@ -457,45 +377,131 @@ var BADGE_COLORS = [
|
|
|
457
377
|
"#FACC15",
|
|
458
378
|
"#34D399"
|
|
459
379
|
];
|
|
460
|
-
var extendLog = /* @__PURE__ */
|
|
380
|
+
var extendLog = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((logFn, name) => {
|
|
461
381
|
return (type, ...args) => logFn(type, ` ${chalk5__default.default.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${titleCase.titleCase(name)} `)} ${args.join(" ")} `);
|
|
462
382
|
}, "extendLog");
|
|
383
|
+
var PROJECT_ROOT_HASH_LENGTH = 45;
|
|
384
|
+
var CACHE_HASH_LENGTH = 62;
|
|
385
|
+
function getPrefixedProjectRootHash(name, projectRootHash) {
|
|
386
|
+
const combined = `${kebabCase.kebabCase(name)}_${projectRootHash}`;
|
|
387
|
+
return combined.length > PROJECT_ROOT_HASH_LENGTH ? combined.slice(0, PROJECT_ROOT_HASH_LENGTH) : combined;
|
|
388
|
+
}
|
|
389
|
+
chunkUSNT2KNT_cjs.__name(getPrefixedProjectRootHash, "getPrefixedProjectRootHash");
|
|
390
|
+
async function getChecksum(path) {
|
|
391
|
+
return hashFiles.hashDirectory(path, {
|
|
392
|
+
ignore: [
|
|
393
|
+
"node_modules",
|
|
394
|
+
".git",
|
|
395
|
+
".nx",
|
|
396
|
+
".cache",
|
|
397
|
+
".storm",
|
|
398
|
+
"tmp",
|
|
399
|
+
"dist"
|
|
400
|
+
]
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
chunkUSNT2KNT_cjs.__name(getChecksum, "getChecksum");
|
|
404
|
+
async function writeMetaFile(context) {
|
|
405
|
+
const metaFilePath = joinPaths.joinPaths(context.dataPath, "meta.json");
|
|
406
|
+
context.log(types.LogLevelLabel.DEBUG, `Writing runtime metadata to ${metaFilePath}`);
|
|
407
|
+
await context.fs.writeFile(metaFilePath, JSON.stringify({
|
|
408
|
+
...context.meta,
|
|
409
|
+
virtualFiles: context.fs[chunkRF6RSWD4_cjs.__VFS_VIRTUAL__].toJSON(context.artifactsPath),
|
|
410
|
+
virtualFilesMeta: context.fs.getPartialMeta()
|
|
411
|
+
}, null, 2), {
|
|
412
|
+
mode: "fs"
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
chunkUSNT2KNT_cjs.__name(writeMetaFile, "writeMetaFile");
|
|
416
|
+
function isPlugin(value) {
|
|
417
|
+
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)) && chunkFCTNMPJF_cjs.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)));
|
|
418
|
+
}
|
|
419
|
+
chunkUSNT2KNT_cjs.__name(isPlugin, "isPlugin");
|
|
420
|
+
function isPluginConfigObject(value) {
|
|
421
|
+
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));
|
|
422
|
+
}
|
|
423
|
+
chunkUSNT2KNT_cjs.__name(isPluginConfigObject, "isPluginConfigObject");
|
|
424
|
+
function isPluginConfigTuple(value) {
|
|
425
|
+
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]));
|
|
426
|
+
}
|
|
427
|
+
chunkUSNT2KNT_cjs.__name(isPluginConfigTuple, "isPluginConfigTuple");
|
|
428
|
+
function isPluginConfig(value) {
|
|
429
|
+
return isSetString.isSetString(value) || isFunction.isFunction(value) || isPlugin(value) || isPluginConfigObject(value) || isPluginConfigTuple(value);
|
|
430
|
+
}
|
|
431
|
+
chunkUSNT2KNT_cjs.__name(isPluginConfig, "isPluginConfig");
|
|
432
|
+
function isPluginHookFunction(value) {
|
|
433
|
+
return isFunction.isFunction(value) || isSetObject.isSetObject(value) && "handler" in value && isFunction.isFunction(value.handler);
|
|
434
|
+
}
|
|
435
|
+
chunkUSNT2KNT_cjs.__name(isPluginHookFunction, "isPluginHookFunction");
|
|
436
|
+
function isPluginHookObject(value) {
|
|
437
|
+
return isSetObject.isSetObject(value) && "handler" in value && isFunction.isFunction(value.handler);
|
|
438
|
+
}
|
|
439
|
+
chunkUSNT2KNT_cjs.__name(isPluginHookObject, "isPluginHookObject");
|
|
440
|
+
function isPluginHook(value) {
|
|
441
|
+
return isPluginHookFunction(value) || isPluginHookObject(value);
|
|
442
|
+
}
|
|
443
|
+
chunkUSNT2KNT_cjs.__name(isPluginHook, "isPluginHook");
|
|
444
|
+
function getHookHandler(pluginHook) {
|
|
445
|
+
return isFunction.isFunction(pluginHook) ? pluginHook : pluginHook.handler;
|
|
446
|
+
}
|
|
447
|
+
chunkUSNT2KNT_cjs.__name(getHookHandler, "getHookHandler");
|
|
448
|
+
function isHookExternal(hook) {
|
|
449
|
+
return hook.startsWith("vite:") || hook.startsWith("esbuild:") || hook.startsWith("rolldown:") || hook.startsWith("rollup:") || hook.startsWith("webpack:") || hook.startsWith("rspack:") || hook.startsWith("farm:");
|
|
450
|
+
}
|
|
451
|
+
chunkUSNT2KNT_cjs.__name(isHookExternal, "isHookExternal");
|
|
452
|
+
function checkDedupe(plugin, plugins) {
|
|
453
|
+
return plugin.dedupe === false || plugins.some((p) => p.dedupe !== false && (isFunction.isFunction(p.dedupe) && p.dedupe(plugin) || p.name === plugin.name));
|
|
454
|
+
}
|
|
455
|
+
chunkUSNT2KNT_cjs.__name(checkDedupe, "checkDedupe");
|
|
456
|
+
function addPluginHook(context, plugin, pluginHook, hooksList) {
|
|
457
|
+
if (!checkDedupe(plugin, hooksList.map((hook) => hook.plugin))) {
|
|
458
|
+
hooksList.push(isFunction.isFunction(pluginHook) ? {
|
|
459
|
+
plugin,
|
|
460
|
+
handler: getHookHandler(pluginHook).bind(context)
|
|
461
|
+
} : {
|
|
462
|
+
plugin,
|
|
463
|
+
...pluginHook,
|
|
464
|
+
handler: getHookHandler(pluginHook).bind(context)
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
chunkUSNT2KNT_cjs.__name(addPluginHook, "addPluginHook");
|
|
463
469
|
function resolveOptions(options) {
|
|
464
|
-
return
|
|
470
|
+
return defu4__default.default(options, {
|
|
465
471
|
interopDefault: true,
|
|
466
472
|
fsCache: options.mode !== "development" ? joinPaths.joinPaths(options.cacheDir, "jiti") : false,
|
|
467
473
|
moduleCache: options.mode !== "development"
|
|
468
474
|
});
|
|
469
475
|
}
|
|
470
|
-
|
|
476
|
+
chunkUSNT2KNT_cjs.__name(resolveOptions, "resolveOptions");
|
|
471
477
|
function createPluginResolver(options) {
|
|
472
478
|
return jiti.createJiti(joinPaths.joinPaths(options.workspaceRoot, options.projectRoot), resolveOptions({
|
|
473
479
|
...options
|
|
474
480
|
}));
|
|
475
481
|
}
|
|
476
|
-
|
|
482
|
+
chunkUSNT2KNT_cjs.__name(createPluginResolver, "createPluginResolver");
|
|
477
483
|
function createResolver(options) {
|
|
478
484
|
const baseResolver = jiti.createJiti(joinPaths.joinPaths(options.workspaceRoot, options.projectRoot), resolveOptions(options));
|
|
479
485
|
baseResolver.plugin = createPluginResolver(options);
|
|
480
486
|
return baseResolver;
|
|
481
487
|
}
|
|
482
|
-
|
|
488
|
+
chunkUSNT2KNT_cjs.__name(createResolver, "createResolver");
|
|
483
489
|
function isBufferEncoding(options) {
|
|
484
490
|
return isSetString.isSetString(options) || options === null;
|
|
485
491
|
}
|
|
486
|
-
|
|
492
|
+
chunkUSNT2KNT_cjs.__name(isBufferEncoding, "isBufferEncoding");
|
|
487
493
|
function isPowerlinesWriteFileOptions(options) {
|
|
488
494
|
return !isBufferEncoding(options) && isSetObject.isSetObject(options) && ("skipFormat" in options || "mode" in options && (options.mode === "fs" || options.mode === "virtual"));
|
|
489
495
|
}
|
|
490
|
-
|
|
496
|
+
chunkUSNT2KNT_cjs.__name(isPowerlinesWriteFileOptions, "isPowerlinesWriteFileOptions");
|
|
491
497
|
function isNodeWriteFileOptions(options) {
|
|
492
498
|
return !isUndefined.isUndefined(options) && (isBufferEncoding(options) || !isPowerlinesWriteFileOptions(options));
|
|
493
499
|
}
|
|
494
|
-
|
|
500
|
+
chunkUSNT2KNT_cjs.__name(isNodeWriteFileOptions, "isNodeWriteFileOptions");
|
|
495
501
|
function isPowerLinesWriteFileData(data) {
|
|
496
502
|
return !!(isSetObject.isSetObject(data) && "code" in data && data.code);
|
|
497
503
|
}
|
|
498
|
-
|
|
504
|
+
chunkUSNT2KNT_cjs.__name(isPowerLinesWriteFileData, "isPowerLinesWriteFileData");
|
|
499
505
|
var FILE_PREFIX = "file://";
|
|
500
506
|
function toFilePath(pathOrUrl) {
|
|
501
507
|
if (!pathOrUrl) {
|
|
@@ -507,7 +513,7 @@ function toFilePath(pathOrUrl) {
|
|
|
507
513
|
}
|
|
508
514
|
return result;
|
|
509
515
|
}
|
|
510
|
-
|
|
516
|
+
chunkUSNT2KNT_cjs.__name(toFilePath, "toFilePath");
|
|
511
517
|
var FS_METHODS = [
|
|
512
518
|
"mkdir",
|
|
513
519
|
"mkdirSync",
|
|
@@ -571,7 +577,7 @@ function cloneFS(originalFS) {
|
|
|
571
577
|
}
|
|
572
578
|
return clonedFS;
|
|
573
579
|
}
|
|
574
|
-
|
|
580
|
+
chunkUSNT2KNT_cjs.__name(cloneFS, "cloneFS");
|
|
575
581
|
function patchFS(originalFS, vfs) {
|
|
576
582
|
const clonedFS = cloneFS(originalFS);
|
|
577
583
|
originalFS.mkdirSync = (file, options) => vfs.mkdirSync(toFilePath(file), options);
|
|
@@ -582,7 +588,7 @@ function patchFS(originalFS, vfs) {
|
|
|
582
588
|
originalFS.promises.unlink = async (file) => vfs.unlink(toFilePath(file));
|
|
583
589
|
originalFS.existsSync = (file) => vfs.existsSync(toFilePath(file));
|
|
584
590
|
Object.defineProperty(originalFS, "realpathSync", {
|
|
585
|
-
value: /* @__PURE__ */
|
|
591
|
+
value: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((file, options) => vfs.realpathSync(toFilePath(file), options), "value")
|
|
586
592
|
});
|
|
587
593
|
originalFS.writeFileSync = (file, data, options) => vfs.writeFileSync(toFilePath(file), data, options);
|
|
588
594
|
originalFS.promises.writeFile = async (file, data, options) => vfs.writeFile(toFilePath(file), data, options);
|
|
@@ -591,12 +597,12 @@ function patchFS(originalFS, vfs) {
|
|
|
591
597
|
originalFS.readdirSync = (file, options) => vfs.readdirSync(toFilePath(file), options);
|
|
592
598
|
originalFS.promises.readdir = (file, options) => vfs.readdir(toFilePath(file), options);
|
|
593
599
|
Object.defineProperty(originalFS, "statSync", {
|
|
594
|
-
value: /* @__PURE__ */
|
|
600
|
+
value: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((file, options) => vfs.statSync(toFilePath(file), options), "value")
|
|
595
601
|
});
|
|
596
602
|
originalFS.stat = (file, options) => vfs.statSync(toFilePath(file), options);
|
|
597
603
|
originalFS.promises.stat = (file, options) => vfs.stat(toFilePath(file), options);
|
|
598
604
|
Object.defineProperty(originalFS, "lstatSync", {
|
|
599
|
-
value: /* @__PURE__ */
|
|
605
|
+
value: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((file, options) => vfs.lstatSync(toFilePath(file), options), "value")
|
|
600
606
|
});
|
|
601
607
|
originalFS.lstat = (file, options) => vfs.lstatSync(toFilePath(file), options);
|
|
602
608
|
originalFS.promises.lstat = (file, options) => vfs.lstat(toFilePath(file), options);
|
|
@@ -627,10 +633,10 @@ function patchFS(originalFS, vfs) {
|
|
|
627
633
|
originalFS.promises.lstat = clonedFS.promises.lstat;
|
|
628
634
|
};
|
|
629
635
|
}
|
|
630
|
-
|
|
636
|
+
chunkUSNT2KNT_cjs.__name(patchFS, "patchFS");
|
|
631
637
|
var VirtualFileSystem = class {
|
|
632
638
|
static {
|
|
633
|
-
|
|
639
|
+
chunkUSNT2KNT_cjs.__name(this, "VirtualFileSystem");
|
|
634
640
|
}
|
|
635
641
|
/**
|
|
636
642
|
* The internal map of virtual files.
|
|
@@ -692,25 +698,25 @@ var VirtualFileSystem = class {
|
|
|
692
698
|
/**
|
|
693
699
|
* Exposes the internal VFS map for advanced usage.
|
|
694
700
|
*/
|
|
695
|
-
get [
|
|
701
|
+
get [chunkRF6RSWD4_cjs.__VFS_CACHE__]() {
|
|
696
702
|
return this.#cachedFS;
|
|
697
703
|
}
|
|
698
704
|
/**
|
|
699
705
|
* Exposes the internal VFS resolver cache for advanced usage.
|
|
700
706
|
*/
|
|
701
|
-
get [
|
|
707
|
+
get [chunkRF6RSWD4_cjs.__VFS_RESOLVER__]() {
|
|
702
708
|
return this.#cachedResolver;
|
|
703
709
|
}
|
|
704
710
|
/**
|
|
705
711
|
* Exposes the internal VFS map for advanced usage.
|
|
706
712
|
*/
|
|
707
|
-
get [
|
|
713
|
+
get [chunkRF6RSWD4_cjs.__VFS_VIRTUAL__]() {
|
|
708
714
|
return this.#virtualFS;
|
|
709
715
|
}
|
|
710
716
|
/**
|
|
711
717
|
* Exposes the internal UFS map for advanced usage.
|
|
712
718
|
*/
|
|
713
|
-
get [
|
|
719
|
+
get [chunkRF6RSWD4_cjs.__VFS_UNIFIED__]() {
|
|
714
720
|
return this.#unifiedFS;
|
|
715
721
|
}
|
|
716
722
|
/**
|
|
@@ -718,7 +724,7 @@ var VirtualFileSystem = class {
|
|
|
718
724
|
*/
|
|
719
725
|
get meta() {
|
|
720
726
|
return new Proxy(this.#meta, {
|
|
721
|
-
get: /* @__PURE__ */
|
|
727
|
+
get: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((target, prop) => {
|
|
722
728
|
if (target[prop]) {
|
|
723
729
|
return {
|
|
724
730
|
id: prop,
|
|
@@ -730,12 +736,12 @@ var VirtualFileSystem = class {
|
|
|
730
736
|
}
|
|
731
737
|
return void 0;
|
|
732
738
|
}, "get"),
|
|
733
|
-
set: /* @__PURE__ */
|
|
739
|
+
set: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((target, prop, value) => {
|
|
734
740
|
target[prop] = value;
|
|
735
741
|
this.#ids[value.id || prop] = prop;
|
|
736
742
|
return true;
|
|
737
743
|
}, "set"),
|
|
738
|
-
deleteProperty: /* @__PURE__ */
|
|
744
|
+
deleteProperty: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((target, prop) => {
|
|
739
745
|
delete this.#ids[target[prop]?.id || prop];
|
|
740
746
|
delete target[prop];
|
|
741
747
|
return true;
|
|
@@ -827,13 +833,13 @@ var VirtualFileSystem = class {
|
|
|
827
833
|
}
|
|
828
834
|
this.#log = extendLog(this.#context.log, "virtual-file-system");
|
|
829
835
|
}
|
|
830
|
-
[
|
|
836
|
+
[chunkRF6RSWD4_cjs.__VFS_INIT__]() {
|
|
831
837
|
if (!this.#isPatched && this.#context.config.output.mode !== "fs") {
|
|
832
838
|
this.#revert = patchFS(fs__default.default, this);
|
|
833
839
|
this.#isPatched = true;
|
|
834
840
|
}
|
|
835
841
|
}
|
|
836
|
-
[
|
|
842
|
+
[chunkRF6RSWD4_cjs.__VFS_REVERT__]() {
|
|
837
843
|
if (this.#isPatched && this.#context.config.output.mode !== "fs") {
|
|
838
844
|
if (!this.#revert) {
|
|
839
845
|
throw new Error("Attempting to revert File System patch prior to calling `__init__` function");
|
|
@@ -949,7 +955,7 @@ var VirtualFileSystem = class {
|
|
|
949
955
|
return;
|
|
950
956
|
}
|
|
951
957
|
this.#log(types.LogLevelLabel.TRACE, `Synchronously removing directory: ${formattedPath}`);
|
|
952
|
-
this.resolveFS(path, options).rmdirSync(formattedPath,
|
|
958
|
+
this.resolveFS(path, options).rmdirSync(formattedPath, defu4__default.default(options, {
|
|
953
959
|
recursive: true
|
|
954
960
|
}));
|
|
955
961
|
this.#cachedFS.delete(formattedPath);
|
|
@@ -969,14 +975,14 @@ var VirtualFileSystem = class {
|
|
|
969
975
|
}
|
|
970
976
|
this.#log(types.LogLevelLabel.TRACE, `Removing directory: ${formattedPath}`);
|
|
971
977
|
if (isFunction.isFunction(this.resolveFS(path, options).promises.rm)) {
|
|
972
|
-
await this.resolveFS(path, options).promises.rm(formattedPath,
|
|
978
|
+
await this.resolveFS(path, options).promises.rm(formattedPath, defu4__default.default(options, {
|
|
973
979
|
force: true,
|
|
974
980
|
recursive: true
|
|
975
981
|
}));
|
|
976
982
|
this.#cachedFS.delete(formattedPath);
|
|
977
983
|
this.clearResolverCache(formattedPath);
|
|
978
984
|
} else {
|
|
979
|
-
this.rmdirSync(formattedPath,
|
|
985
|
+
this.rmdirSync(formattedPath, defu4__default.default(options ?? {}, {
|
|
980
986
|
force: true,
|
|
981
987
|
recursive: true
|
|
982
988
|
}));
|
|
@@ -1019,7 +1025,7 @@ var VirtualFileSystem = class {
|
|
|
1019
1025
|
mkdirSync(path, options = {}) {
|
|
1020
1026
|
const filePath = toFilePath(path);
|
|
1021
1027
|
this.clearResolverCache(filePath);
|
|
1022
|
-
return this.resolveFS(filePath, options).mkdirSync(filePath,
|
|
1028
|
+
return this.resolveFS(filePath, options).mkdirSync(filePath, defu4__default.default(options ?? {}, {
|
|
1023
1029
|
recursive: true
|
|
1024
1030
|
}));
|
|
1025
1031
|
}
|
|
@@ -1034,11 +1040,11 @@ var VirtualFileSystem = class {
|
|
|
1034
1040
|
let result;
|
|
1035
1041
|
const filePath = toFilePath(path);
|
|
1036
1042
|
if (isFunction.isFunction(this.resolveFS(filePath, options).promises.mkdir)) {
|
|
1037
|
-
result = await this.resolveFS(filePath, options).promises.mkdir(filePath,
|
|
1043
|
+
result = await this.resolveFS(filePath, options).promises.mkdir(filePath, defu4__default.default(options ?? {}, {
|
|
1038
1044
|
recursive: true
|
|
1039
1045
|
}));
|
|
1040
1046
|
} else {
|
|
1041
|
-
result = this.resolveFS(filePath, options).mkdirSync(filePath,
|
|
1047
|
+
result = this.resolveFS(filePath, options).mkdirSync(filePath, defu4__default.default(options ?? {}, {
|
|
1042
1048
|
recursive: true
|
|
1043
1049
|
}));
|
|
1044
1050
|
}
|
|
@@ -1721,14 +1727,14 @@ function createVfs(context) {
|
|
|
1721
1727
|
const vfs = new VirtualFileSystem(context);
|
|
1722
1728
|
return vfs;
|
|
1723
1729
|
}
|
|
1724
|
-
|
|
1730
|
+
chunkUSNT2KNT_cjs.__name(createVfs, "createVfs");
|
|
1725
1731
|
|
|
1726
1732
|
// src/internal/contexts/context.ts
|
|
1727
1733
|
var configCache = /* @__PURE__ */ new WeakMap();
|
|
1728
1734
|
var parseCache = /* @__PURE__ */ new WeakMap();
|
|
1729
1735
|
var PowerlinesContext = class _PowerlinesContext {
|
|
1730
1736
|
static {
|
|
1731
|
-
|
|
1737
|
+
chunkUSNT2KNT_cjs.__name(this, "PowerlinesContext");
|
|
1732
1738
|
}
|
|
1733
1739
|
#workspaceConfig;
|
|
1734
1740
|
#checksum = null;
|
|
@@ -1980,7 +1986,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1980
1986
|
return this.fs.writeFile(isType.isAbsolute(path) ? path : append.appendPath(path, this.entryPath), {
|
|
1981
1987
|
code,
|
|
1982
1988
|
variant: "entry"
|
|
1983
|
-
},
|
|
1989
|
+
}, defu4__default.default(options, {
|
|
1984
1990
|
mode: this.config.output.mode
|
|
1985
1991
|
}));
|
|
1986
1992
|
}
|
|
@@ -1997,7 +2003,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1997
2003
|
id,
|
|
1998
2004
|
code,
|
|
1999
2005
|
variant: "builtin"
|
|
2000
|
-
},
|
|
2006
|
+
}, defu4__default.default(options, {
|
|
2001
2007
|
mode: this.config.output.mode
|
|
2002
2008
|
}));
|
|
2003
2009
|
}
|
|
@@ -2019,7 +2025,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2019
2025
|
options
|
|
2020
2026
|
});
|
|
2021
2027
|
}
|
|
2022
|
-
const result = await oxcParser.parseAsync(id, code,
|
|
2028
|
+
const result = await oxcParser.parseAsync(id, code, defu4__default.default(options ?? {}, {
|
|
2023
2029
|
lang: filePathFns.hasFileExtension(id) ? void 0 : "ts",
|
|
2024
2030
|
astType: filePathFns.hasFileExtension(id) ? void 0 : "ts",
|
|
2025
2031
|
sourceType: "module",
|
|
@@ -2121,6 +2127,7 @@ ${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.co
|
|
|
2121
2127
|
mode: (config.mode ?? this.config.mode) || this.workspaceConfig.mode,
|
|
2122
2128
|
skipCache: config.skipCache ?? this.config.skipCache ?? false,
|
|
2123
2129
|
configFile: config.configFile ?? this.config.configFile,
|
|
2130
|
+
framework: config.framework ?? this.config.framework ?? "powerlines",
|
|
2124
2131
|
command: this.config.inlineConfig?.command
|
|
2125
2132
|
};
|
|
2126
2133
|
if (configCache.has(cacheKey)) {
|
|
@@ -2147,7 +2154,7 @@ ${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.co
|
|
|
2147
2154
|
mode: cacheKey.mode,
|
|
2148
2155
|
skipCache: cacheKey.skipCache
|
|
2149
2156
|
});
|
|
2150
|
-
const userConfig = await loadUserConfigFile(cacheKey.projectRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile);
|
|
2157
|
+
const userConfig = await loadUserConfigFile(cacheKey.projectRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile, cacheKey.framework);
|
|
2151
2158
|
this.mergeUserConfig(userConfig.config);
|
|
2152
2159
|
configCache.set(cacheKey, {
|
|
2153
2160
|
projectJson: this.projectJson,
|
|
@@ -2158,7 +2165,7 @@ ${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.co
|
|
|
2158
2165
|
});
|
|
2159
2166
|
}
|
|
2160
2167
|
if (isSetObject.isSetObject(config)) {
|
|
2161
|
-
this.resolvedConfig =
|
|
2168
|
+
this.resolvedConfig = defu4__default.default({
|
|
2162
2169
|
inlineConfig: this.config.inlineConfig,
|
|
2163
2170
|
userConfig: this.config.userConfig
|
|
2164
2171
|
}, options.isHighPriority ? this.#getConfigProps(config) : {}, {
|
|
@@ -2254,7 +2261,7 @@ ${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.co
|
|
|
2254
2261
|
}, []);
|
|
2255
2262
|
}
|
|
2256
2263
|
mergeUserConfig(from = {}, into = this.config.userConfig ?? {}) {
|
|
2257
|
-
this.config.userConfig =
|
|
2264
|
+
this.config.userConfig = defu4__default.default({
|
|
2258
2265
|
entry: Array.isArray(from.entry) && from.entry.length > 0 ? from.entry : Array.isArray(into?.entry) && into.entry.length > 0 ? into.entry : []
|
|
2259
2266
|
}, omit.omit(from ?? {}, [
|
|
2260
2267
|
"entry"
|
|
@@ -2300,22 +2307,22 @@ async function callHook(context, hook, options, ...args) {
|
|
|
2300
2307
|
if (definedResults.length > 0) {
|
|
2301
2308
|
let mergedResult = void 0;
|
|
2302
2309
|
for (const result of definedResults) {
|
|
2303
|
-
mergedResult =
|
|
2310
|
+
mergedResult = defu4.defu(result, mergedResult ?? {});
|
|
2304
2311
|
}
|
|
2305
2312
|
return mergedResult;
|
|
2306
2313
|
}
|
|
2307
2314
|
}
|
|
2308
2315
|
return void 0;
|
|
2309
2316
|
}
|
|
2310
|
-
|
|
2317
|
+
chunkUSNT2KNT_cjs.__name(callHook, "callHook");
|
|
2311
2318
|
|
|
2312
2319
|
// src/internal/contexts/plugin-context.ts
|
|
2313
2320
|
function createPluginContext(plugin, environment) {
|
|
2314
|
-
const normalizeMessage = /* @__PURE__ */
|
|
2321
|
+
const normalizeMessage = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((message) => {
|
|
2315
2322
|
return isString.isString(message) ? message : message.message;
|
|
2316
2323
|
}, "normalizeMessage");
|
|
2317
2324
|
const log = environment.extendLog(plugin.name);
|
|
2318
|
-
const callHookFn = /* @__PURE__ */
|
|
2325
|
+
const callHookFn = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(async (hook, options, ...args) => {
|
|
2319
2326
|
return callHook(environment, hook, {
|
|
2320
2327
|
sequential: true,
|
|
2321
2328
|
...options
|
|
@@ -2366,12 +2373,12 @@ function createPluginContext(plugin, environment) {
|
|
|
2366
2373
|
}
|
|
2367
2374
|
});
|
|
2368
2375
|
}
|
|
2369
|
-
|
|
2376
|
+
chunkUSNT2KNT_cjs.__name(createPluginContext, "createPluginContext");
|
|
2370
2377
|
|
|
2371
2378
|
// src/internal/contexts/environment-context.ts
|
|
2372
2379
|
var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends PowerlinesContext {
|
|
2373
2380
|
static {
|
|
2374
|
-
|
|
2381
|
+
chunkUSNT2KNT_cjs.__name(this, "PowerlinesEnvironmentContext");
|
|
2375
2382
|
}
|
|
2376
2383
|
#hooks = {};
|
|
2377
2384
|
/**
|
|
@@ -2415,7 +2422,7 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends P
|
|
|
2415
2422
|
plugin: resolvedPlugin,
|
|
2416
2423
|
context
|
|
2417
2424
|
});
|
|
2418
|
-
this.#hooks = Object.keys(resolvedPlugin).filter((key) => !
|
|
2425
|
+
this.#hooks = Object.keys(resolvedPlugin).filter((key) => !chunkETKZMGLN_cjs.PLUGIN_NON_HOOK_FIELDS.includes(key)).reduce((ret, key) => {
|
|
2419
2426
|
const hook = key;
|
|
2420
2427
|
const pluginHook = resolvedPlugin[hook];
|
|
2421
2428
|
if (!isPluginHook(pluginHook)) {
|
|
@@ -2489,7 +2496,7 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends P
|
|
|
2489
2496
|
// src/internal/contexts/api-context.ts
|
|
2490
2497
|
var PowerlinesAPIContext = class _PowerlinesAPIContext extends PowerlinesContext {
|
|
2491
2498
|
static {
|
|
2492
|
-
|
|
2499
|
+
chunkUSNT2KNT_cjs.__name(this, "PowerlinesAPIContext");
|
|
2493
2500
|
}
|
|
2494
2501
|
#environments = {};
|
|
2495
2502
|
#plugins = [];
|
|
@@ -2546,284 +2553,73 @@ var PowerlinesAPIContext = class _PowerlinesAPIContext extends PowerlinesContext
|
|
|
2546
2553
|
* @returns A new context instance with the updated environment.
|
|
2547
2554
|
*/
|
|
2548
2555
|
async in(environment) {
|
|
2549
|
-
let context;
|
|
2550
|
-
if (this.environments[environment.name]) {
|
|
2551
|
-
context = this.environments[environment.name];
|
|
2552
|
-
} else {
|
|
2553
|
-
context = await PowerlinesEnvironmentContext.fromConfig(this.workspaceConfig, this.config);
|
|
2554
|
-
}
|
|
2555
|
-
if (isSetObject.isSetObject(this.config.inlineConfig)) {
|
|
2556
|
-
await context.withInlineConfig(this.config.inlineConfig);
|
|
2557
|
-
}
|
|
2558
|
-
context.environment = environment;
|
|
2559
|
-
context.plugins = [];
|
|
2560
|
-
for (const plugin of this.plugins) {
|
|
2561
|
-
await context.addPlugin(plugin);
|
|
2562
|
-
}
|
|
2563
|
-
return context;
|
|
2564
|
-
}
|
|
2565
|
-
async addPlugin(plugin) {
|
|
2566
|
-
this.plugins.push(plugin);
|
|
2567
|
-
await Promise.all(Object.keys(this.environments).map(async (name) => {
|
|
2568
|
-
await this.environments[name].addPlugin(plugin);
|
|
2569
|
-
}));
|
|
2570
|
-
}
|
|
2571
|
-
async getEnvironment(name) {
|
|
2572
|
-
let environment;
|
|
2573
|
-
if (name) {
|
|
2574
|
-
environment = this.environments[name];
|
|
2575
|
-
}
|
|
2576
|
-
if (Object.keys(this.environments).length === 1) {
|
|
2577
|
-
environment = this.environments[Object.keys(this.environments)[0]];
|
|
2578
|
-
this.log(types.LogLevelLabel.DEBUG, `Applying the only configured environment: ${chalk5__default.default.bold.cyanBright(environment?.environment.name)}`);
|
|
2579
|
-
}
|
|
2580
|
-
if (!environment) {
|
|
2581
|
-
if (name) {
|
|
2582
|
-
throw new Error(`Environment "${name}" not found.`);
|
|
2583
|
-
}
|
|
2584
|
-
environment = await this.in(createDefaultEnvironment(this.config.userConfig));
|
|
2585
|
-
this.log(types.LogLevelLabel.WARN, `No environment specified, and no default environment found. Using a temporary default environment: ${chalk5__default.default.bold.cyanBright(environment?.environment.name)}`);
|
|
2586
|
-
}
|
|
2587
|
-
return environment;
|
|
2588
|
-
}
|
|
2589
|
-
async getEnvironmentSafe(name) {
|
|
2590
|
-
try {
|
|
2591
|
-
return await this.getEnvironment(name);
|
|
2592
|
-
} catch {
|
|
2593
|
-
return void 0;
|
|
2594
|
-
}
|
|
2595
|
-
}
|
|
2596
|
-
};
|
|
2597
|
-
function getBaseFileHeader(context) {
|
|
2598
|
-
return `
|
|
2599
|
-
// Generated with ${titleCase.titleCase(context.config.framework)}
|
|
2600
|
-
// Note: Do not edit this file manually - it will be overwritten automatically
|
|
2601
|
-
`;
|
|
2602
|
-
}
|
|
2603
|
-
chunkPK6SKIKE_cjs.__name(getBaseFileHeader, "getBaseFileHeader");
|
|
2604
|
-
function getFileHeader(context, options = {}) {
|
|
2605
|
-
const { directive = null, prettierIgnore = false } = options;
|
|
2606
|
-
return `/* eslint-disable */
|
|
2607
|
-
// biome-ignore lint: disable
|
|
2608
|
-
${prettierIgnore ? `// prettier-ignore` : ""}${directive ? `
|
|
2609
|
-
|
|
2610
|
-
${directive}
|
|
2611
|
-
` : "\n"}
|
|
2612
|
-
${getBaseFileHeader(context)}
|
|
2613
|
-
|
|
2614
|
-
`;
|
|
2615
|
-
}
|
|
2616
|
-
chunkPK6SKIKE_cjs.__name(getFileHeader, "getFileHeader");
|
|
2617
|
-
function getString(code) {
|
|
2618
|
-
if (!code) {
|
|
2619
|
-
return "";
|
|
2620
|
-
}
|
|
2621
|
-
if (isString.isString(code)) {
|
|
2622
|
-
return code;
|
|
2623
|
-
}
|
|
2624
|
-
if (isSetObject.isSetObject(code) && "code" in code) {
|
|
2625
|
-
return code.code;
|
|
2626
|
-
}
|
|
2627
|
-
return code.toString();
|
|
2628
|
-
}
|
|
2629
|
-
chunkPK6SKIKE_cjs.__name(getString, "getString");
|
|
2630
|
-
function getMagicString(code) {
|
|
2631
|
-
if (isString.isString(code)) {
|
|
2632
|
-
return new MagicString__default.default(code);
|
|
2633
|
-
}
|
|
2634
|
-
return code;
|
|
2635
|
-
}
|
|
2636
|
-
chunkPK6SKIKE_cjs.__name(getMagicString, "getMagicString");
|
|
2637
|
-
function getSourceFile(code, id) {
|
|
2638
|
-
const content = code ?? readFile.readFileIfExistingSync(id);
|
|
2639
|
-
return {
|
|
2640
|
-
id,
|
|
2641
|
-
code: getMagicString(content),
|
|
2642
|
-
env: []
|
|
2643
|
-
};
|
|
2644
|
-
}
|
|
2645
|
-
chunkPK6SKIKE_cjs.__name(getSourceFile, "getSourceFile");
|
|
2646
|
-
function resolveModulePath(nodePath, state) {
|
|
2647
|
-
if (!t__namespace.isStringLiteral(nodePath.node)) {
|
|
2648
|
-
return;
|
|
2649
|
-
}
|
|
2650
|
-
const sourcePath = nodePath.node.value;
|
|
2651
|
-
const resolvedPath = state.context?.fs.resolve(sourcePath);
|
|
2652
|
-
if (resolvedPath) {
|
|
2653
|
-
nodePath.replaceWith(t__namespace.stringLiteral(
|
|
2654
|
-
// Remove the file extension if it exists
|
|
2655
|
-
resolvedPath.replace(/\.(?:ts|mts|cts)x?$/, "")
|
|
2656
|
-
));
|
|
2657
|
-
}
|
|
2658
|
-
}
|
|
2659
|
-
chunkPK6SKIKE_cjs.__name(resolveModulePath, "resolveModulePath");
|
|
2660
|
-
var TRANSFORM_FUNCTIONS = [
|
|
2661
|
-
"require",
|
|
2662
|
-
"require.resolve",
|
|
2663
|
-
"System.import",
|
|
2664
|
-
// Jest methods
|
|
2665
|
-
"jest.genMockFromModule",
|
|
2666
|
-
"jest.mock",
|
|
2667
|
-
"jest.unmock",
|
|
2668
|
-
"jest.doMock",
|
|
2669
|
-
// eslint-disable-next-line @cspell/spellchecker
|
|
2670
|
-
"jest.dontMock",
|
|
2671
|
-
"jest.setMock",
|
|
2672
|
-
"jest.requireActual",
|
|
2673
|
-
"jest.requireMock",
|
|
2674
|
-
// Older Jest methods
|
|
2675
|
-
"require.requireActual",
|
|
2676
|
-
"require.requireMock"
|
|
2677
|
-
];
|
|
2678
|
-
function matchesPattern(state, calleePath, pattern) {
|
|
2679
|
-
const { node } = calleePath;
|
|
2680
|
-
if (t__namespace.isMemberExpression(node)) {
|
|
2681
|
-
return calleePath.matchesPattern(pattern);
|
|
2556
|
+
let context;
|
|
2557
|
+
if (this.environments[environment.name]) {
|
|
2558
|
+
context = this.environments[environment.name];
|
|
2559
|
+
} else {
|
|
2560
|
+
context = await PowerlinesEnvironmentContext.fromConfig(this.workspaceConfig, this.config);
|
|
2561
|
+
}
|
|
2562
|
+
if (isSetObject.isSetObject(this.config.inlineConfig)) {
|
|
2563
|
+
await context.withInlineConfig(this.config.inlineConfig);
|
|
2564
|
+
}
|
|
2565
|
+
context.environment = environment;
|
|
2566
|
+
context.plugins = [];
|
|
2567
|
+
for (const plugin of this.plugins) {
|
|
2568
|
+
await context.addPlugin(plugin);
|
|
2569
|
+
}
|
|
2570
|
+
return context;
|
|
2682
2571
|
}
|
|
2683
|
-
|
|
2684
|
-
|
|
2572
|
+
async addPlugin(plugin) {
|
|
2573
|
+
this.plugins.push(plugin);
|
|
2574
|
+
await Promise.all(Object.keys(this.environments).map(async (name) => {
|
|
2575
|
+
await this.environments[name].addPlugin(plugin);
|
|
2576
|
+
}));
|
|
2685
2577
|
}
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
var importVisitors = {
|
|
2691
|
-
CallExpression: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((nodePath, state) => {
|
|
2692
|
-
if (state.moduleResolverVisited.has(nodePath)) {
|
|
2693
|
-
return;
|
|
2694
|
-
}
|
|
2695
|
-
const calleePath = nodePath.get("callee");
|
|
2696
|
-
if (calleePath && TRANSFORM_FUNCTIONS.some((pattern) => matchesPattern(state, calleePath, pattern)) || t__namespace.isImport(nodePath.node.callee)) {
|
|
2697
|
-
state.moduleResolverVisited.add(nodePath);
|
|
2698
|
-
resolveModulePath(nodePath.get("arguments.0"), state);
|
|
2578
|
+
async getEnvironment(name) {
|
|
2579
|
+
let environment;
|
|
2580
|
+
if (name) {
|
|
2581
|
+
environment = this.environments[name];
|
|
2699
2582
|
}
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
if (!nodePath || !nodePath.get("source") || state.moduleResolverVisited.has(nodePath)) {
|
|
2704
|
-
return;
|
|
2583
|
+
if (Object.keys(this.environments).length === 1) {
|
|
2584
|
+
environment = this.environments[Object.keys(this.environments)[0]];
|
|
2585
|
+
this.log(types.LogLevelLabel.DEBUG, `Applying the only configured environment: ${chalk5__default.default.bold.cyanBright(environment?.environment.name)}`);
|
|
2705
2586
|
}
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
};
|
|
2710
|
-
var moduleResolverBabelPlugin = /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((context) => {
|
|
2711
|
-
return helperPluginUtils.declare(/* @__PURE__ */ chunkPK6SKIKE_cjs.__name(function builder(api) {
|
|
2712
|
-
let moduleResolverVisited = /* @__PURE__ */ new Set();
|
|
2713
|
-
return {
|
|
2714
|
-
name: "powerlines:module-resolver",
|
|
2715
|
-
manipulateOptions(opts) {
|
|
2716
|
-
opts.filename ??= "unknown";
|
|
2717
|
-
},
|
|
2718
|
-
pre() {
|
|
2719
|
-
moduleResolverVisited = /* @__PURE__ */ new Set();
|
|
2720
|
-
},
|
|
2721
|
-
visitor: {
|
|
2722
|
-
Program: {
|
|
2723
|
-
enter(programPath, state) {
|
|
2724
|
-
programPath.traverse(importVisitors, {
|
|
2725
|
-
...state,
|
|
2726
|
-
context,
|
|
2727
|
-
moduleResolverVisited,
|
|
2728
|
-
api
|
|
2729
|
-
});
|
|
2730
|
-
},
|
|
2731
|
-
exit(programPath, state) {
|
|
2732
|
-
programPath.traverse(importVisitors, {
|
|
2733
|
-
...state,
|
|
2734
|
-
context,
|
|
2735
|
-
moduleResolverVisited,
|
|
2736
|
-
api
|
|
2737
|
-
});
|
|
2738
|
-
}
|
|
2739
|
-
}
|
|
2740
|
-
},
|
|
2741
|
-
post() {
|
|
2742
|
-
moduleResolverVisited.clear();
|
|
2587
|
+
if (!environment) {
|
|
2588
|
+
if (name) {
|
|
2589
|
+
throw new Error(`Environment "${name}" not found.`);
|
|
2743
2590
|
}
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
}, "moduleResolverBabelPlugin");
|
|
2747
|
-
|
|
2748
|
-
// src/internal/helpers/generate-types.ts
|
|
2749
|
-
async function generateTypes(context) {
|
|
2750
|
-
context.log(types.LogLevelLabel.TRACE, `Preparing the TypeScript definitions for the Powerlines project.`);
|
|
2751
|
-
context.log(types.LogLevelLabel.TRACE, "Transforming built-ins runtime modules files.");
|
|
2752
|
-
const builtinFiles = await context.getBuiltins();
|
|
2753
|
-
const builtinFilePaths = await Promise.all(builtinFiles.map(async (file) => {
|
|
2754
|
-
const result = await core.transformAsync(file.code.toString(), {
|
|
2755
|
-
highlightCode: true,
|
|
2756
|
-
code: true,
|
|
2757
|
-
ast: false,
|
|
2758
|
-
cloneInputAst: false,
|
|
2759
|
-
comments: true,
|
|
2760
|
-
sourceType: "module",
|
|
2761
|
-
configFile: false,
|
|
2762
|
-
babelrc: false,
|
|
2763
|
-
envName: context.config.mode,
|
|
2764
|
-
caller: {
|
|
2765
|
-
name: "powerlines"
|
|
2766
|
-
},
|
|
2767
|
-
...context.config.transform.babel,
|
|
2768
|
-
filename: file.path,
|
|
2769
|
-
plugins: [
|
|
2770
|
-
[
|
|
2771
|
-
"@babel/plugin-syntax-typescript"
|
|
2772
|
-
],
|
|
2773
|
-
[
|
|
2774
|
-
moduleResolverBabelPlugin(context)
|
|
2775
|
-
]
|
|
2776
|
-
]
|
|
2777
|
-
});
|
|
2778
|
-
if (!result?.code) {
|
|
2779
|
-
throw new Error(`Powerlines - Generate Types failed to compile ${file.id}`);
|
|
2591
|
+
environment = await this.in(createDefaultEnvironment(this.config.userConfig));
|
|
2592
|
+
this.log(types.LogLevelLabel.WARN, `No environment specified, and no default environment found. Using a temporary default environment: ${chalk5__default.default.bold.cyanBright(environment?.environment.name)}`);
|
|
2780
2593
|
}
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
compilerOptions: {
|
|
2801
|
-
strict: false,
|
|
2802
|
-
noEmit: false,
|
|
2803
|
-
declaration: true,
|
|
2804
|
-
declarationMap: false,
|
|
2805
|
-
emitDeclarationOnly: true,
|
|
2806
|
-
skipLibCheck: true
|
|
2807
|
-
},
|
|
2808
|
-
exclude: [
|
|
2809
|
-
"node_modules",
|
|
2810
|
-
"dist"
|
|
2811
|
-
],
|
|
2812
|
-
include: files
|
|
2813
|
-
}, context.config.tsconfigRaw ?? {}));
|
|
2814
|
-
resolvedTsconfig.options.configFilePath = joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.tsconfig.tsconfigFilePath);
|
|
2815
|
-
resolvedTsconfig.options.pathsBasePath = context.workspaceConfig.workspaceRoot;
|
|
2816
|
-
resolvedTsconfig.options.suppressOutputPathCheck = true;
|
|
2594
|
+
return environment;
|
|
2595
|
+
}
|
|
2596
|
+
async getEnvironmentSafe(name) {
|
|
2597
|
+
try {
|
|
2598
|
+
return await this.getEnvironment(name);
|
|
2599
|
+
} catch {
|
|
2600
|
+
return void 0;
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
};
|
|
2604
|
+
function formatTypes(code) {
|
|
2605
|
+
return code.replace(
|
|
2606
|
+
// eslint-disable-next-line regexp/no-super-linear-backtracking
|
|
2607
|
+
/import\s*(?:type\s*)?\{?[\w,\s]*(?:\}\s*)?from\s*(?:'|")@?[a-zA-Z0-9-\\/.]*(?:'|");?/g,
|
|
2608
|
+
""
|
|
2609
|
+
).replaceAll("#private;", "").replace(/__Ω/g, "");
|
|
2610
|
+
}
|
|
2611
|
+
chunkUSNT2KNT_cjs.__name(formatTypes, "formatTypes");
|
|
2612
|
+
async function emitTypes(context, tsconfig, files) {
|
|
2817
2613
|
context.log(types.LogLevelLabel.TRACE, "Creating the TypeScript compiler host");
|
|
2818
|
-
const program = ts2.createProgram(files,
|
|
2819
|
-
context.log(types.LogLevelLabel.TRACE, `Running TypeScript compiler
|
|
2614
|
+
const program = ts2.createProgram(files, tsconfig.options, ts2.createCompilerHost(tsconfig.options));
|
|
2615
|
+
context.log(types.LogLevelLabel.TRACE, `Running the TypeScript compiler for ${context.builtins.length} built-in runtime files.`);
|
|
2820
2616
|
let builtinModules = "";
|
|
2821
2617
|
const emitResult = program.emit(void 0, (fileName, text, _, __, sourceFiles, _data) => {
|
|
2822
|
-
const
|
|
2823
|
-
if (
|
|
2824
|
-
if (
|
|
2618
|
+
const sourceFile = sourceFiles?.[0];
|
|
2619
|
+
if (sourceFile?.fileName && !fileName.endsWith(".map")) {
|
|
2620
|
+
if (context.builtins.some((file) => file === sourceFile.fileName || context.fs.meta[file]?.id && context.fs.meta[file]?.id === sourceFile.fileName)) {
|
|
2825
2621
|
builtinModules += `
|
|
2826
|
-
declare module "${context.fs.resolve(
|
|
2622
|
+
declare module "${context.fs.resolve(sourceFile.fileName)}" {
|
|
2827
2623
|
${text.trim().replace(/^\s*export\s*declare\s*/gm, "export ").replace(/^\s*declare\s*/gm, "")}
|
|
2828
2624
|
}
|
|
2829
2625
|
`;
|
|
@@ -2848,25 +2644,9 @@ declare module "${context.fs.resolve(sourceFile2.fileName)}" {
|
|
|
2848
2644
|
|
|
2849
2645
|
${diagnosticMessage.length > 5e3 ? `${diagnosticMessage.slice(0, 5e3)}...` : diagnosticMessage}`);
|
|
2850
2646
|
}
|
|
2851
|
-
|
|
2852
|
-
const sourceFile = getSourceFile(String(context.config.output.dts), `/// <reference types="powerlines/shared" />${context.config.build.platform !== "neutral" ? `
|
|
2853
|
-
/// <reference types="powerlines/${context.config.build.platform}" />` : ""}
|
|
2854
|
-
|
|
2855
|
-
${getFileHeader(context, {
|
|
2856
|
-
directive: null,
|
|
2857
|
-
prettierIgnore: false
|
|
2858
|
-
})}
|
|
2859
|
-
|
|
2860
|
-
${builtinModules}`.replace(
|
|
2861
|
-
// eslint-disable-next-line regexp/no-super-linear-backtracking
|
|
2862
|
-
/import\s*(?:type\s*)?\{?[\w,\s]*(?:\}\s*)?from\s*(?:'|")@?[a-zA-Z0-9-\\/.]*(?:'|");?/g,
|
|
2863
|
-
""
|
|
2864
|
-
).replaceAll("#private;", "").replace(/__Ω/g, ""));
|
|
2865
|
-
await context.fs.writeFile(sourceFile.id, getString(sourceFile.code), {
|
|
2866
|
-
mode: "fs"
|
|
2867
|
-
});
|
|
2647
|
+
return formatTypes(builtinModules);
|
|
2868
2648
|
}
|
|
2869
|
-
|
|
2649
|
+
chunkUSNT2KNT_cjs.__name(emitTypes, "emitTypes");
|
|
2870
2650
|
async function installPackage(context, packageName, dev = false) {
|
|
2871
2651
|
if (!await packageFns.isPackageListed(_package.getPackageName(packageName), {
|
|
2872
2652
|
cwd: context.config.projectRoot
|
|
@@ -2896,13 +2676,18 @@ async function installPackage(context, packageName, dev = false) {
|
|
|
2896
2676
|
}
|
|
2897
2677
|
}
|
|
2898
2678
|
}
|
|
2899
|
-
|
|
2679
|
+
chunkUSNT2KNT_cjs.__name(installPackage, "installPackage");
|
|
2900
2680
|
|
|
2901
2681
|
// src/internal/helpers/install-dependencies.ts
|
|
2902
2682
|
async function installDependencies(context) {
|
|
2903
2683
|
context.log(types.LogLevelLabel.TRACE, `Checking and installing missing project dependencies.`);
|
|
2904
2684
|
context.dependencies ??= {};
|
|
2905
|
-
context.
|
|
2685
|
+
context.devDependencies ??= {};
|
|
2686
|
+
if (Object.keys(context.dependencies).length === 0 && Object.keys(context.devDependencies).length === 0) {
|
|
2687
|
+
context.log(types.LogLevelLabel.TRACE, `No dependencies or devDependencies to install. Skipping installation step.`);
|
|
2688
|
+
return;
|
|
2689
|
+
}
|
|
2690
|
+
context.log(types.LogLevelLabel.DEBUG, `The following packages are required:
|
|
2906
2691
|
Dependencies:
|
|
2907
2692
|
${Object.entries(context.dependencies).map(([name, version]) => `- ${name}@${String(version)}`).join(" \n")}
|
|
2908
2693
|
|
|
@@ -2913,7 +2698,109 @@ ${Object.entries(context.devDependencies).map(([name, version]) => `- ${name}@${
|
|
|
2913
2698
|
Promise.all(Object.entries(context.devDependencies).map(async ([name, version]) => installPackage(context, `${_package.getPackageName(name)}@${String(version)}`, true)))
|
|
2914
2699
|
]);
|
|
2915
2700
|
}
|
|
2916
|
-
|
|
2701
|
+
chunkUSNT2KNT_cjs.__name(installDependencies, "installDependencies");
|
|
2702
|
+
function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig = "tsconfig.json") {
|
|
2703
|
+
let tsconfigFilePath = tsconfig;
|
|
2704
|
+
if (!exists.existsSync(tsconfigFilePath)) {
|
|
2705
|
+
tsconfigFilePath = append.appendPath(tsconfig, projectRoot);
|
|
2706
|
+
if (!exists.existsSync(tsconfigFilePath)) {
|
|
2707
|
+
tsconfigFilePath = append.appendPath(tsconfig, workspaceRoot);
|
|
2708
|
+
if (!exists.existsSync(tsconfigFilePath)) {
|
|
2709
|
+
tsconfigFilePath = append.appendPath(tsconfig, joinPaths.joinPaths(workspaceRoot, projectRoot));
|
|
2710
|
+
if (!exists.existsSync(tsconfigFilePath)) {
|
|
2711
|
+
throw new Error(`Cannot find the \`tsconfig.json\` configuration file at ${tsconfig}, ${append.appendPath(tsconfig, projectRoot)}, ${append.appendPath(tsconfig, workspaceRoot)}, or ${tsconfigFilePath}`);
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
return tsconfigFilePath;
|
|
2717
|
+
}
|
|
2718
|
+
chunkUSNT2KNT_cjs.__name(getTsconfigFilePath, "getTsconfigFilePath");
|
|
2719
|
+
function findMatch(tsconfigType, types, extensions = [
|
|
2720
|
+
".ts",
|
|
2721
|
+
".tsx",
|
|
2722
|
+
".d.ts"
|
|
2723
|
+
]) {
|
|
2724
|
+
return types.find((type) => tsconfigType?.toString().toLowerCase() === type?.toString().toLowerCase() || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}` || `./${tsconfigType?.toString().toLowerCase()}` === type?.toString().toLowerCase() || extensions.some((ext) => `${tsconfigType?.toString().toLowerCase()}${ext}` === type?.toString().toLowerCase() || `${tsconfigType?.toString().toLowerCase()}${ext}` === `./${type?.toString().toLowerCase()}` || `${type?.toString().toLowerCase()}${ext}` === `./${tsconfigType?.toString().toLowerCase()}` || tsconfigType?.toString().toLowerCase() === `${type?.toString().toLowerCase()}${ext}` || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}${ext}` || type?.toString().toLowerCase() === `./${tsconfigType?.toString().toLowerCase()}${ext}`));
|
|
2725
|
+
}
|
|
2726
|
+
chunkUSNT2KNT_cjs.__name(findMatch, "findMatch");
|
|
2727
|
+
function findIncludeMatch(tsconfigType, types) {
|
|
2728
|
+
return findMatch(tsconfigType, types, [
|
|
2729
|
+
".ts",
|
|
2730
|
+
".tsx",
|
|
2731
|
+
".d.ts",
|
|
2732
|
+
".js",
|
|
2733
|
+
".jsx",
|
|
2734
|
+
".mjs",
|
|
2735
|
+
".cjs",
|
|
2736
|
+
".mts",
|
|
2737
|
+
".cts",
|
|
2738
|
+
"/*.ts",
|
|
2739
|
+
"/*.tsx",
|
|
2740
|
+
"/*.d.ts",
|
|
2741
|
+
"/*.js",
|
|
2742
|
+
"/*.jsx",
|
|
2743
|
+
"/*.mjs",
|
|
2744
|
+
"/*.cjs",
|
|
2745
|
+
"/*.mts",
|
|
2746
|
+
"/*.cts",
|
|
2747
|
+
"/**/*.ts",
|
|
2748
|
+
"/**/*.tsx",
|
|
2749
|
+
"/**/*.d.ts",
|
|
2750
|
+
"/**/*.js",
|
|
2751
|
+
"/**/*.jsx",
|
|
2752
|
+
"/**/*.mjs",
|
|
2753
|
+
"/**/*.cjs",
|
|
2754
|
+
"/**/*.mts",
|
|
2755
|
+
"/**/*.cts"
|
|
2756
|
+
]);
|
|
2757
|
+
}
|
|
2758
|
+
chunkUSNT2KNT_cjs.__name(findIncludeMatch, "findIncludeMatch");
|
|
2759
|
+
function isIncludeMatchFound(tsconfigType, types) {
|
|
2760
|
+
return findIncludeMatch(tsconfigType, types) !== void 0;
|
|
2761
|
+
}
|
|
2762
|
+
chunkUSNT2KNT_cjs.__name(isIncludeMatchFound, "isIncludeMatchFound");
|
|
2763
|
+
function getParsedTypeScriptConfig(workspaceRoot, projectRoot, tsconfig, tsconfigRaw = {}, originalTsconfigJson, host = ts2__default.default.sys) {
|
|
2764
|
+
const tsconfigFilePath = getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig);
|
|
2765
|
+
const tsconfigJson = json.readJsonFileSync(tsconfigFilePath);
|
|
2766
|
+
if (!tsconfigJson) {
|
|
2767
|
+
throw new Error(`Cannot find the \`tsconfig.json\` configuration file at ${joinPaths.joinPaths(projectRoot, tsconfig ?? "tsconfig.json")}`);
|
|
2768
|
+
}
|
|
2769
|
+
const parsedCommandLine = ts2__default.default.parseJsonConfigFileContent(defu4__default.default(tsconfigRaw ?? {}, tsconfigJson), host, append.appendPath(projectRoot, workspaceRoot));
|
|
2770
|
+
if (parsedCommandLine.errors.length > 0) {
|
|
2771
|
+
const errorMessage = `Cannot parse the TypeScript compiler options. Please investigate the following issues:
|
|
2772
|
+
${parsedCommandLine.errors.map((error) => `- ${(error.category !== void 0 && error.code ? `[${error.category}-${error.code}]: ` : "") + error.messageText.toString()}`).join("\n")}
|
|
2773
|
+
`;
|
|
2774
|
+
throw new Error(errorMessage);
|
|
2775
|
+
}
|
|
2776
|
+
return {
|
|
2777
|
+
...parsedCommandLine,
|
|
2778
|
+
originalTsconfigJson: originalTsconfigJson ?? tsconfigJson,
|
|
2779
|
+
tsconfigJson,
|
|
2780
|
+
tsconfigFilePath
|
|
2781
|
+
};
|
|
2782
|
+
}
|
|
2783
|
+
chunkUSNT2KNT_cjs.__name(getParsedTypeScriptConfig, "getParsedTypeScriptConfig");
|
|
2784
|
+
async function writeFile(log, filepath, content, skipFormat = false) {
|
|
2785
|
+
try {
|
|
2786
|
+
if (skipFormat) {
|
|
2787
|
+
await writeFile$1.writeFile(filepath, content);
|
|
2788
|
+
} else {
|
|
2789
|
+
const config = await prettier.resolveConfig(filepath);
|
|
2790
|
+
const formatted = await prettier.format(content, {
|
|
2791
|
+
...config ?? {},
|
|
2792
|
+
filepath
|
|
2793
|
+
});
|
|
2794
|
+
await writeFile$1.writeFile(filepath, formatted || "");
|
|
2795
|
+
}
|
|
2796
|
+
} catch (error) {
|
|
2797
|
+
log(types.LogLevelLabel.ERROR, `Failed to write file ${filepath} to disk
|
|
2798
|
+
${error?.message ? error.message : ""}`);
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
chunkUSNT2KNT_cjs.__name(writeFile, "writeFile");
|
|
2802
|
+
|
|
2803
|
+
// src/internal/helpers/resolve-tsconfig.ts
|
|
2917
2804
|
async function resolveTsconfigChanges(context) {
|
|
2918
2805
|
const tsconfig$1 = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw);
|
|
2919
2806
|
const tsconfigFilePath = getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
@@ -3019,7 +2906,7 @@ async function resolveTsconfigChanges(context) {
|
|
|
3019
2906
|
}
|
|
3020
2907
|
return tsconfigJson;
|
|
3021
2908
|
}
|
|
3022
|
-
|
|
2909
|
+
chunkUSNT2KNT_cjs.__name(resolveTsconfigChanges, "resolveTsconfigChanges");
|
|
3023
2910
|
async function initializeTsconfig(context) {
|
|
3024
2911
|
context.log(types.LogLevelLabel.TRACE, "Initializing TypeScript configuration (tsconfig.json) for the Powerlines project.");
|
|
3025
2912
|
if (!packageFns.isPackageExists("typescript")) {
|
|
@@ -3033,7 +2920,7 @@ async function initializeTsconfig(context) {
|
|
|
3033
2920
|
});
|
|
3034
2921
|
context.tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw, context.tsconfig.originalTsconfigJson);
|
|
3035
2922
|
}
|
|
3036
|
-
|
|
2923
|
+
chunkUSNT2KNT_cjs.__name(initializeTsconfig, "initializeTsconfig");
|
|
3037
2924
|
async function resolveTsconfig(context) {
|
|
3038
2925
|
const updateTsconfigJson = await json.readJsonFile(context.tsconfig.tsconfigFilePath);
|
|
3039
2926
|
if (updateTsconfigJson?.compilerOptions?.types && Array.isArray(updateTsconfigJson.compilerOptions.types) && !updateTsconfigJson.compilerOptions.types.length) {
|
|
@@ -3051,7 +2938,7 @@ async function resolveTsconfig(context) {
|
|
|
3051
2938
|
}
|
|
3052
2939
|
});
|
|
3053
2940
|
const changes = [];
|
|
3054
|
-
const getChanges = /* @__PURE__ */
|
|
2941
|
+
const getChanges = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((difference, property) => {
|
|
3055
2942
|
if (difference.status === "added" || difference.status === "deleted" || difference.status === "updated") {
|
|
3056
2943
|
if (difference.diff) {
|
|
3057
2944
|
for (const diff of difference.diff) {
|
|
@@ -3087,12 +2974,32 @@ async function resolveTsconfig(context) {
|
|
|
3087
2974
|
context.tsconfig.tsconfigJson.compilerOptions ??= {};
|
|
3088
2975
|
context.tsconfig.tsconfigJson.compilerOptions.strict = false;
|
|
3089
2976
|
}
|
|
3090
|
-
|
|
2977
|
+
chunkUSNT2KNT_cjs.__name(resolveTsconfig, "resolveTsconfig");
|
|
2978
|
+
function getBaseFileHeader(context) {
|
|
2979
|
+
return `
|
|
2980
|
+
// Generated with ${titleCase.titleCase(context.config.framework)}
|
|
2981
|
+
// Note: Do not edit this file manually - it will be overwritten automatically
|
|
2982
|
+
`;
|
|
2983
|
+
}
|
|
2984
|
+
chunkUSNT2KNT_cjs.__name(getBaseFileHeader, "getBaseFileHeader");
|
|
2985
|
+
function getFileHeader(context, options = {}) {
|
|
2986
|
+
const { directive = null, prettierIgnore = false } = options;
|
|
2987
|
+
return `/* eslint-disable */
|
|
2988
|
+
// biome-ignore lint: disable
|
|
2989
|
+
${prettierIgnore ? `// prettier-ignore` : ""}${directive ? `
|
|
2990
|
+
|
|
2991
|
+
${directive}
|
|
2992
|
+
` : "\n"}
|
|
2993
|
+
${getBaseFileHeader(context)}
|
|
2994
|
+
|
|
2995
|
+
`;
|
|
2996
|
+
}
|
|
2997
|
+
chunkUSNT2KNT_cjs.__name(getFileHeader, "getFileHeader");
|
|
3091
2998
|
|
|
3092
|
-
// src/
|
|
2999
|
+
// src/api.ts
|
|
3093
3000
|
var PowerlinesAPI = class _PowerlinesAPI {
|
|
3094
3001
|
static {
|
|
3095
|
-
|
|
3002
|
+
chunkUSNT2KNT_cjs.__name(this, "PowerlinesAPI");
|
|
3096
3003
|
}
|
|
3097
3004
|
/**
|
|
3098
3005
|
* The Powerlines context
|
|
@@ -3154,7 +3061,7 @@ ${context.entry.map((entry) => `- ${entry.input.file || entry.file}${entry.outpu
|
|
|
3154
3061
|
context.log(types.LogLevelLabel.TRACE, `Powerlines configuration has been resolved:
|
|
3155
3062
|
|
|
3156
3063
|
${console.formatLogMessage(context.config)}`);
|
|
3157
|
-
context.fs[
|
|
3064
|
+
context.fs[chunkRF6RSWD4_cjs.__VFS_INIT__]();
|
|
3158
3065
|
await writeMetaFile(context);
|
|
3159
3066
|
context.persistedMeta = context.meta;
|
|
3160
3067
|
if (!exists.existsSync(context.cachePath)) {
|
|
@@ -3164,20 +3071,129 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
3164
3071
|
await helpers.createDirectory(context.dataPath);
|
|
3165
3072
|
}
|
|
3166
3073
|
await this.callPreHook(context, "prepare");
|
|
3167
|
-
|
|
3168
|
-
context.log(types.LogLevelLabel.TRACE, "Generating built-in barrel file");
|
|
3169
|
-
}
|
|
3074
|
+
await this.callNormalHook(context, "prepare");
|
|
3170
3075
|
if (context.config.output.dts !== false) {
|
|
3171
|
-
|
|
3076
|
+
context.log(types.LogLevelLabel.TRACE, `Preparing the TypeScript definitions for the Powerlines project.`);
|
|
3077
|
+
context.log(types.LogLevelLabel.TRACE, "Transforming built-ins runtime modules files.");
|
|
3078
|
+
const builtinFilePaths = await Promise.all((await context.getBuiltins()).map(async (file) => {
|
|
3079
|
+
const result2 = await core.transformAsync(file.code.toString(), {
|
|
3080
|
+
highlightCode: true,
|
|
3081
|
+
code: true,
|
|
3082
|
+
ast: false,
|
|
3083
|
+
cloneInputAst: false,
|
|
3084
|
+
comments: true,
|
|
3085
|
+
sourceType: "module",
|
|
3086
|
+
configFile: false,
|
|
3087
|
+
babelrc: false,
|
|
3088
|
+
envName: context.config.mode,
|
|
3089
|
+
caller: {
|
|
3090
|
+
name: "powerlines"
|
|
3091
|
+
},
|
|
3092
|
+
...context.config.transform.babel,
|
|
3093
|
+
filename: file.path,
|
|
3094
|
+
plugins: [
|
|
3095
|
+
[
|
|
3096
|
+
"@babel/plugin-syntax-typescript"
|
|
3097
|
+
],
|
|
3098
|
+
[
|
|
3099
|
+
moduleResolverBabelPlugin(context)
|
|
3100
|
+
]
|
|
3101
|
+
]
|
|
3102
|
+
});
|
|
3103
|
+
if (!result2?.code) {
|
|
3104
|
+
throw new Error(`Powerlines - Generate Types failed to compile ${file.id}`);
|
|
3105
|
+
}
|
|
3106
|
+
context.log(types.LogLevelLabel.TRACE, `Writing transformed built-in runtime file ${file.id}.`);
|
|
3107
|
+
await context.writeBuiltin(result2.code, file.id, file.path);
|
|
3108
|
+
return file.path;
|
|
3109
|
+
}));
|
|
3110
|
+
const typescriptPath = await resolve.resolvePackage("typescript");
|
|
3111
|
+
if (!typescriptPath) {
|
|
3112
|
+
throw new Error("Could not resolve TypeScript package location. Please ensure TypeScript is installed.");
|
|
3113
|
+
}
|
|
3114
|
+
const files = builtinFilePaths.reduce((ret, fileName) => {
|
|
3115
|
+
const formatted = replace.replacePath(fileName, context.workspaceConfig.workspaceRoot);
|
|
3116
|
+
if (!ret.includes(formatted)) {
|
|
3117
|
+
ret.push(formatted);
|
|
3118
|
+
}
|
|
3119
|
+
return ret;
|
|
3120
|
+
}, [
|
|
3121
|
+
joinPaths.joinPaths(typescriptPath, "lib", "lib.esnext.full.d.ts")
|
|
3122
|
+
]);
|
|
3123
|
+
context.log(types.LogLevelLabel.TRACE, "Parsing TypeScript configuration for the Powerlines project.");
|
|
3124
|
+
const resolvedTsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.tsconfig.tsconfigFilePath, defu4__default.default({
|
|
3125
|
+
compilerOptions: {
|
|
3126
|
+
strict: false,
|
|
3127
|
+
noEmit: false,
|
|
3128
|
+
declaration: true,
|
|
3129
|
+
declarationMap: false,
|
|
3130
|
+
emitDeclarationOnly: true,
|
|
3131
|
+
skipLibCheck: true
|
|
3132
|
+
},
|
|
3133
|
+
exclude: [
|
|
3134
|
+
"node_modules",
|
|
3135
|
+
"dist"
|
|
3136
|
+
],
|
|
3137
|
+
include: files
|
|
3138
|
+
}, context.config.tsconfigRaw ?? {}));
|
|
3139
|
+
resolvedTsconfig.options.configFilePath = joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.tsconfig.tsconfigFilePath);
|
|
3140
|
+
resolvedTsconfig.options.pathsBasePath = context.workspaceConfig.workspaceRoot;
|
|
3141
|
+
resolvedTsconfig.options.suppressOutputPathCheck = true;
|
|
3142
|
+
let generatedTypes = await emitTypes(context, resolvedTsconfig, files);
|
|
3143
|
+
context.log(types.LogLevelLabel.TRACE, `Generating TypeScript declaration file in ${context.config.output.dts}.`);
|
|
3144
|
+
const directives = [];
|
|
3145
|
+
let result = await this.callPreHook(context, "generateTypes", generatedTypes);
|
|
3146
|
+
if (result) {
|
|
3147
|
+
if (isSetObject.isSetObject(result)) {
|
|
3148
|
+
generatedTypes = result.code;
|
|
3149
|
+
if (Array.isArray(result.directives) && result.directives.length > 0) {
|
|
3150
|
+
directives.push(...result.directives);
|
|
3151
|
+
}
|
|
3152
|
+
} else if (isSetString.isSetString(result)) {
|
|
3153
|
+
generatedTypes = result;
|
|
3154
|
+
}
|
|
3155
|
+
}
|
|
3156
|
+
result = await this.callNormalHook(context, "generateTypes", generatedTypes);
|
|
3157
|
+
if (result) {
|
|
3158
|
+
if (isSetObject.isSetObject(result)) {
|
|
3159
|
+
generatedTypes = result.code;
|
|
3160
|
+
if (Array.isArray(result.directives) && result.directives.length > 0) {
|
|
3161
|
+
directives.push(...result.directives);
|
|
3162
|
+
}
|
|
3163
|
+
} else if (isSetString.isSetString(result)) {
|
|
3164
|
+
generatedTypes = result;
|
|
3165
|
+
}
|
|
3166
|
+
}
|
|
3167
|
+
result = await this.callPostHook(context, "generateTypes", generatedTypes);
|
|
3168
|
+
if (result) {
|
|
3169
|
+
if (isSetObject.isSetObject(result)) {
|
|
3170
|
+
generatedTypes = result.code;
|
|
3171
|
+
if (Array.isArray(result.directives) && result.directives.length > 0) {
|
|
3172
|
+
directives.push(...result.directives);
|
|
3173
|
+
}
|
|
3174
|
+
} else if (isSetString.isSetString(result)) {
|
|
3175
|
+
generatedTypes = result;
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3178
|
+
await context.fs.writeFile(context.config.output.dts, `${directives ? `${directives.map((directive) => `/// <reference types="${directive}" />`).join("\n")}
|
|
3179
|
+
|
|
3180
|
+
` : ""}${getFileHeader(context, {
|
|
3181
|
+
directive: null,
|
|
3182
|
+
prettierIgnore: false
|
|
3183
|
+
})}
|
|
3184
|
+
|
|
3185
|
+
${formatTypes(generatedTypes)}
|
|
3186
|
+
`, {
|
|
3187
|
+
mode: "fs"
|
|
3188
|
+
});
|
|
3172
3189
|
}
|
|
3173
|
-
await this.callNormalHook(context, "prepare");
|
|
3174
3190
|
context.tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
3175
3191
|
if (!context.tsconfig) {
|
|
3176
3192
|
throw new Error("Failed to parse the TypeScript configuration file.");
|
|
3177
3193
|
}
|
|
3178
3194
|
await this.callPostHook(context, "prepare");
|
|
3179
3195
|
await writeMetaFile(context);
|
|
3180
|
-
context.fs[
|
|
3196
|
+
context.fs[chunkRF6RSWD4_cjs.__VFS_REVERT__]();
|
|
3181
3197
|
});
|
|
3182
3198
|
this.context.log(types.LogLevelLabel.INFO, "Powerlines API has been prepared successfully");
|
|
3183
3199
|
}
|
|
@@ -3336,7 +3352,7 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
3336
3352
|
this.context.log(types.LogLevelLabel.TRACE, "Powerlines finalize execution started");
|
|
3337
3353
|
await this.#executeEnvironments(async (context) => {
|
|
3338
3354
|
await this.callHook(context, "finalize");
|
|
3339
|
-
context.fs[
|
|
3355
|
+
context.fs[chunkRF6RSWD4_cjs.__VFS_REVERT__]();
|
|
3340
3356
|
});
|
|
3341
3357
|
this.context.log(types.LogLevelLabel.TRACE, "Powerlines finalize execution completed");
|
|
3342
3358
|
}
|
|
@@ -3597,6 +3613,3 @@ Note: Please ensure the plugin package's default export is a class that extends
|
|
|
3597
3613
|
|
|
3598
3614
|
exports.PowerlinesAPI = PowerlinesAPI;
|
|
3599
3615
|
exports.createLog = createLog;
|
|
3600
|
-
exports.getString = getString;
|
|
3601
|
-
//# sourceMappingURL=chunk-PJRHRDLS.cjs.map
|
|
3602
|
-
//# sourceMappingURL=chunk-PJRHRDLS.cjs.map
|