powerlines 0.14.1 → 0.14.4
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/README.md +30 -21
- package/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/_virtual/_rolldown/runtime.mjs +36 -0
- package/dist/api.cjs +10 -0
- package/dist/api.d.cts +2 -0
- package/dist/api.d.mts +2 -0
- package/dist/api.mjs +3 -0
- package/dist/astro.cjs +24 -28
- package/dist/astro.d.cts +14 -47
- package/dist/astro.d.cts.map +1 -0
- package/dist/astro.d.mts +25 -0
- package/dist/astro.d.mts.map +1 -0
- package/dist/astro.mjs +25 -0
- package/dist/astro.mjs.map +1 -0
- package/dist/config.cjs +9 -0
- package/dist/config.d.cts +1 -0
- package/dist/config.d.mts +1 -0
- package/dist/config.mjs +3 -0
- package/dist/constants.cjs +9 -0
- package/dist/constants.d.cts +1 -0
- package/dist/constants.d.mts +1 -0
- package/dist/constants.mjs +3 -0
- package/dist/context.cjs +9 -0
- package/dist/context.d.cts +1 -0
- package/dist/context.d.mts +1 -0
- package/dist/context.mjs +3 -0
- package/dist/engine.cjs +30 -0
- package/dist/engine.d.cts +24 -0
- package/dist/engine.d.cts.map +1 -0
- package/dist/engine.d.mts +24 -0
- package/dist/engine.d.mts.map +1 -0
- package/dist/engine.mjs +29 -0
- package/dist/engine.mjs.map +1 -0
- package/dist/esbuild.cjs +51 -23
- package/dist/esbuild.d.cts +13 -45
- package/dist/esbuild.d.cts.map +1 -0
- package/dist/esbuild.d.mts +25 -0
- package/dist/esbuild.d.mts.map +1 -0
- package/dist/esbuild.mjs +43 -0
- package/dist/esbuild.mjs.map +1 -0
- package/dist/farm.cjs +26 -18
- package/dist/farm.d.cts +15 -47
- package/dist/farm.d.cts.map +1 -0
- package/dist/farm.d.mts +25 -0
- package/dist/farm.d.mts.map +1 -0
- package/dist/farm.mjs +26 -0
- package/dist/farm.mjs.map +1 -0
- package/dist/index.cjs +40 -91
- package/dist/index.d.cts +21 -60
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +26 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +34 -0
- package/dist/index.mjs.map +1 -0
- package/dist/next.cjs +35 -27
- package/dist/next.d.cts +6 -4
- package/dist/next.d.cts.map +1 -0
- package/dist/{next.d.ts → next.d.mts} +6 -4
- package/dist/next.d.mts.map +1 -0
- package/dist/next.mjs +36 -0
- package/dist/next.mjs.map +1 -0
- package/dist/nuxt.cjs +44 -29
- package/dist/nuxt.d.cts +19 -10
- package/dist/nuxt.d.cts.map +1 -0
- package/dist/nuxt.d.mts +29 -0
- package/dist/nuxt.d.mts.map +1 -0
- package/dist/nuxt.mjs +44 -0
- package/dist/nuxt.mjs.map +1 -0
- package/dist/package.cjs +18 -0
- package/dist/package.mjs +7 -0
- package/dist/package.mjs.map +1 -0
- package/dist/plugin-utils.cjs +9 -0
- package/dist/plugin-utils.d.cts +1 -0
- package/dist/plugin-utils.d.mts +1 -0
- package/dist/plugin-utils.mjs +3 -0
- package/dist/rolldown.cjs +43 -22
- package/dist/rolldown.d.cts +10 -43
- package/dist/rolldown.d.cts.map +1 -0
- package/dist/rolldown.d.mts +24 -0
- package/dist/rolldown.d.mts.map +1 -0
- package/dist/rolldown.mjs +35 -0
- package/dist/rolldown.mjs.map +1 -0
- package/dist/rollup.cjs +34 -22
- package/dist/rollup.d.cts +11 -43
- package/dist/rollup.d.cts.map +1 -0
- package/dist/rollup.d.mts +25 -0
- package/dist/rollup.d.mts.map +1 -0
- package/dist/rollup.mjs +26 -0
- package/dist/rollup.mjs.map +1 -0
- package/dist/rspack.cjs +34 -22
- package/dist/rspack.d.cts +14 -46
- package/dist/rspack.d.cts.map +1 -0
- package/dist/rspack.d.mts +25 -0
- package/dist/rspack.d.mts.map +1 -0
- package/dist/rspack.mjs +26 -0
- package/dist/rspack.mjs.map +1 -0
- package/dist/schemas.cjs +9 -0
- package/dist/schemas.d.cts +1 -0
- package/dist/schemas.d.mts +1 -0
- package/dist/schemas.mjs +3 -0
- package/dist/storage.cjs +9 -0
- package/dist/storage.d.cts +1 -0
- package/dist/storage.d.mts +1 -0
- package/dist/storage.mjs +3 -0
- package/dist/tsdown.cjs +96 -0
- package/dist/tsdown.d.cts +31 -0
- package/dist/tsdown.d.cts.map +1 -0
- package/dist/tsdown.d.mts +31 -0
- package/dist/tsdown.d.mts.map +1 -0
- package/dist/tsdown.mjs +82 -0
- package/dist/tsdown.mjs.map +1 -0
- package/dist/tsup.cjs +67 -24
- package/dist/tsup.d.cts +12 -8
- package/dist/tsup.d.cts.map +1 -0
- package/dist/{tsup.d.ts → tsup.d.mts} +12 -8
- package/dist/tsup.d.mts.map +1 -0
- package/dist/tsup.mjs +59 -0
- package/dist/tsup.mjs.map +1 -0
- package/dist/types.cjs +0 -0
- package/dist/types.d.cts +8 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +8 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +1 -0
- package/dist/typescript.cjs +9 -0
- package/dist/typescript.d.cts +1 -0
- package/dist/typescript.d.mts +1 -0
- package/dist/typescript.mjs +3 -0
- package/dist/unbuild.cjs +17 -0
- package/dist/unbuild.d.cts +2 -0
- package/dist/unbuild.d.mts +2 -0
- package/dist/unbuild.mjs +3 -0
- package/dist/unloader.cjs +23 -26
- package/dist/unloader.d.cts +11 -45
- package/dist/unloader.d.cts.map +1 -0
- package/dist/unloader.d.mts +22 -0
- package/dist/unloader.d.mts.map +1 -0
- package/dist/unloader.mjs +23 -0
- package/dist/unloader.mjs.map +1 -0
- package/dist/unplugin.cjs +105 -37
- package/dist/unplugin.d.cts +9 -69
- package/dist/unplugin.d.cts.map +1 -0
- package/dist/unplugin.d.mts +17 -0
- package/dist/unplugin.d.mts.map +1 -0
- package/dist/unplugin.mjs +101 -0
- package/dist/unplugin.mjs.map +1 -0
- package/dist/utils.cjs +25 -0
- package/dist/utils.d.cts +3 -0
- package/dist/utils.d.mts +3 -0
- package/dist/utils.mjs +7 -0
- package/dist/vite.cjs +76 -24
- package/dist/vite.d.cts +12 -44
- package/dist/vite.d.cts.map +1 -0
- package/dist/vite.d.mts +25 -0
- package/dist/vite.d.mts.map +1 -0
- package/dist/vite.mjs +66 -0
- package/dist/vite.mjs.map +1 -0
- package/dist/webpack.cjs +34 -23
- package/dist/webpack.d.cts +10 -43
- package/dist/webpack.d.cts.map +1 -0
- package/dist/webpack.d.mts +24 -0
- package/dist/webpack.d.mts.map +1 -0
- package/dist/webpack.mjs +25 -0
- package/dist/webpack.mjs.map +1 -0
- package/files/application/README.md.hbs +16 -42
- package/files/application/package.json.hbs +7 -28
- package/files/common/jest.config.ts.hbs +2 -3
- package/files/common/tsconfig.json.hbs +5 -10
- package/files/common/tsconfig.spec.json.hbs +3 -13
- package/files/library/README.md.hbs +11 -34
- package/files/library/package.json.hbs +9 -32
- package/package.json +253 -342
- package/schemas/fs.capnp +42 -0
- package/dist/astro.d.ts +0 -58
- package/dist/astro.js +0 -11
- package/dist/babel-types.d.ts +0 -292
- package/dist/chunk-22K72CJ5.cjs +0 -18
- package/dist/chunk-2OGPXWHG.js +0 -21
- package/dist/chunk-2VIXD2XB.js +0 -3
- package/dist/chunk-3IM6CTCB.cjs +0 -12
- package/dist/chunk-4AKYOJXA.cjs +0 -20
- package/dist/chunk-4FZTGBHW.cjs +0 -12
- package/dist/chunk-4HGQJ4KR.js +0 -11
- package/dist/chunk-4JCNAKOE.cjs +0 -4
- package/dist/chunk-5A5AK6JI.js +0 -31
- package/dist/chunk-5S33UKRI.js +0 -9
- package/dist/chunk-5VPVJHJO.cjs +0 -18
- package/dist/chunk-6TJGZR5X.js +0 -46
- package/dist/chunk-6ZGIV2SU.cjs +0 -4
- package/dist/chunk-7BZQBW77.cjs +0 -4
- package/dist/chunk-7GVRTQLJ.js +0 -16
- package/dist/chunk-7HF3SEKY.cjs +0 -24
- package/dist/chunk-7QQZH7V2.js +0 -9
- package/dist/chunk-7QVYU63E.js +0 -6
- package/dist/chunk-AFJCY3R6.js +0 -3
- package/dist/chunk-APVMN2H7.cjs +0 -14
- 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-EBMELFCF.js +0 -12
- 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-KMLFL4CW.js +0 -14
- package/dist/chunk-LO77RPRV.js +0 -16
- package/dist/chunk-M6XRJI44.js +0 -9
- package/dist/chunk-MW2CYPK5.cjs +0 -34
- package/dist/chunk-N2RUZCWA.js +0 -9
- package/dist/chunk-N6L2CYXV.js +0 -21
- package/dist/chunk-NVNMK4CE.js +0 -39
- package/dist/chunk-O7GICJVN.cjs +0 -116
- package/dist/chunk-OYASPHNL.js +0 -3
- package/dist/chunk-P4BOYWXT.js +0 -3570
- package/dist/chunk-PJRHRDLS.cjs +0 -3602
- package/dist/chunk-PK6SKIKE.cjs +0 -8
- package/dist/chunk-Q7EJVZVI.cjs +0 -4
- package/dist/chunk-RIOZPUCZ.cjs +0 -34
- package/dist/chunk-SIZKRND7.js +0 -12
- package/dist/chunk-TLHFXGYV.js +0 -3
- package/dist/chunk-TLRPAJU2.cjs +0 -12
- package/dist/chunk-TSWMWZ4U.cjs +0 -12
- package/dist/chunk-UFEM5JTE.cjs +0 -42
- package/dist/chunk-UZQYBO6Z.cjs +0 -52
- package/dist/chunk-V7LXFIGK.js +0 -199
- package/dist/chunk-VNRXLY2T.js +0 -3
- package/dist/chunk-VQCQRLGM.cjs +0 -4
- package/dist/chunk-WA6IOZHV.js +0 -109
- package/dist/chunk-WCTOTE3T.cjs +0 -201
- package/dist/chunk-XBF43VLE.cjs +0 -4
- package/dist/chunk-XZO6ZJQP.cjs +0 -4
- package/dist/chunk-Y5CDUGSN.cjs +0 -12
- package/dist/chunk-YFP5GQWW.js +0 -9
- package/dist/chunk-YIWHO6SW.cjs +0 -14
- 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.d.cts +0 -50
- package/dist/define-config.d.ts +0 -50
- package/dist/define-config.js +0 -4
- package/dist/esbuild.d.ts +0 -57
- package/dist/esbuild.js +0 -10
- package/dist/extend-plugin.cjs +0 -13
- package/dist/extend-plugin.d.cts +0 -48
- package/dist/extend-plugin.d.ts +0 -48
- package/dist/extend-plugin.js +0 -4
- package/dist/farm.d.ts +0 -57
- package/dist/farm.js +0 -14
- package/dist/hooks-Wrj1dKJ9.d.cts +0 -28
- package/dist/hooks-q1Az_C64.d.ts +0 -28
- package/dist/index.d.ts +0 -65
- package/dist/index.js +0 -40
- package/dist/internal/api.cjs +0 -16
- package/dist/internal/api.cjs.map +0 -1
- package/dist/internal/api.d.cts +0 -192
- package/dist/internal/api.d.ts +0 -192
- package/dist/internal/api.js +0 -7
- package/dist/internal/api.js.map +0 -1
- package/dist/lib/build/esbuild.cjs +0 -22
- package/dist/lib/build/esbuild.cjs.map +0 -1
- package/dist/lib/build/esbuild.d.cts +0 -51
- package/dist/lib/build/esbuild.d.ts +0 -51
- package/dist/lib/build/esbuild.js +0 -5
- package/dist/lib/build/esbuild.js.map +0 -1
- package/dist/lib/build/index.cjs +0 -82
- package/dist/lib/build/index.cjs.map +0 -1
- package/dist/lib/build/index.d.cts +0 -41
- package/dist/lib/build/index.d.ts +0 -41
- package/dist/lib/build/index.js +0 -13
- package/dist/lib/build/index.js.map +0 -1
- package/dist/lib/build/rolldown.cjs +0 -14
- package/dist/lib/build/rolldown.cjs.map +0 -1
- package/dist/lib/build/rolldown.d.cts +0 -42
- package/dist/lib/build/rolldown.d.ts +0 -42
- package/dist/lib/build/rolldown.js +0 -5
- package/dist/lib/build/rolldown.js.map +0 -1
- package/dist/lib/build/rollup.cjs +0 -17
- package/dist/lib/build/rollup.cjs.map +0 -1
- package/dist/lib/build/rollup.d.cts +0 -49
- package/dist/lib/build/rollup.d.ts +0 -49
- package/dist/lib/build/rollup.js +0 -4
- package/dist/lib/build/rollup.js.map +0 -1
- package/dist/lib/build/rspack.cjs +0 -13
- package/dist/lib/build/rspack.cjs.map +0 -1
- package/dist/lib/build/rspack.d.cts +0 -42
- package/dist/lib/build/rspack.d.ts +0 -42
- package/dist/lib/build/rspack.js +0 -4
- package/dist/lib/build/rspack.js.map +0 -1
- package/dist/lib/build/tsup.cjs +0 -23
- package/dist/lib/build/tsup.cjs.map +0 -1
- package/dist/lib/build/tsup.d.cts +0 -51
- package/dist/lib/build/tsup.d.ts +0 -51
- package/dist/lib/build/tsup.js +0 -6
- package/dist/lib/build/tsup.js.map +0 -1
- package/dist/lib/build/unbuild.cjs +0 -23
- package/dist/lib/build/unbuild.cjs.map +0 -1
- package/dist/lib/build/unbuild.d.cts +0 -63
- package/dist/lib/build/unbuild.d.ts +0 -63
- package/dist/lib/build/unbuild.js +0 -6
- package/dist/lib/build/unbuild.js.map +0 -1
- package/dist/lib/build/vite.cjs +0 -19
- package/dist/lib/build/vite.cjs.map +0 -1
- package/dist/lib/build/vite.d.cts +0 -43
- package/dist/lib/build/vite.d.ts +0 -43
- package/dist/lib/build/vite.js +0 -6
- package/dist/lib/build/vite.js.map +0 -1
- package/dist/lib/build/webpack.cjs +0 -13
- package/dist/lib/build/webpack.cjs.map +0 -1
- package/dist/lib/build/webpack.d.cts +0 -42
- package/dist/lib/build/webpack.d.ts +0 -42
- package/dist/lib/build/webpack.js +0 -4
- package/dist/lib/build/webpack.js.map +0 -1
- package/dist/lib/chunk-35EO5Y7R.js +0 -50
- package/dist/lib/chunk-35EO5Y7R.js.map +0 -1
- package/dist/lib/chunk-367E23MI.js +0 -48
- 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 +0 -58
- 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 +0 -39
- package/dist/lib/chunk-4XUVP2LL.cjs.map +0 -1
- package/dist/lib/chunk-56LQSSQ3.js +0 -62
- package/dist/lib/chunk-56LQSSQ3.js.map +0 -1
- package/dist/lib/chunk-5PNLONNN.cjs +0 -30
- package/dist/lib/chunk-5PNLONNN.cjs.map +0 -1
- package/dist/lib/chunk-62ZJYXT3.cjs +0 -54
- package/dist/lib/chunk-62ZJYXT3.cjs.map +0 -1
- package/dist/lib/chunk-632PWWU7.cjs +0 -57
- package/dist/lib/chunk-632PWWU7.cjs.map +0 -1
- package/dist/lib/chunk-6BRTJXZ2.js +0 -3333
- package/dist/lib/chunk-6BRTJXZ2.js.map +0 -1
- package/dist/lib/chunk-6IJTWIVJ.cjs +0 -107
- package/dist/lib/chunk-6IJTWIVJ.cjs.map +0 -1
- package/dist/lib/chunk-7EAV6Q7B.cjs +0 -78
- package/dist/lib/chunk-7EAV6Q7B.cjs.map +0 -1
- package/dist/lib/chunk-7LLECRBP.cjs +0 -41
- package/dist/lib/chunk-7LLECRBP.cjs.map +0 -1
- package/dist/lib/chunk-7QVYU63E.js +0 -6
- package/dist/lib/chunk-7QVYU63E.js.map +0 -1
- package/dist/lib/chunk-7R23HVGQ.js +0 -27
- package/dist/lib/chunk-7R23HVGQ.js.map +0 -1
- package/dist/lib/chunk-BEKLDCTV.cjs +0 -95
- package/dist/lib/chunk-BEKLDCTV.cjs.map +0 -1
- package/dist/lib/chunk-BW3VFCTS.cjs +0 -110
- package/dist/lib/chunk-BW3VFCTS.cjs.map +0 -1
- package/dist/lib/chunk-CAPN4FSS.js +0 -152
- package/dist/lib/chunk-CAPN4FSS.js.map +0 -1
- package/dist/lib/chunk-ESYYL5UH.js +0 -105
- package/dist/lib/chunk-ESYYL5UH.js.map +0 -1
- package/dist/lib/chunk-GJNFAFKR.cjs +0 -66
- package/dist/lib/chunk-GJNFAFKR.cjs.map +0 -1
- package/dist/lib/chunk-GWYTWFZE.cjs +0 -72
- 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 +0 -27
- package/dist/lib/chunk-HQ6TGY34.js.map +0 -1
- package/dist/lib/chunk-IK3ABDPP.cjs +0 -64
- package/dist/lib/chunk-IK3ABDPP.cjs.map +0 -1
- package/dist/lib/chunk-JTUL3477.cjs +0 -137
- package/dist/lib/chunk-JTUL3477.cjs.map +0 -1
- package/dist/lib/chunk-KOCDKJDJ.js +0 -96
- package/dist/lib/chunk-KOCDKJDJ.js.map +0 -1
- package/dist/lib/chunk-KSBESEOF.js +0 -169
- package/dist/lib/chunk-KSBESEOF.js.map +0 -1
- package/dist/lib/chunk-LBMMBFQE.js +0 -65
- package/dist/lib/chunk-LBMMBFQE.js.map +0 -1
- package/dist/lib/chunk-LEIOWD2W.js +0 -28
- package/dist/lib/chunk-LEIOWD2W.js.map +0 -1
- package/dist/lib/chunk-LJZEN4HP.cjs +0 -110
- package/dist/lib/chunk-LJZEN4HP.cjs.map +0 -1
- package/dist/lib/chunk-LTVWU4J2.js +0 -47
- package/dist/lib/chunk-LTVWU4J2.js.map +0 -1
- package/dist/lib/chunk-LYD5OTBI.cjs +0 -3362
- package/dist/lib/chunk-LYD5OTBI.cjs.map +0 -1
- package/dist/lib/chunk-MAHHHINV.js +0 -67
- package/dist/lib/chunk-MAHHHINV.js.map +0 -1
- package/dist/lib/chunk-MFC7UJHT.cjs +0 -30
- package/dist/lib/chunk-MFC7UJHT.cjs.map +0 -1
- package/dist/lib/chunk-MGEZC2RV.cjs +0 -69
- package/dist/lib/chunk-MGEZC2RV.cjs.map +0 -1
- package/dist/lib/chunk-MVQSM5WM.cjs +0 -73
- package/dist/lib/chunk-MVQSM5WM.cjs.map +0 -1
- package/dist/lib/chunk-NANLYIUO.cjs +0 -70
- package/dist/lib/chunk-NANLYIUO.cjs.map +0 -1
- package/dist/lib/chunk-NE46WXNJ.js +0 -58
- package/dist/lib/chunk-NE46WXNJ.js.map +0 -1
- package/dist/lib/chunk-ODJBZ6PS.js +0 -39
- package/dist/lib/chunk-ODJBZ6PS.js.map +0 -1
- package/dist/lib/chunk-OF5IJ4WG.js +0 -65
- package/dist/lib/chunk-OF5IJ4WG.js.map +0 -1
- package/dist/lib/chunk-OO4BIM7N.js +0 -98
- 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 +0 -8
- package/dist/lib/chunk-PK6SKIKE.cjs.map +0 -1
- package/dist/lib/chunk-PXSRMP4E.js +0 -39
- package/dist/lib/chunk-PXSRMP4E.js.map +0 -1
- package/dist/lib/chunk-Q2L3FNJO.js +0 -120
- package/dist/lib/chunk-Q2L3FNJO.js.map +0 -1
- package/dist/lib/chunk-Q3KJZ3B5.js +0 -161
- package/dist/lib/chunk-Q3KJZ3B5.js.map +0 -1
- package/dist/lib/chunk-RK2VVGL6.cjs +0 -107
- package/dist/lib/chunk-RK2VVGL6.cjs.map +0 -1
- package/dist/lib/chunk-RLMEYZ5I.cjs +0 -167
- package/dist/lib/chunk-RLMEYZ5I.cjs.map +0 -1
- package/dist/lib/chunk-RQICHHZM.cjs +0 -29
- package/dist/lib/chunk-RQICHHZM.cjs.map +0 -1
- package/dist/lib/chunk-RXQWNSZX.js +0 -37
- package/dist/lib/chunk-RXQWNSZX.js.map +0 -1
- package/dist/lib/chunk-STAKGAWR.js +0 -86
- package/dist/lib/chunk-STAKGAWR.js.map +0 -1
- package/dist/lib/chunk-U36VZLW6.cjs +0 -172
- package/dist/lib/chunk-U36VZLW6.cjs.map +0 -1
- package/dist/lib/chunk-UGRFAVAJ.js +0 -93
- package/dist/lib/chunk-UGRFAVAJ.js.map +0 -1
- package/dist/lib/chunk-UQJWVRRE.cjs +0 -47
- package/dist/lib/chunk-UQJWVRRE.cjs.map +0 -1
- package/dist/lib/chunk-V2T4H24I.js +0 -156
- package/dist/lib/chunk-V2T4H24I.js.map +0 -1
- package/dist/lib/chunk-V5OY4ALI.cjs +0 -56
- package/dist/lib/chunk-V5OY4ALI.cjs.map +0 -1
- package/dist/lib/chunk-VJN72T2O.js +0 -50
- package/dist/lib/chunk-VJN72T2O.js.map +0 -1
- package/dist/lib/chunk-W4OMKQ7W.cjs +0 -128
- 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 +0 -53
- package/dist/lib/chunk-XZD7S5TU.cjs.map +0 -1
- package/dist/lib/chunk-YBIWVB66.js +0 -76
- package/dist/lib/chunk-YBIWVB66.js.map +0 -1
- package/dist/lib/chunk-YF3YHK4X.js +0 -127
- package/dist/lib/chunk-YF3YHK4X.js.map +0 -1
- package/dist/lib/chunk-YVDJCVE5.cjs +0 -160
- package/dist/lib/chunk-YVDJCVE5.cjs.map +0 -1
- package/dist/lib/chunk-ZP7PDTVE.cjs +0 -167
- 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-DnifzkPt.d.ts +0 -1474
- package/dist/lib/config-Ro14HmyO.d.cts +0 -1474
- package/dist/lib/config-file.cjs +0 -17
- package/dist/lib/config-file.cjs.map +0 -1
- package/dist/lib/config-file.d.cts +0 -57
- package/dist/lib/config-file.d.ts +0 -57
- package/dist/lib/config-file.js +0 -4
- package/dist/lib/config-file.js.map +0 -1
- package/dist/lib/create-program.cjs +0 -13
- package/dist/lib/create-program.cjs.map +0 -1
- package/dist/lib/create-program.d.cts +0 -42
- package/dist/lib/create-program.d.ts +0 -42
- package/dist/lib/create-program.js +0 -4
- package/dist/lib/create-program.js.map +0 -1
- package/dist/lib/entry.cjs +0 -41
- package/dist/lib/entry.cjs.map +0 -1
- package/dist/lib/entry.d.cts +0 -69
- package/dist/lib/entry.d.ts +0 -69
- package/dist/lib/entry.js +0 -4
- package/dist/lib/entry.js.map +0 -1
- package/dist/lib/hooks-B6Ow5MtE.d.ts +0 -28
- package/dist/lib/hooks-CM-BbMzz.d.cts +0 -28
- package/dist/lib/index.cjs +0 -281
- package/dist/lib/index.cjs.map +0 -1
- package/dist/lib/index.d.cts +0 -57
- package/dist/lib/index.d.ts +0 -57
- package/dist/lib/index.js +0 -28
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/logger.cjs +0 -17
- package/dist/lib/logger.cjs.map +0 -1
- package/dist/lib/logger.d.cts +0 -51
- package/dist/lib/logger.d.ts +0 -51
- package/dist/lib/logger.js +0 -4
- package/dist/lib/logger.js.map +0 -1
- package/dist/lib/tsconfig-Bz-CiFqD.d.cts +0 -68
- package/dist/lib/tsconfig-Bz-CiFqD.d.ts +0 -68
- package/dist/lib/typescript/compiler-host.cjs +0 -166
- package/dist/lib/typescript/compiler-host.cjs.map +0 -1
- package/dist/lib/typescript/compiler-host.d.cts +0 -64
- package/dist/lib/typescript/compiler-host.d.ts +0 -64
- package/dist/lib/typescript/compiler-host.js +0 -158
- package/dist/lib/typescript/compiler-host.js.map +0 -1
- package/dist/lib/typescript/import-transformer.cjs +0 -51
- package/dist/lib/typescript/import-transformer.cjs.map +0 -1
- package/dist/lib/typescript/import-transformer.d.cts +0 -36
- package/dist/lib/typescript/import-transformer.d.ts +0 -36
- package/dist/lib/typescript/import-transformer.js +0 -49
- package/dist/lib/typescript/import-transformer.js.map +0 -1
- package/dist/lib/typescript/index.cjs +0 -60
- package/dist/lib/typescript/index.cjs.map +0 -1
- package/dist/lib/typescript/index.d.cts +0 -35
- package/dist/lib/typescript/index.d.ts +0 -35
- package/dist/lib/typescript/index.js +0 -7
- package/dist/lib/typescript/index.js.map +0 -1
- package/dist/lib/typescript/isolated-decl.cjs +0 -13
- package/dist/lib/typescript/isolated-decl.cjs.map +0 -1
- package/dist/lib/typescript/isolated-decl.d.cts +0 -11
- package/dist/lib/typescript/isolated-decl.d.ts +0 -11
- package/dist/lib/typescript/isolated-decl.js +0 -4
- package/dist/lib/typescript/isolated-decl.js.map +0 -1
- package/dist/lib/typescript/program.cjs +0 -29
- package/dist/lib/typescript/program.cjs.map +0 -1
- package/dist/lib/typescript/program.d.cts +0 -69
- package/dist/lib/typescript/program.d.ts +0 -69
- package/dist/lib/typescript/program.js +0 -4
- package/dist/lib/typescript/program.js.map +0 -1
- package/dist/lib/typescript/tsconfig.cjs +0 -33
- package/dist/lib/typescript/tsconfig.cjs.map +0 -1
- package/dist/lib/typescript/tsconfig.d.cts +0 -61
- package/dist/lib/typescript/tsconfig.d.ts +0 -61
- package/dist/lib/typescript/tsconfig.js +0 -4
- package/dist/lib/typescript/tsconfig.js.map +0 -1
- package/dist/lib/unplugin/factory.cjs +0 -23
- package/dist/lib/unplugin/factory.cjs.map +0 -1
- package/dist/lib/unplugin/factory.d.cts +0 -200
- package/dist/lib/unplugin/factory.d.ts +0 -200
- package/dist/lib/unplugin/factory.js +0 -14
- package/dist/lib/unplugin/factory.js.map +0 -1
- package/dist/lib/unplugin/index.cjs +0 -33
- package/dist/lib/unplugin/index.cjs.map +0 -1
- package/dist/lib/unplugin/index.d.cts +0 -36
- package/dist/lib/unplugin/index.d.ts +0 -36
- package/dist/lib/unplugin/index.js +0 -16
- package/dist/lib/unplugin/index.js.map +0 -1
- package/dist/lib/unplugin/plugin.cjs +0 -16
- package/dist/lib/unplugin/plugin.cjs.map +0 -1
- package/dist/lib/unplugin/plugin.d.cts +0 -55
- package/dist/lib/unplugin/plugin.d.ts +0 -55
- package/dist/lib/unplugin/plugin.js +0 -7
- package/dist/lib/unplugin/plugin.js.map +0 -1
- package/dist/lib/unplugin/resolve-id.cjs +0 -13
- package/dist/lib/unplugin/resolve-id.cjs.map +0 -1
- package/dist/lib/unplugin/resolve-id.d.cts +0 -60
- package/dist/lib/unplugin/resolve-id.d.ts +0 -60
- package/dist/lib/unplugin/resolve-id.js +0 -4
- package/dist/lib/unplugin/resolve-id.js.map +0 -1
- package/dist/lib/utilities/bundle.cjs +0 -16
- package/dist/lib/utilities/bundle.cjs.map +0 -1
- package/dist/lib/utilities/bundle.d.cts +0 -44
- package/dist/lib/utilities/bundle.d.ts +0 -44
- package/dist/lib/utilities/bundle.js +0 -7
- package/dist/lib/utilities/bundle.js.map +0 -1
- package/dist/lib/utilities/cache.cjs +0 -18
- package/dist/lib/utilities/cache.cjs.map +0 -1
- package/dist/lib/utilities/cache.d.cts +0 -7
- package/dist/lib/utilities/cache.d.ts +0 -7
- package/dist/lib/utilities/cache.js +0 -5
- package/dist/lib/utilities/cache.js.map +0 -1
- package/dist/lib/utilities/file-header.cjs +0 -17
- package/dist/lib/utilities/file-header.cjs.map +0 -1
- package/dist/lib/utilities/file-header.d.cts +0 -42
- package/dist/lib/utilities/file-header.d.ts +0 -42
- package/dist/lib/utilities/file-header.js +0 -4
- package/dist/lib/utilities/file-header.js.map +0 -1
- package/dist/lib/utilities/index.cjs +0 -159
- package/dist/lib/utilities/index.cjs.map +0 -1
- package/dist/lib/utilities/index.d.cts +0 -45
- package/dist/lib/utilities/index.d.ts +0 -45
- package/dist/lib/utilities/index.js +0 -18
- package/dist/lib/utilities/index.js.map +0 -1
- package/dist/lib/utilities/meta.cjs +0 -37
- package/dist/lib/utilities/meta.cjs.map +0 -1
- package/dist/lib/utilities/meta.d.cts +0 -68
- package/dist/lib/utilities/meta.d.ts +0 -68
- package/dist/lib/utilities/meta.js +0 -4
- package/dist/lib/utilities/meta.js.map +0 -1
- package/dist/lib/utilities/plugin-helpers.cjs +0 -61
- package/dist/lib/utilities/plugin-helpers.cjs.map +0 -1
- package/dist/lib/utilities/plugin-helpers.d.cts +0 -153
- package/dist/lib/utilities/plugin-helpers.d.ts +0 -153
- package/dist/lib/utilities/plugin-helpers.js +0 -4
- package/dist/lib/utilities/plugin-helpers.js.map +0 -1
- package/dist/lib/utilities/resolve-path.cjs +0 -13
- package/dist/lib/utilities/resolve-path.cjs.map +0 -1
- package/dist/lib/utilities/resolve-path.d.cts +0 -43
- package/dist/lib/utilities/resolve-path.d.ts +0 -43
- package/dist/lib/utilities/resolve-path.js +0 -4
- package/dist/lib/utilities/resolve-path.js.map +0 -1
- package/dist/lib/utilities/resolve.cjs +0 -17
- package/dist/lib/utilities/resolve.cjs.map +0 -1
- package/dist/lib/utilities/resolve.d.cts +0 -44
- package/dist/lib/utilities/resolve.d.ts +0 -44
- package/dist/lib/utilities/resolve.js +0 -8
- package/dist/lib/utilities/resolve.js.map +0 -1
- package/dist/lib/utilities/source-file.cjs +0 -21
- package/dist/lib/utilities/source-file.cjs.map +0 -1
- package/dist/lib/utilities/source-file.d.cts +0 -28
- package/dist/lib/utilities/source-file.d.ts +0 -28
- package/dist/lib/utilities/source-file.js +0 -4
- package/dist/lib/utilities/source-file.js.map +0 -1
- package/dist/lib/utilities/source-map.cjs +0 -13
- package/dist/lib/utilities/source-map.cjs.map +0 -1
- package/dist/lib/utilities/source-map.d.cts +0 -14
- package/dist/lib/utilities/source-map.d.ts +0 -14
- package/dist/lib/utilities/source-map.js +0 -4
- package/dist/lib/utilities/source-map.js.map +0 -1
- package/dist/lib/utilities/worker.cjs +0 -18
- package/dist/lib/utilities/worker.cjs.map +0 -1
- package/dist/lib/utilities/worker.d.cts +0 -58
- package/dist/lib/utilities/worker.d.ts +0 -58
- package/dist/lib/utilities/worker.js +0 -5
- package/dist/lib/utilities/worker.js.map +0 -1
- package/dist/lib/utilities/write-file.cjs +0 -13
- package/dist/lib/utilities/write-file.cjs.map +0 -1
- package/dist/lib/utilities/write-file.d.cts +0 -44
- package/dist/lib/utilities/write-file.d.ts +0 -44
- package/dist/lib/utilities/write-file.js +0 -4
- package/dist/lib/utilities/write-file.js.map +0 -1
- package/dist/next.js +0 -10
- package/dist/nuxt.d.ts +0 -20
- package/dist/nuxt.js +0 -12
- package/dist/resolved-DtY60yLh.d.cts +0 -1351
- package/dist/resolved-wPXZS7aW.d.ts +0 -1351
- package/dist/rolldown.d.ts +0 -57
- package/dist/rolldown.js +0 -9
- package/dist/rollup.d.ts +0 -57
- package/dist/rollup.js +0 -9
- package/dist/rspack.d.ts +0 -57
- package/dist/rspack.js +0 -9
- package/dist/tsup.js +0 -11
- package/dist/types/babel.cjs +0 -6
- package/dist/types/babel.cjs.map +0 -1
- package/dist/types/babel.d.cts +0 -38
- package/dist/types/babel.d.ts +0 -38
- package/dist/types/babel.js +0 -3
- package/dist/types/babel.js.map +0 -1
- package/dist/types/build.cjs +0 -6
- package/dist/types/build.cjs.map +0 -1
- package/dist/types/build.d.cts +0 -111
- package/dist/types/build.d.ts +0 -111
- package/dist/types/build.js +0 -3
- package/dist/types/build.js.map +0 -1
- package/dist/types/commands.cjs +0 -13
- package/dist/types/commands.cjs.map +0 -1
- package/dist/types/commands.d.cts +0 -38
- package/dist/types/commands.d.ts +0 -38
- package/dist/types/commands.js +0 -4
- 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 +0 -6
- package/dist/types/config.cjs.map +0 -1
- package/dist/types/config.d.cts +0 -38
- package/dist/types/config.d.ts +0 -38
- package/dist/types/config.js +0 -3
- package/dist/types/config.js.map +0 -1
- package/dist/types/context.cjs +0 -13
- package/dist/types/context.cjs.map +0 -1
- package/dist/types/context.d.cts +0 -38
- package/dist/types/context.d.ts +0 -38
- package/dist/types/context.js +0 -4
- package/dist/types/context.js.map +0 -1
- package/dist/types/hooks.cjs +0 -6
- package/dist/types/hooks.cjs.map +0 -1
- package/dist/types/hooks.d.cts +0 -38
- package/dist/types/hooks.d.ts +0 -38
- package/dist/types/hooks.js +0 -3
- package/dist/types/hooks.js.map +0 -1
- package/dist/types/index.cjs +0 -58
- package/dist/types/index.cjs.map +0 -1
- package/dist/types/index.d.cts +0 -42
- package/dist/types/index.d.ts +0 -42
- package/dist/types/index.js +0 -17
- package/dist/types/index.js.map +0 -1
- package/dist/types/internal.cjs +0 -4
- package/dist/types/internal.cjs.map +0 -1
- package/dist/types/internal.d.cts +0 -61
- package/dist/types/internal.d.ts +0 -61
- package/dist/types/internal.js +0 -3
- package/dist/types/internal.js.map +0 -1
- package/dist/types/plugin.cjs +0 -13
- package/dist/types/plugin.cjs.map +0 -1
- package/dist/types/plugin.d.cts +0 -38
- package/dist/types/plugin.d.ts +0 -38
- package/dist/types/plugin.js +0 -4
- package/dist/types/plugin.js.map +0 -1
- package/dist/types/resolved.cjs +0 -6
- package/dist/types/resolved.cjs.map +0 -1
- package/dist/types/resolved.d.cts +0 -38
- package/dist/types/resolved.d.ts +0 -38
- package/dist/types/resolved.js +0 -3
- package/dist/types/resolved.js.map +0 -1
- package/dist/types/tsconfig.cjs +0 -6
- package/dist/types/tsconfig.cjs.map +0 -1
- package/dist/types/tsconfig.d.cts +0 -75
- package/dist/types/tsconfig.d.ts +0 -75
- package/dist/types/tsconfig.js +0 -3
- package/dist/types/tsconfig.js.map +0 -1
- package/dist/types/typedoc.cjs +0 -6
- package/dist/types/typedoc.cjs.map +0 -1
- package/dist/types/typedoc.d.cts +0 -25
- package/dist/types/typedoc.d.ts +0 -25
- package/dist/types/typedoc.js +0 -3
- package/dist/types/typedoc.js.map +0 -1
- package/dist/types/unplugin.cjs +0 -6
- package/dist/types/unplugin.cjs.map +0 -1
- package/dist/types/unplugin.d.cts +0 -54
- package/dist/types/unplugin.d.ts +0 -54
- package/dist/types/unplugin.js +0 -3
- package/dist/types/unplugin.js.map +0 -1
- package/dist/types/vfs.cjs +0 -33
- package/dist/types/vfs.cjs.map +0 -1
- package/dist/types/vfs.d.cts +0 -408
- package/dist/types/vfs.d.ts +0 -408
- package/dist/types/vfs.js +0 -4
- package/dist/types/vfs.js.map +0 -1
- package/dist/unloader.d.ts +0 -56
- package/dist/unloader.js +0 -9
- package/dist/unplugin.d.ts +0 -77
- package/dist/unplugin.js +0 -21
- package/dist/vite.d.ts +0 -57
- package/dist/vite.js +0 -10
- package/dist/webpack.d.ts +0 -57
- package/dist/webpack.js +0 -9
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
|
|
4
|
-
var isFunction = require('@stryke/type-checks/is-function');
|
|
5
|
-
var isSetObject = require('@stryke/type-checks/is-set-object');
|
|
6
|
-
var isSetString = require('@stryke/type-checks/is-set-string');
|
|
7
|
-
var isUndefined = require('@stryke/type-checks/is-undefined');
|
|
8
|
-
|
|
9
|
-
// src/types/commands.ts
|
|
10
|
-
var SUPPORTED_COMMANDS = [
|
|
11
|
-
"new",
|
|
12
|
-
"clean",
|
|
13
|
-
"prepare",
|
|
14
|
-
"lint",
|
|
15
|
-
"test",
|
|
16
|
-
"build",
|
|
17
|
-
"docs",
|
|
18
|
-
"release",
|
|
19
|
-
"finalize"
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
// src/lib/utilities/plugin-helpers.ts
|
|
23
|
-
function isPlugin(value) {
|
|
24
|
-
return isSetObject.isSetObject(value) && "name" in value && isSetString.isSetString(value.name) && (isUndefined.isUndefined(value.applyToEnvironment) || "applyToEnvironment" in value && isFunction.isFunction(value.applyToEnvironment)) && (isUndefined.isUndefined(value.dedupe) || "dedupe" in value && isFunction.isFunction(value.dedupe)) && (isUndefined.isUndefined(value.dependsOn) || "dependsOn" in value && Array.isArray(value.dependsOn) && value.dependsOn.every(isPluginConfig)) && SUPPORTED_COMMANDS.every((command) => isUndefined.isUndefined(value[command]) || command in value && (isFunction.isFunction(value[command]) || isSetObject.isSetObject(value[command]) && "handler" in value[command] && isFunction.isFunction(value[command].handler)));
|
|
25
|
-
}
|
|
26
|
-
chunkPK6SKIKE_cjs.__name(isPlugin, "isPlugin");
|
|
27
|
-
function isPluginConfigObject(value) {
|
|
28
|
-
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));
|
|
29
|
-
}
|
|
30
|
-
chunkPK6SKIKE_cjs.__name(isPluginConfigObject, "isPluginConfigObject");
|
|
31
|
-
function isPluginConfigTuple(value) {
|
|
32
|
-
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]));
|
|
33
|
-
}
|
|
34
|
-
chunkPK6SKIKE_cjs.__name(isPluginConfigTuple, "isPluginConfigTuple");
|
|
35
|
-
function isPluginConfig(value) {
|
|
36
|
-
return isSetString.isSetString(value) || isFunction.isFunction(value) || isPlugin(value) || isPluginConfigObject(value) || isPluginConfigTuple(value);
|
|
37
|
-
}
|
|
38
|
-
chunkPK6SKIKE_cjs.__name(isPluginConfig, "isPluginConfig");
|
|
39
|
-
function isPluginHookFunction(value) {
|
|
40
|
-
return isFunction.isFunction(value) || isSetObject.isSetObject(value) && "handler" in value && isFunction.isFunction(value.handler);
|
|
41
|
-
}
|
|
42
|
-
chunkPK6SKIKE_cjs.__name(isPluginHookFunction, "isPluginHookFunction");
|
|
43
|
-
function isPluginHookObject(value) {
|
|
44
|
-
return isSetObject.isSetObject(value) && "handler" in value && isFunction.isFunction(value.handler);
|
|
45
|
-
}
|
|
46
|
-
chunkPK6SKIKE_cjs.__name(isPluginHookObject, "isPluginHookObject");
|
|
47
|
-
function isPluginHook(value) {
|
|
48
|
-
return isPluginHookFunction(value) || isPluginHookObject(value);
|
|
49
|
-
}
|
|
50
|
-
chunkPK6SKIKE_cjs.__name(isPluginHook, "isPluginHook");
|
|
51
|
-
function getHookHandler(pluginHook) {
|
|
52
|
-
return isFunction.isFunction(pluginHook) ? pluginHook : pluginHook.handler;
|
|
53
|
-
}
|
|
54
|
-
chunkPK6SKIKE_cjs.__name(getHookHandler, "getHookHandler");
|
|
55
|
-
function extractPluginHook(context, plugin, hook) {
|
|
56
|
-
const pluginHook = plugin[hook];
|
|
57
|
-
if (!isPluginHook(pluginHook)) {
|
|
58
|
-
return void 0;
|
|
59
|
-
}
|
|
60
|
-
return isFunction.isFunction(pluginHook) ? {
|
|
61
|
-
normal: pluginHook.bind(context)
|
|
62
|
-
} : {
|
|
63
|
-
[pluginHook.order ? pluginHook.order : "normal"]: pluginHook.handler.bind(context)
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
chunkPK6SKIKE_cjs.__name(extractPluginHook, "extractPluginHook");
|
|
67
|
-
function isHookExternal(hook) {
|
|
68
|
-
return hook.startsWith("vite:") || hook.startsWith("esbuild:") || hook.startsWith("rolldown:") || hook.startsWith("rollup:") || hook.startsWith("webpack:") || hook.startsWith("rspack:") || hook.startsWith("farm:");
|
|
69
|
-
}
|
|
70
|
-
chunkPK6SKIKE_cjs.__name(isHookExternal, "isHookExternal");
|
|
71
|
-
function isHookInternal(hook) {
|
|
72
|
-
return !isHookExternal(hook);
|
|
73
|
-
}
|
|
74
|
-
chunkPK6SKIKE_cjs.__name(isHookInternal, "isHookInternal");
|
|
75
|
-
function checkDedupe(plugin, plugins) {
|
|
76
|
-
return plugin.dedupe === false || plugins.some((p) => p.dedupe !== false && (isFunction.isFunction(p.dedupe) && p.dedupe(plugin) || p.name === plugin.name));
|
|
77
|
-
}
|
|
78
|
-
chunkPK6SKIKE_cjs.__name(checkDedupe, "checkDedupe");
|
|
79
|
-
function addPluginHook(context, plugin, pluginHook, hooksList) {
|
|
80
|
-
if (!checkDedupe(plugin, hooksList.map((hook) => hook.plugin))) {
|
|
81
|
-
hooksList.push(isFunction.isFunction(pluginHook) ? {
|
|
82
|
-
plugin,
|
|
83
|
-
handler: getHookHandler(pluginHook).bind(context)
|
|
84
|
-
} : {
|
|
85
|
-
plugin,
|
|
86
|
-
...pluginHook,
|
|
87
|
-
handler: getHookHandler(pluginHook).bind(context)
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
chunkPK6SKIKE_cjs.__name(addPluginHook, "addPluginHook");
|
|
92
|
-
|
|
93
|
-
exports.addPluginHook = addPluginHook;
|
|
94
|
-
exports.checkDedupe = checkDedupe;
|
|
95
|
-
exports.extractPluginHook = extractPluginHook;
|
|
96
|
-
exports.getHookHandler = getHookHandler;
|
|
97
|
-
exports.isHookExternal = isHookExternal;
|
|
98
|
-
exports.isHookInternal = isHookInternal;
|
|
99
|
-
exports.isPlugin = isPlugin;
|
|
100
|
-
exports.isPluginConfig = isPluginConfig;
|
|
101
|
-
exports.isPluginConfigObject = isPluginConfigObject;
|
|
102
|
-
exports.isPluginConfigTuple = isPluginConfigTuple;
|
|
103
|
-
exports.isPluginHook = isPluginHook;
|
|
104
|
-
exports.isPluginHookFunction = isPluginHookFunction;
|
|
105
|
-
exports.isPluginHookObject = isPluginHookObject;
|
|
106
|
-
//# sourceMappingURL=chunk-RK2VVGL6.cjs.map
|
|
107
|
-
//# sourceMappingURL=chunk-RK2VVGL6.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/commands.ts","../../src/lib/utilities/plugin-helpers.ts"],"names":["SUPPORTED_COMMANDS","isPlugin","value","isSetObject","isSetString","name","isUndefined","applyToEnvironment","isFunction","dedupe","dependsOn","Array","isArray","every","isPluginConfig","command","handler","isPluginConfigObject","plugin","options","isPluginConfigTuple","length","isPluginHookFunction","isPluginHookObject","isPluginHook","getHookHandler","pluginHook","extractPluginHook","context","hook","undefined","normal","bind","order","isHookExternal","startsWith","isHookInternal","checkDedupe","plugins","some","p","addPluginHook","hooksList","map","push"],"mappings":";;;;;;;;;AAsBO,IAAMA,kBAAAA,GAAqB;AAChC,EAAA,KAAA;AACA,EAAA,OAAA;AACA,EAAA,SAAA;AACA,EAAA,MAAA;AACA,EAAA,MAAA;AACA,EAAA,OAAA;AACA,EAAA,MAAA;AACA,EAAA,SAAA;AACA,EAAA;;;;ACcK,SAASC,SAEdC,KAAAA,EAAc;AACd,EAAA,OACEC,uBAAAA,CAAYD,KAAAA,CAAAA,IACZ,MAAA,IAAUA,SACVE,uBAAAA,CAAYF,KAAAA,CAAMG,IAAI,CAAA,KACrBC,wBACEJ,KAAAA,CAAiDK,kBAAkB,CAAA,IAEnE,oBAAA,IAAwBL,SACvBM,qBAAAA,CAAWN,KAAAA,CAAMK,kBAAkB,CAAA,CAAA,KACtCD,wBAAaJ,KAAAA,CAAiDO,MAAM,CAAA,IAClE,QAAA,IAAYP,SAASM,qBAAAA,CAAWN,KAAAA,CAAMO,MAAM,CAAA,CAAA,KAC9CH,wBAAaJ,KAAAA,CAAiDQ,SAAS,CAAA,IACrE,WAAA,IAAeR,SACdS,KAAAA,CAAMC,OAAAA,CAAQV,KAAAA,CAAMQ,SAAS,KAC7BR,KAAAA,CAAMQ,SAAAA,CAAUG,KAAAA,CAAMC,cAAAA,MAC1Bd,kBAAAA,CAAmBa,KAAAA,CACjBE,CAAAA,OAAAA,KACET,wBACGJ,KAAAA,CAAiDa,OAAAA,CAAQ,CAAA,IAE3DA,WAAWb,KAAAA,KACTM,qBAAAA,CAAYN,KAAAA,CAA8Ba,OAAAA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Ob,IAAAA,CAAG,CAAA;AAG5E;AAbgBgC,wBAAAA,CAAAA,WAAAA,EAAAA,aAAAA,CAAAA;AAuBT,SAASI,aAAAA,CACdb,OAAAA,EACAV,MAAAA,EACAQ,UAAAA,EACAgB,SAAAA,EAAgE;AAEhE,EAAA,IACE,CAACL,WAAAA,CACCnB,MAAAA,EACAwB,SAAAA,CAAUC,GAAAA,CAAId,CAAAA,IAAAA,KAAQA,IAAAA,CAAKX,MAAM,CAAA,CAAA,EAEnC;AACAwB,IAAAA,SAAAA,CAAUE,IAAAA,CACRpC,qBAAAA,CAAWkB,UAAAA,CAAAA,GACP;AACER,MAAAA,MAAAA;AACAF,MAAAA,OAAAA,EAASS,cAAAA,CAAeC,UAAAA,CAAAA,CAAYM,IAAAA,CAAKJ,OAAAA;KAC3C,GACA;AACEV,MAAAA,MAAAA;MACA,GAAGQ,UAAAA;AACHV,MAAAA,OAAAA,EAASS,cAAAA,CAAeC,UAAAA,CAAAA,CAAYM,IAAAA,CAAKJ,OAAAA;KAC3C,CAAA;AAER,EAAA;AACF;AAzBgBa,wBAAAA,CAAAA,aAAAA,EAAAA,eAAAA,CAAAA","file":"chunk-RK2VVGL6.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ArrayValues } from \"@stryke/types/array\";\nimport type { MaybePromise } from \"@stryke/types/base\";\nimport type { Context } from \"./context\";\n\nexport const SUPPORTED_COMMANDS = [\n \"new\",\n \"clean\",\n \"prepare\",\n \"lint\",\n \"test\",\n \"build\",\n \"docs\",\n \"release\",\n \"finalize\"\n] as const;\n\nexport type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;\nexport type Commands<TContext extends Context = Context> = Record<\n CommandType,\n (this: TContext) => MaybePromise<void>\n>;\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { AnyFunction } from \"@stryke/types/base\";\nimport { SUPPORTED_COMMANDS } from \"../../types/commands\";\nimport {\n PluginConfig,\n PluginConfigObject,\n PluginConfigTuple\n} from \"../../types/config\";\nimport { PluginContext } from \"../../types/context\";\nimport {\n BaseHookKeys,\n BaseHooksListItem,\n ExternalHookKeys,\n HookKeys\n} from \"../../types/hooks\";\nimport { Plugin, PluginHook, PluginHookObject } from \"../../types/plugin\";\nimport { ResolvedConfig } from \"../../types/resolved\";\n\n/**\n * Type guard to check if an object is a {@link Plugin}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link Plugin}, false otherwise\n */\nexport function isPlugin<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig\n>(value: unknown): value is Plugin<PluginContext<TResolvedConfig>> {\n return (\n isSetObject(value) &&\n \"name\" in value &&\n isSetString(value.name) &&\n (isUndefined(\n (value as Plugin<PluginContext<TResolvedConfig>>).applyToEnvironment\n ) ||\n (\"applyToEnvironment\" in value &&\n isFunction(value.applyToEnvironment))) &&\n (isUndefined((value as Plugin<PluginContext<TResolvedConfig>>).dedupe) ||\n (\"dedupe\" in value && isFunction(value.dedupe))) &&\n (isUndefined((value as Plugin<PluginContext<TResolvedConfig>>).dependsOn) ||\n (\"dependsOn\" in value &&\n Array.isArray(value.dependsOn) &&\n value.dependsOn.every(isPluginConfig))) &&\n SUPPORTED_COMMANDS.every(\n command =>\n isUndefined(\n (value as Plugin<PluginContext<TResolvedConfig>>)[command]\n ) ||\n (command in value &&\n (isFunction((value as Record<string, any>)[command]) ||\n (isSetObject((value as Record<string, any>)[command]) &&\n \"handler\" in (value as Record<string, any>)[command] &&\n isFunction((value as Record<string, any>)[command].handler))))\n )\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfigObject}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfigObject}, false otherwise\n */\nexport function isPluginConfigObject(\n value: unknown\n): value is PluginConfigObject {\n return (\n isSetObject(value) &&\n \"plugin\" in value &&\n (((isSetString(value.plugin) || isFunction(value.plugin)) &&\n \"options\" in value &&\n isSetObject(value.options)) ||\n isPlugin(value.plugin))\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfigTuple}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfigTuple}, false otherwise\n */\nexport function isPluginConfigTuple(\n value: unknown\n): value is PluginConfigTuple {\n return (\n Array.isArray(value) &&\n (value.length === 1 || value.length === 2) &&\n (((isSetString(value[0]) || isFunction(value[0])) &&\n value.length > 1 &&\n isSetObject(value[1])) ||\n isPlugin(value[0]))\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfig}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfig}, false otherwise\n */\nexport function isPluginConfig(value: unknown): value is PluginConfig {\n return (\n isSetString(value) ||\n isFunction(value) ||\n isPlugin(value) ||\n isPluginConfigObject(value) ||\n isPluginConfigTuple(value)\n );\n}\n\n/**\n * Type guard to check if an value is a {@link PluginHook} function\n *\n * @param value - The value to check\n * @returns True if the value is a {@link PluginHook} function, false otherwise\n */\nexport function isPluginHookFunction(value: unknown): value is AnyFunction {\n return (\n isFunction(value) ||\n (isSetObject(value) && \"handler\" in value && isFunction(value.handler))\n );\n}\n\n/**\n * Type guard to check if an value is a {@link PluginHook} function\n *\n * @param value - The value to check\n * @returns True if the value is a {@link PluginHook} function, false otherwise\n */\nexport function isPluginHookObject(\n value: unknown\n): value is PluginHookObject<AnyFunction> {\n return isSetObject(value) && \"handler\" in value && isFunction(value.handler);\n}\n\n/**\n * Type guard to check if an object is a {@link PluginHook}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginHook}, false otherwise\n */\nexport function isPluginHook(value: unknown): value is PluginHook<AnyFunction> {\n return isPluginHookFunction(value) || isPluginHookObject(value);\n}\n\n/**\n * Extract the hook handler function from a plugin hook\n *\n * @param pluginHook - The plugin hook to extract the handler function from\n * @returns The hook handler function\n */\nexport function getHookHandler(\n pluginHook: PluginHook<AnyFunction>\n): AnyFunction {\n return isFunction(pluginHook) ? pluginHook : pluginHook.handler;\n}\n\n/**\n * Extract a plugin hook from a plugin\n *\n * @param context - The build context\n * @param plugin - The plugin to extract the hook from\n * @param hook - The name of the hook to extract\n * @returns The extracted hook, or undefined if the hook does not exist\n */\nexport function extractPluginHook<\n TContext extends PluginContext = PluginContext,\n TPlugin extends Plugin<TContext> = Plugin<TContext>\n>(context: TContext, plugin: TPlugin, hook: BaseHookKeys<TContext>) {\n const pluginHook = plugin[hook];\n if (!isPluginHook(pluginHook)) {\n return undefined;\n }\n\n return isFunction(pluginHook)\n ? {\n normal: pluginHook.bind(context)\n }\n : {\n [pluginHook.order ? pluginHook.order : \"normal\"]:\n pluginHook.handler.bind(context)\n };\n}\n\n/**\n * Check if a hook is external.\n *\n * @param hook - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isHookExternal(hook: HookKeys): hook is ExternalHookKeys {\n return (\n hook.startsWith(\"vite:\") ||\n hook.startsWith(\"esbuild:\") ||\n hook.startsWith(\"rolldown:\") ||\n hook.startsWith(\"rollup:\") ||\n hook.startsWith(\"webpack:\") ||\n hook.startsWith(\"rspack:\") ||\n hook.startsWith(\"farm:\")\n );\n}\n\n/**\n * Check if a hook is internal.\n *\n * @param hook - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isHookInternal(hook: HookKeys): hook is BaseHookKeys {\n return !isHookExternal(hook);\n}\n\n/**\n * Check if a plugin should be deduplicated.\n *\n * @param plugin - The plugin to check\n * @param plugins - The list of plugins to check against\n * @returns True if the plugin should be deduplicated, false otherwise\n */\nexport function checkDedupe<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig,\n TContext extends\n PluginContext<TResolvedConfig> = PluginContext<TResolvedConfig>\n>(plugin: Plugin<TContext>, plugins: Plugin<TContext>[]) {\n return (\n plugin.dedupe === false ||\n plugins.some(\n p =>\n p.dedupe !== false &&\n ((isFunction(p.dedupe) && p.dedupe(plugin)) || p.name === plugin.name)\n )\n );\n}\n\n/**\n * Add a plugin hook to the hooks list.\n *\n * @param context - The plugin context\n * @param plugin - The plugin to add the hook from\n * @param pluginHook - The plugin hook to add\n * @param hooksList - The list of hooks to add to\n */\nexport function addPluginHook<TContext extends PluginContext = PluginContext>(\n context: TContext,\n plugin: Plugin<TContext>,\n pluginHook: PluginHook<AnyFunction>,\n hooksList: BaseHooksListItem<TContext, BaseHookKeys<TContext>>[]\n) {\n if (\n !checkDedupe(\n plugin,\n hooksList.map(hook => hook.plugin)\n )\n ) {\n hooksList.push(\n isFunction(pluginHook)\n ? {\n plugin,\n handler: getHookHandler(pluginHook).bind(context)\n }\n : {\n plugin,\n ...pluginHook,\n handler: getHookHandler(pluginHook).bind(context)\n }\n );\n }\n}\n"]}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
|
|
4
|
-
var listFiles = require('@stryke/fs/list-files');
|
|
5
|
-
var readFile = require('@stryke/fs/read-file');
|
|
6
|
-
var resolve = require('@stryke/fs/resolve');
|
|
7
|
-
var filePathFns = require('@stryke/path/file-path-fns');
|
|
8
|
-
var joinPaths = require('@stryke/path/join-paths');
|
|
9
|
-
var defu = require('defu');
|
|
10
|
-
var minimatch = require('minimatch');
|
|
11
|
-
var ts = require('typescript');
|
|
12
|
-
|
|
13
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
|
|
15
|
-
var defu__default = /*#__PURE__*/_interopDefault(defu);
|
|
16
|
-
var ts__default = /*#__PURE__*/_interopDefault(ts);
|
|
17
|
-
|
|
18
|
-
var SourcesMap = Map;
|
|
19
|
-
async function loadLibFiles() {
|
|
20
|
-
const libLocation = await resolve.resolvePackage("typescript");
|
|
21
|
-
if (!libLocation) {
|
|
22
|
-
throw new Error("Could not resolve TypeScript package location.");
|
|
23
|
-
}
|
|
24
|
-
const libFiles = await listFiles.listFiles(joinPaths.joinPaths(libLocation, "lib", "**", "lib.*.d.ts"));
|
|
25
|
-
if (libFiles.length === 0) {
|
|
26
|
-
throw new Error("No TypeScript library files found.");
|
|
27
|
-
}
|
|
28
|
-
const lib = /* @__PURE__ */ new Map();
|
|
29
|
-
for (const file of libFiles) {
|
|
30
|
-
lib.set(`/node_modules/typescript/lib/${filePathFns.findFileName(file)}`, await readFile.readFile(file));
|
|
31
|
-
}
|
|
32
|
-
return lib;
|
|
33
|
-
}
|
|
34
|
-
chunkPK6SKIKE_cjs.__name(loadLibFiles, "loadLibFiles");
|
|
35
|
-
function getDefaultCompilerOptions() {
|
|
36
|
-
return {
|
|
37
|
-
...ts__default.default.getDefaultCompilerOptions(),
|
|
38
|
-
jsx: ts__default.default.JsxEmit.React,
|
|
39
|
-
strict: true,
|
|
40
|
-
esModuleInterop: true,
|
|
41
|
-
module: ts__default.default.ModuleKind.ESNext,
|
|
42
|
-
suppressOutputPathCheck: true,
|
|
43
|
-
skipLibCheck: true,
|
|
44
|
-
skipDefaultLibCheck: true,
|
|
45
|
-
moduleResolution: ts__default.default.ModuleResolutionKind.Node10
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
chunkPK6SKIKE_cjs.__name(getDefaultCompilerOptions, "getDefaultCompilerOptions");
|
|
49
|
-
async function createVirtualProgram(rootNames, context, compilerOptions = {}) {
|
|
50
|
-
const options = defu__default.default(compilerOptions, getDefaultCompilerOptions());
|
|
51
|
-
const host = {
|
|
52
|
-
name: "storm-vfs",
|
|
53
|
-
root: context.workspaceConfig.workspaceRoot,
|
|
54
|
-
...ts__default.default.sys,
|
|
55
|
-
realpath: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((path) => {
|
|
56
|
-
if (context.fs.existsSync(path)) {
|
|
57
|
-
return context.fs.resolve(path);
|
|
58
|
-
}
|
|
59
|
-
return ts__default.default.sys.realpath?.(path) ?? path;
|
|
60
|
-
}, "realpath"),
|
|
61
|
-
getCurrentDirectory() {
|
|
62
|
-
return context.workspaceConfig.workspaceRoot;
|
|
63
|
-
},
|
|
64
|
-
getCanonicalFileName(fileName) {
|
|
65
|
-
return fileName;
|
|
66
|
-
},
|
|
67
|
-
getDefaultLibFileName(_options) {
|
|
68
|
-
return ts__default.default.getDefaultLibFileName(options);
|
|
69
|
-
},
|
|
70
|
-
getDefaultLibLocation() {
|
|
71
|
-
return "/";
|
|
72
|
-
},
|
|
73
|
-
getNewLine() {
|
|
74
|
-
return "\n";
|
|
75
|
-
},
|
|
76
|
-
useCaseSensitiveFileNames() {
|
|
77
|
-
return true;
|
|
78
|
-
},
|
|
79
|
-
fileExists(fileName) {
|
|
80
|
-
return context.fs.existsSync(fileName);
|
|
81
|
-
},
|
|
82
|
-
readFile(fileName) {
|
|
83
|
-
if (context.fs.existsSync(fileName)) {
|
|
84
|
-
return context.fs.readFileSync(fileName);
|
|
85
|
-
}
|
|
86
|
-
return void 0;
|
|
87
|
-
},
|
|
88
|
-
readDirectory: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((path, extensions = [], exclude = [], include = []) => {
|
|
89
|
-
let results = [];
|
|
90
|
-
if (context.fs.existsSync(path)) {
|
|
91
|
-
results = context.fs.readdirSync(path, {
|
|
92
|
-
encoding: "utf8",
|
|
93
|
-
recursive: true
|
|
94
|
-
});
|
|
95
|
-
if (extensions.length > 0) {
|
|
96
|
-
results = results.filter((file) => extensions.some((ext) => file.endsWith(ext.startsWith(".") ? ext : `.${ext}`)));
|
|
97
|
-
}
|
|
98
|
-
if (exclude.length > 0) {
|
|
99
|
-
results = results.filter((file) => !exclude.some((pattern) => minimatch.minimatch(file, pattern)));
|
|
100
|
-
}
|
|
101
|
-
if (include.length > 0) {
|
|
102
|
-
results = results.filter((file) => include.some((pattern) => minimatch.minimatch(file, pattern)));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return results;
|
|
106
|
-
}, "readDirectory"),
|
|
107
|
-
writeFile(fileName, data) {
|
|
108
|
-
context.fs.writeFileSync(fileName, data);
|
|
109
|
-
},
|
|
110
|
-
resolvePath: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((fileName) => {
|
|
111
|
-
if (context.fs.existsSync(fileName)) {
|
|
112
|
-
return context.fs.resolve(fileName);
|
|
113
|
-
}
|
|
114
|
-
return ts__default.default.sys.resolvePath(fileName);
|
|
115
|
-
}, "resolvePath"),
|
|
116
|
-
getSourceFile(fileName, languageVersionOrOptions, _, shouldCreateNewSourceFile) {
|
|
117
|
-
if (context.fs.existsSync(fileName)) {
|
|
118
|
-
return ts__default.default.createSourceFile(fileName, context.fs.readFileSync(fileName), languageVersionOrOptions ?? compilerOptions.target ?? getDefaultCompilerOptions().target, false);
|
|
119
|
-
} else if (shouldCreateNewSourceFile) {
|
|
120
|
-
const sourceFile = ts__default.default.createSourceFile(fileName, "", languageVersionOrOptions ?? compilerOptions.target ?? getDefaultCompilerOptions().target, false);
|
|
121
|
-
context.fs.writeFileSync(fileName, sourceFile.text);
|
|
122
|
-
return sourceFile;
|
|
123
|
-
}
|
|
124
|
-
return void 0;
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
return ts__default.default.createProgram(rootNames, options, host);
|
|
128
|
-
}
|
|
129
|
-
chunkPK6SKIKE_cjs.__name(createVirtualProgram, "createVirtualProgram");
|
|
130
|
-
function createVirtualCompilerHost(context, sys, compilerOptions) {
|
|
131
|
-
return {
|
|
132
|
-
compilerHost: {
|
|
133
|
-
...sys,
|
|
134
|
-
getCanonicalFileName: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((fileName) => fileName, "getCanonicalFileName"),
|
|
135
|
-
getDefaultLibFileName: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(() => `/${ts__default.default.getDefaultLibFileName(compilerOptions)}`, "getDefaultLibFileName"),
|
|
136
|
-
// getDefaultLibLocation: () => '/',
|
|
137
|
-
getNewLine: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(() => sys.newLine, "getNewLine"),
|
|
138
|
-
getSourceFile: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((fileName, languageVersionOrOptions) => {
|
|
139
|
-
const resolved = context.fs.resolve(fileName);
|
|
140
|
-
if (resolved && context.fs.existsSync(resolved)) {
|
|
141
|
-
return context.fs.readFileSync(resolved);
|
|
142
|
-
}
|
|
143
|
-
return ts__default.default.createSourceFile(fileName, sys.readFile(fileName), languageVersionOrOptions ?? compilerOptions.target, false);
|
|
144
|
-
}, "getSourceFile"),
|
|
145
|
-
useCaseSensitiveFileNames: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(() => sys.useCaseSensitiveFileNames, "useCaseSensitiveFileNames")
|
|
146
|
-
},
|
|
147
|
-
updateFile: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((sourceFile) => {
|
|
148
|
-
const alreadyExists = context.fs.existsSync(sourceFile.fileName);
|
|
149
|
-
sys.writeFile(sourceFile.fileName, sourceFile.text);
|
|
150
|
-
return alreadyExists;
|
|
151
|
-
}, "updateFile"),
|
|
152
|
-
deleteFile: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((sourceFile) => {
|
|
153
|
-
const alreadyExists = context.fs.existsSync(sourceFile.fileName);
|
|
154
|
-
sys.deleteFile(sourceFile.fileName);
|
|
155
|
-
return alreadyExists;
|
|
156
|
-
}, "deleteFile")
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
chunkPK6SKIKE_cjs.__name(createVirtualCompilerHost, "createVirtualCompilerHost");
|
|
160
|
-
|
|
161
|
-
exports.SourcesMap = SourcesMap;
|
|
162
|
-
exports.createVirtualCompilerHost = createVirtualCompilerHost;
|
|
163
|
-
exports.createVirtualProgram = createVirtualProgram;
|
|
164
|
-
exports.getDefaultCompilerOptions = getDefaultCompilerOptions;
|
|
165
|
-
exports.loadLibFiles = loadLibFiles;
|
|
166
|
-
//# sourceMappingURL=chunk-RLMEYZ5I.cjs.map
|
|
167
|
-
//# sourceMappingURL=chunk-RLMEYZ5I.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/typescript/program.ts"],"names":["SourcesMap","Map","loadLibFiles","libLocation","resolvePackage","Error","libFiles","listFiles","joinPaths","length","lib","file","set","findFileName","readFile","getDefaultCompilerOptions","ts","jsx","JsxEmit","React","strict","esModuleInterop","module","ModuleKind","ESNext","suppressOutputPathCheck","skipLibCheck","skipDefaultLibCheck","moduleResolution","ModuleResolutionKind","Node10","createVirtualProgram","rootNames","context","compilerOptions","options","defu","host","name","root","workspaceConfig","workspaceRoot","sys","realpath","path","fs","existsSync","resolve","getCurrentDirectory","getCanonicalFileName","fileName","getDefaultLibFileName","_options","getDefaultLibLocation","getNewLine","useCaseSensitiveFileNames","fileExists","readFileSync","undefined","readDirectory","__name","extensions","exclude","include","results","readdirSync","encoding","recursive","filter","some","ext","endsWith","startsWith","pattern","minimatch","writeFile","data","writeFileSync","resolvePath","getSourceFile","languageVersionOrOptions","_","shouldCreateNewSourceFile","createSourceFile","target","sourceFile","text","createProgram","createVirtualC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A,2BAAAA,CAAAA","file":"chunk-RLMEYZ5I.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { listFiles } from \"@stryke/fs/list-files\";\nimport { readFile } from \"@stryke/fs/read-file\";\nimport { resolvePackage } from \"@stryke/fs/resolve\";\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { minimatch } from \"minimatch\";\nimport ts, { CompilerOptions } from \"typescript\";\nimport { Context } from \"../../types/context\";\n\nexport const SourcesMap = Map<string, string>;\n// eslint-disable-next-line ts/no-redeclare\nexport type SourcesMap = InstanceType<typeof SourcesMap>;\n\nexport async function loadLibFiles(): Promise<SourcesMap> {\n const libLocation = await resolvePackage(\"typescript\");\n if (!libLocation) {\n throw new Error(\"Could not resolve TypeScript package location.\");\n }\n\n const libFiles = await listFiles(\n joinPaths(libLocation, \"lib\", \"**\", \"lib.*.d.ts\")\n );\n if (libFiles.length === 0) {\n throw new Error(\"No TypeScript library files found.\");\n }\n\n const lib: SourcesMap = new Map();\n for (const file of libFiles) {\n lib.set(\n `/node_modules/typescript/lib/${findFileName(file)}`,\n await readFile(file)\n );\n }\n\n return lib;\n}\n\n/** The default compiler options if TypeScript could ever change the compiler options */\nexport function getDefaultCompilerOptions(): CompilerOptions {\n return {\n ...ts.getDefaultCompilerOptions(),\n jsx: ts.JsxEmit.React,\n strict: true,\n esModuleInterop: true,\n module: ts.ModuleKind.ESNext,\n suppressOutputPathCheck: true,\n skipLibCheck: true,\n skipDefaultLibCheck: true,\n moduleResolution: ts.ModuleResolutionKind.Node10\n };\n}\n\n/**\n * Creates a TypeScript program from in-memory, virtual source files.\n *\n * @param rootNames - An array of root file names to include in the program.\n * @param context - The context containing options and environment paths.\n * @param compilerOptions - Optional TypeScript compiler options. Defaults to the standard TypeScript options\n * @returns A TypeScript program instance that can be used for type checking, emitting, etc.\n * @throws If the provided library files are not in the expected format or if the TypeScript package cannot be resolved.\n */\nexport async function createVirtualProgram(\n rootNames: readonly string[],\n context: Context,\n compilerOptions: ts.CompilerOptions = {}\n): Promise<ts.Program> {\n const options = defu(compilerOptions, getDefaultCompilerOptions());\n\n const host = {\n name: \"storm-vfs\",\n root: context.workspaceConfig.workspaceRoot,\n ...ts.sys,\n realpath: (path: string) => {\n if (context.fs.existsSync(path)) {\n return context.fs.resolve(path);\n }\n\n return ts.sys.realpath?.(path) ?? path;\n },\n getCurrentDirectory(): string {\n return context.workspaceConfig.workspaceRoot;\n },\n getCanonicalFileName(fileName: string): string {\n return fileName;\n },\n getDefaultLibFileName(_options: ts.CompilerOptions): string {\n return ts.getDefaultLibFileName(options);\n },\n getDefaultLibLocation(): string {\n return \"/\";\n },\n getNewLine(): string {\n return \"\\n\";\n },\n useCaseSensitiveFileNames(): boolean {\n return true;\n },\n fileExists(fileName: string): boolean {\n return context.fs.existsSync(fileName);\n },\n readFile(fileName: string): string | undefined {\n if (context.fs.existsSync(fileName)) {\n return context.fs.readFileSync(fileName);\n }\n\n return undefined;\n },\n readDirectory: (\n path: string,\n extensions: readonly string[] = [],\n exclude: readonly string[] = [],\n include: readonly string[] = []\n ) => {\n let results = [] as string[];\n if (context.fs.existsSync(path)) {\n results = context.fs.readdirSync(path, {\n encoding: \"utf8\",\n recursive: true\n });\n\n if (extensions.length > 0) {\n results = results.filter(file =>\n extensions.some(ext =>\n file.endsWith(ext.startsWith(\".\") ? ext : `.${ext}`)\n )\n );\n }\n\n if (exclude.length > 0) {\n results = results.filter(\n file => !exclude.some(pattern => minimatch(file, pattern))\n );\n }\n\n if (include.length > 0) {\n results = results.filter(file =>\n include.some(pattern => minimatch(file, pattern))\n );\n }\n }\n\n return results;\n },\n writeFile(fileName: string, data: string): void {\n context.fs.writeFileSync(fileName, data);\n },\n resolvePath: (fileName: string): string => {\n if (context.fs.existsSync(fileName)) {\n return context.fs.resolve(fileName) as string;\n }\n\n return ts.sys.resolvePath(fileName);\n },\n getSourceFile(\n fileName: string,\n languageVersionOrOptions: ts.ScriptTarget | ts.CreateSourceFileOptions,\n _?: (message: string) => void,\n shouldCreateNewSourceFile?: boolean\n ): ts.SourceFile | undefined {\n if (context.fs.existsSync(fileName)) {\n return ts.createSourceFile(\n fileName,\n context.fs.readFileSync(fileName)!,\n languageVersionOrOptions ??\n compilerOptions.target ??\n getDefaultCompilerOptions().target!,\n false\n );\n } else if (shouldCreateNewSourceFile) {\n const sourceFile = ts.createSourceFile(\n fileName,\n \"\",\n languageVersionOrOptions ??\n compilerOptions.target ??\n getDefaultCompilerOptions().target!,\n false\n );\n context.fs.writeFileSync(fileName, sourceFile.text);\n return sourceFile;\n }\n\n return undefined;\n }\n } as ts.CompilerHost;\n\n return ts.createProgram(rootNames, options, host);\n}\n\ninterface VirtualCompilerHostReturn {\n compilerHost: ts.CompilerHost;\n updateFile: (sourceFile: ts.SourceFile) => boolean;\n deleteFile: (sourceFile: ts.SourceFile) => boolean;\n}\n\n/**\n * Creates an in-memory CompilerHost -which is essentially an extra wrapper to System\n * which works with TypeScript objects - returns both a compiler host, and a way to add new SourceFile\n * instances to the in-memory file system.\n */\nexport function createVirtualCompilerHost(\n context: Context,\n sys: ts.System,\n compilerOptions: ts.CompilerOptions\n) {\n return {\n compilerHost: {\n ...sys,\n getCanonicalFileName: fileName => fileName,\n getDefaultLibFileName: () =>\n `/${ts.getDefaultLibFileName(compilerOptions)}`, // '/lib.d.ts',\n // getDefaultLibLocation: () => '/',\n getNewLine: () => sys.newLine,\n getSourceFile: (\n fileName: string,\n languageVersionOrOptions: ts.ScriptTarget | ts.CreateSourceFileOptions\n ) => {\n const resolved = context.fs.resolve(fileName);\n if (resolved && context.fs.existsSync(resolved)) {\n return context.fs.readFileSync(resolved);\n }\n\n return ts.createSourceFile(\n fileName,\n sys.readFile(fileName)!,\n languageVersionOrOptions ?? compilerOptions.target,\n false\n );\n },\n useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames\n },\n updateFile: sourceFile => {\n const alreadyExists = context.fs.existsSync(sourceFile.fileName);\n sys.writeFile(sourceFile.fileName, sourceFile.text);\n return alreadyExists;\n },\n deleteFile: sourceFile => {\n const alreadyExists = context.fs.existsSync(sourceFile.fileName);\n sys.deleteFile!(sourceFile.fileName);\n return alreadyExists;\n }\n } as VirtualCompilerHostReturn;\n}\n"]}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
|
|
4
|
-
var types = require('@storm-software/config-tools/types');
|
|
5
|
-
var writeFile$1 = require('@stryke/fs/write-file');
|
|
6
|
-
var prettier = require('prettier');
|
|
7
|
-
|
|
8
|
-
async function writeFile(log, filepath, content, skipFormat = false) {
|
|
9
|
-
try {
|
|
10
|
-
if (skipFormat) {
|
|
11
|
-
await writeFile$1.writeFile(filepath, content);
|
|
12
|
-
} else {
|
|
13
|
-
const config = await prettier.resolveConfig(filepath);
|
|
14
|
-
const formatted = await prettier.format(content, {
|
|
15
|
-
...config ?? {},
|
|
16
|
-
filepath
|
|
17
|
-
});
|
|
18
|
-
await writeFile$1.writeFile(filepath, formatted || "");
|
|
19
|
-
}
|
|
20
|
-
} catch (error) {
|
|
21
|
-
log(types.LogLevelLabel.ERROR, `Failed to write file ${filepath} to disk
|
|
22
|
-
${error?.message ? error.message : ""}`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
chunkPK6SKIKE_cjs.__name(writeFile, "writeFile");
|
|
26
|
-
|
|
27
|
-
exports.writeFile = writeFile;
|
|
28
|
-
//# sourceMappingURL=chunk-RQICHHZM.cjs.map
|
|
29
|
-
//# sourceMappingURL=chunk-RQICHHZM.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utilities/write-file.ts"],"names":["writeFile","log","filepath","content","skipFormat","writeFileBase","config","resolveConfig","formatted","format","error","LogLevelLabel","ERROR","message"],"mappings":";;;;;;;AA+BA,eAAsBA,SAAAA,CACpBC,GAAAA,EACAC,QAAAA,EACAC,OAAAA,EACAC,aAAa,KAAA,EAAK;AAElB,EAAA,IAAI;AACF,IAAA,IAAIA,UAAAA,EAAY;AACd,MAAA,MAAMC,qBAAAA,CAAcH,UAAUC,OAAAA,CAAAA;IAChC,CAAA,MAAO;AACL,MAAA,MAAMG,MAAAA,GAAS,MAAMC,sBAAAA,CAAcL,QAAAA,CAAAA;AACnC,MAAA,MAAMM,SAAAA,GAAY,MAAMC,eAAAA,CAAON,OAAAA,EAAS;AACtC,QAAA,GAAIG,UAAU,EAAC;AACfJ,QAAAA;OACF,CAAA;AAEA,MAAA,MAAMG,qBAAAA,CAAcH,QAAAA,EAAUM,SAAAA,IAAa,EAAA,CAAA;AAC7C,IAAA;AACF,EAAA,CAAA,CAAA,OAASE,KAAAA,EAAO;AACdT,IAAAA,GAAAA,CACEU,mBAAAA,CAAcC,KAAAA,EACd,CAAA,qBAAA,EAAwBV,QAAAA,CAAAA;AAAuBQ,EAAAA,KAAAA,EAAiBG,OAAAA,GAAWH,KAAAA,CAAgBG,OAAAA,GAAU,EAAA,CAAA,CAAI,CAAA;AAE7G,EAAA;AACF;AAxBsBb,wBAAAA,CAAAA,SAAAA,EAAAA,WAAAA,CAAAA","file":"chunk-RQICHHZM.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { writeFile as writeFileBase } from \"@stryke/fs/write-file\";\nimport { format, resolveConfig } from \"prettier\";\nimport type { LogFn } from \"../../types/config\";\n\n/**\n * Writes and formats a file to the file system\n *\n * @param log - The logging function to use for logging errors\n * @param filepath - The file path to write the file\n * @param content - The content to write to the file\n * @param skipFormat - Should the plugin skip formatting the `content` string with Prettier\n */\nexport async function writeFile(\n log: LogFn,\n filepath: string,\n content: string,\n skipFormat = false\n) {\n try {\n if (skipFormat) {\n await writeFileBase(filepath, content);\n } else {\n const config = await resolveConfig(filepath);\n const formatted = await format(content, {\n ...(config ?? {}),\n filepath\n });\n\n await writeFileBase(filepath, formatted || \"\");\n }\n } catch (error) {\n log(\n LogLevelLabel.ERROR,\n `Failed to write file ${filepath} to disk \\n${(error as Error)?.message ? (error as Error).message : \"\"}`\n );\n }\n}\n"]}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { __name } from './chunk-7QVYU63E.js';
|
|
2
|
-
import { resolvePackage } from '@stryke/fs/resolve';
|
|
3
|
-
import { joinPaths } from '@stryke/path/join-paths';
|
|
4
|
-
|
|
5
|
-
async function resolvePath(context, file) {
|
|
6
|
-
let path = context.fs.resolve(file);
|
|
7
|
-
if (path) {
|
|
8
|
-
return path;
|
|
9
|
-
}
|
|
10
|
-
path = file;
|
|
11
|
-
if (context.fs.existsSync(path)) {
|
|
12
|
-
return path;
|
|
13
|
-
}
|
|
14
|
-
path = joinPaths(context.workspaceConfig.workspaceRoot, file);
|
|
15
|
-
if (context.fs.existsSync(path)) {
|
|
16
|
-
return path;
|
|
17
|
-
}
|
|
18
|
-
path = joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, file);
|
|
19
|
-
if (context.fs.existsSync(path)) {
|
|
20
|
-
return path;
|
|
21
|
-
}
|
|
22
|
-
path = joinPaths(context.config.projectRoot, file);
|
|
23
|
-
if (context.fs.existsSync(path)) {
|
|
24
|
-
return path;
|
|
25
|
-
}
|
|
26
|
-
return resolvePackage(file, {
|
|
27
|
-
paths: [
|
|
28
|
-
context.workspaceConfig.workspaceRoot,
|
|
29
|
-
joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot)
|
|
30
|
-
]
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
__name(resolvePath, "resolvePath");
|
|
34
|
-
|
|
35
|
-
export { resolvePath };
|
|
36
|
-
//# sourceMappingURL=chunk-RXQWNSZX.js.map
|
|
37
|
-
//# sourceMappingURL=chunk-RXQWNSZX.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utilities/resolve-path.ts"],"names":["resolvePath","context","file","path","fs","resolve","existsSync","joinPaths","workspaceConfig","workspaceRoot","config","projectRoot","resolvePackage","paths"],"mappings":";;;;AA6BA,eAAsBA,WAAAA,CACpBC,SACAC,IAAAA,EAAY;AAEZ,EAAA,IAAIC,IAAAA,GAAOF,OAAAA,CAAQG,EAAAA,CAAGC,OAAAA,CAAQH,IAAAA,CAAAA;AAC9B,EAAA,IAAIC,IAAAA,EAAM;AACR,IAAA,OAAOA,IAAAA;AACT,EAAA;AAEAA,EAAAA,IAAAA,GAAOD,IAAAA;AACP,EAAA,IAAID,OAAAA,CAAQG,EAAAA,CAAGE,UAAAA,CAAWH,IAAAA,CAAAA,EAAO;AAC/B,IAAA,OAAOA,IAAAA;AACT,EAAA;AAEAA,EAAAA,IAAAA,GAAOI,SAAAA,CAAUN,OAAAA,CAAQO,eAAAA,CAAgBC,aAAAA,EAAeP,IAAAA,CAAAA;AACxD,EAAA,IAAID,OAAAA,CAAQG,EAAAA,CAAGE,UAAAA,CAAWH,IAAAA,CAAAA,EAAO;AAC/B,IAAA,OAAOA,IAAAA;AACT,EAAA;AAEAA,EAAAA,IAAAA,GAAOI,UACLN,OAAAA,CAAQO,eAAAA,CAAgBC,eACxBR,OAAAA,CAAQS,MAAAA,CAAOC,aACfT,IAAAA,CAAAA;AAEF,EAAA,IAAID,OAAAA,CAAQG,EAAAA,CAAGE,UAAAA,CAAWH,IAAAA,CAAAA,EAAO;AAC/B,IAAA,OAAOA,IAAAA;AACT,EAAA;AAEAA,EAAAA,IAAAA,GAAOI,SAAAA,CAAUN,OAAAA,CAAQS,MAAAA,CAAOC,WAAAA,EAAaT,IAAAA,CAAAA;AAC7C,EAAA,IAAID,OAAAA,CAAQG,EAAAA,CAAGE,UAAAA,CAAWH,IAAAA,CAAAA,EAAO;AAC/B,IAAA,OAAOA,IAAAA;AACT,EAAA;AAEA,EAAA,OAAOS,eAAeV,IAAAA,EAAM;IAC1BW,KAAAA,EAAO;AACLZ,MAAAA,OAAAA,CAAQO,eAAAA,CAAgBC,aAAAA;AACxBF,MAAAA,SAAAA,CACEN,OAAAA,CAAQO,eAAAA,CAAgBC,aAAAA,EACxBR,OAAAA,CAAQS,OAAOC,WAAW;;GAGhC,CAAA;AACF;AA1CsBX,MAAAA,CAAAA,WAAAA,EAAAA,aAAAA,CAAAA","file":"chunk-RXQWNSZX.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { resolvePackage } from \"@stryke/fs/resolve\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { Context } from \"../../types/context\";\n\n/**\n * Resolves the path of a file in the workspace or project root.\n *\n * @param context - The context object containing the environment paths.\n * @param file - The file path to resolve.\n * @returns A promise that resolves to the resolved path.\n */\nexport async function resolvePath(\n context: Context,\n file: string\n): Promise<string | undefined> {\n let path = context.fs.resolve(file);\n if (path) {\n return path;\n }\n\n path = file;\n if (context.fs.existsSync(path)) {\n return path;\n }\n\n path = joinPaths(context.workspaceConfig.workspaceRoot, file);\n if (context.fs.existsSync(path)) {\n return path;\n }\n\n path = joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n file\n );\n if (context.fs.existsSync(path)) {\n return path;\n }\n\n path = joinPaths(context.config.projectRoot, file);\n if (context.fs.existsSync(path)) {\n return path;\n }\n\n return resolvePackage(file, {\n paths: [\n context.workspaceConfig.workspaceRoot,\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot\n )\n ]\n });\n}\n"]}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { __name } from './chunk-7QVYU63E.js';
|
|
2
|
-
import { parseTypeDefinition } from '@stryke/convert/parse-type-definition';
|
|
3
|
-
import { toArray } from '@stryke/convert/to-array';
|
|
4
|
-
import { listFiles, listFilesSync } from '@stryke/fs/list-files';
|
|
5
|
-
import { murmurhash } from '@stryke/hash/murmurhash';
|
|
6
|
-
import { getUniqueBy } from '@stryke/helpers/get-unique';
|
|
7
|
-
import { appendPath } from '@stryke/path/append';
|
|
8
|
-
import { findFileExtensionSafe } from '@stryke/path/file-path-fns';
|
|
9
|
-
import { joinPaths } from '@stryke/path/join-paths';
|
|
10
|
-
import { replacePath } from '@stryke/path/replace';
|
|
11
|
-
import { isSetString } from '@stryke/type-checks/is-set-string';
|
|
12
|
-
|
|
13
|
-
function resolveEntryInputFile(context, typeDefinition) {
|
|
14
|
-
return replacePath(typeDefinition.file, joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot));
|
|
15
|
-
}
|
|
16
|
-
__name(resolveEntryInputFile, "resolveEntryInputFile");
|
|
17
|
-
function resolveEntryInput(context, typeDefinition) {
|
|
18
|
-
return {
|
|
19
|
-
file: resolveEntryInputFile(context, typeDefinition),
|
|
20
|
-
name: typeDefinition.name
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
__name(resolveEntryInput, "resolveEntryInput");
|
|
24
|
-
function resolveEntryOutput(context, typeDefinition) {
|
|
25
|
-
return joinPaths(replacePath(replacePath(replacePath(replacePath(typeDefinition.file, joinPaths(context.workspaceConfig.workspaceRoot, context.config.sourceRoot)), joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot)), context.config.sourceRoot), context.config.projectRoot)).replace(`.${findFileExtensionSafe(typeDefinition.file)}`, "");
|
|
26
|
-
}
|
|
27
|
-
__name(resolveEntryOutput, "resolveEntryOutput");
|
|
28
|
-
function resolveEntry(context, typeDefinition) {
|
|
29
|
-
const input = resolveEntryInput(context, typeDefinition);
|
|
30
|
-
return {
|
|
31
|
-
...input,
|
|
32
|
-
input,
|
|
33
|
-
output: resolveEntryOutput(context, typeDefinition)
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
__name(resolveEntry, "resolveEntry");
|
|
37
|
-
async function resolveEntries(context, typeDefinitions) {
|
|
38
|
-
return (await Promise.all(typeDefinitions.map(async (typeDefinition) => {
|
|
39
|
-
const parsed = parseTypeDefinition(typeDefinition);
|
|
40
|
-
return (await listFiles(appendPath(parsed.file, context.config.projectRoot))).map((file) => resolveEntry(context, {
|
|
41
|
-
file,
|
|
42
|
-
name: parsed.name
|
|
43
|
-
}));
|
|
44
|
-
}))).flat().filter(Boolean);
|
|
45
|
-
}
|
|
46
|
-
__name(resolveEntries, "resolveEntries");
|
|
47
|
-
function resolveEntriesSync(context, typeDefinitions) {
|
|
48
|
-
return typeDefinitions.map((typeDefinition) => {
|
|
49
|
-
const parsed = parseTypeDefinition(typeDefinition);
|
|
50
|
-
return listFilesSync(appendPath(parsed.file, context.config.projectRoot)).map((file) => resolveEntry(context, {
|
|
51
|
-
file,
|
|
52
|
-
name: parsed.name
|
|
53
|
-
}));
|
|
54
|
-
}).flat().filter(Boolean);
|
|
55
|
-
}
|
|
56
|
-
__name(resolveEntriesSync, "resolveEntriesSync");
|
|
57
|
-
function resolveVirtualEntry(context, typeDefinition) {
|
|
58
|
-
const parsed = parseTypeDefinition(typeDefinition);
|
|
59
|
-
const resolved = resolveEntry(context, parsed);
|
|
60
|
-
const file = joinPaths(context.artifactsPath, `entry-${murmurhash({
|
|
61
|
-
file: resolved.file,
|
|
62
|
-
name: resolved.name
|
|
63
|
-
}, {
|
|
64
|
-
maxLength: 24
|
|
65
|
-
}).replaceAll("-", "0").replaceAll("_", "1")}.ts`);
|
|
66
|
-
return {
|
|
67
|
-
file,
|
|
68
|
-
name: resolved.name,
|
|
69
|
-
input: {
|
|
70
|
-
file,
|
|
71
|
-
name: resolved.name
|
|
72
|
-
},
|
|
73
|
-
output: file
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
__name(resolveVirtualEntry, "resolveVirtualEntry");
|
|
77
|
-
function getUniqueEntries(entries = []) {
|
|
78
|
-
return getUniqueBy(toArray(entries), (item) => isSetString(item) ? item : murmurhash(item ?? {}, {
|
|
79
|
-
maxLength: 24
|
|
80
|
-
}));
|
|
81
|
-
}
|
|
82
|
-
__name(getUniqueEntries, "getUniqueEntries");
|
|
83
|
-
|
|
84
|
-
export { getUniqueEntries, resolveEntries, resolveEntriesSync, resolveEntry, resolveEntryInput, resolveEntryInputFile, resolveEntryOutput, resolveVirtualEntry };
|
|
85
|
-
//# sourceMappingURL=chunk-STAKGAWR.js.map
|
|
86
|
-
//# sourceMappingURL=chunk-STAKGAWR.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/entry.ts"],"names":["resolveEntryInputFile","context","typeDefinition","replacePath","file","joinPaths","workspaceConfig","workspaceRoot","config","projectRoot","resolveEntryInput","name","resolveEntryOutput","sourceRoot","replace","findFileExtensionSafe","resolveEntry","input","output","resolveEntries","typeDefinitions","Promise","all","map","parsed","parseTypeDefinition","listFiles","appendPath","flat","filter","Boolean","resolveEntriesSync","listFilesSync","resolveVirtualEntry","resolved","artifactsPath","murmurhash","maxLength","replaceAll","getUniqueEntries","entries","getUniqueBy","toArray","item","isSetString"],"mappings":";;;;;;;;;;;;AAmCO,SAASA,qBAAAA,CACdC,SACAC,cAAAA,EAA8B;AAE9B,EAAA,OAAOC,WAAAA,CACLD,cAAAA,CAAeE,IAAAA,EACfC,SAAAA,CAAUJ,OAAAA,CAAQK,gBAAgBC,aAAAA,EAAeN,OAAAA,CAAQO,MAAAA,CAAOC,WAAW,CAAA,CAAA;AAE/E;AARgBT,MAAAA,CAAAA,qBAAAA,EAAAA,uBAAAA,CAAAA;AAUT,SAASU,iBAAAA,CACdT,SACAC,cAAAA,EAA8B;AAE9B,EAAA,OAAO;IACLE,IAAAA,EAAMJ,qBAAAA,CAAsBC,SAASC,cAAAA,CAAAA;AACrCS,IAAAA,IAAAA,EAAMT,cAAAA,CAAeS;AACvB,GAAA;AACF;AARgBD,MAAAA,CAAAA,iBAAAA,EAAAA,mBAAAA,CAAAA;AAUT,SAASE,kBAAAA,CACdX,SACAC,cAAAA,EAA8B;AAE9B,EAAA,OAAOG,UACLF,WAAAA,CACEA,WAAAA,CACEA,YACEA,WAAAA,CACED,cAAAA,CAAeE,MACfC,SAAAA,CACEJ,OAAAA,CAAQK,eAAAA,CAAgBC,aAAAA,EACxBN,QAAQO,MAAAA,CAAOK,UAAU,CAAA,CAAA,EAG7BR,SAAAA,CACEJ,QAAQK,eAAAA,CAAgBC,aAAAA,EACxBN,OAAAA,CAAQO,MAAAA,CAAOC,WAAW,CAAA,CAAA,EAG9BR,QAAQO,MAAAA,CAAOK,UAAU,GAE3BZ,OAAAA,CAAQO,MAAAA,CAAOC,WAAW,CAAA,CAAA,CAE5BK,QAAQ,CAAA,CAAA,EAAIC,qBAAAA,CAAsBb,eAAeE,IAAI,CAAA,IAAK,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A,GAA+D,EAAA,EAAE;AAEjE,EAAA,OAAOC,WAAAA,CAAYC,OAAAA,CAAQF,OAAAA,CAAAA,EAAU,CAACG,IAAAA,KACpCC,WAAAA,CAAYD,IAAAA,CAAAA,GAAQA,IAAAA,GAAOP,UAAAA,CAAWO,IAAAA,IAAQ,EAAC,EAAG;IAAEN,SAAAA,EAAW;AAAG,GAAA,CAAA,CAAA;AAEtE;AANgBE,MAAAA,CAAAA,gBAAAA,EAAAA,kBAAAA,CAAAA","file":"chunk-STAKGAWR.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { listFiles, listFilesSync } from \"@stryke/fs/list-files\";\nimport { murmurhash } from \"@stryke/hash/murmurhash\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { findFileExtensionSafe } from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport type {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport type { Context } from \"../types/context\";\nimport { ResolvedEntryTypeDefinition } from \"../types/resolved\";\n\nexport function resolveEntryInputFile(\n context: Context,\n typeDefinition: TypeDefinition\n): string {\n return replacePath(\n typeDefinition.file,\n joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot)\n );\n}\n\nexport function resolveEntryInput(\n context: Context,\n typeDefinition: TypeDefinition\n): TypeDefinition {\n return {\n file: resolveEntryInputFile(context, typeDefinition),\n name: typeDefinition.name\n };\n}\n\nexport function resolveEntryOutput(\n context: Context,\n typeDefinition: TypeDefinition\n): string {\n return joinPaths(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n typeDefinition.file,\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.sourceRoot\n )\n ),\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot\n )\n ),\n context.config.sourceRoot\n ),\n context.config.projectRoot\n )\n ).replace(`.${findFileExtensionSafe(typeDefinition.file)}`, \"\");\n}\n\nexport function resolveEntry(\n context: Context,\n typeDefinition: TypeDefinition\n): ResolvedEntryTypeDefinition {\n const input = resolveEntryInput(context, typeDefinition);\n\n return {\n ...input,\n input,\n output: resolveEntryOutput(context, typeDefinition)\n };\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport async function resolveEntries(\n context: Context,\n typeDefinitions: TypeDefinitionParameter[]\n): Promise<ResolvedEntryTypeDefinition[]> {\n return (\n await Promise.all(\n typeDefinitions.map(async typeDefinition => {\n const parsed = parseTypeDefinition(typeDefinition)!;\n\n return (\n await listFiles(appendPath(parsed.file, context.config.projectRoot))\n ).map(file =>\n resolveEntry(context, {\n file,\n name: parsed.name\n })\n );\n })\n )\n )\n .flat()\n .filter(Boolean);\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport function resolveEntriesSync(\n context: Context,\n typeDefinitions: TypeDefinitionParameter[]\n): ResolvedEntryTypeDefinition[] {\n return typeDefinitions\n .map(typeDefinition => {\n const parsed = parseTypeDefinition(typeDefinition)!;\n\n return listFilesSync(\n appendPath(parsed.file, context.config.projectRoot)\n ).map(file =>\n resolveEntry(context, {\n file,\n name: parsed.name\n })\n );\n })\n .flat()\n .filter(Boolean);\n}\n\n/** Resolve a virtual entry point by generating a unique file path in the artifacts directory.\n *\n * @param context - The current context\n * @param typeDefinition - The type definition to resolve.\n * @returns The resolved entry type definition with a unique virtual file path.\n */\nexport function resolveVirtualEntry(\n context: Context,\n typeDefinition: TypeDefinitionParameter\n): ResolvedEntryTypeDefinition {\n const parsed = parseTypeDefinition(typeDefinition)!;\n const resolved = resolveEntry(context, parsed);\n const file = joinPaths(\n context.artifactsPath,\n `entry-${murmurhash(\n { file: resolved.file, name: resolved.name },\n { maxLength: 24 }\n )\n .replaceAll(\"-\", \"0\")\n .replaceAll(\"_\", \"1\")}.ts`\n );\n\n return {\n file,\n name: resolved.name,\n input: {\n file,\n name: resolved.name\n },\n output: file\n };\n}\n\n/**\n * Get unique entries from the provided list.\n *\n * @param entries - The entries to process.\n * @returns An array of unique entries (by file path or content hash).\n */\nexport function getUniqueEntries(\n entries: TypeDefinitionParameter | TypeDefinitionParameter[] = []\n): TypeDefinitionParameter[] {\n return getUniqueBy(toArray(entries), (item: TypeDefinitionParameter) =>\n isSetString(item) ? item : murmurhash(item ?? {}, { maxLength: 24 })\n );\n}\n"]}
|