@powerlines/core 0.48.27 → 0.48.29
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-DTCbbtSH.d.cts +6 -0
- package/dist/api-DTCbbtSH.d.cts.map +1 -0
- package/dist/api-DTCbbtSH.d.mts +6 -0
- package/dist/api-DTCbbtSH.d.mts.map +1 -0
- package/dist/base-context-BmxgDD3S.d.mts +79 -0
- package/dist/base-context-BmxgDD3S.d.mts.map +1 -0
- package/dist/base-context-mHoSEqHf.d.cts +79 -0
- package/dist/base-context-mHoSEqHf.d.cts.map +1 -0
- package/dist/{_virtual/_rolldown/runtime.cjs → chunk-C_NdSu1c.cjs} +6 -9
- package/dist/commands-DzGd8pnR.d.cts +5 -0
- package/dist/commands-DzGd8pnR.d.cts.map +1 -0
- package/dist/commands-DzGd8pnR.d.mts +5 -0
- package/dist/commands-DzGd8pnR.d.mts.map +1 -0
- package/dist/config-BnV_o0Es.d.cts +2461 -0
- package/dist/config-BnV_o0Es.d.cts.map +1 -0
- package/dist/config-DKeDSykZ.d.cts +138 -0
- package/dist/config-DKeDSykZ.d.cts.map +1 -0
- package/dist/config-DbOP5nVu.d.mts +138 -0
- package/dist/config-DbOP5nVu.d.mts.map +1 -0
- package/dist/config-DboKmDhl.d.mts +2461 -0
- package/dist/config-DboKmDhl.d.mts.map +1 -0
- package/dist/constants/api.cjs +0 -8
- package/dist/constants/api.d.cts +2 -6
- package/dist/constants/api.d.mts +2 -8
- package/dist/constants/api.mjs +0 -8
- package/dist/constants/api.mjs.map +1 -1
- package/dist/constants/commands.cjs +0 -8
- package/dist/constants/commands.d.cts +2 -5
- package/dist/constants/commands.d.mts +2 -7
- package/dist/constants/commands.mjs +0 -8
- package/dist/constants/commands.mjs.map +1 -1
- package/dist/constants/devtools.cjs +0 -8
- package/dist/constants/devtools.d.cts +2 -13
- package/dist/constants/devtools.d.mts +2 -15
- package/dist/constants/devtools.mjs +0 -8
- package/dist/constants/devtools.mjs.map +1 -1
- package/dist/constants/environments.cjs +0 -8
- package/dist/constants/environments.d.cts +2 -10
- package/dist/constants/environments.d.mts +2 -12
- package/dist/constants/environments.mjs +0 -8
- package/dist/constants/environments.mjs.map +1 -1
- package/dist/constants/extensions.cjs +0 -8
- package/dist/constants/extensions.d.cts +2 -5
- package/dist/constants/extensions.d.mts +2 -7
- package/dist/constants/extensions.mjs +0 -8
- package/dist/constants/extensions.mjs.map +1 -1
- package/dist/constants/fs.cjs +0 -8
- package/dist/constants/fs.d.cts +2 -7
- package/dist/constants/fs.d.mts +2 -9
- package/dist/constants/fs.mjs +0 -8
- package/dist/constants/fs.mjs.map +1 -1
- package/dist/constants/hooks.cjs +0 -8
- package/dist/constants/hooks.d.cts +2 -5
- package/dist/constants/hooks.d.mts +2 -7
- package/dist/constants/hooks.mjs +0 -8
- package/dist/constants/hooks.mjs.map +1 -1
- package/dist/constants/index.cjs +0 -8
- package/dist/constants/index.d.cts +10 -10
- package/dist/constants/index.d.mts +10 -12
- package/dist/constants/index.mjs +0 -8
- package/dist/constants/log-level.cjs +0 -8
- package/dist/constants/log-level.d.cts +2 -67
- package/dist/constants/log-level.d.mts +2 -69
- package/dist/constants/log-level.mjs +0 -8
- package/dist/constants/log-level.mjs.map +1 -1
- package/dist/constants/meta.cjs +0 -8
- package/dist/constants/meta.d.cts +2 -6
- package/dist/constants/meta.d.mts +2 -8
- package/dist/constants/meta.mjs +0 -8
- package/dist/constants/meta.mjs.map +1 -1
- package/dist/constants/plugin.cjs +0 -8
- package/dist/constants/plugin.d.cts +2 -9
- package/dist/constants/plugin.d.mts +2 -11
- package/dist/constants/plugin.mjs +0 -8
- package/dist/constants/plugin.mjs.map +1 -1
- package/dist/context/base-context.cjs +2 -10
- package/dist/context/base-context.d.cts +2 -81
- package/dist/context/base-context.d.mts +2 -83
- package/dist/context/base-context.mjs +0 -8
- package/dist/context/base-context.mjs.map +1 -1
- package/dist/context/context.cjs +2 -10
- package/dist/context/context.d.cts +2 -373
- package/dist/context/context.d.mts +2 -375
- package/dist/context/context.mjs +0 -8
- package/dist/context/context.mjs.map +1 -1
- package/dist/context/environment-context.cjs +0 -8
- package/dist/context/environment-context.d.cts +2 -5
- package/dist/context/environment-context.d.cts.map +1 -1
- package/dist/context/environment-context.d.mts +2 -7
- package/dist/context/environment-context.d.mts.map +1 -1
- package/dist/context/environment-context.mjs +0 -8
- package/dist/context/environment-context.mjs.map +1 -1
- package/dist/context/execution-context.cjs +2 -10
- package/dist/context/execution-context.d.cts +2 -6
- package/dist/context/execution-context.d.cts.map +1 -1
- package/dist/context/execution-context.d.mts +2 -8
- package/dist/context/execution-context.d.mts.map +1 -1
- package/dist/context/execution-context.mjs +0 -8
- package/dist/context/execution-context.mjs.map +1 -1
- package/dist/context/index.cjs +0 -8
- package/dist/context/index.d.cts +2 -2
- package/dist/context/index.d.mts +2 -4
- package/dist/context/index.mjs +0 -8
- package/dist/context/plugin-context.cjs +0 -8
- package/dist/context/plugin-context.d.cts +1 -3
- package/dist/context/plugin-context.d.cts.map +1 -1
- package/dist/context/plugin-context.d.mts +1 -5
- package/dist/context/plugin-context.d.mts.map +1 -1
- package/dist/context/plugin-context.mjs +0 -8
- package/dist/context/plugin-context.mjs.map +1 -1
- package/dist/context-C6oL3mPw.d.mts +368 -0
- package/dist/context-C6oL3mPw.d.mts.map +1 -0
- package/dist/context-DcY6YqBQ.d.cts +368 -0
- package/dist/context-DcY6YqBQ.d.cts.map +1 -0
- package/dist/context-helpers-BKxpDArS.d.mts +15 -0
- package/dist/context-helpers-BKxpDArS.d.mts.map +1 -0
- package/dist/context-helpers-zXovPE7i.d.cts +15 -0
- package/dist/context-helpers-zXovPE7i.d.cts.map +1 -0
- package/dist/devtools-h0du-bSj.d.cts +13 -0
- package/dist/devtools-h0du-bSj.d.cts.map +1 -0
- package/dist/devtools-h0du-bSj.d.mts +13 -0
- package/dist/devtools-h0du-bSj.d.mts.map +1 -0
- package/dist/entry-BC_V2K2U.d.cts +46 -0
- package/dist/entry-BC_V2K2U.d.cts.map +1 -0
- package/dist/entry-CHIaWcmk.d.mts +46 -0
- package/dist/entry-CHIaWcmk.d.mts.map +1 -0
- package/dist/environments-BYv_kHRG.d.cts +10 -0
- package/dist/environments-BYv_kHRG.d.cts.map +1 -0
- package/dist/environments-BYv_kHRG.d.mts +10 -0
- package/dist/environments-BYv_kHRG.d.mts.map +1 -0
- package/dist/events-NA1XM2Vz.d.cts +10 -0
- package/dist/events-NA1XM2Vz.d.cts.map +1 -0
- package/dist/events-NA1XM2Vz.d.mts +10 -0
- package/dist/events-NA1XM2Vz.d.mts.map +1 -0
- package/dist/extensions-ctxXzgay.d.cts +5 -0
- package/dist/extensions-ctxXzgay.d.cts.map +1 -0
- package/dist/extensions-ctxXzgay.d.mts +5 -0
- package/dist/extensions-ctxXzgay.d.mts.map +1 -0
- package/dist/file-header-Co9oo7aI.d.cts +41 -0
- package/dist/file-header-Co9oo7aI.d.cts.map +1 -0
- package/dist/file-header-rHqeXgRV.d.mts +41 -0
- package/dist/file-header-rHqeXgRV.d.mts.map +1 -0
- package/dist/format-Cf-cgZ-s.d.cts +24 -0
- package/dist/format-Cf-cgZ-s.d.cts.map +1 -0
- package/dist/format-IQPqgWIe.d.mts +24 -0
- package/dist/format-IQPqgWIe.d.mts.map +1 -0
- package/dist/fs-BzXT5ZPj.d.cts +7 -0
- package/dist/fs-BzXT5ZPj.d.cts.map +1 -0
- package/dist/fs-BzXT5ZPj.d.mts +7 -0
- package/dist/fs-BzXT5ZPj.d.mts.map +1 -0
- package/dist/{schemas/fs.cjs → fs-C2lru696.cjs} +38 -16
- package/dist/{schemas/fs.mjs → fs-DqLn15uU.mjs} +2 -10
- package/dist/fs-DqLn15uU.mjs.map +1 -0
- package/dist/generate-types-CDkVosrS.d.cts +65 -0
- package/dist/generate-types-CDkVosrS.d.cts.map +1 -0
- package/dist/generate-types-Dw6p3cB_.d.mts +65 -0
- package/dist/generate-types-Dw6p3cB_.d.mts.map +1 -0
- package/dist/helpers-CrRRFQl5.d.mts +22 -0
- package/dist/helpers-CrRRFQl5.d.mts.map +1 -0
- package/dist/helpers-DBLIQW3U.d.cts +22 -0
- package/dist/helpers-DBLIQW3U.d.cts.map +1 -0
- package/dist/hooks-Dhc3ahex.d.cts +5 -0
- package/dist/hooks-Dhc3ahex.d.cts.map +1 -0
- package/dist/hooks-Dhc3ahex.d.mts +5 -0
- package/dist/hooks-Dhc3ahex.d.mts.map +1 -0
- package/dist/index-BKZ67WMa.d.cts +1 -0
- package/dist/index-BKZ67WMa.d.mts +1 -0
- package/dist/index-BVVgDSdq.d.cts +1 -0
- package/dist/index-BVVgDSdq.d.mts +1 -0
- package/dist/index-Den-MsLx.d.cts +1 -0
- package/dist/index-Den-MsLx.d.mts +1 -0
- package/dist/index-DmtQKWjk.d.cts +1 -0
- package/dist/index-DmtQKWjk.d.mts +1 -0
- package/dist/index-LtpXjuJR.d.mts +25 -0
- package/dist/index-LtpXjuJR.d.mts.map +1 -0
- package/dist/index-_6s0AX1B.d.cts +1 -0
- package/dist/index-_6s0AX1B.d.mts +1 -0
- package/dist/index-xk4vSgtB.d.cts +25 -0
- package/dist/index-xk4vSgtB.d.cts.map +1 -0
- package/dist/index.cjs +1 -9
- package/dist/index.d.cts +24 -32
- package/dist/index.d.mts +24 -34
- package/dist/index.mjs +1 -9
- package/dist/install-dependencies-CCjZfS9Y.d.mts +12 -0
- package/dist/install-dependencies-CCjZfS9Y.d.mts.map +1 -0
- package/dist/install-dependencies-CyeYsrfz.d.cts +12 -0
- package/dist/install-dependencies-CyeYsrfz.d.cts.map +1 -0
- package/dist/lib/config.cjs +2 -10
- package/dist/lib/config.d.cts +2 -140
- package/dist/lib/config.d.mts +2 -142
- package/dist/lib/config.mjs +0 -8
- package/dist/lib/config.mjs.map +1 -1
- package/dist/lib/context-helpers.cjs +0 -8
- package/dist/lib/context-helpers.d.cts +2 -16
- package/dist/lib/context-helpers.d.mts +2 -18
- package/dist/lib/context-helpers.mjs +0 -8
- package/dist/lib/context-helpers.mjs.map +1 -1
- package/dist/lib/entry.cjs +0 -8
- package/dist/lib/entry.d.cts +2 -47
- package/dist/lib/entry.d.mts +2 -49
- package/dist/lib/entry.mjs +0 -8
- package/dist/lib/entry.mjs.map +1 -1
- package/dist/lib/environment.cjs +2 -10
- package/dist/lib/environment.d.cts +1 -2
- package/dist/lib/environment.d.cts.map +1 -1
- package/dist/lib/environment.d.mts +1 -4
- package/dist/lib/environment.d.mts.map +1 -1
- package/dist/lib/environment.mjs +0 -8
- package/dist/lib/environment.mjs.map +1 -1
- package/dist/lib/events.cjs +0 -8
- package/dist/lib/events.d.cts +2 -10
- package/dist/lib/events.d.mts +2 -12
- package/dist/lib/events.mjs +0 -8
- package/dist/lib/events.mjs.map +1 -1
- package/dist/lib/generate-types.cjs +0 -8
- package/dist/lib/generate-types.d.cts +2 -66
- package/dist/lib/generate-types.d.mts +2 -68
- package/dist/lib/generate-types.mjs +0 -8
- package/dist/lib/generate-types.mjs.map +1 -1
- package/dist/lib/hooks.cjs +2 -10
- package/dist/lib/hooks.d.cts +2 -28
- package/dist/lib/hooks.d.mts +2 -30
- package/dist/lib/hooks.mjs +0 -8
- package/dist/lib/hooks.mjs.map +1 -1
- package/dist/lib/index.cjs +1 -9
- package/dist/lib/index.d.cts +23 -23
- package/dist/lib/index.d.mts +23 -25
- package/dist/lib/index.mjs +1 -9
- package/dist/lib/install-dependencies.cjs +0 -8
- package/dist/lib/install-dependencies.d.cts +2 -12
- package/dist/lib/install-dependencies.d.mts +2 -14
- package/dist/lib/install-dependencies.mjs +0 -8
- package/dist/lib/install-dependencies.mjs.map +1 -1
- package/dist/lib/meta.cjs +0 -8
- package/dist/lib/meta.d.cts +2 -33
- package/dist/lib/meta.d.mts +2 -35
- package/dist/lib/meta.mjs +0 -8
- package/dist/lib/meta.mjs.map +1 -1
- package/dist/lib/plugins.cjs +2 -10
- package/dist/lib/plugins.d.cts +2 -39
- package/dist/lib/plugins.d.mts +2 -41
- package/dist/lib/plugins.mjs +0 -8
- package/dist/lib/plugins.mjs.map +1 -1
- package/dist/lib/resolver.cjs +2 -10
- package/dist/lib/resolver.d.cts +2 -20
- package/dist/lib/resolver.d.mts +2 -22
- package/dist/lib/resolver.mjs +0 -8
- package/dist/lib/resolver.mjs.map +1 -1
- package/dist/lib/schemas.cjs +1 -9
- package/dist/lib/schemas.d.cts +1 -1
- package/dist/lib/schemas.d.mts +1 -3
- package/dist/lib/schemas.mjs +1 -9
- package/dist/lib/streaming-channel.cjs +0 -8
- package/dist/lib/streaming-channel.d.cts +2 -126
- package/dist/lib/streaming-channel.d.mts +2 -128
- package/dist/lib/streaming-channel.mjs +0 -8
- package/dist/lib/streaming-channel.mjs.map +1 -1
- package/dist/lib/typescript/index.cjs +0 -8
- package/dist/lib/typescript/index.d.cts +2 -2
- package/dist/lib/typescript/index.d.mts +2 -4
- package/dist/lib/typescript/index.mjs +0 -8
- package/dist/lib/typescript/ts-morph.cjs +2 -10
- package/dist/lib/typescript/ts-morph.d.cts +2 -38
- package/dist/lib/typescript/ts-morph.d.mts +2 -40
- package/dist/lib/typescript/ts-morph.mjs +0 -8
- package/dist/lib/typescript/ts-morph.mjs.map +1 -1
- package/dist/lib/typescript/tsconfig.cjs +4 -12
- package/dist/lib/typescript/tsconfig.d.cts +2 -77
- package/dist/lib/typescript/tsconfig.d.mts +2 -79
- package/dist/lib/typescript/tsconfig.mjs +0 -8
- package/dist/lib/typescript/tsconfig.mjs.map +1 -1
- package/dist/lib/unplugin/helpers.cjs +0 -8
- package/dist/lib/unplugin/helpers.d.cts +2 -23
- package/dist/lib/unplugin/helpers.d.mts +2 -25
- package/dist/lib/unplugin/helpers.mjs +0 -8
- package/dist/lib/unplugin/helpers.mjs.map +1 -1
- package/dist/lib/unplugin/index.cjs +0 -8
- package/dist/lib/unplugin/index.d.cts +3 -3
- package/dist/lib/unplugin/index.d.mts +3 -5
- package/dist/lib/unplugin/index.mjs +0 -8
- package/dist/lib/unplugin/module-resolution.cjs +2 -10
- package/dist/lib/unplugin/module-resolution.d.cts +2 -41
- package/dist/lib/unplugin/module-resolution.d.mts +2 -43
- package/dist/lib/unplugin/module-resolution.mjs +0 -8
- package/dist/lib/unplugin/module-resolution.mjs.map +1 -1
- package/dist/lib/unplugin/plugin.cjs +0 -8
- package/dist/lib/unplugin/plugin.d.cts +2 -40
- package/dist/lib/unplugin/plugin.d.mts +2 -42
- package/dist/lib/unplugin/plugin.mjs +0 -8
- package/dist/lib/unplugin/plugin.mjs.map +1 -1
- package/dist/lib/utilities/file-header.cjs +0 -8
- package/dist/lib/utilities/file-header.d.cts +2 -41
- package/dist/lib/utilities/file-header.d.mts +2 -43
- package/dist/lib/utilities/file-header.mjs +0 -8
- package/dist/lib/utilities/file-header.mjs.map +1 -1
- package/dist/lib/utilities/format.cjs +2 -10
- package/dist/lib/utilities/format.d.cts +2 -24
- package/dist/lib/utilities/format.d.mts +2 -26
- package/dist/lib/utilities/format.mjs +0 -8
- package/dist/lib/utilities/format.mjs.map +1 -1
- package/dist/lib/utilities/index.cjs +0 -8
- package/dist/lib/utilities/index.d.cts +5 -5
- package/dist/lib/utilities/index.d.mts +5 -7
- package/dist/lib/utilities/index.mjs +0 -8
- package/dist/lib/utilities/source-file.cjs +2 -10
- package/dist/lib/utilities/source-file.d.cts +2 -30
- package/dist/lib/utilities/source-file.d.mts +2 -32
- package/dist/lib/utilities/source-file.mjs +0 -8
- package/dist/lib/utilities/source-file.mjs.map +1 -1
- package/dist/lib/utilities/source-map.cjs +2 -10
- package/dist/lib/utilities/source-map.d.cts +2 -16
- package/dist/lib/utilities/source-map.d.mts +2 -18
- package/dist/lib/utilities/source-map.mjs +0 -8
- package/dist/lib/utilities/source-map.mjs.map +1 -1
- package/dist/lib/utilities/write-file.cjs +0 -8
- package/dist/lib/utilities/write-file.d.cts +2 -15
- package/dist/lib/utilities/write-file.d.mts +2 -17
- package/dist/lib/utilities/write-file.mjs +0 -8
- package/dist/lib/utilities/write-file.mjs.map +1 -1
- package/dist/lib/vfs.cjs +3 -11
- package/dist/lib/vfs.d.cts +2 -321
- package/dist/lib/vfs.d.mts +2 -323
- package/dist/lib/vfs.mjs +1 -9
- package/dist/lib/vfs.mjs.map +1 -1
- package/dist/log-level-BC8g4BBL.d.cts +67 -0
- package/dist/log-level-BC8g4BBL.d.cts.map +1 -0
- package/dist/log-level-BC8g4BBL.d.mts +67 -0
- package/dist/log-level-BC8g4BBL.d.mts.map +1 -0
- package/dist/meta-CdDd2ykC.d.cts +33 -0
- package/dist/meta-CdDd2ykC.d.cts.map +1 -0
- package/dist/meta-CfTCHU_o.d.mts +33 -0
- package/dist/meta-CfTCHU_o.d.mts.map +1 -0
- package/dist/meta-QA_SN1j3.d.cts +6 -0
- package/dist/meta-QA_SN1j3.d.cts.map +1 -0
- package/dist/meta-QA_SN1j3.d.mts +6 -0
- package/dist/meta-QA_SN1j3.d.mts.map +1 -0
- package/dist/module-resolution-CRMNPsdn.d.mts +40 -0
- package/dist/module-resolution-CRMNPsdn.d.mts.map +1 -0
- package/dist/module-resolution-D-w-EZaK.d.cts +40 -0
- package/dist/module-resolution-D-w-EZaK.d.cts.map +1 -0
- package/dist/plugin-B_b7XqaN.d.mts +39 -0
- package/dist/plugin-B_b7XqaN.d.mts.map +1 -0
- package/dist/plugin-CzV-aFwU.d.cts +39 -0
- package/dist/plugin-CzV-aFwU.d.cts.map +1 -0
- package/dist/plugin-base.cjs +0 -8
- package/dist/plugin-base.d.cts +1 -3
- package/dist/plugin-base.d.cts.map +1 -1
- package/dist/plugin-base.d.mts +1 -5
- package/dist/plugin-base.d.mts.map +1 -1
- package/dist/plugin-base.mjs +0 -8
- package/dist/plugin-base.mjs.map +1 -1
- package/dist/plugin-fhBG7SSQ.d.cts +9 -0
- package/dist/plugin-fhBG7SSQ.d.cts.map +1 -0
- package/dist/plugin-fhBG7SSQ.d.mts +9 -0
- package/dist/plugin-fhBG7SSQ.d.mts.map +1 -0
- package/dist/plugin-utils/build-helpers.cjs +0 -8
- package/dist/plugin-utils/build-helpers.d.cts +1 -2
- package/dist/plugin-utils/build-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/build-helpers.d.mts +1 -4
- package/dist/plugin-utils/build-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/build-helpers.mjs +0 -8
- package/dist/plugin-utils/build-helpers.mjs.map +1 -1
- package/dist/plugin-utils/combine-plugins.cjs +0 -8
- package/dist/plugin-utils/combine-plugins.d.cts +1 -1
- package/dist/plugin-utils/combine-plugins.d.mts +1 -3
- package/dist/plugin-utils/combine-plugins.d.mts.map +1 -1
- package/dist/plugin-utils/combine-plugins.mjs +0 -8
- package/dist/plugin-utils/combine-plugins.mjs.map +1 -1
- package/dist/plugin-utils/context-helpers.cjs +0 -8
- package/dist/plugin-utils/context-helpers.d.cts +1 -1
- package/dist/plugin-utils/context-helpers.d.mts +1 -3
- package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/context-helpers.mjs +0 -8
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/docs-helper.cjs +0 -8
- package/dist/plugin-utils/docs-helper.d.mts +0 -2
- package/dist/plugin-utils/docs-helper.d.mts.map +1 -1
- package/dist/plugin-utils/docs-helper.mjs +0 -8
- package/dist/plugin-utils/docs-helper.mjs.map +1 -1
- package/dist/plugin-utils/enable-plugin.cjs +0 -8
- package/dist/plugin-utils/enable-plugin.d.cts +1 -2
- package/dist/plugin-utils/enable-plugin.d.cts.map +1 -1
- package/dist/plugin-utils/enable-plugin.d.mts +1 -4
- package/dist/plugin-utils/enable-plugin.d.mts.map +1 -1
- package/dist/plugin-utils/enable-plugin.mjs +0 -8
- package/dist/plugin-utils/enable-plugin.mjs.map +1 -1
- package/dist/plugin-utils/extend.cjs +0 -8
- package/dist/plugin-utils/extend.d.cts +1 -3
- package/dist/plugin-utils/extend.d.cts.map +1 -1
- package/dist/plugin-utils/extend.d.mts +1 -5
- package/dist/plugin-utils/extend.d.mts.map +1 -1
- package/dist/plugin-utils/extend.mjs +0 -8
- package/dist/plugin-utils/extend.mjs.map +1 -1
- package/dist/plugin-utils/filter.cjs +2 -10
- package/dist/plugin-utils/filter.d.cts +1 -1
- package/dist/plugin-utils/filter.d.mts +1 -3
- package/dist/plugin-utils/filter.d.mts.map +1 -1
- package/dist/plugin-utils/filter.mjs +0 -8
- package/dist/plugin-utils/filter.mjs.map +1 -1
- package/dist/plugin-utils/format-package-json.cjs +0 -8
- package/dist/plugin-utils/format-package-json.d.cts +1 -1
- package/dist/plugin-utils/format-package-json.d.mts +1 -3
- package/dist/plugin-utils/format-package-json.d.mts.map +1 -1
- package/dist/plugin-utils/format-package-json.mjs +0 -8
- package/dist/plugin-utils/format-package-json.mjs.map +1 -1
- package/dist/plugin-utils/format.cjs +0 -8
- package/dist/plugin-utils/format.d.mts +0 -2
- package/dist/plugin-utils/format.d.mts.map +1 -1
- package/dist/plugin-utils/format.mjs +0 -8
- package/dist/plugin-utils/format.mjs.map +1 -1
- package/dist/plugin-utils/get-config-path.cjs +0 -8
- package/dist/plugin-utils/get-config-path.d.cts +1 -1
- package/dist/plugin-utils/get-config-path.d.mts +1 -3
- package/dist/plugin-utils/get-config-path.d.mts.map +1 -1
- package/dist/plugin-utils/get-config-path.mjs +0 -8
- package/dist/plugin-utils/get-config-path.mjs.map +1 -1
- package/dist/plugin-utils/helpers.cjs +0 -8
- package/dist/plugin-utils/helpers.d.cts +1 -5
- package/dist/plugin-utils/helpers.d.cts.map +1 -1
- package/dist/plugin-utils/helpers.d.mts +1 -7
- package/dist/plugin-utils/helpers.d.mts.map +1 -1
- package/dist/plugin-utils/helpers.mjs +0 -8
- package/dist/plugin-utils/helpers.mjs.map +1 -1
- package/dist/plugin-utils/index.cjs +0 -8
- package/dist/plugin-utils/index.d.mts +0 -2
- package/dist/plugin-utils/index.mjs +0 -8
- package/dist/plugin-utils/install.cjs +0 -8
- package/dist/plugin-utils/install.d.cts +1 -1
- package/dist/plugin-utils/install.d.mts +1 -3
- package/dist/plugin-utils/install.d.mts.map +1 -1
- package/dist/plugin-utils/install.mjs +0 -8
- package/dist/plugin-utils/install.mjs.map +1 -1
- package/dist/plugin-utils/logging.cjs +2 -10
- package/dist/plugin-utils/logging.d.cts +1 -3
- package/dist/plugin-utils/logging.d.cts.map +1 -1
- package/dist/plugin-utils/logging.d.mts +1 -5
- package/dist/plugin-utils/logging.d.mts.map +1 -1
- package/dist/plugin-utils/logging.mjs +0 -8
- package/dist/plugin-utils/logging.mjs.map +1 -1
- package/dist/plugin-utils/merge.cjs +2 -10
- package/dist/plugin-utils/merge.d.cts +1 -3
- package/dist/plugin-utils/merge.d.cts.map +1 -1
- package/dist/plugin-utils/merge.d.mts +1 -5
- package/dist/plugin-utils/merge.d.mts.map +1 -1
- package/dist/plugin-utils/merge.mjs +0 -8
- package/dist/plugin-utils/merge.mjs.map +1 -1
- package/dist/plugin-utils/modules.cjs +0 -8
- package/dist/plugin-utils/modules.d.cts +1 -1
- package/dist/plugin-utils/modules.d.mts +1 -3
- package/dist/plugin-utils/modules.d.mts.map +1 -1
- package/dist/plugin-utils/modules.mjs +0 -8
- package/dist/plugin-utils/modules.mjs.map +1 -1
- package/dist/plugin-utils/paths.cjs +0 -8
- package/dist/plugin-utils/paths.d.cts +1 -1
- package/dist/plugin-utils/paths.d.mts +1 -3
- package/dist/plugin-utils/paths.d.mts.map +1 -1
- package/dist/plugin-utils/paths.mjs +0 -8
- package/dist/plugin-utils/paths.mjs.map +1 -1
- package/dist/plugin-utils/virtual.cjs +0 -8
- package/dist/plugin-utils/virtual.d.mts +0 -2
- package/dist/plugin-utils/virtual.d.mts.map +1 -1
- package/dist/plugin-utils/virtual.mjs +0 -8
- package/dist/plugin-utils/virtual.mjs.map +1 -1
- package/dist/plugins-DfL1fBZi.d.cts +37 -0
- package/dist/plugins-DfL1fBZi.d.cts.map +1 -0
- package/dist/plugins-zG2X2LA8.d.mts +37 -0
- package/dist/plugins-zG2X2LA8.d.mts.map +1 -0
- package/dist/resolver-CdBAh8dA.d.mts +19 -0
- package/dist/resolver-CdBAh8dA.d.mts.map +1 -0
- package/dist/resolver-CfCl--Eh.d.cts +19 -0
- package/dist/resolver-CfCl--Eh.d.cts.map +1 -0
- package/dist/{schemas/fs.d.cts → schemas-Zvqwdrw_.d.cts} +2 -2
- package/dist/schemas-Zvqwdrw_.d.cts.map +1 -0
- package/dist/{schemas/fs.d.mts → schemas-Zvqwdrw_.d.mts} +2 -4
- package/dist/schemas-Zvqwdrw_.d.mts.map +1 -0
- package/dist/source-file-CLw13fKE.d.mts +30 -0
- package/dist/source-file-CLw13fKE.d.mts.map +1 -0
- package/dist/source-file-CuuHaBL5.d.cts +30 -0
- package/dist/source-file-CuuHaBL5.d.cts.map +1 -0
- package/dist/source-map-Cy0aqSpe.d.mts +16 -0
- package/dist/source-map-Cy0aqSpe.d.mts.map +1 -0
- package/dist/source-map-HU4IoICc.d.cts +16 -0
- package/dist/source-map-HU4IoICc.d.cts.map +1 -0
- package/dist/storage/base.cjs +0 -8
- package/dist/storage/base.d.cts +1 -2
- package/dist/storage/base.d.cts.map +1 -1
- package/dist/storage/base.d.mts +1 -4
- package/dist/storage/base.d.mts.map +1 -1
- package/dist/storage/base.mjs +0 -8
- package/dist/storage/base.mjs.map +1 -1
- package/dist/storage/file-system.cjs +0 -8
- package/dist/storage/file-system.d.cts +1 -1
- package/dist/storage/file-system.d.mts +1 -3
- package/dist/storage/file-system.d.mts.map +1 -1
- package/dist/storage/file-system.mjs +0 -8
- package/dist/storage/file-system.mjs.map +1 -1
- package/dist/storage/helpers.cjs +0 -8
- package/dist/storage/helpers.d.mts +0 -2
- package/dist/storage/helpers.d.mts.map +1 -1
- package/dist/storage/helpers.mjs +0 -8
- package/dist/storage/helpers.mjs.map +1 -1
- package/dist/storage/index.cjs +0 -8
- package/dist/storage/index.d.mts +0 -2
- package/dist/storage/index.mjs +0 -8
- package/dist/storage/virtual.cjs +0 -8
- package/dist/storage/virtual.d.cts +1 -1
- package/dist/storage/virtual.d.cts.map +1 -1
- package/dist/storage/virtual.d.mts +1 -3
- package/dist/storage/virtual.d.mts.map +1 -1
- package/dist/storage/virtual.mjs +0 -8
- package/dist/storage/virtual.mjs.map +1 -1
- package/dist/streaming-channel-CiyFd_6l.d.cts +126 -0
- package/dist/streaming-channel-CiyFd_6l.d.cts.map +1 -0
- package/dist/streaming-channel-CiyFd_6l.d.mts +126 -0
- package/dist/streaming-channel-CiyFd_6l.d.mts.map +1 -0
- package/dist/ts-morph-BGgjbOgM.d.cts +38 -0
- package/dist/ts-morph-BGgjbOgM.d.cts.map +1 -0
- package/dist/ts-morph-zLvdifpA.d.mts +38 -0
- package/dist/ts-morph-zLvdifpA.d.mts.map +1 -0
- package/dist/tsconfig-DExoZEQ0.d.cts +75 -0
- package/dist/tsconfig-DExoZEQ0.d.cts.map +1 -0
- package/dist/tsconfig-De09cBeX.d.mts +75 -0
- package/dist/tsconfig-De09cBeX.d.mts.map +1 -0
- package/dist/vfs-B9Vhnajc.d.cts +320 -0
- package/dist/vfs-B9Vhnajc.d.cts.map +1 -0
- package/dist/vfs-Dl6nPqdS.d.mts +320 -0
- package/dist/vfs-Dl6nPqdS.d.mts.map +1 -0
- package/dist/write-file-BVMnXVPo.d.cts +15 -0
- package/dist/write-file-BVMnXVPo.d.cts.map +1 -0
- package/dist/write-file-CWf9Xxwd.d.mts +15 -0
- package/dist/write-file-CWf9Xxwd.d.mts.map +1 -0
- package/package.json +17 -17
- package/dist/constants/api.d.cts.map +0 -1
- package/dist/constants/api.d.mts.map +0 -1
- package/dist/constants/commands.d.cts.map +0 -1
- package/dist/constants/commands.d.mts.map +0 -1
- package/dist/constants/devtools.d.cts.map +0 -1
- package/dist/constants/devtools.d.mts.map +0 -1
- package/dist/constants/environments.d.cts.map +0 -1
- package/dist/constants/environments.d.mts.map +0 -1
- package/dist/constants/extensions.d.cts.map +0 -1
- package/dist/constants/extensions.d.mts.map +0 -1
- package/dist/constants/fs.d.cts.map +0 -1
- package/dist/constants/fs.d.mts.map +0 -1
- package/dist/constants/hooks.d.cts.map +0 -1
- package/dist/constants/hooks.d.mts.map +0 -1
- package/dist/constants/log-level.d.cts.map +0 -1
- package/dist/constants/log-level.d.mts.map +0 -1
- package/dist/constants/meta.d.cts.map +0 -1
- package/dist/constants/meta.d.mts.map +0 -1
- package/dist/constants/plugin.d.cts.map +0 -1
- package/dist/constants/plugin.d.mts.map +0 -1
- package/dist/context/base-context.d.cts.map +0 -1
- package/dist/context/base-context.d.mts.map +0 -1
- package/dist/context/context.d.cts.map +0 -1
- package/dist/context/context.d.mts.map +0 -1
- package/dist/lib/config.d.cts.map +0 -1
- package/dist/lib/config.d.mts.map +0 -1
- package/dist/lib/context-helpers.d.cts.map +0 -1
- package/dist/lib/context-helpers.d.mts.map +0 -1
- package/dist/lib/entry.d.cts.map +0 -1
- package/dist/lib/entry.d.mts.map +0 -1
- package/dist/lib/events.d.cts.map +0 -1
- package/dist/lib/events.d.mts.map +0 -1
- package/dist/lib/generate-types.d.cts.map +0 -1
- package/dist/lib/generate-types.d.mts.map +0 -1
- package/dist/lib/hooks.d.cts.map +0 -1
- package/dist/lib/hooks.d.mts.map +0 -1
- package/dist/lib/install-dependencies.d.cts.map +0 -1
- package/dist/lib/install-dependencies.d.mts.map +0 -1
- package/dist/lib/meta.d.cts.map +0 -1
- package/dist/lib/meta.d.mts.map +0 -1
- package/dist/lib/plugins.d.cts.map +0 -1
- package/dist/lib/plugins.d.mts.map +0 -1
- package/dist/lib/resolver.d.cts.map +0 -1
- package/dist/lib/resolver.d.mts.map +0 -1
- package/dist/lib/streaming-channel.d.cts.map +0 -1
- package/dist/lib/streaming-channel.d.mts.map +0 -1
- package/dist/lib/typescript/ts-morph.d.cts.map +0 -1
- package/dist/lib/typescript/ts-morph.d.mts.map +0 -1
- package/dist/lib/typescript/tsconfig.d.cts.map +0 -1
- package/dist/lib/typescript/tsconfig.d.mts.map +0 -1
- package/dist/lib/unplugin/helpers.d.cts.map +0 -1
- package/dist/lib/unplugin/helpers.d.mts.map +0 -1
- package/dist/lib/unplugin/module-resolution.d.cts.map +0 -1
- package/dist/lib/unplugin/module-resolution.d.mts.map +0 -1
- package/dist/lib/unplugin/plugin.d.cts.map +0 -1
- package/dist/lib/unplugin/plugin.d.mts.map +0 -1
- package/dist/lib/utilities/file-header.d.cts.map +0 -1
- package/dist/lib/utilities/file-header.d.mts.map +0 -1
- package/dist/lib/utilities/format.d.cts.map +0 -1
- package/dist/lib/utilities/format.d.mts.map +0 -1
- package/dist/lib/utilities/source-file.d.cts.map +0 -1
- package/dist/lib/utilities/source-file.d.mts.map +0 -1
- package/dist/lib/utilities/source-map.d.cts.map +0 -1
- package/dist/lib/utilities/source-map.d.mts.map +0 -1
- package/dist/lib/utilities/write-file.d.cts.map +0 -1
- package/dist/lib/utilities/write-file.d.mts.map +0 -1
- package/dist/lib/vfs.d.cts.map +0 -1
- package/dist/lib/vfs.d.mts.map +0 -1
- package/dist/schemas/fs.d.cts.map +0 -1
- package/dist/schemas/fs.d.mts.map +0 -1
- package/dist/schemas/fs.mjs.map +0 -1
- package/dist/types/api.d.cts +0 -16
- package/dist/types/api.d.cts.map +0 -1
- package/dist/types/api.d.mts +0 -18
- package/dist/types/api.d.mts.map +0 -1
- package/dist/types/config.d.cts +0 -739
- package/dist/types/config.d.cts.map +0 -1
- package/dist/types/config.d.mts +0 -741
- package/dist/types/config.d.mts.map +0 -1
- package/dist/types/context.d.cts +0 -682
- package/dist/types/context.d.cts.map +0 -1
- package/dist/types/context.d.mts +0 -684
- package/dist/types/context.d.mts.map +0 -1
- package/dist/types/fs.d.cts +0 -538
- package/dist/types/fs.d.cts.map +0 -1
- package/dist/types/fs.d.mts +0 -540
- package/dist/types/fs.d.mts.map +0 -1
- package/dist/types/hooks.d.cts +0 -96
- package/dist/types/hooks.d.cts.map +0 -1
- package/dist/types/hooks.d.mts +0 -98
- package/dist/types/hooks.d.mts.map +0 -1
- package/dist/types/index.d.cts +0 -9
- package/dist/types/index.d.mts +0 -11
- package/dist/types/logging.d.cts +0 -145
- package/dist/types/logging.d.cts.map +0 -1
- package/dist/types/logging.d.mts +0 -147
- package/dist/types/logging.d.mts.map +0 -1
- package/dist/types/plugin.d.cts +0 -207
- package/dist/types/plugin.d.cts.map +0 -1
- package/dist/types/plugin.d.mts +0 -209
- package/dist/types/plugin.d.mts.map +0 -1
- package/dist/types/tsconfig.d.cts +0 -73
- package/dist/types/tsconfig.d.cts.map +0 -1
- package/dist/types/tsconfig.d.mts +0 -75
- package/dist/types/tsconfig.d.mts.map +0 -1
- package/dist/types/unplugin.d.cts +0 -22
- package/dist/types/unplugin.d.cts.map +0 -1
- package/dist/types/unplugin.d.mts +0 -24
- package/dist/types/unplugin.d.mts.map +0 -1
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/lib/install-dependencies.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Install missing project dependencies.
|
|
6
|
-
*
|
|
7
|
-
* @param context - The build context.
|
|
8
|
-
*/
|
|
9
|
-
declare function installDependencies<TContext extends Context = Context>(context: TContext): Promise<void>;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { installDependencies };
|
|
12
|
-
//# sourceMappingURL=install-dependencies.d.cts.map
|
|
1
|
+
import { t as installDependencies } from "../install-dependencies-CyeYsrfz.cjs";
|
|
2
|
+
export { installDependencies };
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { Context } from "../types/context.mjs";
|
|
4
|
-
|
|
5
|
-
//#region src/lib/install-dependencies.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Install missing project dependencies.
|
|
8
|
-
*
|
|
9
|
-
* @param context - The build context.
|
|
10
|
-
*/
|
|
11
|
-
declare function installDependencies<TContext extends Context = Context>(context: TContext): Promise<void>;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { installDependencies };
|
|
14
|
-
//# sourceMappingURL=install-dependencies.d.mts.map
|
|
1
|
+
import { t as installDependencies } from "../install-dependencies-CCjZfS9Y.mjs";
|
|
2
|
+
export { installDependencies };
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
9
1
|
import { installPackage } from "../plugin-utils/install.mjs";
|
|
10
2
|
import { getPackageName } from "@stryke/string-format/package";
|
|
11
3
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-dependencies.mjs","names":[],"sources":["../../src/lib/install-dependencies.ts"],"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 { getPackageName } from \"@stryke/string-format/package\";\nimport { installPackage } from \"../plugin-utils/install\";\nimport type { Context } from \"../types/context\";\n\n/**\n * Install missing project dependencies.\n *\n * @param context - The build context.\n */\nexport async function installDependencies<TContext extends Context = Context>(\n context: TContext\n): Promise<void> {\n context.debug(`Checking and installing missing project dependencies.`);\n\n context.dependencies ??= {};\n context.devDependencies ??= {};\n\n if (\n Object.keys(context.dependencies).length === 0 &&\n Object.keys(context.devDependencies).length === 0\n ) {\n context.debug(\n `No dependencies or devDependencies to install. Skipping installation step.`\n );\n return;\n }\n\n context.debug(\n `The following packages are required: \\nDependencies: \\n${Object.entries(\n context.dependencies\n )\n .map(([name, version]) => `- ${name}@${String(version)}`)\n .join(\" \\n\")}\\n\\nDevDependencies: \\n${Object.entries(\n context.devDependencies\n )\n .map(([name, version]) => `- ${name}@${String(version)}`)\n .join(\" \\n\")}`\n );\n\n await Promise.all([\n Promise.all(\n Object.entries(context.dependencies).map(async ([name, version]) =>\n installPackage(\n context,\n `${getPackageName(name)}@${String(version)}`,\n false\n )\n )\n ),\n Promise.all(\n Object.entries(context.devDependencies).map(async ([name, version]) =>\n installPackage(\n context,\n `${getPackageName(name)}@${String(version)}`,\n true\n )\n )\n )\n ]);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"install-dependencies.mjs","names":[],"sources":["../../src/lib/install-dependencies.ts"],"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 { getPackageName } from \"@stryke/string-format/package\";\nimport { installPackage } from \"../plugin-utils/install\";\nimport type { Context } from \"../types/context\";\n\n/**\n * Install missing project dependencies.\n *\n * @param context - The build context.\n */\nexport async function installDependencies<TContext extends Context = Context>(\n context: TContext\n): Promise<void> {\n context.debug(`Checking and installing missing project dependencies.`);\n\n context.dependencies ??= {};\n context.devDependencies ??= {};\n\n if (\n Object.keys(context.dependencies).length === 0 &&\n Object.keys(context.devDependencies).length === 0\n ) {\n context.debug(\n `No dependencies or devDependencies to install. Skipping installation step.`\n );\n return;\n }\n\n context.debug(\n `The following packages are required: \\nDependencies: \\n${Object.entries(\n context.dependencies\n )\n .map(([name, version]) => `- ${name}@${String(version)}`)\n .join(\" \\n\")}\\n\\nDevDependencies: \\n${Object.entries(\n context.devDependencies\n )\n .map(([name, version]) => `- ${name}@${String(version)}`)\n .join(\" \\n\")}`\n );\n\n await Promise.all([\n Promise.all(\n Object.entries(context.dependencies).map(async ([name, version]) =>\n installPackage(\n context,\n `${getPackageName(name)}@${String(version)}`,\n false\n )\n )\n ),\n Promise.all(\n Object.entries(context.devDependencies).map(async ([name, version]) =>\n installPackage(\n context,\n `${getPackageName(name)}@${String(version)}`,\n true\n )\n )\n )\n ]);\n}\n"],"mappings":";;;;;;;;;AA2BA,eAAsB,oBACpB,SACe;CACf,QAAQ,MAAM,uDAAuD;CAErE,QAAQ,iBAAiB,CAAC;CAC1B,QAAQ,oBAAoB,CAAC;CAE7B,IACE,OAAO,KAAK,QAAQ,YAAY,EAAE,WAAW,KAC7C,OAAO,KAAK,QAAQ,eAAe,EAAE,WAAW,GAChD;EACA,QAAQ,MACN,4EACF;EACA;CACF;CAEA,QAAQ,MACN,0DAA0D,OAAO,QAC/D,QAAQ,YACV,EACG,KAAK,CAAC,MAAM,aAAa,KAAK,KAAK,GAAG,OAAO,OAAO,GAAG,EACvD,KAAK,KAAK,EAAE,yBAAyB,OAAO,QAC7C,QAAQ,eACV,EACG,KAAK,CAAC,MAAM,aAAa,KAAK,KAAK,GAAG,OAAO,OAAO,GAAG,EACvD,KAAK,KAAK,GACf;CAEA,MAAM,QAAQ,IAAI,CAChB,QAAQ,IACN,OAAO,QAAQ,QAAQ,YAAY,EAAE,IAAI,OAAO,CAAC,MAAM,aACrD,eACE,SACA,GAAG,eAAe,IAAI,EAAE,GAAG,OAAO,OAAO,KACzC,KACF,CACF,CACF,GACA,QAAQ,IACN,OAAO,QAAQ,QAAQ,eAAe,EAAE,IAAI,OAAO,CAAC,MAAM,aACxD,eACE,SACA,GAAG,eAAe,IAAI,EAAE,GAAG,OAAO,OAAO,KACzC,IACF,CACF,CACF,CACF,CAAC;AACH"}
|
package/dist/lib/meta.cjs
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
9
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
10
2
|
const require_constants_meta = require('../constants/meta.cjs');
|
|
11
3
|
require('../constants/index.cjs');
|
package/dist/lib/meta.d.cts
CHANGED
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
interface CreateContextOptions {
|
|
4
|
-
name?: string;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Generates a prefixed project root hash object.
|
|
8
|
-
*
|
|
9
|
-
* @remarks
|
|
10
|
-
* This function returns a string where the project root hash is prefixed with the project name plus a hyphen. If the total length of this string combination exceeds 45 characters, it will truncate the hash.
|
|
11
|
-
*
|
|
12
|
-
* @param name - The name of the project.
|
|
13
|
-
* @param rootHash - The hash of the project root.
|
|
14
|
-
* @returns An object containing the name and project root hash.
|
|
15
|
-
*/
|
|
16
|
-
declare function getPrefixedRootHash(name: string, rootHash: string): string;
|
|
17
|
-
/**
|
|
18
|
-
* Retrieves the persisted meta information from the context's data path.
|
|
19
|
-
*
|
|
20
|
-
* @param context - The build context.
|
|
21
|
-
* @returns A promise that resolves to the persisted meta information, or undefined if not found.
|
|
22
|
-
*/
|
|
23
|
-
declare function getPersistedMeta(context: Context): Promise<MetaInfo | undefined>;
|
|
24
|
-
/**
|
|
25
|
-
* Writes the meta file for the context.
|
|
26
|
-
*
|
|
27
|
-
* @param context - The context to write the meta file for.
|
|
28
|
-
* @returns A promise that resolves when the meta file has been written.
|
|
29
|
-
*/
|
|
30
|
-
declare function writeMetaFile(context: Context): Promise<void>;
|
|
31
|
-
//#endregion
|
|
32
|
-
export { CreateContextOptions, getPersistedMeta, getPrefixedRootHash, writeMetaFile };
|
|
33
|
-
//# sourceMappingURL=meta.d.cts.map
|
|
1
|
+
import { i as writeMetaFile, n as getPersistedMeta, r as getPrefixedRootHash, t as CreateContextOptions } from "../meta-CdDd2ykC.cjs";
|
|
2
|
+
export { CreateContextOptions, getPersistedMeta, getPrefixedRootHash, writeMetaFile };
|
package/dist/lib/meta.d.mts
CHANGED
|
@@ -1,35 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { Context, MetaInfo } from "../types/context.mjs";
|
|
4
|
-
//#region src/lib/meta.d.ts
|
|
5
|
-
interface CreateContextOptions {
|
|
6
|
-
name?: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Generates a prefixed project root hash object.
|
|
10
|
-
*
|
|
11
|
-
* @remarks
|
|
12
|
-
* This function returns a string where the project root hash is prefixed with the project name plus a hyphen. If the total length of this string combination exceeds 45 characters, it will truncate the hash.
|
|
13
|
-
*
|
|
14
|
-
* @param name - The name of the project.
|
|
15
|
-
* @param rootHash - The hash of the project root.
|
|
16
|
-
* @returns An object containing the name and project root hash.
|
|
17
|
-
*/
|
|
18
|
-
declare function getPrefixedRootHash(name: string, rootHash: string): string;
|
|
19
|
-
/**
|
|
20
|
-
* Retrieves the persisted meta information from the context's data path.
|
|
21
|
-
*
|
|
22
|
-
* @param context - The build context.
|
|
23
|
-
* @returns A promise that resolves to the persisted meta information, or undefined if not found.
|
|
24
|
-
*/
|
|
25
|
-
declare function getPersistedMeta(context: Context): Promise<MetaInfo | undefined>;
|
|
26
|
-
/**
|
|
27
|
-
* Writes the meta file for the context.
|
|
28
|
-
*
|
|
29
|
-
* @param context - The context to write the meta file for.
|
|
30
|
-
* @returns A promise that resolves when the meta file has been written.
|
|
31
|
-
*/
|
|
32
|
-
declare function writeMetaFile(context: Context): Promise<void>;
|
|
33
|
-
//#endregion
|
|
34
|
-
export { CreateContextOptions, getPersistedMeta, getPrefixedRootHash, writeMetaFile };
|
|
35
|
-
//# sourceMappingURL=meta.d.mts.map
|
|
1
|
+
import { i as writeMetaFile, n as getPersistedMeta, r as getPrefixedRootHash, t as CreateContextOptions } from "../meta-CfTCHU_o.mjs";
|
|
2
|
+
export { CreateContextOptions, getPersistedMeta, getPrefixedRootHash, writeMetaFile };
|
package/dist/lib/meta.mjs
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
9
1
|
import { ROOT_HASH_LENGTH } from "../constants/meta.mjs";
|
|
10
2
|
import "../constants/index.mjs";
|
|
11
3
|
import { existsSync } from "@stryke/fs/exists";
|
package/dist/lib/meta.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.mjs","names":[],"sources":["../../src/lib/meta.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { readJsonFile } from \"@stryke/fs/json\";\nimport { removeFile } from \"@stryke/fs/remove-file\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { ROOT_HASH_LENGTH } from \"../constants\";\nimport type { Context, MetaInfo } from \"../types\";\n\nexport interface CreateContextOptions {\n name?: string;\n}\n\n/**\n * Generates a prefixed project root hash object.\n *\n * @remarks\n * This function returns a string where the project root hash is prefixed with the project name plus a hyphen. If the total length of this string combination exceeds 45 characters, it will truncate the hash.\n *\n * @param name - The name of the project.\n * @param rootHash - The hash of the project root.\n * @returns An object containing the name and project root hash.\n */\nexport function getPrefixedRootHash(name: string, rootHash: string): string {\n const combined = `${kebabCase(name)}_${rootHash}`;\n\n return combined.length > ROOT_HASH_LENGTH\n ? combined.slice(0, ROOT_HASH_LENGTH)\n : combined;\n}\n\n/**\n * Retrieves the persisted meta information from the context's data path.\n *\n * @param context - The build context.\n * @returns A promise that resolves to the persisted meta information, or undefined if not found.\n */\nexport async function getPersistedMeta(\n context: Context\n): Promise<MetaInfo | undefined> {\n const metaFilePath = joinPaths(context.dataPath, \"meta.json\");\n if (existsSync(metaFilePath)) {\n try {\n return await readJsonFile<MetaInfo>(metaFilePath);\n } catch {\n context.warn(\n `Failed to read meta file at ${metaFilePath}. It may be corrupted.`\n );\n await removeFile(metaFilePath);\n\n context.persistedMeta = undefined;\n }\n }\n\n return undefined;\n}\n\n/**\n * Writes the meta file for the context.\n *\n * @param context - The context to write the meta file for.\n * @returns A promise that resolves when the meta file has been written.\n */\nexport async function writeMetaFile(context: Context): Promise<void> {\n const metaFilePath = joinPaths(context.dataPath, \"meta.json\");\n\n context.debug(`Writing runtime metadata to ${metaFilePath}`);\n\n await context.fs.write(metaFilePath, JSON.stringify(context.meta, null, 2));\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"meta.mjs","names":[],"sources":["../../src/lib/meta.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { readJsonFile } from \"@stryke/fs/json\";\nimport { removeFile } from \"@stryke/fs/remove-file\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { ROOT_HASH_LENGTH } from \"../constants\";\nimport type { Context, MetaInfo } from \"../types\";\n\nexport interface CreateContextOptions {\n name?: string;\n}\n\n/**\n * Generates a prefixed project root hash object.\n *\n * @remarks\n * This function returns a string where the project root hash is prefixed with the project name plus a hyphen. If the total length of this string combination exceeds 45 characters, it will truncate the hash.\n *\n * @param name - The name of the project.\n * @param rootHash - The hash of the project root.\n * @returns An object containing the name and project root hash.\n */\nexport function getPrefixedRootHash(name: string, rootHash: string): string {\n const combined = `${kebabCase(name)}_${rootHash}`;\n\n return combined.length > ROOT_HASH_LENGTH\n ? combined.slice(0, ROOT_HASH_LENGTH)\n : combined;\n}\n\n/**\n * Retrieves the persisted meta information from the context's data path.\n *\n * @param context - The build context.\n * @returns A promise that resolves to the persisted meta information, or undefined if not found.\n */\nexport async function getPersistedMeta(\n context: Context\n): Promise<MetaInfo | undefined> {\n const metaFilePath = joinPaths(context.dataPath, \"meta.json\");\n if (existsSync(metaFilePath)) {\n try {\n return await readJsonFile<MetaInfo>(metaFilePath);\n } catch {\n context.warn(\n `Failed to read meta file at ${metaFilePath}. It may be corrupted.`\n );\n await removeFile(metaFilePath);\n\n context.persistedMeta = undefined;\n }\n }\n\n return undefined;\n}\n\n/**\n * Writes the meta file for the context.\n *\n * @param context - The context to write the meta file for.\n * @returns A promise that resolves when the meta file has been written.\n */\nexport async function writeMetaFile(context: Context): Promise<void> {\n const metaFilePath = joinPaths(context.dataPath, \"meta.json\");\n\n context.debug(`Writing runtime metadata to ${metaFilePath}`);\n\n await context.fs.write(metaFilePath, JSON.stringify(context.meta, null, 2));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwCA,SAAgB,oBAAoB,MAAc,UAA0B;CAC1E,MAAM,WAAW,GAAG,UAAU,IAAI,EAAE,GAAG;CAEvC,OAAO,SAAS,cACZ,SAAS,MAAM,KAAmB,IAClC;AACN;;;;;;;AAQA,eAAsB,iBACpB,SAC+B;CAC/B,MAAM,eAAe,UAAU,QAAQ,UAAU,WAAW;CAC5D,IAAI,WAAW,YAAY,GACzB,IAAI;EACF,OAAO,MAAM,aAAuB,YAAY;CAClD,QAAQ;EACN,QAAQ,KACN,+BAA+B,aAAa,uBAC9C;EACA,MAAM,WAAW,YAAY;EAE7B,QAAQ,gBAAgB;CAC1B;AAIJ;;;;;;;AAQA,eAAsB,cAAc,SAAiC;CACnE,MAAM,eAAe,UAAU,QAAQ,UAAU,WAAW;CAE5D,QAAQ,MAAM,+BAA+B,cAAc;CAE3D,MAAM,QAAQ,GAAG,MAAM,cAAc,KAAK,UAAU,QAAQ,MAAM,MAAM,CAAC,CAAC;AAC5E"}
|
package/dist/lib/plugins.cjs
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
9
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
10
|
-
const
|
|
2
|
+
const require_chunk = require('../chunk-C_NdSu1c.cjs');
|
|
11
3
|
const require_plugin_utils_helpers = require('../plugin-utils/helpers.cjs');
|
|
12
4
|
require('../plugin-utils/index.cjs');
|
|
13
5
|
let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
14
6
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
15
7
|
let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
16
8
|
let chalk = require("chalk");
|
|
17
|
-
chalk =
|
|
9
|
+
chalk = require_chunk.__toESM(chalk, 1);
|
|
18
10
|
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
19
11
|
let _stryke_path_join = require("@stryke/path/join");
|
|
20
12
|
let _stryke_fs_install = require("@stryke/fs/install");
|
package/dist/lib/plugins.d.cts
CHANGED
|
@@ -1,39 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { PluginConfig, ResolvedConfig } from "../types/config.cjs";
|
|
4
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
5
|
-
|
|
6
|
-
//#region src/lib/plugins.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* Resolve a plugin module based on the provided plugin path. This function checks if the plugin package is installed, attempts to import the plugin module, and handles various error cases such as missing packages or invalid module exports. It supports both direct plugin exports and plugins exported from a "plugin" subdirectory within the package.
|
|
9
|
-
*
|
|
10
|
-
* @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.
|
|
11
|
-
* @param pluginPath - The path to the plugin module. This can be a package name, a scoped package name, or a path to a local module.
|
|
12
|
-
* @returns A promise that resolves to the plugin module, which can be a plugin instance, a factory function that returns a plugin, or an array of plugins.
|
|
13
|
-
*/
|
|
14
|
-
declare function resolvePlugin<TResolvedConfig extends ResolvedConfig, TSystemContext, TContext extends EnvironmentContext<TResolvedConfig, TSystemContext> | ExecutionContext<TResolvedConfig, TSystemContext> = EnvironmentContext<TResolvedConfig, TSystemContext> | ExecutionContext<TResolvedConfig, TSystemContext>, TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> = PluginContext<TResolvedConfig, TSystemContext>>(context: TContext, pluginPath: string): Promise<Plugin<TPluginContext> | Plugin<TPluginContext>[] | ((options?: any) => MaybePromise<Plugin<TPluginContext> | Plugin<TPluginContext>[]>)>;
|
|
15
|
-
/**
|
|
16
|
-
* Initialize a plugin based on the provided plugin configuration. This function handles various forms of plugin configurations, including direct plugin instances, factory functions, string paths to plugins, and arrays of plugins or plugin configurations. It validates the plugin configuration, resolves any plugin paths, and returns an array of initialized plugins.
|
|
17
|
-
*
|
|
18
|
-
* @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.
|
|
19
|
-
* @param config - The plugin configuration, which can be in various forms such as a direct plugin instance, a string path to a plugin, a factory function that returns a plugin, or an array of plugins or plugin configurations. This configuration will be processed and validated to initialize the appropriate plugins.
|
|
20
|
-
* @returns A promise that resolves to an array of initialized plugins based on the provided configuration. If the configuration is invalid, an error will be thrown with details about the issue.
|
|
21
|
-
*/
|
|
22
|
-
declare function initPlugin<TResolvedConfig extends ResolvedConfig, TSystemContext, TContext extends EnvironmentContext<TResolvedConfig, TSystemContext> | ExecutionContext<TResolvedConfig, TSystemContext> = EnvironmentContext<TResolvedConfig, TSystemContext> | ExecutionContext<TResolvedConfig, TSystemContext>, TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> = PluginContext<TResolvedConfig, TSystemContext>>(context: TContext, config: PluginConfig<TPluginContext>, options?: ResolvePluginsOptions): Promise<Plugin<TPluginContext>[] | null>;
|
|
23
|
-
interface ResolvePluginsOptions {
|
|
24
|
-
/**
|
|
25
|
-
* If true, the plugin resolution process will skip logging messages about the plugin initialization. This can be useful in scenarios where you want to suppress plugin-related logs, such as when running in a non-interactive environment or when you want to reduce log verbosity. By default, this option is false, and plugin initialization messages will be logged using the context's logger.
|
|
26
|
-
*/
|
|
27
|
-
skipLogging?: boolean;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Initialize a plugin based on the provided plugin configuration. This function handles various forms of plugin configurations, including direct plugin instances, plugin names, factory functions, and arrays of plugins. It validates the configuration, resolves plugin modules if necessary, and returns an array of initialized plugins ready to be added to the execution context.
|
|
31
|
-
*
|
|
32
|
-
* @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.
|
|
33
|
-
* @param config - The plugin configuration, which can be in various forms such as a plugin instance, a plugin name string, a factory function that returns a plugin or an array of plugins, or an array of plugin configurations. The function will handle the resolution and initialization of the plugin(s) based on the provided configuration.
|
|
34
|
-
* @returns A promise that resolves to an array of initialized plugins that can be added to the execution context, or null if the configuration is invalid or results in no plugins being initialized.
|
|
35
|
-
*/
|
|
36
|
-
declare function resolvePlugins<TResolvedConfig extends ResolvedConfig, TSystemContext, TContext extends EnvironmentContext<TResolvedConfig, TSystemContext> | ExecutionContext<TResolvedConfig, TSystemContext> = EnvironmentContext<TResolvedConfig, TSystemContext> | ExecutionContext<TResolvedConfig, TSystemContext>, TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> = PluginContext<TResolvedConfig, TSystemContext>>(context: TContext, config: PluginConfig<TPluginContext>, options?: ResolvePluginsOptions): Promise<Plugin<TPluginContext>[]>;
|
|
37
|
-
//#endregion
|
|
38
|
-
export { ResolvePluginsOptions, initPlugin, resolvePlugin, resolvePlugins };
|
|
39
|
-
//# sourceMappingURL=plugins.d.cts.map
|
|
1
|
+
import { i as resolvePlugins, n as initPlugin, r as resolvePlugin, t as ResolvePluginsOptions } from "../plugins-DfL1fBZi.cjs";
|
|
2
|
+
export { ResolvePluginsOptions, initPlugin, resolvePlugin, resolvePlugins };
|
package/dist/lib/plugins.d.mts
CHANGED
|
@@ -1,41 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { Plugin } from "../types/plugin.mjs";
|
|
4
|
-
import { EnvironmentContext, ExecutionContext, PluginContext } from "../types/context.mjs";
|
|
5
|
-
import { PluginConfig, ResolvedConfig } from "../types/config.mjs";
|
|
6
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
7
|
-
|
|
8
|
-
//#region src/lib/plugins.d.ts
|
|
9
|
-
/**
|
|
10
|
-
* Resolve a plugin module based on the provided plugin path. This function checks if the plugin package is installed, attempts to import the plugin module, and handles various error cases such as missing packages or invalid module exports. It supports both direct plugin exports and plugins exported from a "plugin" subdirectory within the package.
|
|
11
|
-
*
|
|
12
|
-
* @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.
|
|
13
|
-
* @param pluginPath - The path to the plugin module. This can be a package name, a scoped package name, or a path to a local module.
|
|
14
|
-
* @returns A promise that resolves to the plugin module, which can be a plugin instance, a factory function that returns a plugin, or an array of plugins.
|
|
15
|
-
*/
|
|
16
|
-
declare function resolvePlugin<TResolvedConfig extends ResolvedConfig, TSystemContext, TContext extends EnvironmentContext<TResolvedConfig, TSystemContext> | ExecutionContext<TResolvedConfig, TSystemContext> = EnvironmentContext<TResolvedConfig, TSystemContext> | ExecutionContext<TResolvedConfig, TSystemContext>, TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> = PluginContext<TResolvedConfig, TSystemContext>>(context: TContext, pluginPath: string): Promise<Plugin<TPluginContext> | Plugin<TPluginContext>[] | ((options?: any) => MaybePromise<Plugin<TPluginContext> | Plugin<TPluginContext>[]>)>;
|
|
17
|
-
/**
|
|
18
|
-
* Initialize a plugin based on the provided plugin configuration. This function handles various forms of plugin configurations, including direct plugin instances, factory functions, string paths to plugins, and arrays of plugins or plugin configurations. It validates the plugin configuration, resolves any plugin paths, and returns an array of initialized plugins.
|
|
19
|
-
*
|
|
20
|
-
* @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.
|
|
21
|
-
* @param config - The plugin configuration, which can be in various forms such as a direct plugin instance, a string path to a plugin, a factory function that returns a plugin, or an array of plugins or plugin configurations. This configuration will be processed and validated to initialize the appropriate plugins.
|
|
22
|
-
* @returns A promise that resolves to an array of initialized plugins based on the provided configuration. If the configuration is invalid, an error will be thrown with details about the issue.
|
|
23
|
-
*/
|
|
24
|
-
declare function initPlugin<TResolvedConfig extends ResolvedConfig, TSystemContext, TContext extends EnvironmentContext<TResolvedConfig, TSystemContext> | ExecutionContext<TResolvedConfig, TSystemContext> = EnvironmentContext<TResolvedConfig, TSystemContext> | ExecutionContext<TResolvedConfig, TSystemContext>, TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> = PluginContext<TResolvedConfig, TSystemContext>>(context: TContext, config: PluginConfig<TPluginContext>, options?: ResolvePluginsOptions): Promise<Plugin<TPluginContext>[] | null>;
|
|
25
|
-
interface ResolvePluginsOptions {
|
|
26
|
-
/**
|
|
27
|
-
* If true, the plugin resolution process will skip logging messages about the plugin initialization. This can be useful in scenarios where you want to suppress plugin-related logs, such as when running in a non-interactive environment or when you want to reduce log verbosity. By default, this option is false, and plugin initialization messages will be logged using the context's logger.
|
|
28
|
-
*/
|
|
29
|
-
skipLogging?: boolean;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Initialize a plugin based on the provided plugin configuration. This function handles various forms of plugin configurations, including direct plugin instances, plugin names, factory functions, and arrays of plugins. It validates the configuration, resolves plugin modules if necessary, and returns an array of initialized plugins ready to be added to the execution context.
|
|
33
|
-
*
|
|
34
|
-
* @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.
|
|
35
|
-
* @param config - The plugin configuration, which can be in various forms such as a plugin instance, a plugin name string, a factory function that returns a plugin or an array of plugins, or an array of plugin configurations. The function will handle the resolution and initialization of the plugin(s) based on the provided configuration.
|
|
36
|
-
* @returns A promise that resolves to an array of initialized plugins that can be added to the execution context, or null if the configuration is invalid or results in no plugins being initialized.
|
|
37
|
-
*/
|
|
38
|
-
declare function resolvePlugins<TResolvedConfig extends ResolvedConfig, TSystemContext, TContext extends EnvironmentContext<TResolvedConfig, TSystemContext> | ExecutionContext<TResolvedConfig, TSystemContext> = EnvironmentContext<TResolvedConfig, TSystemContext> | ExecutionContext<TResolvedConfig, TSystemContext>, TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> = PluginContext<TResolvedConfig, TSystemContext>>(context: TContext, config: PluginConfig<TPluginContext>, options?: ResolvePluginsOptions): Promise<Plugin<TPluginContext>[]>;
|
|
39
|
-
//#endregion
|
|
40
|
-
export { ResolvePluginsOptions, initPlugin, resolvePlugin, resolvePlugins };
|
|
41
|
-
//# sourceMappingURL=plugins.d.mts.map
|
|
1
|
+
import { i as resolvePlugins, n as initPlugin, r as resolvePlugin, t as ResolvePluginsOptions } from "../plugins-zG2X2LA8.mjs";
|
|
2
|
+
export { ResolvePluginsOptions, initPlugin, resolvePlugin, resolvePlugins };
|
package/dist/lib/plugins.mjs
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
9
1
|
import { findInvalidPluginConfig, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple } from "../plugin-utils/helpers.mjs";
|
|
10
2
|
import "../plugin-utils/index.mjs";
|
|
11
3
|
import { isFunction } from "@stryke/type-checks/is-function";
|
package/dist/lib/plugins.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.mjs","names":[],"sources":["../../src/lib/plugins.ts"],"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 { toArray } from \"@stryke/convert/to-array\";\nimport { install } from \"@stryke/fs/install\";\nimport { isPackageExists } from \"@stryke/fs/package-fns\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isPromiseLike } from \"@stryke/type-checks/is-promise\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { MaybePromise } from \"@stryke/types/base\";\nimport chalk from \"chalk\";\nimport {\n findInvalidPluginConfig,\n isDuplicate,\n isPlugin,\n isPluginConfig,\n isPluginConfigObject,\n isPluginConfigTuple\n} from \"../plugin-utils\";\nimport type {\n EnvironmentContext,\n ExecutionContext,\n Plugin,\n PluginConfig,\n PluginConfigTuple,\n PluginContext,\n PluginFactory,\n ResolvedConfig\n} from \"../types\";\n\n/**\n * Resolve a plugin module based on the provided plugin path. This function checks if the plugin package is installed, attempts to import the plugin module, and handles various error cases such as missing packages or invalid module exports. It supports both direct plugin exports and plugins exported from a \"plugin\" subdirectory within the package.\n *\n * @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.\n * @param pluginPath - The path to the plugin module. This can be a package name, a scoped package name, or a path to a local module.\n * @returns A promise that resolves to the plugin module, which can be a plugin instance, a factory function that returns a plugin, or an array of plugins.\n */\nexport async function resolvePlugin<\n TResolvedConfig extends ResolvedConfig,\n TSystemContext,\n TContext extends\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext> =\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext>,\n TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> =\n PluginContext<TResolvedConfig, TSystemContext>\n>(\n context: TContext,\n pluginPath: string\n): Promise<\n | Plugin<TPluginContext>\n | Plugin<TPluginContext>[]\n | ((\n options?: any\n ) => MaybePromise<Plugin<TPluginContext> | Plugin<TPluginContext>[]>)\n> {\n if (\n pluginPath.startsWith(\"@\") &&\n pluginPath.split(\"/\").filter(Boolean).length > 2\n ) {\n const splits = pluginPath.split(\"/\").filter(Boolean);\n pluginPath = `${splits[0]}/${splits[1]}`;\n }\n\n const isInstalled = isPackageExists(pluginPath, {\n paths: [context.config.cwd, context.config.root]\n });\n if (!isInstalled && context.config.autoInstall) {\n context.warn(\n `The plugin package \"${\n pluginPath\n }\" is not installed. It will be installed automatically.`\n );\n\n const result = await install(pluginPath, {\n cwd: context.config.root\n });\n if (isNumber(result.exitCode) && result.exitCode > 0) {\n context.error(result.stderr);\n\n throw new Error(\n `An error occurred while installing the build plugin package \"${\n pluginPath\n }\" `\n );\n }\n }\n\n try {\n // First check if the package has a \"plugin\" subdirectory - @scope/package/plugin\n const module = await context.resolver.plugin.import<{\n plugin?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n default?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n }>(context.resolver.plugin.esmResolve(joinPaths(pluginPath, \"plugin\")));\n\n const result = module.plugin ?? module.default;\n if (!result) {\n throw new Error(\n `The plugin package \"${pluginPath}\" does not export a valid module.`\n );\n }\n\n return result;\n } catch (error) {\n try {\n const module = await context.resolver.plugin.import<{\n plugin?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n default?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n }>(context.resolver.plugin.esmResolve(pluginPath));\n\n const result = module.plugin ?? module.default;\n if (!result) {\n throw new Error(\n `The plugin package \"${pluginPath}\" does not export a valid module.`\n );\n }\n\n return result;\n } catch {\n if (!isInstalled) {\n throw new Error(\n `The plugin package \"${\n pluginPath\n }\" is not installed. Please install the package using the command: \"npm install ${\n pluginPath\n } --save-dev\"`\n );\n } else {\n throw new Error(\n `An error occurred while importing the build plugin package \"${\n pluginPath\n }\":\n${isError(error) ? error.message : String(error)}\n\nNote: Please ensure the plugin package's default export is a class that extends \\`Plugin\\` with a constructor that excepts a single arguments of type \\`PluginOptions\\`.`\n );\n }\n }\n }\n}\n\n/**\n * Initialize a plugin based on the provided plugin configuration. This function handles various forms of plugin configurations, including direct plugin instances, factory functions, string paths to plugins, and arrays of plugins or plugin configurations. It validates the plugin configuration, resolves any plugin paths, and returns an array of initialized plugins.\n *\n * @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.\n * @param config - The plugin configuration, which can be in various forms such as a direct plugin instance, a string path to a plugin, a factory function that returns a plugin, or an array of plugins or plugin configurations. This configuration will be processed and validated to initialize the appropriate plugins.\n * @returns A promise that resolves to an array of initialized plugins based on the provided configuration. If the configuration is invalid, an error will be thrown with details about the issue.\n */\nexport async function initPlugin<\n TResolvedConfig extends ResolvedConfig,\n TSystemContext,\n TContext extends\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext> =\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext>,\n TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> =\n PluginContext<TResolvedConfig, TSystemContext>\n>(\n context: TContext,\n config: PluginConfig<TPluginContext>,\n options: ResolvePluginsOptions = {}\n): Promise<Plugin<TPluginContext>[] | null> {\n const { skipLogging = false } = options;\n\n let awaited = config;\n if (isPromiseLike(config)) {\n awaited = (await Promise.resolve(\n config as Promise<any>\n )) as PluginConfig<TPluginContext>;\n }\n\n if (!isPluginConfig<TPluginContext>(awaited)) {\n const invalid = findInvalidPluginConfig(awaited);\n\n throw new Error(\n `Invalid ${\n invalid && invalid.length > 1 ? \"plugins\" : \"plugin\"\n } specified in the configuration - ${\n invalid && invalid.length > 0\n ? JSON.stringify(awaited)\n : invalid?.join(\"\\n\\n\")\n } \\n\\nPlease ensure the value is one of the following: \\n - an instance of \\`Plugin\\` \\n - a plugin name \\n - an object with the \\`plugin\\` and \\`options\\` properties \\n - a tuple array with the plugin and options \\n - a factory function that returns a plugin or array of plugins \\n - an array of plugins or plugin configurations`\n );\n }\n\n let plugins!: Plugin<TPluginContext>[];\n if (isPlugin<TPluginContext>(awaited)) {\n plugins = [awaited];\n } else if (isFunction(awaited)) {\n plugins = toArray(await Promise.resolve(awaited()));\n } else if (isString(awaited)) {\n const resolved = await resolvePlugin<\n TResolvedConfig,\n TSystemContext,\n TContext\n >(context, awaited);\n if (isFunction(resolved)) {\n plugins = toArray(await Promise.resolve(resolved()));\n } else {\n plugins = toArray(resolved);\n }\n } else if (\n Array.isArray(awaited) &&\n (awaited as TPluginContext[]).every(isPlugin<TPluginContext>)\n ) {\n plugins = awaited as Plugin<TPluginContext>[];\n } else if (\n Array.isArray(awaited) &&\n (awaited as PluginConfig<TPluginContext>[]).every(\n isPluginConfig<TPluginContext>\n )\n ) {\n plugins = [];\n for (const pluginConfig of awaited as PluginConfig<TPluginContext>[]) {\n const initialized = await initPlugin<\n TResolvedConfig,\n TSystemContext,\n TContext,\n TPluginContext\n >(context, pluginConfig);\n if (initialized) {\n plugins.push(...initialized);\n }\n }\n } else if (\n isPluginConfigTuple<TPluginContext>(awaited) ||\n isPluginConfigObject<TPluginContext>(awaited)\n ) {\n let pluginConfig!:\n | string\n | PluginFactory<TPluginContext>\n | Plugin<TPluginContext>;\n let pluginOptions: any;\n\n if (isPluginConfigTuple<TPluginContext>(awaited)) {\n pluginConfig = awaited[0] as Plugin<TPluginContext>;\n pluginOptions =\n (awaited as PluginConfigTuple)?.length === 2 ? awaited[1] : undefined;\n } else {\n pluginConfig = awaited.plugin as Plugin<TPluginContext>;\n pluginOptions = awaited.options;\n }\n\n if (isSetString(pluginConfig)) {\n const resolved = await resolvePlugin<\n TResolvedConfig,\n TSystemContext,\n TContext,\n TPluginContext\n >(context, pluginConfig);\n if (isFunction(resolved)) {\n plugins = toArray(\n await Promise.resolve(\n pluginOptions ? resolved(pluginOptions) : resolved()\n )\n );\n } else {\n plugins = toArray(resolved);\n }\n } else if (isFunction(pluginConfig)) {\n plugins = toArray(await Promise.resolve(pluginConfig(pluginOptions)));\n } else if (\n Array.isArray(pluginConfig) &&\n pluginConfig.every(isPlugin<TPluginContext>)\n ) {\n plugins = pluginConfig;\n } else if (isPlugin<TPluginContext>(pluginConfig)) {\n plugins = toArray(pluginConfig);\n }\n }\n\n if (!plugins) {\n throw new Error(\n `The plugin configuration ${JSON.stringify(awaited)} is invalid. This configuration must point to a valid Powerlines plugin module.`\n );\n }\n\n if (plugins.length > 0 && !plugins.every(isPlugin<TPluginContext>)) {\n throw new Error(\n `The plugin option ${JSON.stringify(plugins)} does not export a valid module. This configuration must point to a valid Powerlines plugin module.`\n );\n }\n\n const result = [] as Plugin<TPluginContext>[];\n for (const plugin of plugins) {\n if (isDuplicate<TPluginContext>(plugin, context.plugins)) {\n if (!skipLogging) {\n context.trace({\n meta: {\n category: \"plugins\"\n },\n message: `Duplicate ${chalk.bold.cyanBright(\n plugin.name\n )} plugin dependency detected - Skipping initialization.`\n });\n }\n } else {\n result.push(plugin);\n\n if (!skipLogging) {\n context.trace({\n meta: {\n category: \"plugins\"\n },\n message: `Initializing the ${chalk.bold.cyanBright(plugin.name)} plugin...`\n });\n }\n }\n }\n\n return result;\n}\n\nexport interface ResolvePluginsOptions {\n /**\n * If true, the plugin resolution process will skip logging messages about the plugin initialization. This can be useful in scenarios where you want to suppress plugin-related logs, such as when running in a non-interactive environment or when you want to reduce log verbosity. By default, this option is false, and plugin initialization messages will be logged using the context's logger.\n */\n skipLogging?: boolean;\n}\n\n/**\n * Initialize a plugin based on the provided plugin configuration. This function handles various forms of plugin configurations, including direct plugin instances, plugin names, factory functions, and arrays of plugins. It validates the configuration, resolves plugin modules if necessary, and returns an array of initialized plugins ready to be added to the execution context.\n *\n * @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.\n * @param config - The plugin configuration, which can be in various forms such as a plugin instance, a plugin name string, a factory function that returns a plugin or an array of plugins, or an array of plugin configurations. The function will handle the resolution and initialization of the plugin(s) based on the provided configuration.\n * @returns A promise that resolves to an array of initialized plugins that can be added to the execution context, or null if the configuration is invalid or results in no plugins being initialized.\n */\nexport async function resolvePlugins<\n TResolvedConfig extends ResolvedConfig,\n TSystemContext,\n TContext extends\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext> =\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext>,\n TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> =\n PluginContext<TResolvedConfig, TSystemContext>\n>(\n context: TContext,\n config: PluginConfig<TPluginContext>,\n options: ResolvePluginsOptions = {}\n) {\n const { skipLogging = false } = options;\n\n const plugins = [] as Plugin<TPluginContext>[];\n if (config) {\n const result = await initPlugin<\n TResolvedConfig,\n TSystemContext,\n TContext,\n TPluginContext\n >(context, config);\n if (result) {\n for (const plugin of result) {\n if (!skipLogging) {\n context.debug({\n meta: {\n category: \"plugins\"\n },\n message: `Successfully initialized the ${chalk.bold.cyanBright(\n plugin.name\n )} plugin`\n });\n }\n\n plugins.push(plugin);\n }\n }\n }\n\n return plugins;\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"plugins.mjs","names":[],"sources":["../../src/lib/plugins.ts"],"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 { toArray } from \"@stryke/convert/to-array\";\nimport { install } from \"@stryke/fs/install\";\nimport { isPackageExists } from \"@stryke/fs/package-fns\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isPromiseLike } from \"@stryke/type-checks/is-promise\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { MaybePromise } from \"@stryke/types/base\";\nimport chalk from \"chalk\";\nimport {\n findInvalidPluginConfig,\n isDuplicate,\n isPlugin,\n isPluginConfig,\n isPluginConfigObject,\n isPluginConfigTuple\n} from \"../plugin-utils\";\nimport type {\n EnvironmentContext,\n ExecutionContext,\n Plugin,\n PluginConfig,\n PluginConfigTuple,\n PluginContext,\n PluginFactory,\n ResolvedConfig\n} from \"../types\";\n\n/**\n * Resolve a plugin module based on the provided plugin path. This function checks if the plugin package is installed, attempts to import the plugin module, and handles various error cases such as missing packages or invalid module exports. It supports both direct plugin exports and plugins exported from a \"plugin\" subdirectory within the package.\n *\n * @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.\n * @param pluginPath - The path to the plugin module. This can be a package name, a scoped package name, or a path to a local module.\n * @returns A promise that resolves to the plugin module, which can be a plugin instance, a factory function that returns a plugin, or an array of plugins.\n */\nexport async function resolvePlugin<\n TResolvedConfig extends ResolvedConfig,\n TSystemContext,\n TContext extends\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext> =\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext>,\n TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> =\n PluginContext<TResolvedConfig, TSystemContext>\n>(\n context: TContext,\n pluginPath: string\n): Promise<\n | Plugin<TPluginContext>\n | Plugin<TPluginContext>[]\n | ((\n options?: any\n ) => MaybePromise<Plugin<TPluginContext> | Plugin<TPluginContext>[]>)\n> {\n if (\n pluginPath.startsWith(\"@\") &&\n pluginPath.split(\"/\").filter(Boolean).length > 2\n ) {\n const splits = pluginPath.split(\"/\").filter(Boolean);\n pluginPath = `${splits[0]}/${splits[1]}`;\n }\n\n const isInstalled = isPackageExists(pluginPath, {\n paths: [context.config.cwd, context.config.root]\n });\n if (!isInstalled && context.config.autoInstall) {\n context.warn(\n `The plugin package \"${\n pluginPath\n }\" is not installed. It will be installed automatically.`\n );\n\n const result = await install(pluginPath, {\n cwd: context.config.root\n });\n if (isNumber(result.exitCode) && result.exitCode > 0) {\n context.error(result.stderr);\n\n throw new Error(\n `An error occurred while installing the build plugin package \"${\n pluginPath\n }\" `\n );\n }\n }\n\n try {\n // First check if the package has a \"plugin\" subdirectory - @scope/package/plugin\n const module = await context.resolver.plugin.import<{\n plugin?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n default?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n }>(context.resolver.plugin.esmResolve(joinPaths(pluginPath, \"plugin\")));\n\n const result = module.plugin ?? module.default;\n if (!result) {\n throw new Error(\n `The plugin package \"${pluginPath}\" does not export a valid module.`\n );\n }\n\n return result;\n } catch (error) {\n try {\n const module = await context.resolver.plugin.import<{\n plugin?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n default?:\n | Plugin<TPluginContext>\n | ((options?: any) => MaybePromise<Plugin<TPluginContext>>);\n }>(context.resolver.plugin.esmResolve(pluginPath));\n\n const result = module.plugin ?? module.default;\n if (!result) {\n throw new Error(\n `The plugin package \"${pluginPath}\" does not export a valid module.`\n );\n }\n\n return result;\n } catch {\n if (!isInstalled) {\n throw new Error(\n `The plugin package \"${\n pluginPath\n }\" is not installed. Please install the package using the command: \"npm install ${\n pluginPath\n } --save-dev\"`\n );\n } else {\n throw new Error(\n `An error occurred while importing the build plugin package \"${\n pluginPath\n }\":\n${isError(error) ? error.message : String(error)}\n\nNote: Please ensure the plugin package's default export is a class that extends \\`Plugin\\` with a constructor that excepts a single arguments of type \\`PluginOptions\\`.`\n );\n }\n }\n }\n}\n\n/**\n * Initialize a plugin based on the provided plugin configuration. This function handles various forms of plugin configurations, including direct plugin instances, factory functions, string paths to plugins, and arrays of plugins or plugin configurations. It validates the plugin configuration, resolves any plugin paths, and returns an array of initialized plugins.\n *\n * @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.\n * @param config - The plugin configuration, which can be in various forms such as a direct plugin instance, a string path to a plugin, a factory function that returns a plugin, or an array of plugins or plugin configurations. This configuration will be processed and validated to initialize the appropriate plugins.\n * @returns A promise that resolves to an array of initialized plugins based on the provided configuration. If the configuration is invalid, an error will be thrown with details about the issue.\n */\nexport async function initPlugin<\n TResolvedConfig extends ResolvedConfig,\n TSystemContext,\n TContext extends\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext> =\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext>,\n TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> =\n PluginContext<TResolvedConfig, TSystemContext>\n>(\n context: TContext,\n config: PluginConfig<TPluginContext>,\n options: ResolvePluginsOptions = {}\n): Promise<Plugin<TPluginContext>[] | null> {\n const { skipLogging = false } = options;\n\n let awaited = config;\n if (isPromiseLike(config)) {\n awaited = (await Promise.resolve(\n config as Promise<any>\n )) as PluginConfig<TPluginContext>;\n }\n\n if (!isPluginConfig<TPluginContext>(awaited)) {\n const invalid = findInvalidPluginConfig(awaited);\n\n throw new Error(\n `Invalid ${\n invalid && invalid.length > 1 ? \"plugins\" : \"plugin\"\n } specified in the configuration - ${\n invalid && invalid.length > 0\n ? JSON.stringify(awaited)\n : invalid?.join(\"\\n\\n\")\n } \\n\\nPlease ensure the value is one of the following: \\n - an instance of \\`Plugin\\` \\n - a plugin name \\n - an object with the \\`plugin\\` and \\`options\\` properties \\n - a tuple array with the plugin and options \\n - a factory function that returns a plugin or array of plugins \\n - an array of plugins or plugin configurations`\n );\n }\n\n let plugins!: Plugin<TPluginContext>[];\n if (isPlugin<TPluginContext>(awaited)) {\n plugins = [awaited];\n } else if (isFunction(awaited)) {\n plugins = toArray(await Promise.resolve(awaited()));\n } else if (isString(awaited)) {\n const resolved = await resolvePlugin<\n TResolvedConfig,\n TSystemContext,\n TContext\n >(context, awaited);\n if (isFunction(resolved)) {\n plugins = toArray(await Promise.resolve(resolved()));\n } else {\n plugins = toArray(resolved);\n }\n } else if (\n Array.isArray(awaited) &&\n (awaited as TPluginContext[]).every(isPlugin<TPluginContext>)\n ) {\n plugins = awaited as Plugin<TPluginContext>[];\n } else if (\n Array.isArray(awaited) &&\n (awaited as PluginConfig<TPluginContext>[]).every(\n isPluginConfig<TPluginContext>\n )\n ) {\n plugins = [];\n for (const pluginConfig of awaited as PluginConfig<TPluginContext>[]) {\n const initialized = await initPlugin<\n TResolvedConfig,\n TSystemContext,\n TContext,\n TPluginContext\n >(context, pluginConfig);\n if (initialized) {\n plugins.push(...initialized);\n }\n }\n } else if (\n isPluginConfigTuple<TPluginContext>(awaited) ||\n isPluginConfigObject<TPluginContext>(awaited)\n ) {\n let pluginConfig!:\n | string\n | PluginFactory<TPluginContext>\n | Plugin<TPluginContext>;\n let pluginOptions: any;\n\n if (isPluginConfigTuple<TPluginContext>(awaited)) {\n pluginConfig = awaited[0] as Plugin<TPluginContext>;\n pluginOptions =\n (awaited as PluginConfigTuple)?.length === 2 ? awaited[1] : undefined;\n } else {\n pluginConfig = awaited.plugin as Plugin<TPluginContext>;\n pluginOptions = awaited.options;\n }\n\n if (isSetString(pluginConfig)) {\n const resolved = await resolvePlugin<\n TResolvedConfig,\n TSystemContext,\n TContext,\n TPluginContext\n >(context, pluginConfig);\n if (isFunction(resolved)) {\n plugins = toArray(\n await Promise.resolve(\n pluginOptions ? resolved(pluginOptions) : resolved()\n )\n );\n } else {\n plugins = toArray(resolved);\n }\n } else if (isFunction(pluginConfig)) {\n plugins = toArray(await Promise.resolve(pluginConfig(pluginOptions)));\n } else if (\n Array.isArray(pluginConfig) &&\n pluginConfig.every(isPlugin<TPluginContext>)\n ) {\n plugins = pluginConfig;\n } else if (isPlugin<TPluginContext>(pluginConfig)) {\n plugins = toArray(pluginConfig);\n }\n }\n\n if (!plugins) {\n throw new Error(\n `The plugin configuration ${JSON.stringify(awaited)} is invalid. This configuration must point to a valid Powerlines plugin module.`\n );\n }\n\n if (plugins.length > 0 && !plugins.every(isPlugin<TPluginContext>)) {\n throw new Error(\n `The plugin option ${JSON.stringify(plugins)} does not export a valid module. This configuration must point to a valid Powerlines plugin module.`\n );\n }\n\n const result = [] as Plugin<TPluginContext>[];\n for (const plugin of plugins) {\n if (isDuplicate<TPluginContext>(plugin, context.plugins)) {\n if (!skipLogging) {\n context.trace({\n meta: {\n category: \"plugins\"\n },\n message: `Duplicate ${chalk.bold.cyanBright(\n plugin.name\n )} plugin dependency detected - Skipping initialization.`\n });\n }\n } else {\n result.push(plugin);\n\n if (!skipLogging) {\n context.trace({\n meta: {\n category: \"plugins\"\n },\n message: `Initializing the ${chalk.bold.cyanBright(plugin.name)} plugin...`\n });\n }\n }\n }\n\n return result;\n}\n\nexport interface ResolvePluginsOptions {\n /**\n * If true, the plugin resolution process will skip logging messages about the plugin initialization. This can be useful in scenarios where you want to suppress plugin-related logs, such as when running in a non-interactive environment or when you want to reduce log verbosity. By default, this option is false, and plugin initialization messages will be logged using the context's logger.\n */\n skipLogging?: boolean;\n}\n\n/**\n * Initialize a plugin based on the provided plugin configuration. This function handles various forms of plugin configurations, including direct plugin instances, plugin names, factory functions, and arrays of plugins. It validates the configuration, resolves plugin modules if necessary, and returns an array of initialized plugins ready to be added to the execution context.\n *\n * @param context - The execution context in which the plugin will be initialized. This context provides access to configuration, logging, and other utilities that may be needed during plugin initialization.\n * @param config - The plugin configuration, which can be in various forms such as a plugin instance, a plugin name string, a factory function that returns a plugin or an array of plugins, or an array of plugin configurations. The function will handle the resolution and initialization of the plugin(s) based on the provided configuration.\n * @returns A promise that resolves to an array of initialized plugins that can be added to the execution context, or null if the configuration is invalid or results in no plugins being initialized.\n */\nexport async function resolvePlugins<\n TResolvedConfig extends ResolvedConfig,\n TSystemContext,\n TContext extends\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext> =\n | EnvironmentContext<TResolvedConfig, TSystemContext>\n | ExecutionContext<TResolvedConfig, TSystemContext>,\n TPluginContext extends PluginContext<TResolvedConfig, TSystemContext> =\n PluginContext<TResolvedConfig, TSystemContext>\n>(\n context: TContext,\n config: PluginConfig<TPluginContext>,\n options: ResolvePluginsOptions = {}\n) {\n const { skipLogging = false } = options;\n\n const plugins = [] as Plugin<TPluginContext>[];\n if (config) {\n const result = await initPlugin<\n TResolvedConfig,\n TSystemContext,\n TContext,\n TPluginContext\n >(context, config);\n if (result) {\n for (const plugin of result) {\n if (!skipLogging) {\n context.debug({\n meta: {\n category: \"plugins\"\n },\n message: `Successfully initialized the ${chalk.bold.cyanBright(\n plugin.name\n )} plugin`\n });\n }\n\n plugins.push(plugin);\n }\n }\n }\n\n return plugins;\n}\n"],"mappings":"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"}
|
package/dist/lib/resolver.cjs
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
9
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
10
|
-
const
|
|
2
|
+
const require_chunk = require('../chunk-C_NdSu1c.cjs');
|
|
11
3
|
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
12
4
|
let defu = require("defu");
|
|
13
|
-
defu =
|
|
5
|
+
defu = require_chunk.__toESM(defu, 1);
|
|
14
6
|
let jiti = require("jiti");
|
|
15
7
|
|
|
16
8
|
//#region src/lib/resolver.ts
|
package/dist/lib/resolver.d.cts
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { JitiOptions } from "jiti";
|
|
4
|
-
|
|
5
|
-
//#region src/lib/resolver.d.ts
|
|
6
|
-
type CreateResolverOptions = Omit<JitiOptions, "fsCache" | "moduleCache" | "interopDefault"> & Partial<Pick<ResolvedConfig, "mode" | "skipCache">> & {
|
|
7
|
-
cwd: string;
|
|
8
|
-
root: string;
|
|
9
|
-
cacheDir: string;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Create a Jiti resolver for the given workspace and project root.
|
|
13
|
-
*
|
|
14
|
-
* @param options - The options for creating the resolver.
|
|
15
|
-
* @returns A Jiti instance configured for the specified workspace and project root.
|
|
16
|
-
*/
|
|
17
|
-
declare function createResolver(options: CreateResolverOptions): Resolver;
|
|
18
|
-
//#endregion
|
|
19
|
-
export { CreateResolverOptions, createResolver };
|
|
20
|
-
//# sourceMappingURL=resolver.d.cts.map
|
|
1
|
+
import { n as createResolver, t as CreateResolverOptions } from "../resolver-CfCl--Eh.cjs";
|
|
2
|
+
export { CreateResolverOptions, createResolver };
|
package/dist/lib/resolver.d.mts
CHANGED
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { Resolver } from "../types/context.mjs";
|
|
4
|
-
import { ResolvedConfig } from "../types/config.mjs";
|
|
5
|
-
import { JitiOptions } from "jiti";
|
|
6
|
-
|
|
7
|
-
//#region src/lib/resolver.d.ts
|
|
8
|
-
type CreateResolverOptions = Omit<JitiOptions, "fsCache" | "moduleCache" | "interopDefault"> & Partial<Pick<ResolvedConfig, "mode" | "skipCache">> & {
|
|
9
|
-
cwd: string;
|
|
10
|
-
root: string;
|
|
11
|
-
cacheDir: string;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Create a Jiti resolver for the given workspace and project root.
|
|
15
|
-
*
|
|
16
|
-
* @param options - The options for creating the resolver.
|
|
17
|
-
* @returns A Jiti instance configured for the specified workspace and project root.
|
|
18
|
-
*/
|
|
19
|
-
declare function createResolver(options: CreateResolverOptions): Resolver;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { CreateResolverOptions, createResolver };
|
|
22
|
-
//# sourceMappingURL=resolver.d.mts.map
|
|
1
|
+
import { n as createResolver, t as CreateResolverOptions } from "../resolver-CdBAh8dA.mjs";
|
|
2
|
+
export { CreateResolverOptions, createResolver };
|
package/dist/lib/resolver.mjs
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
9
1
|
import { joinPaths } from "@stryke/path/join-paths";
|
|
10
2
|
import defu from "defu";
|
|
11
3
|
import { createJiti } from "jiti";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.mjs","names":[],"sources":["../../src/lib/resolver.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { JitiOptions, createJiti } from \"jiti\";\nimport { ResolvedConfig } from \"../types/config\";\nimport { Resolver } from \"../types/context\";\n\nexport type CreateResolverOptions = Omit<\n JitiOptions,\n \"fsCache\" | \"moduleCache\" | \"interopDefault\"\n> &\n Partial<Pick<ResolvedConfig, \"mode\" | \"skipCache\">> & {\n cwd: string;\n root: string;\n cacheDir: string;\n };\n\n/**\n * Create a Jiti resolver for the given workspace and project root.\n *\n * @param options - The options for creating the resolver.\n * @returns A Jiti instance configured for the specified workspace and project root.\n */\nfunction resolveOptions(options: CreateResolverOptions): JitiOptions {\n return defu(options, {\n interopDefault: true,\n fsCache:\n options.mode !== \"development\"\n ? joinPaths(options.cacheDir, \"jiti\")\n : false,\n moduleCache: options.mode !== \"development\"\n });\n}\n\n/**\n * Create a Jiti resolver for the given workspace and project root.\n *\n * @param options - The options for creating the resolver.\n * @returns A Jiti instance configured for the specified workspace and project root.\n */\nexport function createResolver(options: CreateResolverOptions): Resolver {\n const baseResolver = createJiti(\n joinPaths(options.cwd, options.root),\n resolveOptions(options)\n ) as Resolver;\n baseResolver.plugin = createJiti(\n joinPaths(options.cwd, options.root),\n resolveOptions(options)\n );\n\n return baseResolver;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolver.mjs","names":[],"sources":["../../src/lib/resolver.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { JitiOptions, createJiti } from \"jiti\";\nimport { ResolvedConfig } from \"../types/config\";\nimport { Resolver } from \"../types/context\";\n\nexport type CreateResolverOptions = Omit<\n JitiOptions,\n \"fsCache\" | \"moduleCache\" | \"interopDefault\"\n> &\n Partial<Pick<ResolvedConfig, \"mode\" | \"skipCache\">> & {\n cwd: string;\n root: string;\n cacheDir: string;\n };\n\n/**\n * Create a Jiti resolver for the given workspace and project root.\n *\n * @param options - The options for creating the resolver.\n * @returns A Jiti instance configured for the specified workspace and project root.\n */\nfunction resolveOptions(options: CreateResolverOptions): JitiOptions {\n return defu(options, {\n interopDefault: true,\n fsCache:\n options.mode !== \"development\"\n ? joinPaths(options.cacheDir, \"jiti\")\n : false,\n moduleCache: options.mode !== \"development\"\n });\n}\n\n/**\n * Create a Jiti resolver for the given workspace and project root.\n *\n * @param options - The options for creating the resolver.\n * @returns A Jiti instance configured for the specified workspace and project root.\n */\nexport function createResolver(options: CreateResolverOptions): Resolver {\n const baseResolver = createJiti(\n joinPaths(options.cwd, options.root),\n resolveOptions(options)\n ) as Resolver;\n baseResolver.plugin = createJiti(\n joinPaths(options.cwd, options.root),\n resolveOptions(options)\n );\n\n return baseResolver;\n}\n"],"mappings":";;;;;;;;;;;AAwCA,SAAS,eAAe,SAA6C;CACnE,OAAO,KAAK,SAAS;EACnB,gBAAgB;EAChB,SACE,QAAQ,SAAS,gBACb,UAAU,QAAQ,UAAU,MAAM,IAClC;EACN,aAAa,QAAQ,SAAS;CAChC,CAAC;AACH;;;;;;;AAQA,SAAgB,eAAe,SAA0C;CACvE,MAAM,eAAe,WACnB,UAAU,QAAQ,KAAK,QAAQ,IAAI,GACnC,eAAe,OAAO,CACxB;CACA,aAAa,SAAS,WACpB,UAAU,QAAQ,KAAK,QAAQ,IAAI,GACnC,eAAe,OAAO,CACxB;CAEA,OAAO;AACT"}
|
package/dist/lib/schemas.cjs
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
9
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
10
|
-
const require_fs = require('../
|
|
2
|
+
const require_fs = require('../fs-C2lru696.cjs');
|
|
11
3
|
|
|
12
4
|
exports.FileId = require_fs.FileId;
|
|
13
5
|
exports.FileMetadata = require_fs.FileMetadata;
|
package/dist/lib/schemas.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as FileSystem, i as FileStorage, n as FileMetadata, o as _capnpFileId, r as FileMetadata_KeyValuePair, t as FileId } from "../schemas-Zvqwdrw_.cjs";
|
|
2
2
|
export { FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, _capnpFileId };
|
package/dist/lib/schemas.d.mts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import { FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, _capnpFileId } from "../schemas/fs.mjs";
|
|
1
|
+
import { a as FileSystem, i as FileStorage, n as FileMetadata, o as _capnpFileId, r as FileMetadata_KeyValuePair, t as FileId } from "../schemas-Zvqwdrw_.mjs";
|
|
4
2
|
export { FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, _capnpFileId };
|
package/dist/lib/schemas.mjs
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
9
|
-
import { FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, _capnpFileId } from "../schemas/fs.mjs";
|
|
1
|
+
import { a as FileSystem, i as FileStorage, n as FileMetadata, o as _capnpFileId, r as FileMetadata_KeyValuePair, t as FileId } from "../fs-DqLn15uU.mjs";
|
|
10
2
|
|
|
11
3
|
export { FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, _capnpFileId };
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import __tsdown_shims_path from 'node:path'
|
|
4
|
-
import __tsdown_shims_url from 'node:url'
|
|
5
|
-
|
|
6
|
-
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
-
|
|
9
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
10
2
|
const require_lib_events = require('./events.cjs');
|
|
11
3
|
let _stryke_unique_id_nanoid_client = require("@stryke/unique-id/nanoid-client");
|