@powerlines/core 0.48.28 → 0.48.30
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 -23
- 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 +3 -18
- package/dist/context/base-context.d.cts +2 -81
- package/dist/context/base-context.d.mts +2 -83
- package/dist/context/base-context.mjs +1 -11
- package/dist/context/base-context.mjs.map +1 -1
- package/dist/context/context.cjs +3 -18
- package/dist/context/context.d.cts +2 -373
- package/dist/context/context.d.mts +2 -375
- package/dist/context/context.mjs +1 -11
- package/dist/context/context.mjs.map +1 -1
- package/dist/context/environment-context.cjs +1 -17
- 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 +1 -11
- package/dist/context/environment-context.mjs.map +1 -1
- package/dist/context/execution-context.cjs +3 -18
- 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 +1 -11
- 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 +1 -17
- 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 +1 -11
- 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-BRt-Eq-v.d.mts +15 -0
- package/dist/context-helpers-BRt-Eq-v.d.mts.map +1 -0
- package/dist/context-helpers-Cnsku6fQ.d.cts +15 -0
- package/dist/context-helpers-Cnsku6fQ.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-LtpXjuJR.d.mts +25 -0
- package/dist/index-LtpXjuJR.d.mts.map +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 -28
- package/dist/lib/config.d.cts +2 -140
- package/dist/lib/config.d.mts +2 -142
- package/dist/lib/config.mjs +1 -22
- package/dist/lib/config.mjs.map +1 -1
- package/dist/lib/context-helpers.cjs +0 -19
- package/dist/lib/context-helpers.d.cts +2 -16
- package/dist/lib/context-helpers.d.mts +2 -18
- package/dist/lib/context-helpers.mjs +1 -14
- package/dist/lib/context-helpers.mjs.map +1 -1
- package/dist/lib/entry.cjs +0 -24
- package/dist/lib/entry.d.cts +2 -47
- package/dist/lib/entry.d.mts +2 -49
- package/dist/lib/entry.mjs +1 -19
- package/dist/lib/entry.mjs.map +1 -1
- package/dist/lib/environment.cjs +2 -22
- 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 +1 -16
- package/dist/lib/environment.mjs.map +1 -1
- package/dist/lib/events.cjs +1 -17
- package/dist/lib/events.d.cts +2 -10
- package/dist/lib/events.d.mts +2 -12
- package/dist/lib/events.mjs +1 -12
- package/dist/lib/events.mjs.map +1 -1
- package/dist/lib/generate-types.cjs +0 -20
- package/dist/lib/generate-types.d.cts +2 -66
- package/dist/lib/generate-types.d.mts +2 -68
- package/dist/lib/generate-types.mjs +1 -15
- package/dist/lib/generate-types.mjs.map +1 -1
- package/dist/lib/hooks.cjs +2 -22
- package/dist/lib/hooks.d.cts +2 -28
- package/dist/lib/hooks.d.mts +2 -30
- package/dist/lib/hooks.mjs +1 -16
- 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 +1 -17
- package/dist/lib/install-dependencies.d.cts +2 -12
- package/dist/lib/install-dependencies.d.mts +2 -14
- package/dist/lib/install-dependencies.mjs +1 -11
- 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 -21
- package/dist/lib/plugins.d.cts +2 -39
- package/dist/lib/plugins.d.mts +2 -41
- package/dist/lib/plugins.mjs +1 -15
- package/dist/lib/plugins.mjs.map +1 -1
- package/dist/lib/resolver.cjs +3 -18
- package/dist/lib/resolver.d.cts +2 -20
- package/dist/lib/resolver.d.mts +2 -22
- package/dist/lib/resolver.mjs +1 -11
- 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 +1 -20
- package/dist/lib/streaming-channel.d.cts +2 -126
- package/dist/lib/streaming-channel.d.mts +2 -128
- package/dist/lib/streaming-channel.mjs +1 -14
- 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 +3 -21
- 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 +1 -14
- package/dist/lib/typescript/ts-morph.mjs.map +1 -1
- package/dist/lib/typescript/tsconfig.cjs +5 -31
- package/dist/lib/typescript/tsconfig.d.cts +2 -77
- package/dist/lib/typescript/tsconfig.d.mts +2 -79
- package/dist/lib/typescript/tsconfig.mjs +1 -22
- package/dist/lib/typescript/tsconfig.mjs.map +1 -1
- package/dist/lib/unplugin/helpers.cjs +0 -19
- package/dist/lib/unplugin/helpers.d.cts +2 -23
- package/dist/lib/unplugin/helpers.d.mts +2 -25
- package/dist/lib/unplugin/helpers.mjs +1 -14
- 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 +3 -18
- 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 +1 -11
- package/dist/lib/unplugin/module-resolution.mjs.map +1 -1
- package/dist/lib/unplugin/plugin.cjs +1 -20
- package/dist/lib/unplugin/plugin.d.cts +2 -40
- package/dist/lib/unplugin/plugin.d.mts +2 -42
- package/dist/lib/unplugin/plugin.mjs +1 -14
- package/dist/lib/unplugin/plugin.mjs.map +1 -1
- package/dist/lib/utilities/file-header.cjs +0 -21
- 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 +1 -16
- package/dist/lib/utilities/file-header.mjs.map +1 -1
- package/dist/lib/utilities/format.cjs +3 -21
- package/dist/lib/utilities/format.d.cts +2 -24
- package/dist/lib/utilities/format.d.mts +2 -26
- package/dist/lib/utilities/format.mjs +1 -14
- 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 +3 -22
- 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 +1 -15
- package/dist/lib/utilities/source-file.mjs.map +1 -1
- package/dist/lib/utilities/source-map.cjs +3 -18
- 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 +1 -11
- package/dist/lib/utilities/source-map.mjs.map +1 -1
- package/dist/lib/utilities/write-file.cjs +1 -17
- 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 +1 -11
- package/dist/lib/utilities/write-file.mjs.map +1 -1
- package/dist/lib/vfs.cjs +4 -19
- package/dist/lib/vfs.d.cts +2 -321
- package/dist/lib/vfs.d.mts +2 -323
- package/dist/lib/vfs.mjs +2 -12
- 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 +1 -20
- 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 +1 -14
- 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 -16
- 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 +1 -11
- package/dist/plugin-utils/build-helpers.mjs.map +1 -1
- package/dist/plugin-utils/combine-plugins.cjs +1 -20
- 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 +1 -14
- package/dist/plugin-utils/combine-plugins.mjs.map +1 -1
- package/dist/plugin-utils/context-helpers.cjs +0 -21
- 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 +1 -16
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/docs-helper.cjs +0 -16
- 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 +1 -11
- package/dist/plugin-utils/docs-helper.mjs.map +1 -1
- package/dist/plugin-utils/enable-plugin.cjs +1 -17
- 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 +1 -11
- package/dist/plugin-utils/enable-plugin.mjs.map +1 -1
- package/dist/plugin-utils/extend.cjs +1 -17
- 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 +1 -11
- package/dist/plugin-utils/extend.mjs.map +1 -1
- package/dist/plugin-utils/filter.cjs +2 -27
- 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 +1 -21
- package/dist/plugin-utils/filter.mjs.map +1 -1
- package/dist/plugin-utils/format-package-json.cjs +1 -17
- 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 +1 -11
- package/dist/plugin-utils/format-package-json.mjs.map +1 -1
- package/dist/plugin-utils/format.cjs +1 -17
- 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 +1 -11
- package/dist/plugin-utils/format.mjs.map +1 -1
- package/dist/plugin-utils/get-config-path.cjs +1 -17
- 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 +1 -11
- package/dist/plugin-utils/get-config-path.mjs.map +1 -1
- package/dist/plugin-utils/helpers.cjs +0 -33
- 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 +1 -28
- 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 +1 -20
- 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 +1 -14
- package/dist/plugin-utils/install.mjs.map +1 -1
- package/dist/plugin-utils/logging.cjs +2 -34
- 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 +1 -28
- package/dist/plugin-utils/logging.mjs.map +1 -1
- package/dist/plugin-utils/merge.cjs +3 -21
- 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 +1 -14
- package/dist/plugin-utils/merge.mjs.map +1 -1
- package/dist/plugin-utils/modules.cjs +1 -17
- 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 +1 -12
- package/dist/plugin-utils/modules.mjs.map +1 -1
- package/dist/plugin-utils/paths.cjs +0 -16
- 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 +1 -11
- package/dist/plugin-utils/paths.mjs.map +1 -1
- package/dist/plugin-utils/virtual.cjs +1 -25
- 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 +1 -20
- 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 +1 -17
- 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 +1 -11
- package/dist/storage/base.mjs.map +1 -1
- package/dist/storage/file-system.cjs +1 -17
- 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 +1 -11
- package/dist/storage/file-system.mjs.map +1 -1
- package/dist/storage/helpers.cjs +0 -20
- package/dist/storage/helpers.d.mts +0 -2
- package/dist/storage/helpers.d.mts.map +1 -1
- package/dist/storage/helpers.mjs +1 -15
- 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 +1 -17
- package/dist/storage/virtual.d.cts +1 -1
- package/dist/storage/virtual.d.mts +1 -3
- package/dist/storage/virtual.d.mts.map +1 -1
- package/dist/storage/virtual.mjs +1 -11
- 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 +14 -254
- package/dist/_virtual/_rolldown/runtime.mjs +0 -26
- package/dist/constants/api.d.cts.map +0 -1
- package/dist/constants/api.d.mts.map +0 -1
- package/dist/constants/api.test.cjs +0 -42
- package/dist/constants/api.test.d.mts +0 -2
- package/dist/constants/api.test.mjs +0 -44
- package/dist/constants/api.test.mjs.map +0 -1
- package/dist/constants/commands.d.cts.map +0 -1
- package/dist/constants/commands.d.mts.map +0 -1
- package/dist/constants/commands.test.cjs +0 -29
- package/dist/constants/commands.test.d.mts +0 -2
- package/dist/constants/commands.test.mjs +0 -31
- package/dist/constants/commands.test.mjs.map +0 -1
- package/dist/constants/devtools.d.cts.map +0 -1
- package/dist/constants/devtools.d.mts.map +0 -1
- package/dist/constants/devtools.test.cjs +0 -46
- package/dist/constants/devtools.test.d.mts +0 -2
- package/dist/constants/devtools.test.mjs +0 -48
- package/dist/constants/devtools.test.mjs.map +0 -1
- package/dist/constants/environments.d.cts.map +0 -1
- package/dist/constants/environments.d.mts.map +0 -1
- package/dist/constants/environments.test.cjs +0 -34
- package/dist/constants/environments.test.d.mts +0 -2
- package/dist/constants/environments.test.mjs +0 -36
- package/dist/constants/environments.test.mjs.map +0 -1
- package/dist/constants/extensions.d.cts.map +0 -1
- package/dist/constants/extensions.d.mts.map +0 -1
- package/dist/constants/extensions.test.cjs +0 -35
- package/dist/constants/extensions.test.d.mts +0 -2
- package/dist/constants/extensions.test.mjs +0 -37
- package/dist/constants/extensions.test.mjs.map +0 -1
- package/dist/constants/fs.d.cts.map +0 -1
- package/dist/constants/fs.d.mts.map +0 -1
- package/dist/constants/fs.test.cjs +0 -34
- package/dist/constants/fs.test.d.mts +0 -2
- package/dist/constants/fs.test.mjs +0 -36
- package/dist/constants/fs.test.mjs.map +0 -1
- package/dist/constants/hooks.d.cts.map +0 -1
- package/dist/constants/hooks.d.mts.map +0 -1
- package/dist/constants/hooks.test.cjs +0 -29
- package/dist/constants/hooks.test.d.mts +0 -2
- package/dist/constants/hooks.test.mjs +0 -31
- package/dist/constants/hooks.test.mjs.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/log-level.test.cjs +0 -76
- package/dist/constants/log-level.test.d.mts +0 -2
- package/dist/constants/log-level.test.mjs +0 -78
- package/dist/constants/log-level.test.mjs.map +0 -1
- package/dist/constants/meta.d.cts.map +0 -1
- package/dist/constants/meta.d.mts.map +0 -1
- package/dist/constants/meta.test.cjs +0 -33
- package/dist/constants/meta.test.d.mts +0 -2
- package/dist/constants/meta.test.mjs +0 -35
- package/dist/constants/meta.test.mjs.map +0 -1
- package/dist/constants/plugin.d.cts.map +0 -1
- package/dist/constants/plugin.d.mts.map +0 -1
- package/dist/constants/plugin.test.cjs +0 -59
- package/dist/constants/plugin.test.d.mts +0 -2
- package/dist/constants/plugin.test.mjs +0 -61
- package/dist/constants/plugin.test.mjs.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/base-context.test.cjs +0 -23
- package/dist/context/base-context.test.d.cts +0 -1
- package/dist/context/base-context.test.d.mts +0 -2
- package/dist/context/base-context.test.mjs +0 -25
- package/dist/context/base-context.test.mjs.map +0 -1
- package/dist/context/context.d.cts.map +0 -1
- package/dist/context/context.d.mts.map +0 -1
- package/dist/context/context.test.cjs +0 -23
- package/dist/context/context.test.d.cts +0 -1
- package/dist/context/context.test.d.mts +0 -2
- package/dist/context/context.test.mjs +0 -25
- package/dist/context/context.test.mjs.map +0 -1
- package/dist/context/environment-context.test.cjs +0 -23
- package/dist/context/environment-context.test.d.cts +0 -1
- package/dist/context/environment-context.test.d.mts +0 -2
- package/dist/context/environment-context.test.mjs +0 -25
- package/dist/context/environment-context.test.mjs.map +0 -1
- package/dist/context/execution-context.test.cjs +0 -23
- package/dist/context/execution-context.test.d.cts +0 -1
- package/dist/context/execution-context.test.d.mts +0 -2
- package/dist/context/execution-context.test.mjs +0 -25
- package/dist/context/execution-context.test.mjs.map +0 -1
- package/dist/context/plugin-context.test.cjs +0 -23
- package/dist/context/plugin-context.test.d.cts +0 -1
- package/dist/context/plugin-context.test.d.mts +0 -2
- package/dist/context/plugin-context.test.mjs +0 -25
- package/dist/context/plugin-context.test.mjs.map +0 -1
- package/dist/lib/config.d.cts.map +0 -1
- package/dist/lib/config.d.mts.map +0 -1
- package/dist/lib/config.test.cjs +0 -23
- package/dist/lib/config.test.d.cts +0 -1
- package/dist/lib/config.test.d.mts +0 -2
- package/dist/lib/config.test.mjs +0 -25
- package/dist/lib/config.test.mjs.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/context-helpers.test.cjs +0 -23
- package/dist/lib/context-helpers.test.d.cts +0 -1
- package/dist/lib/context-helpers.test.d.mts +0 -2
- package/dist/lib/context-helpers.test.mjs +0 -25
- package/dist/lib/context-helpers.test.mjs.map +0 -1
- package/dist/lib/entry.d.cts.map +0 -1
- package/dist/lib/entry.d.mts.map +0 -1
- package/dist/lib/entry.test.cjs +0 -23
- package/dist/lib/entry.test.d.cts +0 -1
- package/dist/lib/entry.test.d.mts +0 -2
- package/dist/lib/entry.test.mjs +0 -25
- package/dist/lib/entry.test.mjs.map +0 -1
- package/dist/lib/environment.test.cjs +0 -23
- package/dist/lib/environment.test.d.cts +0 -1
- package/dist/lib/environment.test.d.mts +0 -2
- package/dist/lib/environment.test.mjs +0 -25
- package/dist/lib/environment.test.mjs.map +0 -1
- package/dist/lib/events.d.cts.map +0 -1
- package/dist/lib/events.d.mts.map +0 -1
- package/dist/lib/events.test.cjs +0 -23
- package/dist/lib/events.test.d.cts +0 -1
- package/dist/lib/events.test.d.mts +0 -2
- package/dist/lib/events.test.mjs +0 -25
- package/dist/lib/events.test.mjs.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/generate-types.test.cjs +0 -23
- package/dist/lib/generate-types.test.d.cts +0 -1
- package/dist/lib/generate-types.test.d.mts +0 -2
- package/dist/lib/generate-types.test.mjs +0 -25
- package/dist/lib/generate-types.test.mjs.map +0 -1
- package/dist/lib/hooks.d.cts.map +0 -1
- package/dist/lib/hooks.d.mts.map +0 -1
- package/dist/lib/hooks.test.cjs +0 -23
- package/dist/lib/hooks.test.d.cts +0 -1
- package/dist/lib/hooks.test.d.mts +0 -2
- package/dist/lib/hooks.test.mjs +0 -25
- package/dist/lib/hooks.test.mjs.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/install-dependencies.test.cjs +0 -23
- package/dist/lib/install-dependencies.test.d.cts +0 -1
- package/dist/lib/install-dependencies.test.d.mts +0 -2
- package/dist/lib/install-dependencies.test.mjs +0 -25
- package/dist/lib/install-dependencies.test.mjs.map +0 -1
- package/dist/lib/meta.d.cts.map +0 -1
- package/dist/lib/meta.d.mts.map +0 -1
- package/dist/lib/meta.test.cjs +0 -35
- package/dist/lib/meta.test.d.cts +0 -1
- package/dist/lib/meta.test.d.mts +0 -2
- package/dist/lib/meta.test.mjs +0 -37
- package/dist/lib/meta.test.mjs.map +0 -1
- package/dist/lib/plugins.d.cts.map +0 -1
- package/dist/lib/plugins.d.mts.map +0 -1
- package/dist/lib/plugins.test.cjs +0 -23
- package/dist/lib/plugins.test.d.cts +0 -1
- package/dist/lib/plugins.test.d.mts +0 -2
- package/dist/lib/plugins.test.mjs +0 -25
- package/dist/lib/plugins.test.mjs.map +0 -1
- package/dist/lib/resolver.d.cts.map +0 -1
- package/dist/lib/resolver.d.mts.map +0 -1
- package/dist/lib/resolver.test.cjs +0 -23
- package/dist/lib/resolver.test.d.cts +0 -1
- package/dist/lib/resolver.test.d.mts +0 -2
- package/dist/lib/resolver.test.mjs +0 -25
- package/dist/lib/resolver.test.mjs.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/streaming-channel.test.cjs +0 -23
- package/dist/lib/streaming-channel.test.d.cts +0 -1
- package/dist/lib/streaming-channel.test.d.mts +0 -2
- package/dist/lib/streaming-channel.test.mjs +0 -25
- package/dist/lib/streaming-channel.test.mjs.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/ts-morph.test.cjs +0 -23
- package/dist/lib/typescript/ts-morph.test.d.cts +0 -1
- package/dist/lib/typescript/ts-morph.test.d.mts +0 -2
- package/dist/lib/typescript/ts-morph.test.mjs +0 -25
- package/dist/lib/typescript/ts-morph.test.mjs.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/typescript/tsconfig.test.cjs +0 -23
- package/dist/lib/typescript/tsconfig.test.d.cts +0 -1
- package/dist/lib/typescript/tsconfig.test.d.mts +0 -2
- package/dist/lib/typescript/tsconfig.test.mjs +0 -25
- package/dist/lib/typescript/tsconfig.test.mjs.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/helpers.test.cjs +0 -23
- package/dist/lib/unplugin/helpers.test.d.cts +0 -1
- package/dist/lib/unplugin/helpers.test.d.mts +0 -2
- package/dist/lib/unplugin/helpers.test.mjs +0 -25
- package/dist/lib/unplugin/helpers.test.mjs.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/module-resolution.test.cjs +0 -23
- package/dist/lib/unplugin/module-resolution.test.d.cts +0 -1
- package/dist/lib/unplugin/module-resolution.test.d.mts +0 -2
- package/dist/lib/unplugin/module-resolution.test.mjs +0 -25
- package/dist/lib/unplugin/module-resolution.test.mjs.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/unplugin/plugin.test.cjs +0 -23
- package/dist/lib/unplugin/plugin.test.d.cts +0 -1
- package/dist/lib/unplugin/plugin.test.d.mts +0 -2
- package/dist/lib/unplugin/plugin.test.mjs +0 -25
- package/dist/lib/unplugin/plugin.test.mjs.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/file-header.test.cjs +0 -23
- package/dist/lib/utilities/file-header.test.d.cts +0 -1
- package/dist/lib/utilities/file-header.test.d.mts +0 -2
- package/dist/lib/utilities/file-header.test.mjs +0 -25
- package/dist/lib/utilities/file-header.test.mjs.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/format.test.cjs +0 -23
- package/dist/lib/utilities/format.test.d.cts +0 -1
- package/dist/lib/utilities/format.test.d.mts +0 -2
- package/dist/lib/utilities/format.test.mjs +0 -25
- package/dist/lib/utilities/format.test.mjs.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-file.test.cjs +0 -23
- package/dist/lib/utilities/source-file.test.d.cts +0 -1
- package/dist/lib/utilities/source-file.test.d.mts +0 -2
- package/dist/lib/utilities/source-file.test.mjs +0 -25
- package/dist/lib/utilities/source-file.test.mjs.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/source-map.test.cjs +0 -23
- package/dist/lib/utilities/source-map.test.d.cts +0 -1
- package/dist/lib/utilities/source-map.test.d.mts +0 -2
- package/dist/lib/utilities/source-map.test.mjs +0 -25
- package/dist/lib/utilities/source-map.test.mjs.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/utilities/write-file.test.cjs +0 -23
- package/dist/lib/utilities/write-file.test.d.cts +0 -1
- package/dist/lib/utilities/write-file.test.d.mts +0 -2
- package/dist/lib/utilities/write-file.test.mjs +0 -25
- package/dist/lib/utilities/write-file.test.mjs.map +0 -1
- package/dist/lib/vfs.d.cts.map +0 -1
- package/dist/lib/vfs.d.mts.map +0 -1
- package/dist/lib/vfs.test.cjs +0 -23
- package/dist/lib/vfs.test.d.cts +0 -1
- package/dist/lib/vfs.test.d.mts +0 -2
- package/dist/lib/vfs.test.mjs +0 -25
- package/dist/lib/vfs.test.mjs.map +0 -1
- package/dist/plugin-base.test.cjs +0 -23
- package/dist/plugin-base.test.d.cts +0 -1
- package/dist/plugin-base.test.d.mts +0 -2
- package/dist/plugin-base.test.mjs +0 -25
- package/dist/plugin-base.test.mjs.map +0 -1
- package/dist/plugin-utils/build-helpers.test.cjs +0 -23
- package/dist/plugin-utils/build-helpers.test.d.cts +0 -1
- package/dist/plugin-utils/build-helpers.test.d.mts +0 -2
- package/dist/plugin-utils/build-helpers.test.mjs +0 -25
- package/dist/plugin-utils/build-helpers.test.mjs.map +0 -1
- package/dist/plugin-utils/combine-plugins.test.cjs +0 -23
- package/dist/plugin-utils/combine-plugins.test.d.cts +0 -1
- package/dist/plugin-utils/combine-plugins.test.d.mts +0 -2
- package/dist/plugin-utils/combine-plugins.test.mjs +0 -25
- package/dist/plugin-utils/combine-plugins.test.mjs.map +0 -1
- package/dist/plugin-utils/context-helpers.test.cjs +0 -23
- package/dist/plugin-utils/context-helpers.test.d.cts +0 -1
- package/dist/plugin-utils/context-helpers.test.d.mts +0 -2
- package/dist/plugin-utils/context-helpers.test.mjs +0 -25
- package/dist/plugin-utils/context-helpers.test.mjs.map +0 -1
- package/dist/plugin-utils/docs-helper.test.cjs +0 -23
- package/dist/plugin-utils/docs-helper.test.d.cts +0 -1
- package/dist/plugin-utils/docs-helper.test.d.mts +0 -2
- package/dist/plugin-utils/docs-helper.test.mjs +0 -25
- package/dist/plugin-utils/docs-helper.test.mjs.map +0 -1
- package/dist/plugin-utils/enable-plugin.test.cjs +0 -23
- package/dist/plugin-utils/enable-plugin.test.d.cts +0 -1
- package/dist/plugin-utils/enable-plugin.test.d.mts +0 -2
- package/dist/plugin-utils/enable-plugin.test.mjs +0 -25
- package/dist/plugin-utils/enable-plugin.test.mjs.map +0 -1
- package/dist/plugin-utils/extend.test.cjs +0 -23
- package/dist/plugin-utils/extend.test.d.cts +0 -1
- package/dist/plugin-utils/extend.test.d.mts +0 -2
- package/dist/plugin-utils/extend.test.mjs +0 -25
- package/dist/plugin-utils/extend.test.mjs.map +0 -1
- package/dist/plugin-utils/filter.test.cjs +0 -23
- package/dist/plugin-utils/filter.test.d.cts +0 -1
- package/dist/plugin-utils/filter.test.d.mts +0 -2
- package/dist/plugin-utils/filter.test.mjs +0 -25
- package/dist/plugin-utils/filter.test.mjs.map +0 -1
- package/dist/plugin-utils/format-package-json.test.cjs +0 -23
- package/dist/plugin-utils/format-package-json.test.d.cts +0 -1
- package/dist/plugin-utils/format-package-json.test.d.mts +0 -2
- package/dist/plugin-utils/format-package-json.test.mjs +0 -25
- package/dist/plugin-utils/format-package-json.test.mjs.map +0 -1
- package/dist/plugin-utils/format.test.cjs +0 -23
- package/dist/plugin-utils/format.test.d.cts +0 -1
- package/dist/plugin-utils/format.test.d.mts +0 -2
- package/dist/plugin-utils/format.test.mjs +0 -25
- package/dist/plugin-utils/format.test.mjs.map +0 -1
- package/dist/plugin-utils/get-config-path.test.cjs +0 -23
- package/dist/plugin-utils/get-config-path.test.d.cts +0 -1
- package/dist/plugin-utils/get-config-path.test.d.mts +0 -2
- package/dist/plugin-utils/get-config-path.test.mjs +0 -25
- package/dist/plugin-utils/get-config-path.test.mjs.map +0 -1
- package/dist/plugin-utils/helpers.test.cjs +0 -23
- package/dist/plugin-utils/helpers.test.d.cts +0 -1
- package/dist/plugin-utils/helpers.test.d.mts +0 -2
- package/dist/plugin-utils/helpers.test.mjs +0 -25
- package/dist/plugin-utils/helpers.test.mjs.map +0 -1
- package/dist/plugin-utils/install.test.cjs +0 -23
- package/dist/plugin-utils/install.test.d.cts +0 -1
- package/dist/plugin-utils/install.test.d.mts +0 -2
- package/dist/plugin-utils/install.test.mjs +0 -25
- package/dist/plugin-utils/install.test.mjs.map +0 -1
- package/dist/plugin-utils/logging.test.cjs +0 -23
- package/dist/plugin-utils/logging.test.d.cts +0 -1
- package/dist/plugin-utils/logging.test.d.mts +0 -2
- package/dist/plugin-utils/logging.test.mjs +0 -25
- package/dist/plugin-utils/logging.test.mjs.map +0 -1
- package/dist/plugin-utils/merge.test.cjs +0 -23
- package/dist/plugin-utils/merge.test.d.cts +0 -1
- package/dist/plugin-utils/merge.test.d.mts +0 -2
- package/dist/plugin-utils/merge.test.mjs +0 -25
- package/dist/plugin-utils/merge.test.mjs.map +0 -1
- package/dist/plugin-utils/modules.test.cjs +0 -23
- package/dist/plugin-utils/modules.test.d.cts +0 -1
- package/dist/plugin-utils/modules.test.d.mts +0 -2
- package/dist/plugin-utils/modules.test.mjs +0 -25
- package/dist/plugin-utils/modules.test.mjs.map +0 -1
- package/dist/plugin-utils/paths.test.cjs +0 -23
- package/dist/plugin-utils/paths.test.d.cts +0 -1
- package/dist/plugin-utils/paths.test.d.mts +0 -2
- package/dist/plugin-utils/paths.test.mjs +0 -25
- package/dist/plugin-utils/paths.test.mjs.map +0 -1
- package/dist/plugin-utils/virtual.test.cjs +0 -23
- package/dist/plugin-utils/virtual.test.d.cts +0 -1
- package/dist/plugin-utils/virtual.test.d.mts +0 -2
- package/dist/plugin-utils/virtual.test.mjs +0 -25
- package/dist/plugin-utils/virtual.test.mjs.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/storage/base.test.cjs +0 -23
- package/dist/storage/base.test.d.cts +0 -1
- package/dist/storage/base.test.d.mts +0 -2
- package/dist/storage/base.test.mjs +0 -25
- package/dist/storage/base.test.mjs.map +0 -1
- package/dist/storage/file-system.test.cjs +0 -23
- package/dist/storage/file-system.test.d.cts +0 -1
- package/dist/storage/file-system.test.d.mts +0 -2
- package/dist/storage/file-system.test.mjs +0 -25
- package/dist/storage/file-system.test.mjs.map +0 -1
- package/dist/storage/helpers.test.cjs +0 -23
- package/dist/storage/helpers.test.d.cts +0 -1
- package/dist/storage/helpers.test.d.mts +0 -2
- package/dist/storage/helpers.test.mjs +0 -25
- package/dist/storage/helpers.test.mjs.map +0 -1
- package/dist/storage/virtual.test.cjs +0 -23
- package/dist/storage/virtual.test.d.cts +0 -1
- package/dist/storage/virtual.test.d.mts +0 -2
- package/dist/storage/virtual.test.mjs +0 -25
- package/dist/storage/virtual.test.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
- /package/dist/{constants/api.test.d.cts → index-BKZ67WMa.d.cts} +0 -0
- /package/dist/{constants/commands.test.d.cts → index-BKZ67WMa.d.mts} +0 -0
- /package/dist/{constants/devtools.test.d.cts → index-BVVgDSdq.d.cts} +0 -0
- /package/dist/{constants/environments.test.d.cts → index-BVVgDSdq.d.mts} +0 -0
- /package/dist/{constants/extensions.test.d.cts → index-Den-MsLx.d.cts} +0 -0
- /package/dist/{constants/fs.test.d.cts → index-Den-MsLx.d.mts} +0 -0
- /package/dist/{constants/hooks.test.d.cts → index-DmtQKWjk.d.cts} +0 -0
- /package/dist/{constants/log-level.test.d.cts → index-DmtQKWjk.d.mts} +0 -0
- /package/dist/{constants/meta.test.d.cts → index-_6s0AX1B.d.cts} +0 -0
- /package/dist/{constants/plugin.test.d.cts → index-_6s0AX1B.d.mts} +0 -0
|
@@ -0,0 +1,2461 @@
|
|
|
1
|
+
import { n as EXECUTION_API_METHODS, t as BASE_EXECUTION_API_METHODS } from "./api-DTCbbtSH.cjs";
|
|
2
|
+
import { t as SUPPORTED_COMMANDS } from "./commands-DzGd8pnR.cjs";
|
|
3
|
+
import { i as LOG_CATEGORIES, o as LOG_LEVELS } from "./log-level-BC8g4BBL.cjs";
|
|
4
|
+
import { i as PLUGIN_NON_HOOK_FIELDS } from "./plugin-fhBG7SSQ.cjs";
|
|
5
|
+
import { EnvPaths } from "@stryke/env/get-env-paths";
|
|
6
|
+
import { Format } from "@storm-software/build-tools/types";
|
|
7
|
+
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
8
|
+
import { AnyFunction, DeepPartial, DeepReadonly, MaybePromise, NonUndefined, PartialKeys, RequiredKeys } from "@stryke/types/base";
|
|
9
|
+
import { FileReference, FileReferenceInput } from "@stryke/types/configuration";
|
|
10
|
+
import { AssetGlob } from "@stryke/types/file";
|
|
11
|
+
import { ConfigLayer, ResolvedConfig } from "c12";
|
|
12
|
+
import { CompatibilityDateSpec, CompatibilityDates } from "compatx";
|
|
13
|
+
import { PreviewOptions, ResolvedPreviewOptions } from "vite";
|
|
14
|
+
import { PackageJson } from "@stryke/types/package-json";
|
|
15
|
+
import { Jiti } from "jiti";
|
|
16
|
+
import MagicString, { SourceMap } from "magic-string";
|
|
17
|
+
import { ParseResult, ParserOptions } from "oxc-parser";
|
|
18
|
+
import { Range } from "semver";
|
|
19
|
+
import { RequestInfo, Response } from "undici";
|
|
20
|
+
import { Unimport } from "unimport";
|
|
21
|
+
import { ExternalIdResult, HookFilter, StringOrRegExp, TransformResult, UnpluginBuildContext, UnpluginMessage, UnpluginOptions } from "unplugin";
|
|
22
|
+
import { ResolveOptions } from "@stryke/fs/resolve";
|
|
23
|
+
import { ArrayValues } from "@stryke/types/array";
|
|
24
|
+
import { LoadResult } from "rollup";
|
|
25
|
+
import { CompilerOptions, TsConfigJson } from "@stryke/types/tsconfig";
|
|
26
|
+
import ts from "typescript";
|
|
27
|
+
|
|
28
|
+
//#region src/types/fs.d.ts
|
|
29
|
+
type VirtualFileExtension = "js" | "ts" | "jsx" | "tsx";
|
|
30
|
+
type StoragePreset = "fs" | "virtual";
|
|
31
|
+
/**
|
|
32
|
+
* Interface defining the methods and properties for a storage adapter.
|
|
33
|
+
*/
|
|
34
|
+
interface StorageAdapter {
|
|
35
|
+
/**
|
|
36
|
+
* A name identifying the storage adapter type.
|
|
37
|
+
*/
|
|
38
|
+
name: string;
|
|
39
|
+
/**
|
|
40
|
+
* The storage preset for the adapter.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* This can be used as an alternate way to identify the type of storage being used.
|
|
44
|
+
*/
|
|
45
|
+
preset?: StoragePreset | null;
|
|
46
|
+
/**
|
|
47
|
+
* Checks if a key exists in the storage.
|
|
48
|
+
*
|
|
49
|
+
* @param key - The key to check for existence.
|
|
50
|
+
* @returns A promise that resolves to `true` if the key exists, otherwise `false`.
|
|
51
|
+
*/
|
|
52
|
+
exists: (key: string) => Promise<boolean>;
|
|
53
|
+
/**
|
|
54
|
+
* Synchronously checks if a key exists in the storage.
|
|
55
|
+
*
|
|
56
|
+
* @param key - The key to check for existence.
|
|
57
|
+
* @returns Returns `true` if the key exists, otherwise `false`.
|
|
58
|
+
*/
|
|
59
|
+
existsSync: (key: string) => boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Read a value associated with a key from the storage.
|
|
62
|
+
*
|
|
63
|
+
* @param key - The key to read the value for.
|
|
64
|
+
* @returns A promise that resolves to the value if found, otherwise `null`.
|
|
65
|
+
*/
|
|
66
|
+
get: (key: string) => Promise<string | null>;
|
|
67
|
+
/**
|
|
68
|
+
* Synchronously reads the value associated with a key from the storage.
|
|
69
|
+
*
|
|
70
|
+
* @param key - The key to read the value for.
|
|
71
|
+
* @returns The value if found, otherwise `null`.
|
|
72
|
+
*/
|
|
73
|
+
getSync: (key: string) => string | null;
|
|
74
|
+
/**
|
|
75
|
+
* Writes a value to the storage for the given key.
|
|
76
|
+
*
|
|
77
|
+
* @param key - The key to associate the value with.
|
|
78
|
+
* @param value - The value to store.
|
|
79
|
+
*/
|
|
80
|
+
set: (key: string, value: string) => Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Synchronously writes a value to the storage for the given key.
|
|
83
|
+
*
|
|
84
|
+
* @param key - The key to associate the value with.
|
|
85
|
+
* @param value - The value to store.
|
|
86
|
+
*/
|
|
87
|
+
setSync: (key: string, value: string) => void;
|
|
88
|
+
/**
|
|
89
|
+
* Removes a value from the storage.
|
|
90
|
+
*
|
|
91
|
+
* @param key - The key whose value should be removed.
|
|
92
|
+
*/
|
|
93
|
+
remove: (key: string) => Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Synchronously removes a value from the storage.
|
|
96
|
+
*
|
|
97
|
+
* @param key - The key whose value should be removed.
|
|
98
|
+
*/
|
|
99
|
+
removeSync: (key: string) => void;
|
|
100
|
+
/**
|
|
101
|
+
* Creates a directory at the specified path.
|
|
102
|
+
*
|
|
103
|
+
* @param dirPath - The path of the directory to create.
|
|
104
|
+
*/
|
|
105
|
+
mkdir: (dirPath: string) => Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* Synchronously creates a directory at the specified path.
|
|
108
|
+
*
|
|
109
|
+
* @param dirPath - The path of the directory to create.
|
|
110
|
+
*/
|
|
111
|
+
mkdirSync: (dirPath: string) => void;
|
|
112
|
+
/**
|
|
113
|
+
* Remove all entries from the storage that match the provided base path.
|
|
114
|
+
*
|
|
115
|
+
* @param base - The base path or prefix to clear entries from.
|
|
116
|
+
*/
|
|
117
|
+
clear: (base?: string) => Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* Synchronously remove all entries from the storage that match the provided base path.
|
|
120
|
+
*
|
|
121
|
+
* @param base - The base path or prefix to clear entries from.
|
|
122
|
+
*/
|
|
123
|
+
clearSync: (base?: string) => void;
|
|
124
|
+
/**
|
|
125
|
+
* Lists all keys under the provided base path.
|
|
126
|
+
*
|
|
127
|
+
* @param base - The base path or prefix to list keys from.
|
|
128
|
+
* @returns A promise resolving to the list of keys.
|
|
129
|
+
*/
|
|
130
|
+
list: (base?: string) => Promise<string[]>;
|
|
131
|
+
/**
|
|
132
|
+
* Synchronously lists all keys under the provided base path.
|
|
133
|
+
*
|
|
134
|
+
* @param base - The base path or prefix to list keys from.
|
|
135
|
+
* @returns The list of keys.
|
|
136
|
+
*/
|
|
137
|
+
listSync: (base?: string) => string[];
|
|
138
|
+
/**
|
|
139
|
+
* Checks if the given key is a directory.
|
|
140
|
+
*
|
|
141
|
+
* @param key - The key to check.
|
|
142
|
+
* @returns A promise that resolves to `true` if the key is a directory, otherwise `false`.
|
|
143
|
+
*/
|
|
144
|
+
isDirectory: (key: string) => Promise<boolean>;
|
|
145
|
+
/**
|
|
146
|
+
* Synchronously checks if the given key is a directory.
|
|
147
|
+
*
|
|
148
|
+
* @param key - The key to check.
|
|
149
|
+
* @returns `true` if the key is a directory, otherwise `false`.
|
|
150
|
+
*/
|
|
151
|
+
isDirectorySync: (key: string) => boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Checks if the given key is a file.
|
|
154
|
+
*
|
|
155
|
+
* @param key - The key to check.
|
|
156
|
+
* @returns A promise that resolves to `true` if the key is a file, otherwise `false`.
|
|
157
|
+
*/
|
|
158
|
+
isFile: (key: string) => Promise<boolean>;
|
|
159
|
+
/**
|
|
160
|
+
* Synchronously checks if the given key is a file.
|
|
161
|
+
*
|
|
162
|
+
* @param key - The key to check.
|
|
163
|
+
* @returns `true` if the key is a file, otherwise `false`.
|
|
164
|
+
*/
|
|
165
|
+
isFileSync: (key: string) => boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Releases any resources held by the storage adapter.
|
|
168
|
+
*/
|
|
169
|
+
dispose: () => MaybePromise<void>;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* A mapping of file paths to storage adapter names and their corresponding {@link StorageAdapter} instances.
|
|
173
|
+
*/
|
|
174
|
+
type StoragePort = Record<string, StorageAdapter>;
|
|
175
|
+
interface VirtualFileMetadata {
|
|
176
|
+
/**
|
|
177
|
+
* The identifier for the file data.
|
|
178
|
+
*/
|
|
179
|
+
id: string;
|
|
180
|
+
/**
|
|
181
|
+
* The timestamp of the virtual file.
|
|
182
|
+
*/
|
|
183
|
+
timestamp: number;
|
|
184
|
+
/**
|
|
185
|
+
* The type of the file.
|
|
186
|
+
*
|
|
187
|
+
* @remarks
|
|
188
|
+
* This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
|
|
189
|
+
* - `builtin`: Indicates that the file is a built-in module provided by the system.
|
|
190
|
+
* - `entry`: Indicates that the file is an entry point for execution.
|
|
191
|
+
* - `infrastructure`: Indicates that the file is an infrastructure module used by the system during deployments.
|
|
192
|
+
* - `normal`: Indicates that the file is a standard file without any special role.
|
|
193
|
+
*/
|
|
194
|
+
type: string;
|
|
195
|
+
/**
|
|
196
|
+
* Additional metadata associated with the file.
|
|
197
|
+
*/
|
|
198
|
+
properties: Record<string, string | undefined>;
|
|
199
|
+
}
|
|
200
|
+
interface VirtualFileData {
|
|
201
|
+
/**
|
|
202
|
+
* The identifier for the file data.
|
|
203
|
+
*/
|
|
204
|
+
id?: string;
|
|
205
|
+
/**
|
|
206
|
+
* The contents of the virtual file.
|
|
207
|
+
*/
|
|
208
|
+
code: string;
|
|
209
|
+
/**
|
|
210
|
+
* The type of the file.
|
|
211
|
+
*
|
|
212
|
+
* @remarks
|
|
213
|
+
* This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
|
|
214
|
+
* - `builtin`: Indicates that the file is a built-in module provided by the system.
|
|
215
|
+
* - `entry`: Indicates that the file is an entry point for execution.
|
|
216
|
+
* - `infrastructure`: Indicates that the file is an infrastructure module used by the system during deployments.
|
|
217
|
+
* - `normal`: Indicates that the file is a standard file without any special role.
|
|
218
|
+
*/
|
|
219
|
+
type?: string;
|
|
220
|
+
/**
|
|
221
|
+
* Additional metadata associated with the file.
|
|
222
|
+
*/
|
|
223
|
+
properties?: Record<string, string | undefined>;
|
|
224
|
+
}
|
|
225
|
+
interface VirtualFile extends Required<VirtualFileData>, VirtualFileMetadata {
|
|
226
|
+
/**
|
|
227
|
+
* An additional name for the file.
|
|
228
|
+
*/
|
|
229
|
+
path: string;
|
|
230
|
+
/**
|
|
231
|
+
* The timestamp of the virtual file.
|
|
232
|
+
*/
|
|
233
|
+
timestamp: number;
|
|
234
|
+
}
|
|
235
|
+
interface WriteOptions {
|
|
236
|
+
/**
|
|
237
|
+
* Should the file skip formatting before being written?
|
|
238
|
+
*
|
|
239
|
+
* @defaultValue false
|
|
240
|
+
*/
|
|
241
|
+
skipFormat?: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* The storage preset or adapter name for the output file.
|
|
244
|
+
*
|
|
245
|
+
* @remarks
|
|
246
|
+
* If not specified, the output mode will be determined by the provided `output.mode` value.
|
|
247
|
+
*/
|
|
248
|
+
storage?: StoragePreset | string;
|
|
249
|
+
/**
|
|
250
|
+
* Additional metadata for the file.
|
|
251
|
+
*/
|
|
252
|
+
meta?: Partial<VirtualFileMetadata>;
|
|
253
|
+
}
|
|
254
|
+
type WriteData = string | NodeJS.ArrayBufferView | VirtualFileData;
|
|
255
|
+
interface ResolveOptions$1 extends ResolveOptions {
|
|
256
|
+
/**
|
|
257
|
+
* If true, the module is being resolved as an entry point.
|
|
258
|
+
*/
|
|
259
|
+
isEntry?: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* If true, the resolver will skip alias resolution when resolving modules.
|
|
262
|
+
*/
|
|
263
|
+
skipAlias?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* If true, the resolver will skip using the cache when resolving modules.
|
|
266
|
+
*/
|
|
267
|
+
skipCache?: boolean;
|
|
268
|
+
/**
|
|
269
|
+
* An array of external modules or patterns to exclude from resolution.
|
|
270
|
+
*/
|
|
271
|
+
external?: (string | RegExp)[];
|
|
272
|
+
/**
|
|
273
|
+
* An array of modules or patterns to include in the resolution, even if they are marked as external.
|
|
274
|
+
*/
|
|
275
|
+
noExternal?: (string | RegExp)[];
|
|
276
|
+
/**
|
|
277
|
+
* An array of patterns to match when resolving modules.
|
|
278
|
+
*/
|
|
279
|
+
skipNodeModulesBundle?: boolean;
|
|
280
|
+
/**
|
|
281
|
+
* If true, the resolver will treat the module as a file.
|
|
282
|
+
*/
|
|
283
|
+
isFile?: boolean;
|
|
284
|
+
}
|
|
285
|
+
interface VirtualFileSystemInterface {
|
|
286
|
+
/**
|
|
287
|
+
* The underlying file metadata.
|
|
288
|
+
*/
|
|
289
|
+
metadata: Readonly<Record<string, VirtualFileMetadata>>;
|
|
290
|
+
/**
|
|
291
|
+
* A map of file paths to their module ids.
|
|
292
|
+
*/
|
|
293
|
+
ids: Readonly<Record<string, string>>;
|
|
294
|
+
/**
|
|
295
|
+
* A map of module ids to their file paths.
|
|
296
|
+
*/
|
|
297
|
+
paths: Readonly<Record<string, string>>;
|
|
298
|
+
/**
|
|
299
|
+
* Checks if a file exists in the virtual file system (VFS).
|
|
300
|
+
*
|
|
301
|
+
* @param path - The path or id of the file.
|
|
302
|
+
* @returns `true` if the file exists, otherwise `false`.
|
|
303
|
+
*/
|
|
304
|
+
exists: (path: string) => Promise<boolean>;
|
|
305
|
+
/**
|
|
306
|
+
* Synchronously Checks if a file exists in the virtual file system (VFS).
|
|
307
|
+
*
|
|
308
|
+
* @param path - The path or id of the file.
|
|
309
|
+
* @returns `true` if the file exists, otherwise `false`.
|
|
310
|
+
*/
|
|
311
|
+
existsSync: (path: string) => boolean;
|
|
312
|
+
/**
|
|
313
|
+
* Checks if a file is virtual in the virtual file system (VFS).
|
|
314
|
+
*
|
|
315
|
+
* @param path - The path or id of the file.
|
|
316
|
+
* @param importer - An optional path to the importer module, used for resolving the file path.
|
|
317
|
+
* @param options - Additional options for resolving the file path.
|
|
318
|
+
* @returns `true` if the file is virtual, otherwise `false`.
|
|
319
|
+
*/
|
|
320
|
+
isVirtual: (path: string, importer?: string | undefined, options?: ResolveOptions$1) => boolean;
|
|
321
|
+
/**
|
|
322
|
+
* Checks if the given key is a directory.
|
|
323
|
+
*
|
|
324
|
+
* @param key - The key to check.
|
|
325
|
+
* @param importer - An optional path to the importer module, used for resolving the file path.
|
|
326
|
+
* @param options - Additional options for resolving the file path.
|
|
327
|
+
* @returns A promise that resolves to `true` if the key is a directory, otherwise `false`.
|
|
328
|
+
*/
|
|
329
|
+
isDirectory: (key: string, importer?: string | undefined, options?: ResolveOptions$1) => Promise<boolean>;
|
|
330
|
+
/**
|
|
331
|
+
* Synchronously checks if the given key is a directory.
|
|
332
|
+
*
|
|
333
|
+
* @param key - The key to check.
|
|
334
|
+
* @param importer - An optional path to the importer module, used for resolving the file path.
|
|
335
|
+
* @param options - Additional options for resolving the file path.
|
|
336
|
+
* @returns `true` if the key is a directory, otherwise `false`.
|
|
337
|
+
*/
|
|
338
|
+
isDirectorySync: (key: string, importer?: string | undefined, options?: ResolveOptions$1) => boolean;
|
|
339
|
+
/**
|
|
340
|
+
* Checks if the given key is a file.
|
|
341
|
+
*
|
|
342
|
+
* @param key - The key to check.
|
|
343
|
+
* @param importer - An optional path to the importer module, used for resolving the file path.
|
|
344
|
+
* @param options - Additional options for resolving the file path.
|
|
345
|
+
* @returns A promise that resolves to `true` if the key is a file, otherwise `false`.
|
|
346
|
+
*/
|
|
347
|
+
isFile: (key: string, importer?: string | undefined, options?: ResolveOptions$1) => Promise<boolean>;
|
|
348
|
+
/**
|
|
349
|
+
* Synchronously checks if the given key is a file.
|
|
350
|
+
*
|
|
351
|
+
* @param key - The key to check.
|
|
352
|
+
* @param importer - An optional path to the importer module, used for resolving the file path.
|
|
353
|
+
* @param options - Additional options for resolving the file path.
|
|
354
|
+
* @returns `true` if the key is a file, otherwise `false`.
|
|
355
|
+
*/
|
|
356
|
+
isFileSync: (key: string, importer?: string | undefined, options?: ResolveOptions$1) => boolean;
|
|
357
|
+
/**
|
|
358
|
+
* Checks if a file Id must be resolved by the virtual file system (VFS).
|
|
359
|
+
*
|
|
360
|
+
* @remarks
|
|
361
|
+
* Examples of file Ids that would be considered virtual include:
|
|
362
|
+
* - Ids that start with the framework specific prefix (e.g. `powerlines:`)
|
|
363
|
+
* - Ids that match a configured alias for virtual modules (returned true from {@link VirtualFileSystemInterface.isVirtual})
|
|
364
|
+
*
|
|
365
|
+
* @param path - The path or id of the file.
|
|
366
|
+
* @param importer - An optional path to the importer module, used for resolving the file path.
|
|
367
|
+
* @param options - Additional options for resolving the file path.
|
|
368
|
+
* @returns `true` if the file is virtual, otherwise `false`.
|
|
369
|
+
*/
|
|
370
|
+
isResolvableId: (path: string, importer?: string | undefined, options?: ResolveOptions$1) => boolean;
|
|
371
|
+
/**
|
|
372
|
+
* Checks if a given module ID is an alias.
|
|
373
|
+
*
|
|
374
|
+
* @remarks
|
|
375
|
+
* This function can be used to determine if a module ID matches any configured aliases.
|
|
376
|
+
*
|
|
377
|
+
* @param id - The module ID to check.
|
|
378
|
+
* @returns A boolean indicating whether the module ID is an alias.
|
|
379
|
+
*/
|
|
380
|
+
isAlias: (id: string) => boolean;
|
|
381
|
+
/**
|
|
382
|
+
* Checks if a given module ID is a tsconfig path.
|
|
383
|
+
*
|
|
384
|
+
* @remarks
|
|
385
|
+
* This function can be used to determine if a module ID matches any configured tsconfig paths.
|
|
386
|
+
*
|
|
387
|
+
* @param id - The module ID to check.
|
|
388
|
+
* @returns A boolean indicating whether the module ID is a tsconfig path.
|
|
389
|
+
*/
|
|
390
|
+
isTsconfigPath: (id: string) => boolean;
|
|
391
|
+
/**
|
|
392
|
+
* Gets the metadata of a file in the virtual file system (VFS).
|
|
393
|
+
*
|
|
394
|
+
* @param path - The path or id of the file.
|
|
395
|
+
* @returns The metadata of the file if it exists, otherwise undefined.
|
|
396
|
+
*/
|
|
397
|
+
getMetadata: (path: string) => VirtualFileMetadata | undefined;
|
|
398
|
+
/**
|
|
399
|
+
* Lists files in a given path.
|
|
400
|
+
*
|
|
401
|
+
* @param path - The path to list files from.
|
|
402
|
+
* @returns An array of file names in the specified path.
|
|
403
|
+
*/
|
|
404
|
+
listSync: (path: string) => string[];
|
|
405
|
+
/**
|
|
406
|
+
* Lists files in a given path.
|
|
407
|
+
*
|
|
408
|
+
* @param path - The path to list files from.
|
|
409
|
+
* @returns An array of file names in the specified path.
|
|
410
|
+
*/
|
|
411
|
+
list: (path: string) => Promise<string[]>;
|
|
412
|
+
/**
|
|
413
|
+
* Removes a file or symbolic link in the virtual file system (VFS).
|
|
414
|
+
*
|
|
415
|
+
* @param path - The path to the file to remove.
|
|
416
|
+
* @returns A promise that resolves when the file is removed.
|
|
417
|
+
*/
|
|
418
|
+
removeSync: (path: string) => void;
|
|
419
|
+
/**
|
|
420
|
+
* Asynchronously removes a file or symbolic link in the virtual file system (VFS).
|
|
421
|
+
*
|
|
422
|
+
* @param path - The path to the file to remove.
|
|
423
|
+
* @returns A promise that resolves when the file is removed.
|
|
424
|
+
*/
|
|
425
|
+
remove: (path: string) => Promise<void>;
|
|
426
|
+
/**
|
|
427
|
+
* Reads a file from the virtual file system (VFS).
|
|
428
|
+
*
|
|
429
|
+
* @param path - The path or id of the file.
|
|
430
|
+
* @returns The contents of the file if it exists, otherwise undefined.
|
|
431
|
+
*/
|
|
432
|
+
read: (path: string) => Promise<string | undefined>;
|
|
433
|
+
/**
|
|
434
|
+
* Reads a file from the virtual file system (VFS).
|
|
435
|
+
*
|
|
436
|
+
* @param path - The path or id of the file.
|
|
437
|
+
*/
|
|
438
|
+
readSync: (path: string) => string | undefined;
|
|
439
|
+
/**
|
|
440
|
+
* Writes a file to the virtual file system (VFS).
|
|
441
|
+
*
|
|
442
|
+
* @param path - The path to the file.
|
|
443
|
+
* @param data - The contents of the file.
|
|
444
|
+
* @param options - Options for writing the file.
|
|
445
|
+
* @returns A promise that resolves when the file is written.
|
|
446
|
+
*/
|
|
447
|
+
write: (path: string, data: string, options?: WriteOptions) => Promise<void>;
|
|
448
|
+
/**
|
|
449
|
+
* Writes a file to the virtual file system (VFS).
|
|
450
|
+
*
|
|
451
|
+
* @param path - The path to the file.
|
|
452
|
+
* @param data - The contents of the file.
|
|
453
|
+
* @param options - Options for writing the file.
|
|
454
|
+
*/
|
|
455
|
+
writeSync: (path: string, data: string, options?: WriteOptions) => void;
|
|
456
|
+
/**
|
|
457
|
+
* Creates a directory at the specified path.
|
|
458
|
+
*
|
|
459
|
+
* @param dirPath - The path of the directory to create.
|
|
460
|
+
*/
|
|
461
|
+
mkdir: (dirPath: string) => Promise<void>;
|
|
462
|
+
/**
|
|
463
|
+
* Synchronously creates a directory at the specified path.
|
|
464
|
+
*
|
|
465
|
+
* @param dirPath - The path of the directory to create.
|
|
466
|
+
*/
|
|
467
|
+
mkdirSync: (dirPath: string) => void;
|
|
468
|
+
/**
|
|
469
|
+
* Moves a file from one path to another in the virtual file system (VFS).
|
|
470
|
+
*
|
|
471
|
+
* @param srcPath - The source path to move
|
|
472
|
+
* @param destPath - The destination path to move to
|
|
473
|
+
*/
|
|
474
|
+
move: (srcPath: string, destPath: string) => Promise<void>;
|
|
475
|
+
/**
|
|
476
|
+
* Synchronously moves a file from one path to another in the virtual file system (VFS).
|
|
477
|
+
*
|
|
478
|
+
* @param srcPath - The source path to move
|
|
479
|
+
* @param destPath - The destination path to move to
|
|
480
|
+
*/
|
|
481
|
+
moveSync: (srcPath: string, destPath: string) => void;
|
|
482
|
+
/**
|
|
483
|
+
* Copies a file from one path to another in the virtual file system (VFS).
|
|
484
|
+
*
|
|
485
|
+
* @param srcPath - The source path to copy
|
|
486
|
+
* @param destPath - The destination path to copy to
|
|
487
|
+
*/
|
|
488
|
+
copy: (srcPath: string | URL | Omit<AssetGlob, "output">, destPath: string | URL) => Promise<void>;
|
|
489
|
+
/**
|
|
490
|
+
* Synchronously copies a file from one path to another in the virtual file system (VFS).
|
|
491
|
+
*
|
|
492
|
+
* @param srcPath - The source path to copy
|
|
493
|
+
* @param destPath - The destination path to copy to
|
|
494
|
+
*/
|
|
495
|
+
copySync: (srcPath: string | URL | Omit<AssetGlob, "output">, destPath: string | URL) => void;
|
|
496
|
+
/**
|
|
497
|
+
* Glob files in the virtual file system (VFS) based on the provided pattern(s).
|
|
498
|
+
*
|
|
499
|
+
* @param pattern - A pattern (or multiple patterns) to use to determine the file paths to return
|
|
500
|
+
* @returns An array of file paths matching the provided pattern(s)
|
|
501
|
+
*/
|
|
502
|
+
glob: (patterns: string | Omit<AssetGlob, "output"> | (string | Omit<AssetGlob, "output">)[]) => Promise<string[]>;
|
|
503
|
+
/**
|
|
504
|
+
* Synchronously glob files in the virtual file system (VFS) based on the provided pattern(s).
|
|
505
|
+
*
|
|
506
|
+
* @param pattern - A pattern (or multiple patterns) to use to determine the file paths to return
|
|
507
|
+
* @returns An array of file paths matching the provided pattern(s)
|
|
508
|
+
*/
|
|
509
|
+
globSync: (patterns: string | Omit<AssetGlob, "output"> | (string | Omit<AssetGlob, "output">)[]) => string[];
|
|
510
|
+
/**
|
|
511
|
+
* A helper function to resolve modules using the Jiti resolver
|
|
512
|
+
*
|
|
513
|
+
* @remarks
|
|
514
|
+
* This function can be used to resolve modules relative to the project root directory.
|
|
515
|
+
*
|
|
516
|
+
* @example
|
|
517
|
+
* ```ts
|
|
518
|
+
* const resolvedPath = await context.resolve("some-module", "/path/to/importer");
|
|
519
|
+
* ```
|
|
520
|
+
*
|
|
521
|
+
* @param id - The module to resolve.
|
|
522
|
+
* @param importer - An optional path to the importer module.
|
|
523
|
+
* @param options - Additional resolution options.
|
|
524
|
+
* @returns A promise that resolves to the resolved module path.
|
|
525
|
+
*/
|
|
526
|
+
resolve: (id: string, importer?: string, options?: ResolveOptions$1) => Promise<string | undefined>;
|
|
527
|
+
/**
|
|
528
|
+
* A synchronous helper function to resolve modules using the Jiti resolver
|
|
529
|
+
*
|
|
530
|
+
* @remarks
|
|
531
|
+
* This function can be used to resolve modules relative to the project root directory.
|
|
532
|
+
*
|
|
533
|
+
* @example
|
|
534
|
+
* ```ts
|
|
535
|
+
* const resolvedPath = context.resolveSync("some-module", "/path/to/importer");
|
|
536
|
+
* ```
|
|
537
|
+
*
|
|
538
|
+
* @param id - The module to resolve.
|
|
539
|
+
* @param importer - An optional path to the importer module.
|
|
540
|
+
* @param options - Additional resolution options.
|
|
541
|
+
* @returns The resolved module path.
|
|
542
|
+
*/
|
|
543
|
+
resolveSync: (id: string, importer?: string, options?: ResolveOptions$1) => string | undefined;
|
|
544
|
+
/**
|
|
545
|
+
* Resolves a given module ID using the configured aliases.
|
|
546
|
+
*
|
|
547
|
+
* @remarks
|
|
548
|
+
* This function can be used to map module IDs to different paths based on the alias configuration.
|
|
549
|
+
*
|
|
550
|
+
* @param id - The module ID to resolve.
|
|
551
|
+
* @returns The resolved module ID - after applying any configured aliases (this will be the same as the input ID if no aliases match).
|
|
552
|
+
*/
|
|
553
|
+
resolveAlias: (id: string) => string;
|
|
554
|
+
/**
|
|
555
|
+
* Disposes of the virtual file system (VFS), writes any virtual file changes to disk, and releases any associated resources.
|
|
556
|
+
*/
|
|
557
|
+
dispose: () => Promise<void>;
|
|
558
|
+
}
|
|
559
|
+
//#endregion
|
|
560
|
+
//#region src/types/api.d.ts
|
|
561
|
+
type BaseCommandType = ArrayValues<typeof BASE_EXECUTION_API_METHODS> | "finalize";
|
|
562
|
+
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
563
|
+
type Commands<TContext extends Context = Context> = Record<CommandType, (this: TContext) => MaybePromise<void>>;
|
|
564
|
+
type BaseExecutionApiMethods = (typeof BASE_EXECUTION_API_METHODS)[number];
|
|
565
|
+
type ExecutionApiMethods = (typeof EXECUTION_API_METHODS)[number];
|
|
566
|
+
type SupportedCommands = (typeof SUPPORTED_COMMANDS)[number];
|
|
567
|
+
//#endregion
|
|
568
|
+
//#region src/types/unplugin.d.ts
|
|
569
|
+
type UnpluginBuilderVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown" | "bun";
|
|
570
|
+
type BuilderVariant = UnpluginBuilderVariant | "tsup" | "tsdown" | "unbuild";
|
|
571
|
+
interface UnpluginOptions$1<TContext extends UnresolvedContext> extends UnpluginOptions {
|
|
572
|
+
/**
|
|
573
|
+
* An API object that can be used for inter-plugin communication.
|
|
574
|
+
*
|
|
575
|
+
* @see https://rollupjs.org/plugin-development/#direct-plugin-communication
|
|
576
|
+
*/
|
|
577
|
+
context: TContext;
|
|
578
|
+
}
|
|
579
|
+
type UnpluginHookFunctions<TContext extends PluginContext = PluginContext, TUnpluginBuilderVariant extends UnpluginBuilderVariant = UnpluginBuilderVariant, TField extends keyof Required<UnpluginOptions$1<TContext>>[TUnpluginBuilderVariant] = keyof Required<UnpluginOptions$1<TContext>>[TUnpluginBuilderVariant]> = Required<UnpluginOptions$1<TContext>>[TUnpluginBuilderVariant][TField] extends infer THandler | {
|
|
580
|
+
handler: infer THandler;
|
|
581
|
+
} ? THandler extends ((this: infer THandlerOriginalContext, ...args: infer THandlerArgs) => infer THandlerReturn) ? (this: THandlerOriginalContext & WithUnpluginBuildContext<TContext>, ...args: THandlerArgs) => THandlerReturn : THandler extends {
|
|
582
|
+
handler: infer THandlerFunction;
|
|
583
|
+
} ? THandlerFunction extends ((this: infer THandlerFunctionOriginalContext, ...args: infer THandlerFunctionArgs) => infer THandlerFunctionReturn) ? (this: THandlerFunctionOriginalContext & WithUnpluginBuildContext<TContext>, ...args: THandlerFunctionArgs) => THandlerFunctionReturn : never : never : never;
|
|
584
|
+
//#endregion
|
|
585
|
+
//#region src/types/plugin.d.ts
|
|
586
|
+
interface PluginHookObject<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> {
|
|
587
|
+
/**
|
|
588
|
+
* The order in which the plugin should be applied.
|
|
589
|
+
*/
|
|
590
|
+
order?: "pre" | "post" | null | undefined;
|
|
591
|
+
/**
|
|
592
|
+
* A filter to determine when the hook should be called.
|
|
593
|
+
*/
|
|
594
|
+
filter?: Pick<HookFilter, TFilter>;
|
|
595
|
+
/**
|
|
596
|
+
* The hook function to be called.
|
|
597
|
+
*/
|
|
598
|
+
handler: THookFunction;
|
|
599
|
+
}
|
|
600
|
+
type PluginHook<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> = THookFunction | PluginHookObject<THookFunction, TFilter>;
|
|
601
|
+
/**
|
|
602
|
+
* A result returned by the plugin from the `types` hook that describes the declaration types output file.
|
|
603
|
+
*/
|
|
604
|
+
interface TypesResult {
|
|
605
|
+
directives?: string[];
|
|
606
|
+
code: string;
|
|
607
|
+
}
|
|
608
|
+
interface Hooks<TContext extends PluginContext> {
|
|
609
|
+
/**
|
|
610
|
+
* A function that returns configuration options to be merged with the build context's options.
|
|
611
|
+
*
|
|
612
|
+
* @remarks
|
|
613
|
+
* Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
|
|
614
|
+
*
|
|
615
|
+
* @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect.
|
|
616
|
+
*
|
|
617
|
+
* @see https://vitejs.dev/guide/api-plugin#config
|
|
618
|
+
*
|
|
619
|
+
* @param this - The build context.
|
|
620
|
+
* @param config - The partial configuration object to be modified.
|
|
621
|
+
* @returns A promise that resolves to a partial configuration object.
|
|
622
|
+
*/
|
|
623
|
+
config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial$1<TContext["config"]> & Record<string, any>>;
|
|
624
|
+
/**
|
|
625
|
+
* Modify environment configs before it's resolved. The hook can either mutate the passed-in environment config directly, or return a partial config object that will be deeply merged into existing config.
|
|
626
|
+
*
|
|
627
|
+
* @remarks
|
|
628
|
+
* This hook is called for each environment with a partially resolved environment config that already accounts for the default environment config values set at the root level. If plugins need to modify the config of a given environment, they should do it in this hook instead of the config hook. Leaving the config hook only for modifying the root default environment config.
|
|
629
|
+
*
|
|
630
|
+
* @see https://vitejs.dev/guide/api-plugin#configenvironment
|
|
631
|
+
*
|
|
632
|
+
* @param this - The build context.
|
|
633
|
+
* @param name - The name of the environment being configured.
|
|
634
|
+
* @param environment - The Vite-like environment object containing information about the current build environment.
|
|
635
|
+
* @returns A promise that resolves when the hook is complete.
|
|
636
|
+
*/
|
|
637
|
+
configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<ResolvedEnvironmentConfig> | undefined | null>;
|
|
638
|
+
/**
|
|
639
|
+
* A hook that is called when the plugin is resolved.
|
|
640
|
+
*
|
|
641
|
+
* @see https://vitejs.dev/guide/api-plugin#configresolved
|
|
642
|
+
*
|
|
643
|
+
* @param this - The build context.
|
|
644
|
+
* @returns A promise that resolves when the hook is complete.
|
|
645
|
+
*/
|
|
646
|
+
configResolved: (this: TContext) => MaybePromise<void>;
|
|
647
|
+
/**
|
|
648
|
+
* A hook that is called to overwrite the generated declaration types file (.d.ts). The generated type definitions should describe the built-in modules/logic added during the `prepare` task.
|
|
649
|
+
*
|
|
650
|
+
* @param this - The build context.
|
|
651
|
+
* @param code - The source code to generate types for.
|
|
652
|
+
* @returns A promise that resolves when the hook is complete.
|
|
653
|
+
*/
|
|
654
|
+
types: (this: TContext, code: string) => MaybePromise<TypesResult | string | undefined | null>;
|
|
655
|
+
/**
|
|
656
|
+
* A hook that is called at the start of the build process.
|
|
657
|
+
*
|
|
658
|
+
* @param this - The build context and unplugin build context.
|
|
659
|
+
* @returns A promise that resolves when the hook is complete.
|
|
660
|
+
*/
|
|
661
|
+
buildStart: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
|
|
662
|
+
/**
|
|
663
|
+
* A hook that is called at the end of the build process.
|
|
664
|
+
*
|
|
665
|
+
* @param this - The build context and unplugin build context.
|
|
666
|
+
* @returns A promise that resolves when the hook is complete.
|
|
667
|
+
*/
|
|
668
|
+
buildEnd: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
|
|
669
|
+
/**
|
|
670
|
+
* A hook that is called to transform the source code.
|
|
671
|
+
*
|
|
672
|
+
* @param this - The build context, unplugin build context, and unplugin context.
|
|
673
|
+
* @param code - The source code to transform.
|
|
674
|
+
* @param id - The identifier of the source code.
|
|
675
|
+
* @returns A promise that resolves when the hook is complete.
|
|
676
|
+
*/
|
|
677
|
+
transform: (this: BuildPluginContext<TContext["config"]> & TContext, code: string, id: string) => MaybePromise<TransformResult>;
|
|
678
|
+
/**
|
|
679
|
+
* A hook that is called to load the source code.
|
|
680
|
+
*
|
|
681
|
+
* @param this - The build context, unplugin build context, and unplugin context.
|
|
682
|
+
* @param id - The identifier of the source code.
|
|
683
|
+
* @returns A promise that resolves when the hook is complete.
|
|
684
|
+
*/
|
|
685
|
+
load: (this: BuildPluginContext<TContext["config"]> & TContext, id: string) => MaybePromise<LoadResult>;
|
|
686
|
+
/**
|
|
687
|
+
* A hook that is called to resolve the identifier of the source code.
|
|
688
|
+
*
|
|
689
|
+
* @param this - The build context, unplugin build context, and unplugin context.
|
|
690
|
+
* @param id - The identifier of the source code.
|
|
691
|
+
* @param importer - The importer of the source code.
|
|
692
|
+
* @param options - The options for resolving the identifier.
|
|
693
|
+
* @returns A promise that resolves when the hook is complete.
|
|
694
|
+
*/
|
|
695
|
+
resolveId: (this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
|
|
696
|
+
isEntry: boolean;
|
|
697
|
+
}) => MaybePromise<string | ResolveResult | null | undefined>;
|
|
698
|
+
/**
|
|
699
|
+
* A hook that is called to write the bundle to disk.
|
|
700
|
+
*
|
|
701
|
+
* @param this - The build context.
|
|
702
|
+
* @returns A promise that resolves when the hook is complete.
|
|
703
|
+
*/
|
|
704
|
+
writeBundle: (this: TContext) => MaybePromise<void>;
|
|
705
|
+
}
|
|
706
|
+
type HookFunctions<TContext extends PluginContext> = { [TCommandType in BaseCommandType]: (this: TContext) => MaybePromise<void> } & Hooks<TContext>;
|
|
707
|
+
type DeepPartial$1<T> = { [K in keyof T]?: DeepPartial$1<T[K]> };
|
|
708
|
+
type InferPluginHookFunction<TContext extends PluginContext, TKey extends string> = TKey extends keyof HookFunctions<TContext> ? HookFunctions<TContext>[TKey] extends AnyFunction ? PluginHook<HookFunctions<TContext>[TKey], TKey & keyof HookFilter> : HookFunctions<TContext>[TKey] extends object ? { [K in keyof HookFunctions<TContext>[TKey]]?: InferPluginHookFunction<TContext, `${TKey}:${K & string}`> } : never : never;
|
|
709
|
+
type PluginHooks<TContext extends PluginContext> = { [TKey in keyof HookFunctions<TContext>]?: InferPluginHookFunction<TContext, TKey> } & {
|
|
710
|
+
types?: PluginHook<HookFunctions<TContext>["types"], never>;
|
|
711
|
+
transform?: PluginHook<HookFunctions<TContext>["transform"], "code" | "id">;
|
|
712
|
+
load?: PluginHook<HookFunctions<TContext>["load"], "id">;
|
|
713
|
+
resolveId?: PluginHook<HookFunctions<TContext>["resolveId"], "id">;
|
|
714
|
+
};
|
|
715
|
+
interface BasePlugin<TContext extends PluginContext> {
|
|
716
|
+
/**
|
|
717
|
+
* The name of the plugin, for use in deduplication, error messages and logs.
|
|
718
|
+
*/
|
|
719
|
+
name: string;
|
|
720
|
+
/**
|
|
721
|
+
* An API object that can be used for inter-plugin communication.
|
|
722
|
+
*
|
|
723
|
+
* @see https://rollupjs.org/plugin-development/#direct-plugin-communication
|
|
724
|
+
*/
|
|
725
|
+
api?: Record<string, any>;
|
|
726
|
+
/**
|
|
727
|
+
* Enforce plugin invocation tier similar to webpack loaders. Hooks ordering is still subject to the `order` property in the hook object.
|
|
728
|
+
*
|
|
729
|
+
* @remarks
|
|
730
|
+
* The Plugin invocation order is as follows:
|
|
731
|
+
* - `enforce: 'pre'` plugins
|
|
732
|
+
* - `order: 'pre'` plugin hooks
|
|
733
|
+
* - any other plugins (normal)
|
|
734
|
+
* - `order: 'post'` plugin hooks
|
|
735
|
+
* - `enforce: 'post'` plugins
|
|
736
|
+
*
|
|
737
|
+
* @see https://vitejs.dev/guide/api-plugin.html#plugin-ordering
|
|
738
|
+
* @see https://rollupjs.org/plugin-development/#build-hooks
|
|
739
|
+
* @see https://webpack.js.org/concepts/loaders/#enforce---pre-and-post
|
|
740
|
+
* @see https://esbuild.github.io/plugins/#concepts
|
|
741
|
+
*/
|
|
742
|
+
enforce?: "pre" | "post";
|
|
743
|
+
/**
|
|
744
|
+
* A function to determine if two plugins are the same and can be de-duplicated.
|
|
745
|
+
*
|
|
746
|
+
* @remarks
|
|
747
|
+
* If this is not provided, plugins are de-duplicated by comparing their names.
|
|
748
|
+
*
|
|
749
|
+
* @param other - The other plugin to compare against.
|
|
750
|
+
* @returns `true` if the two plugins are the same, `false` otherwise.
|
|
751
|
+
*/
|
|
752
|
+
dedupe?: false | ((other: Plugin<any>) => boolean);
|
|
753
|
+
/**
|
|
754
|
+
* Define environments where this plugin should be active. By default, the plugin is active in all environments.
|
|
755
|
+
*
|
|
756
|
+
* @param environment - The environment to check.
|
|
757
|
+
* @returns `true` if the plugin should be active in the specified environment, `false` otherwise.
|
|
758
|
+
*/
|
|
759
|
+
applyToEnvironment?: (environment: ResolvedEnvironmentConfig) => boolean | PluginConfig<any>;
|
|
760
|
+
/**
|
|
761
|
+
* A function that returns configuration options to be merged with the build context's options.
|
|
762
|
+
*
|
|
763
|
+
* @remarks
|
|
764
|
+
* Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
|
|
765
|
+
*
|
|
766
|
+
* @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect. If you want to add plugins, consider doing so in the {@link Plugin.dependsOn} property instead.
|
|
767
|
+
*
|
|
768
|
+
* @see https://vitejs.dev/guide/api-plugin#config
|
|
769
|
+
*
|
|
770
|
+
* @param this - The build context.
|
|
771
|
+
* @param config - The partial configuration object to be modified.
|
|
772
|
+
* @returns A promise that resolves to a partial configuration object.
|
|
773
|
+
*/
|
|
774
|
+
config?: PluginHook<(this: UnresolvedContext<TContext["config"], TContext["system"]>) => MaybePromise<DeepPartial$1<TContext["config"]> & Record<string, any>>> | (DeepPartial$1<TContext["config"]> & Record<string, any>);
|
|
775
|
+
}
|
|
776
|
+
type Plugin<TContext extends PluginContext> = Partial<PluginHooks<TContext>> & BasePlugin<TContext> & Pick<UnpluginOptions$1<TContext>, UnpluginBuilderVariant>;
|
|
777
|
+
type PluginNonHookFields = ArrayValues<typeof PLUGIN_NON_HOOK_FIELDS>;
|
|
778
|
+
type PluginHookFields<TContext extends PluginContext = PluginContext, TKey extends string = string> = TKey extends ArrayValues<typeof PLUGIN_NON_HOOK_FIELDS> ? never : TKey extends keyof HookFunctions<TContext> ? HookFunctions<TContext>[TKey] extends AnyFunction ? TKey : HookFunctions<TContext>[TKey] extends object ? { [K in keyof HookFunctions<TContext>[TKey]]?: `${TKey}:${K & string}` }[keyof HookFunctions<TContext>[TKey]] : never : never;
|
|
779
|
+
//#endregion
|
|
780
|
+
//#region src/types/hooks.d.ts
|
|
781
|
+
type HookListOrders = "preOrdered" | "preEnforced" | "normal" | "postEnforced" | "postOrdered";
|
|
782
|
+
interface HooksListItem<TContext extends PluginContext = PluginContext, TFields extends string = string> {
|
|
783
|
+
plugin: Plugin<TContext>;
|
|
784
|
+
handler: InferHookFunction<TContext, TFields>;
|
|
785
|
+
}
|
|
786
|
+
type PluginFilter = (input: string) => boolean;
|
|
787
|
+
type TransformHookFilter = (id: string, code: string) => boolean;
|
|
788
|
+
interface NormalizedStringFilter {
|
|
789
|
+
include?: StringOrRegExp[];
|
|
790
|
+
exclude?: StringOrRegExp[];
|
|
791
|
+
}
|
|
792
|
+
type HooksList<TContext extends PluginContext = PluginContext, TFields extends string = string> = { [TKey in HookListOrders]?: HooksListItem<TContext, TFields>[] | undefined };
|
|
793
|
+
type InferPluginFunction<TObject, TKey extends keyof Required<TObject>> = InferPluginFunctionKey<Required<TObject>[TKey]>;
|
|
794
|
+
type InferPluginFunctionKey<TValue> = TValue extends AnyFunction ? TValue : TValue extends PluginHook<infer THookFunction, any> ? THookFunction : never;
|
|
795
|
+
type InferHookFunction<TContext extends PluginContext, TKey extends string> = TKey extends `${infer TVariant}:${infer TField}` ? TVariant extends keyof Required<BasePlugin<TContext>> ? TField extends keyof Required<BasePlugin<TContext>>[TVariant] ? InferPluginFunction<Required<BasePlugin<TContext>>[TVariant], TField> : TVariant extends keyof Required<PluginHooks<TContext>> ? TField extends keyof Required<PluginHooks<TContext>>[TVariant] ? InferPluginFunction<Required<PluginHooks<TContext>>[TVariant], TField> : never : never : TVariant extends UnpluginBuilderVariant ? TField extends keyof Required<UnpluginOptions>[TVariant] ? UnpluginHookFunctions<TContext, TVariant, TField> : never : never : TKey extends keyof Required<BasePlugin<TContext>> ? InferPluginFunction<Required<BasePlugin<TContext>>, TKey> : TKey extends keyof Required<PluginHooks<TContext>> ? InferPluginFunction<Required<PluginHooks<TContext>>, TKey> : never;
|
|
796
|
+
type InferHookReturnType<TContext extends PluginContext, TKey extends string> = ReturnType<InferHookFunction<TContext, TKey>>;
|
|
797
|
+
type InferHookParameters<TContext extends PluginContext, TKey extends string> = Parameters<InferHookFunction<TContext, TKey>>;
|
|
798
|
+
type InferHookThisType<TContext extends PluginContext, TKey extends string> = ThisParameterType<InferHookFunction<TContext, TKey>>;
|
|
799
|
+
type CallHookOptions<TResult = any> = SelectHooksOptions & (({
|
|
800
|
+
/**
|
|
801
|
+
* Whether to call the hooks sequentially or in parallel.
|
|
802
|
+
*
|
|
803
|
+
* @defaultValue true
|
|
804
|
+
*/
|
|
805
|
+
sequential?: true;
|
|
806
|
+
} & ({
|
|
807
|
+
/**
|
|
808
|
+
* How to handle multiple return values from hooks.
|
|
809
|
+
* - "merge": Merge all non-undefined return values (if they are objects).
|
|
810
|
+
* - "first": Return the first non-undefined value.
|
|
811
|
+
* - "last": Return the last non-undefined value.
|
|
812
|
+
*
|
|
813
|
+
* @remarks
|
|
814
|
+
* Merging only works if the return values are objects.
|
|
815
|
+
*
|
|
816
|
+
* @defaultValue "merge"
|
|
817
|
+
*/
|
|
818
|
+
result: "first";
|
|
819
|
+
} | ({
|
|
820
|
+
/**
|
|
821
|
+
* An indicator specifying if the results of the previous hook should be provided as the **first** parameter of the next hook function, or a function to process the result of the previous hook function and pass the returned value as the next hook's **first** parameter
|
|
822
|
+
*/
|
|
823
|
+
asNextParam?: false | ((previousResult: TResult) => MaybePromise<TResult>);
|
|
824
|
+
} & ({
|
|
825
|
+
/**
|
|
826
|
+
* How to handle multiple return values from hooks.
|
|
827
|
+
* - "merge": Merge all non-undefined return values (if they are objects).
|
|
828
|
+
* - "first": Return the first non-undefined value.
|
|
829
|
+
* - "last": Return the last non-undefined value.
|
|
830
|
+
*
|
|
831
|
+
* @remarks
|
|
832
|
+
* Merging only works if the return values are objects.
|
|
833
|
+
*
|
|
834
|
+
* @defaultValue "merge"
|
|
835
|
+
*/
|
|
836
|
+
result?: "merge";
|
|
837
|
+
/**
|
|
838
|
+
* A custom function to merge two sets of return values from hooks.
|
|
839
|
+
*
|
|
840
|
+
* @remarks
|
|
841
|
+
* If not provided, the {@link mergeResults} function will be used by default, which merges string results by concatenation and object results by deep merging.
|
|
842
|
+
*
|
|
843
|
+
* @param currentResult - The current hook result to merge with the previous results.
|
|
844
|
+
* @param previousResult - The previous hook result to merge with the current result.
|
|
845
|
+
* @returns The merged result.
|
|
846
|
+
*/
|
|
847
|
+
merge?: (currentResult: TResult, previousResult: TResult) => MaybePromise<TResult>;
|
|
848
|
+
} | {
|
|
849
|
+
/**
|
|
850
|
+
* How to handle multiple return values from hooks.
|
|
851
|
+
* - "merge": Merge all non-undefined return values (if they are objects).
|
|
852
|
+
* - "first": Return the first non-undefined value.
|
|
853
|
+
* - "last": Return the last non-undefined value.
|
|
854
|
+
*
|
|
855
|
+
* @remarks
|
|
856
|
+
* Merging only works if the return values are objects.
|
|
857
|
+
*
|
|
858
|
+
* @defaultValue "merge"
|
|
859
|
+
*/
|
|
860
|
+
result?: "last";
|
|
861
|
+
})))) | {
|
|
862
|
+
/**
|
|
863
|
+
* Whether to call the hooks sequentially or in parallel.
|
|
864
|
+
*/
|
|
865
|
+
sequential: false;
|
|
866
|
+
});
|
|
867
|
+
//#endregion
|
|
868
|
+
//#region src/types/logging.d.ts
|
|
869
|
+
type LogLevel = (typeof LOG_LEVELS)[number];
|
|
870
|
+
type LogCategory = (typeof LOG_CATEGORIES)[number];
|
|
871
|
+
interface LogMeta {
|
|
872
|
+
/**
|
|
873
|
+
* A unique identifier for the log message, which can be used to correlate related log entries across different parts of the system or different executions.
|
|
874
|
+
*/
|
|
875
|
+
logId: string;
|
|
876
|
+
/**
|
|
877
|
+
* The log level of the message, which indicates the severity or importance of the log entry. The log level can be used to filter log messages based on their importance, allowing users to focus on critical issues or relevant information while ignoring less important messages.
|
|
878
|
+
*/
|
|
879
|
+
type: LogLevel;
|
|
880
|
+
/**
|
|
881
|
+
* The category of the log message, which can be used to classify and filter log entries based on their purpose or origin.
|
|
882
|
+
*/
|
|
883
|
+
category: LogCategory;
|
|
884
|
+
/**
|
|
885
|
+
* The timestamp when the RPC message was created, represented as the number of milliseconds since the Unix epoch.
|
|
886
|
+
*/
|
|
887
|
+
timestamp: number;
|
|
888
|
+
/**
|
|
889
|
+
* The name of the project or package associated with the log message, which can be used to identify the source of the log entry and provide context for the message.
|
|
890
|
+
*/
|
|
891
|
+
name?: string;
|
|
892
|
+
/**
|
|
893
|
+
* A unique identifier for the current execution instance, which can be used for logging and other purposes to distinguish between different executions in the same process.
|
|
894
|
+
*/
|
|
895
|
+
executionId?: string;
|
|
896
|
+
/**
|
|
897
|
+
* The zero-based index of the current execution within the sequence of executions in the same process.
|
|
898
|
+
*/
|
|
899
|
+
configIndex?: number;
|
|
900
|
+
/**
|
|
901
|
+
* Optional command identifier to specify the command or task associated with the log message, which can be used to provide additional context about the operation being performed when the log entry was generated.
|
|
902
|
+
*/
|
|
903
|
+
command?: string;
|
|
904
|
+
/**
|
|
905
|
+
* Optional hook name to specify the plugin hook associated with the log message, which can be used to provide additional context about the specific plugin hook being executed when the log entry was generated.
|
|
906
|
+
*/
|
|
907
|
+
hook?: string;
|
|
908
|
+
/**
|
|
909
|
+
* Optional environment identifier to specify the context or environment in which the message is being processed.
|
|
910
|
+
*/
|
|
911
|
+
environment?: string;
|
|
912
|
+
/**
|
|
913
|
+
* Optional plugin name to specify the source plugin of the log message.
|
|
914
|
+
*/
|
|
915
|
+
plugin?: string;
|
|
916
|
+
/**
|
|
917
|
+
* The name of the logger or source of the log message, which can be used to identify the origin of the log entry.
|
|
918
|
+
*/
|
|
919
|
+
source?: string;
|
|
920
|
+
/**
|
|
921
|
+
* Indicates whether the log message is related to inter-process communication (IPC).
|
|
922
|
+
*
|
|
923
|
+
* @internal
|
|
924
|
+
*/
|
|
925
|
+
$$ipc?: boolean;
|
|
926
|
+
}
|
|
927
|
+
type LogFnOptions = Omit<Partial<LogMeta>, "logId" | "timestamp" | "name" | "type"> & {
|
|
928
|
+
mode?: Mode;
|
|
929
|
+
logLevel?: LogLevelUserConfig;
|
|
930
|
+
};
|
|
931
|
+
type LogFnMeta = LogLevel | PartialKeys<LogMeta, "logId" | "timestamp" | "name" | "category">;
|
|
932
|
+
type LogFn = (meta: LogFnMeta, message: string) => void;
|
|
933
|
+
type LoggerMeta = PartialKeys<Omit<LogMeta, "type">, "logId" | "timestamp" | "name" | "category">;
|
|
934
|
+
type LoggerOptions = Omit<LoggerMeta, "logId" | "timestamp" | "type"> & {
|
|
935
|
+
mode?: Mode;
|
|
936
|
+
logLevel?: LogLevelUserConfig;
|
|
937
|
+
};
|
|
938
|
+
interface PowerlinesMessage<TMeta> extends UnpluginMessage {
|
|
939
|
+
meta: TMeta;
|
|
940
|
+
error?: Error;
|
|
941
|
+
}
|
|
942
|
+
type LogMessage = PowerlinesMessage<Partial<LogMeta>>;
|
|
943
|
+
/**
|
|
944
|
+
* A type representing a log message that can be passed to the logging methods defined in the {@link Logger} interface, which includes the log metadata and message content. This type is used as the parameter for the logging methods defined in the {@link Logger} interface, allowing users to log messages with rich metadata that can be used for filtering, formatting, or other purposes in the logging implementation.
|
|
945
|
+
*/
|
|
946
|
+
type LoggerMessage = PowerlinesMessage<LoggerMeta>;
|
|
947
|
+
/**
|
|
948
|
+
* An internal interface representing a logger instance used within Powerlines for logging messages at various log levels, including "error", "warn", "info", "debug", and "trace". This interface defines methods for logging messages at each log level, which accept a message parameter that can be either a string or an object containing the log metadata and message content. The logger instance also includes an options property that contains the configuration options used for the logger, such as the source, command, environment, plugin, log level, and other relevant metadata. This interface is intended for internal use within Powerlines and is not meant to be implemented by users directly; instead, users can provide a custom logger that implements the {@link CustomLogger} interface to integrate with Powerlines' logging system.
|
|
949
|
+
*/
|
|
950
|
+
interface Logger {
|
|
951
|
+
options: LoggerOptions;
|
|
952
|
+
error: (message: string | LoggerMessage | Error) => void;
|
|
953
|
+
warn: (message: string | LoggerMessage) => void;
|
|
954
|
+
info: (message: string | LoggerMessage) => void;
|
|
955
|
+
debug: (message: string | LoggerMessage) => void;
|
|
956
|
+
trace: (message: string | LoggerMessage) => void;
|
|
957
|
+
log: (type: LogLevel, message: string | LoggerMessage) => void;
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* A type representing a log message that can be passed to a custom logger, which includes the log metadata and message content. This type is used as the parameter for the logging methods defined in the {@link CustomLogger} interface, allowing users to log messages with rich metadata that can be used for filtering, formatting, or other purposes in their custom logging implementation.
|
|
961
|
+
*/
|
|
962
|
+
type CustomLoggerMessage = PowerlinesMessage<Omit<LogMeta, "type">>;
|
|
963
|
+
/**
|
|
964
|
+
* An interface representing a custom logger that can be provided by the user to override the default logging behavior of Powerlines. This interface defines methods for logging messages at different log levels, including "error", "warn", "info", "debug", and "trace". Each method accepts a message parameter, which can be either a string or an object containing the log metadata and message content. By implementing this interface, users can integrate their own logging system with Powerlines or customize the logging behavior to suit their specific needs.
|
|
965
|
+
*/
|
|
966
|
+
interface CustomLogger {
|
|
967
|
+
/**
|
|
968
|
+
* A function to log messages at the "error" level, which indicates a serious issue that has caused a failure in the build process or a critical problem that needs immediate attention.
|
|
969
|
+
*
|
|
970
|
+
* @param message - The log message to be recorded, which can be a string or an object containing the log metadata and message content. The log message should provide sufficient information to understand the context and nature of the error being reported.
|
|
971
|
+
* @returns void
|
|
972
|
+
*/
|
|
973
|
+
error?: (message: CustomLoggerMessage) => void;
|
|
974
|
+
/**
|
|
975
|
+
* A function to log messages at the "warn" level, which indicates a potential issue or a situation that may require attention but does not necessarily cause a failure in the build process.
|
|
976
|
+
*
|
|
977
|
+
* @param message - The log message to be recorded, which can be a string or an object containing the log metadata and message content. The log message should provide sufficient information to understand the context and nature of the warning being reported.
|
|
978
|
+
* @returns void
|
|
979
|
+
*/
|
|
980
|
+
warn?: (message: CustomLoggerMessage) => void;
|
|
981
|
+
/**
|
|
982
|
+
* A function to log messages at the "info" level, which indicates general informational messages about the build process, such as the start and completion of tasks, configuration details, or other relevant information that may be useful for monitoring the build process.
|
|
983
|
+
*
|
|
984
|
+
* @param message - The log message to be recorded, which can be a string or an object containing the log metadata and message content. The log message should provide sufficient information to understand the context and nature of the informational message being reported.
|
|
985
|
+
* @returns void
|
|
986
|
+
*/
|
|
987
|
+
info?: (message: CustomLoggerMessage) => void;
|
|
988
|
+
/**
|
|
989
|
+
* A function to log messages at the "debug" level, which indicates detailed debugging information that may be useful for diagnosing issues during development or troubleshooting problems in the build process.
|
|
990
|
+
*
|
|
991
|
+
* @param message - The log message to be recorded, which can be a string or an object containing the log metadata and message content. The log message should provide sufficient information to understand the context and nature of the debug information being reported.
|
|
992
|
+
* @returns void
|
|
993
|
+
*/
|
|
994
|
+
debug?: (message: CustomLoggerMessage) => void;
|
|
995
|
+
/**
|
|
996
|
+
* A function to log messages at the "trace" level, which indicates very detailed tracing information that may be useful for in-depth analysis of the build process or for tracking the flow of execution through various stages of the build.
|
|
997
|
+
*
|
|
998
|
+
* @param message - The log message to be recorded, which can be a string or an object containing the log metadata and message content. The log message should provide sufficient information to understand the context and nature of the trace information being reported.
|
|
999
|
+
* @returns void
|
|
1000
|
+
*/
|
|
1001
|
+
trace?: (message: CustomLoggerMessage) => void;
|
|
1002
|
+
}
|
|
1003
|
+
type LogLevelUserConfig = LogLevel | RequiredKeys<Partial<Record<LogCategory, LogLevel | boolean | undefined>>, "general">;
|
|
1004
|
+
type LogLevelResolvedConfig = Record<LogCategory, LogLevel>;
|
|
1005
|
+
//#endregion
|
|
1006
|
+
//#region src/types/tsconfig.d.ts
|
|
1007
|
+
type ReflectionMode = "default" | "explicit" | "never";
|
|
1008
|
+
type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
|
|
1009
|
+
/**
|
|
1010
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
1011
|
+
*
|
|
1012
|
+
* @remarks
|
|
1013
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
1014
|
+
* - `minimal` - Only the essential type information is captured.
|
|
1015
|
+
* - `default` - Additional type information is captured, including some contextual data.
|
|
1016
|
+
* - `extended` - Even more detailed type information is captured, including extended contextual data.
|
|
1017
|
+
* - `all` - All available type information is captured, including detailed contextual data.
|
|
1018
|
+
*/
|
|
1019
|
+
type Level = "minimal" | "default" | "extended" | "all";
|
|
1020
|
+
interface DeepkitOptions {
|
|
1021
|
+
/**
|
|
1022
|
+
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
1023
|
+
* or a list of globs/file paths relative to this tsconfig.json.
|
|
1024
|
+
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
1025
|
+
*/
|
|
1026
|
+
reflection?: RawReflectionMode;
|
|
1027
|
+
/**
|
|
1028
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
1029
|
+
*
|
|
1030
|
+
* @remarks
|
|
1031
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
1032
|
+
* - `minimal` - Only the essential type information is captured. (only "hidden", "ignore" and "internal", "readonly")
|
|
1033
|
+
* - `default` - Additional type information is captured, including some contextual data. (adds "alias" and "runtime")
|
|
1034
|
+
* - `extended` - Even more detailed type information is captured, including extended contextual data. (adds "permissions" and "domain")
|
|
1035
|
+
* - `all` - All available type information is captured, including detailed contextual data. (adds "title" and "description")
|
|
1036
|
+
*/
|
|
1037
|
+
level?: Level;
|
|
1038
|
+
}
|
|
1039
|
+
type TSCompilerOptions = CompilerOptions & DeepkitOptions;
|
|
1040
|
+
/**
|
|
1041
|
+
* The TypeScript compiler configuration.
|
|
1042
|
+
*
|
|
1043
|
+
* @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
|
|
1044
|
+
*/
|
|
1045
|
+
interface TSConfig extends Omit<TsConfigJson, "reflection"> {
|
|
1046
|
+
/**
|
|
1047
|
+
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
1048
|
+
* or a list of globs/file paths relative to this tsconfig.json.
|
|
1049
|
+
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
1050
|
+
*/
|
|
1051
|
+
reflection?: RawReflectionMode;
|
|
1052
|
+
/**
|
|
1053
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
1054
|
+
*
|
|
1055
|
+
* @remarks
|
|
1056
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
1057
|
+
* - `minimal` - Only the essential type information is captured.
|
|
1058
|
+
* - `default` - Additional type information is captured, including some contextual data.
|
|
1059
|
+
* - `extended` - Even more detailed type information is captured, including extended contextual data.
|
|
1060
|
+
* - `all` - All available type information is captured, including detailed contextual data.
|
|
1061
|
+
*/
|
|
1062
|
+
level?: Level;
|
|
1063
|
+
/**
|
|
1064
|
+
* Instructs the TypeScript compiler how to compile `.ts` files.
|
|
1065
|
+
*/
|
|
1066
|
+
compilerOptions?: TSCompilerOptions;
|
|
1067
|
+
}
|
|
1068
|
+
type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
|
|
1069
|
+
originalTsconfigJson: TsConfigJson;
|
|
1070
|
+
tsconfigJson: TSConfig;
|
|
1071
|
+
tsconfigFilePath: string;
|
|
1072
|
+
};
|
|
1073
|
+
//#endregion
|
|
1074
|
+
//#region src/types/context.d.ts
|
|
1075
|
+
type MetaInfo = Record<string, any> & {
|
|
1076
|
+
/**
|
|
1077
|
+
* The checksum generated from the resolved options
|
|
1078
|
+
*/
|
|
1079
|
+
checksum: string;
|
|
1080
|
+
/**
|
|
1081
|
+
* The unique identifier of the execution, which can be used for logging and other purposes to distinguish between different executions in the same process.
|
|
1082
|
+
*/
|
|
1083
|
+
executionId: string;
|
|
1084
|
+
/**
|
|
1085
|
+
* The build id, which is a unique identifier for the current build process. This can be used for logging and other purposes to distinguish between different builds in the same process.
|
|
1086
|
+
*/
|
|
1087
|
+
buildId: string;
|
|
1088
|
+
/**
|
|
1089
|
+
* The release id, which is a unique identifier for the current release. This can be used for logging and other purposes to distinguish between different releases in the same process.
|
|
1090
|
+
*/
|
|
1091
|
+
releaseId: string;
|
|
1092
|
+
/**
|
|
1093
|
+
* The timestamp when the execution context was initialized
|
|
1094
|
+
*/
|
|
1095
|
+
timestamp: number;
|
|
1096
|
+
/**
|
|
1097
|
+
* A hash that represents the path to the project root directory
|
|
1098
|
+
*/
|
|
1099
|
+
rootHash: string;
|
|
1100
|
+
/**
|
|
1101
|
+
* A hash that represents the path to the configuration root directory
|
|
1102
|
+
*/
|
|
1103
|
+
configHash: string;
|
|
1104
|
+
};
|
|
1105
|
+
interface Resolver extends Jiti {
|
|
1106
|
+
plugin: Jiti;
|
|
1107
|
+
}
|
|
1108
|
+
interface TransformResult$1 {
|
|
1109
|
+
code: string;
|
|
1110
|
+
map: SourceMap | null;
|
|
1111
|
+
}
|
|
1112
|
+
/**
|
|
1113
|
+
* The format for providing source code to the compiler
|
|
1114
|
+
*/
|
|
1115
|
+
interface SourceFile {
|
|
1116
|
+
/**
|
|
1117
|
+
* The name of the file to be compiled
|
|
1118
|
+
*/
|
|
1119
|
+
id: string;
|
|
1120
|
+
/**
|
|
1121
|
+
* The source code to be compiled
|
|
1122
|
+
*/
|
|
1123
|
+
code: MagicString;
|
|
1124
|
+
/**
|
|
1125
|
+
* The environment variables used in the source code
|
|
1126
|
+
*/
|
|
1127
|
+
env: string[];
|
|
1128
|
+
/**
|
|
1129
|
+
* The result of the transformation
|
|
1130
|
+
*/
|
|
1131
|
+
result?: TransformResult$1;
|
|
1132
|
+
}
|
|
1133
|
+
type UnimportContext = Omit<Unimport, "injectImports"> & {
|
|
1134
|
+
dumpImports: () => Promise<void>;
|
|
1135
|
+
injectImports: (source: SourceFile) => Promise<SourceFile>;
|
|
1136
|
+
refreshRuntimeImports: () => Promise<void>;
|
|
1137
|
+
};
|
|
1138
|
+
interface SelectHooksOptions {
|
|
1139
|
+
order?: "pre" | "post" | "normal";
|
|
1140
|
+
}
|
|
1141
|
+
/**
|
|
1142
|
+
* Options for initializing or updating the context with new configuration values
|
|
1143
|
+
*/
|
|
1144
|
+
interface InitContextOptions {
|
|
1145
|
+
/**
|
|
1146
|
+
* If false, the plugin will be loaded after all other plugins.
|
|
1147
|
+
*
|
|
1148
|
+
* @defaultValue true
|
|
1149
|
+
*/
|
|
1150
|
+
isHighPriority: boolean;
|
|
1151
|
+
}
|
|
1152
|
+
/**
|
|
1153
|
+
* Options for fetch requests made via the context's {@link Context.fetch} method
|
|
1154
|
+
*/
|
|
1155
|
+
interface FetchOptions extends RequestInit {
|
|
1156
|
+
/**
|
|
1157
|
+
* An indicator specifying that the request should bypass any caching
|
|
1158
|
+
*/
|
|
1159
|
+
skipCache?: boolean;
|
|
1160
|
+
/**
|
|
1161
|
+
* The maximum time in milliseconds to wait for the request to complete.
|
|
1162
|
+
*
|
|
1163
|
+
* @defaultValue 30000
|
|
1164
|
+
*/
|
|
1165
|
+
timeout?: number;
|
|
1166
|
+
}
|
|
1167
|
+
/**
|
|
1168
|
+
* Options for parsing code using [Oxc-Parser](https://github.com/oxc/oxc)
|
|
1169
|
+
*/
|
|
1170
|
+
interface ParseOptions extends ParserOptions {
|
|
1171
|
+
/**
|
|
1172
|
+
* When true this allows return statements to be outside functions to e.g. support parsing CommonJS code.
|
|
1173
|
+
*/
|
|
1174
|
+
allowReturnOutsideFunction?: boolean;
|
|
1175
|
+
}
|
|
1176
|
+
interface EmitOptions extends WriteOptions {
|
|
1177
|
+
/**
|
|
1178
|
+
* The file extension to use when emitting the file
|
|
1179
|
+
*/
|
|
1180
|
+
extension?: string;
|
|
1181
|
+
/**
|
|
1182
|
+
* If true, will emit the file using {@link UnpluginBuildContext.emitFile | the bundler's emit function}.
|
|
1183
|
+
*/
|
|
1184
|
+
emitWithBundler?: boolean;
|
|
1185
|
+
needsCodeReference?: Parameters<UnpluginBuildContext["emitFile"]>[0]["needsCodeReference"];
|
|
1186
|
+
originalFileName?: Parameters<UnpluginBuildContext["emitFile"]>[0]["originalFileName"];
|
|
1187
|
+
}
|
|
1188
|
+
/**
|
|
1189
|
+
* Options for emitting entry virtual files
|
|
1190
|
+
*/
|
|
1191
|
+
type EmitEntryOptions = EmitOptions & Omit<ResolvedEntryFileReference, "file">;
|
|
1192
|
+
interface ResolveResult extends ExternalIdResult {
|
|
1193
|
+
/**
|
|
1194
|
+
* A flag indicating whether the resolved module is part of the generated runtime modules
|
|
1195
|
+
*/
|
|
1196
|
+
virtual?: boolean;
|
|
1197
|
+
}
|
|
1198
|
+
/**
|
|
1199
|
+
* The base Powerlines context.
|
|
1200
|
+
*
|
|
1201
|
+
* @remarks
|
|
1202
|
+
* This context provides the foundational structure for interacting with the Powerlines engine.
|
|
1203
|
+
*/
|
|
1204
|
+
interface BaseContext<TSystemContext = any> extends Pick<Required<Options>, "cwd"> {
|
|
1205
|
+
/**
|
|
1206
|
+
* The system instance associated with the context, which can be used to interact with the Powerlines engine and perform various operations during the build process. The specific type of the system may vary depending on the environment and use case, but it typically provides methods for logging, file system operations, and other interactions with the Powerlines engine.
|
|
1207
|
+
*/
|
|
1208
|
+
system: TSystemContext;
|
|
1209
|
+
/**
|
|
1210
|
+
* The timestamp when the context was initialized
|
|
1211
|
+
*/
|
|
1212
|
+
timestamp: number;
|
|
1213
|
+
/**
|
|
1214
|
+
* The Powerlines environment paths
|
|
1215
|
+
*/
|
|
1216
|
+
envPaths: EnvPaths;
|
|
1217
|
+
/**
|
|
1218
|
+
* The file system path to the Powerlines package installation
|
|
1219
|
+
*/
|
|
1220
|
+
powerlinesPath: string;
|
|
1221
|
+
/**
|
|
1222
|
+
* The options provided to the Powerlines process.
|
|
1223
|
+
*/
|
|
1224
|
+
options: Options;
|
|
1225
|
+
/**
|
|
1226
|
+
* An instance of the Powerlines logger client that can be used to generate log messages with consistent formatting and metadata.
|
|
1227
|
+
*/
|
|
1228
|
+
logger: Logger;
|
|
1229
|
+
/**
|
|
1230
|
+
* A logging function for fatal messages
|
|
1231
|
+
*/
|
|
1232
|
+
fatal: (message: string | LogMessage | Error) => void;
|
|
1233
|
+
/**
|
|
1234
|
+
* A logging function for error messages
|
|
1235
|
+
*/
|
|
1236
|
+
error: (message: string | LogMessage | Error) => void;
|
|
1237
|
+
/**
|
|
1238
|
+
* A logging function for warning messages
|
|
1239
|
+
*/
|
|
1240
|
+
warn: (message: string | LogMessage) => void;
|
|
1241
|
+
/**
|
|
1242
|
+
* A logging function for informational messages
|
|
1243
|
+
*/
|
|
1244
|
+
info: (message: string | LogMessage) => void;
|
|
1245
|
+
/**
|
|
1246
|
+
* A logging function for debug messages
|
|
1247
|
+
*/
|
|
1248
|
+
debug: (message: string | LogMessage) => void;
|
|
1249
|
+
/**
|
|
1250
|
+
* A logging function for trace messages
|
|
1251
|
+
*/
|
|
1252
|
+
trace: (message: string | LogMessage) => void;
|
|
1253
|
+
/**
|
|
1254
|
+
* A function to create a timer for measuring the duration of asynchronous operations
|
|
1255
|
+
*
|
|
1256
|
+
* @example
|
|
1257
|
+
* ```ts
|
|
1258
|
+
* const stopTimer = context.timer("Your Async Operation");
|
|
1259
|
+
* await performAsyncOperation();
|
|
1260
|
+
* stopTimer(); // "Your Async Operation completed in 123.45 milliseconds"
|
|
1261
|
+
* ```
|
|
1262
|
+
*
|
|
1263
|
+
* @param name - The name of the timer.
|
|
1264
|
+
* @returns A function that, when called, stops the timer and logs the duration.
|
|
1265
|
+
*/
|
|
1266
|
+
timer: (name: string) => () => void;
|
|
1267
|
+
/**
|
|
1268
|
+
* Create a new logger instance
|
|
1269
|
+
*
|
|
1270
|
+
* @param options - The configuration options to use for the logger instance, which can be used to customize the appearance and behavior of the log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance.
|
|
1271
|
+
* @returns A logger client instance that can be used to generate log messages with consistent formatting and metadata.
|
|
1272
|
+
*/
|
|
1273
|
+
createLogger: (options: LoggerOptions, logFn?: LogFn) => Logger;
|
|
1274
|
+
/**
|
|
1275
|
+
* Extend the current logger instance with a new source
|
|
1276
|
+
*
|
|
1277
|
+
* @param options - The overlay metadata to use for the badge in the log output.
|
|
1278
|
+
* @returns A logger client instance that extends the current logger with the provided configuration options.
|
|
1279
|
+
*/
|
|
1280
|
+
extendLogger: (options: LoggerOptions, logFn?: LogFn) => Logger;
|
|
1281
|
+
}
|
|
1282
|
+
/**
|
|
1283
|
+
* The unresolved Powerlines context.
|
|
1284
|
+
*
|
|
1285
|
+
* @remarks
|
|
1286
|
+
* This context is used before the user configuration has been fully resolved after the `config`.
|
|
1287
|
+
*/
|
|
1288
|
+
interface UnresolvedContext<TResolvedConfig extends ResolvedConfig$1 = ResolvedConfig$1, TSystemContext = any> extends BaseContext<TSystemContext> {
|
|
1289
|
+
/**
|
|
1290
|
+
* The options provided to the Powerlines process, resolved with default values and merged with any configuration provided by plugins or other sources. This is typically the final configuration used during the build process, but may also include additional options that are relevant to the context and its interactions with the Powerlines engine.
|
|
1291
|
+
*/
|
|
1292
|
+
options: ExecutionOptions;
|
|
1293
|
+
/**
|
|
1294
|
+
* An object containing the options provided to Powerlines
|
|
1295
|
+
*/
|
|
1296
|
+
config: Omit<TResolvedConfig, "pluginConfig">;
|
|
1297
|
+
/**
|
|
1298
|
+
* A place to store metadata information on the context for access in plugins and other parts of the system. This can be used to store information about the current execution, such as a unique identifier for the execution, timestamps, or any other relevant data that may be useful for plugins or other parts of the system to access during the build process.
|
|
1299
|
+
*/
|
|
1300
|
+
meta: MetaInfo;
|
|
1301
|
+
/**
|
|
1302
|
+
* The metadata information currently written to disk
|
|
1303
|
+
*/
|
|
1304
|
+
persistedMeta?: MetaInfo;
|
|
1305
|
+
/**
|
|
1306
|
+
* The path to a directory where the reflection data buffers (used by the build processes) are stored
|
|
1307
|
+
*/
|
|
1308
|
+
readonly dataPath: string;
|
|
1309
|
+
/**
|
|
1310
|
+
* The path to a directory where the project cache (used by the build processes) is stored
|
|
1311
|
+
*/
|
|
1312
|
+
readonly cachePath: string;
|
|
1313
|
+
/**
|
|
1314
|
+
* The Powerlines artifacts directory
|
|
1315
|
+
*/
|
|
1316
|
+
readonly artifactsPath: string;
|
|
1317
|
+
/**
|
|
1318
|
+
* The path to the Powerlines builtin runtime modules directory
|
|
1319
|
+
*/
|
|
1320
|
+
readonly builtinsPath: string;
|
|
1321
|
+
/**
|
|
1322
|
+
* The path to the Powerlines entry modules directory
|
|
1323
|
+
*/
|
|
1324
|
+
readonly entryPath: string;
|
|
1325
|
+
/**
|
|
1326
|
+
* The path to the Powerlines infrastructure modules directory
|
|
1327
|
+
*/
|
|
1328
|
+
readonly infrastructurePath: string;
|
|
1329
|
+
/**
|
|
1330
|
+
* The path to the Powerlines TypeScript declaration files directory
|
|
1331
|
+
*/
|
|
1332
|
+
readonly typesPath: string;
|
|
1333
|
+
/**
|
|
1334
|
+
* Invokes the configured plugin hooks
|
|
1335
|
+
*
|
|
1336
|
+
* @remarks
|
|
1337
|
+
* By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
|
|
1338
|
+
*
|
|
1339
|
+
* @param hook - The hook to call
|
|
1340
|
+
* @param options - The options to provide to the hook
|
|
1341
|
+
* @param args - The arguments to pass to the hook
|
|
1342
|
+
* @returns The result of the hook call
|
|
1343
|
+
*/
|
|
1344
|
+
callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
|
|
1345
|
+
environment?: string | EnvironmentContext<TResolvedConfig>;
|
|
1346
|
+
}, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
|
|
1347
|
+
/**
|
|
1348
|
+
* The virtual file system interface for managing files during the build process
|
|
1349
|
+
*/
|
|
1350
|
+
fs: VirtualFileSystemInterface;
|
|
1351
|
+
/**
|
|
1352
|
+
* The project's `package.json` file content
|
|
1353
|
+
*/
|
|
1354
|
+
packageJson: PackageJson & Record<string, any>;
|
|
1355
|
+
/**
|
|
1356
|
+
* The project's `project.json` file content
|
|
1357
|
+
*/
|
|
1358
|
+
projectJson?: Record<string, any>;
|
|
1359
|
+
/**
|
|
1360
|
+
* The dependency installations required by the project
|
|
1361
|
+
*/
|
|
1362
|
+
dependencies: Record<string, string | Range>;
|
|
1363
|
+
/**
|
|
1364
|
+
* The development dependency installations required by the project
|
|
1365
|
+
*/
|
|
1366
|
+
devDependencies: Record<string, string | Range>;
|
|
1367
|
+
/**
|
|
1368
|
+
* The parsed TypeScript configuration from the `tsconfig.json` file
|
|
1369
|
+
*/
|
|
1370
|
+
tsconfig: ParsedTypeScriptConfig;
|
|
1371
|
+
/**
|
|
1372
|
+
* The entry points of the source code
|
|
1373
|
+
*/
|
|
1374
|
+
entry: ResolvedEntryFileReference[];
|
|
1375
|
+
/**
|
|
1376
|
+
* The Jiti module resolver
|
|
1377
|
+
*/
|
|
1378
|
+
resolver: Resolver;
|
|
1379
|
+
/**
|
|
1380
|
+
* The builtin module id that exist in the Powerlines virtual file system
|
|
1381
|
+
*/
|
|
1382
|
+
builtins: string[];
|
|
1383
|
+
/**
|
|
1384
|
+
* The alias mappings for the project used during module resolution
|
|
1385
|
+
*
|
|
1386
|
+
* @remarks
|
|
1387
|
+
* This includes both the built-in module aliases as well as any custom aliases defined in the build configuration.
|
|
1388
|
+
*/
|
|
1389
|
+
alias: Record<string, string>;
|
|
1390
|
+
/**
|
|
1391
|
+
* The resolved tsconfig file paths for the project
|
|
1392
|
+
*/
|
|
1393
|
+
resolvePatterns: RegExp[];
|
|
1394
|
+
/**
|
|
1395
|
+
* Additional arguments provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed.
|
|
1396
|
+
*/
|
|
1397
|
+
additionalArgs: Record<string, string | string[]>;
|
|
1398
|
+
/**
|
|
1399
|
+
* A function to perform HTTP fetch requests
|
|
1400
|
+
*
|
|
1401
|
+
* @remarks
|
|
1402
|
+
* This function uses a caching layer to avoid duplicate requests during the Powerlines process.
|
|
1403
|
+
*
|
|
1404
|
+
* @example
|
|
1405
|
+
* ```ts
|
|
1406
|
+
* const response = await context.fetch("https://api.example.com/data");
|
|
1407
|
+
* const data = await response.json();
|
|
1408
|
+
* ```
|
|
1409
|
+
*
|
|
1410
|
+
* @see https://github.com/nodejs/undici
|
|
1411
|
+
*
|
|
1412
|
+
* @param input - The URL to fetch.
|
|
1413
|
+
* @param options - The fetch request options.
|
|
1414
|
+
* @returns A promise that resolves to a response returned by the fetch.
|
|
1415
|
+
*/
|
|
1416
|
+
fetch: (input: RequestInfo, options?: FetchOptions) => Promise<Response>;
|
|
1417
|
+
/**
|
|
1418
|
+
* Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
1419
|
+
*
|
|
1420
|
+
* @remarks
|
|
1421
|
+
* This function can be used to parse TypeScript code into an AST for further analysis or transformation.
|
|
1422
|
+
*
|
|
1423
|
+
* @example
|
|
1424
|
+
* ```ts
|
|
1425
|
+
* const ast = context.parse("const x: number = 42;");
|
|
1426
|
+
* ```
|
|
1427
|
+
*
|
|
1428
|
+
* @see https://rollupjs.org/plugin-development/#this-parse
|
|
1429
|
+
* @see https://github.com/oxc/oxc
|
|
1430
|
+
*
|
|
1431
|
+
* @param code - The source code to parse.
|
|
1432
|
+
* @param options - The options to pass to the parser.
|
|
1433
|
+
* @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
1434
|
+
*/
|
|
1435
|
+
parse: (code: string, options?: ParseOptions) => Promise<ParseResult>;
|
|
1436
|
+
/**
|
|
1437
|
+
* A helper function to resolve modules using the Jiti resolver
|
|
1438
|
+
*
|
|
1439
|
+
* @remarks
|
|
1440
|
+
* This function can be used to resolve modules relative to the project root directory.
|
|
1441
|
+
*
|
|
1442
|
+
* @example
|
|
1443
|
+
* ```ts
|
|
1444
|
+
* const resolvedPath = await context.resolve("some-module", "/path/to/importer");
|
|
1445
|
+
* ```
|
|
1446
|
+
*
|
|
1447
|
+
* @param id - The module to resolve.
|
|
1448
|
+
* @param importer - An optional path to the importer module.
|
|
1449
|
+
* @param options - Additional resolution options.
|
|
1450
|
+
* @returns A promise that resolves to the resolved module path.
|
|
1451
|
+
*/
|
|
1452
|
+
resolve: (id: string, importer?: string, options?: ResolveOptions$1) => Promise<ResolveResult | undefined>;
|
|
1453
|
+
/**
|
|
1454
|
+
* A helper function to load modules using the Jiti resolver
|
|
1455
|
+
*
|
|
1456
|
+
* @remarks
|
|
1457
|
+
* This function can be used to load modules relative to the project root directory.
|
|
1458
|
+
*
|
|
1459
|
+
* @example
|
|
1460
|
+
* ```ts
|
|
1461
|
+
* const module = await context.load("some-module", "/path/to/importer");
|
|
1462
|
+
* ```
|
|
1463
|
+
*
|
|
1464
|
+
* @param id - The module to load.
|
|
1465
|
+
* @returns A promise that resolves to the loaded module.
|
|
1466
|
+
*/
|
|
1467
|
+
load: (id: string) => Promise<TransformResult$1 | undefined>;
|
|
1468
|
+
/**
|
|
1469
|
+
* The Powerlines builtin virtual files
|
|
1470
|
+
*/
|
|
1471
|
+
getBuiltins: () => Promise<VirtualFile[]>;
|
|
1472
|
+
/**
|
|
1473
|
+
* Resolves a file and writes it to the VFS if it does not already exist
|
|
1474
|
+
*
|
|
1475
|
+
* @param code - The source code of the file
|
|
1476
|
+
* @param path - The path to write the file to
|
|
1477
|
+
* @param options - Additional options for writing the file
|
|
1478
|
+
*/
|
|
1479
|
+
emit: (code: string, path: string, options?: EmitOptions) => Promise<void>;
|
|
1480
|
+
/**
|
|
1481
|
+
* Synchronously resolves a file and writes it to the VFS if it does not already exist
|
|
1482
|
+
*
|
|
1483
|
+
* @param code - The source code of the file
|
|
1484
|
+
* @param path - The path to write the file to
|
|
1485
|
+
* @param options - Additional options for writing the file
|
|
1486
|
+
*/
|
|
1487
|
+
emitSync: (code: string, path: string, options?: EmitOptions) => void;
|
|
1488
|
+
/**
|
|
1489
|
+
* Resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
1490
|
+
*
|
|
1491
|
+
* @param code - The source code of the builtin file
|
|
1492
|
+
* @param id - The unique identifier of the builtin file
|
|
1493
|
+
* @param options - Additional options for writing the builtin file
|
|
1494
|
+
*/
|
|
1495
|
+
emitBuiltin: (code: string, id: string, options?: EmitOptions) => Promise<void>;
|
|
1496
|
+
/**
|
|
1497
|
+
* Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
1498
|
+
*
|
|
1499
|
+
* @param code - The source code of the builtin file
|
|
1500
|
+
* @param id - The unique identifier of the builtin file
|
|
1501
|
+
* @param options - Additional options for writing the builtin file
|
|
1502
|
+
*/
|
|
1503
|
+
emitBuiltinSync: (code: string, id: string, options?: EmitOptions) => void;
|
|
1504
|
+
/**
|
|
1505
|
+
* Resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
1506
|
+
*
|
|
1507
|
+
* @param code - The source code of the entry file
|
|
1508
|
+
* @param path - An optional path to write the entry file to
|
|
1509
|
+
* @param options - Additional options for writing the entry file
|
|
1510
|
+
*/
|
|
1511
|
+
emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
|
|
1512
|
+
/**
|
|
1513
|
+
* Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
1514
|
+
*
|
|
1515
|
+
* @param code - The source code of the entry file
|
|
1516
|
+
* @param path - An optional path to write the entry file to
|
|
1517
|
+
* @param options - Additional options for writing the entry file
|
|
1518
|
+
*/
|
|
1519
|
+
emitEntrySync: (code: string, path: string, options?: EmitEntryOptions) => void;
|
|
1520
|
+
/**
|
|
1521
|
+
* Resolves a infrastructure virtual file and writes it to the VFS if it does not already exist
|
|
1522
|
+
*
|
|
1523
|
+
* @param code - The source code of the infrastructure file
|
|
1524
|
+
* @param id - The unique identifier of the infrastructure file
|
|
1525
|
+
* @param options - Additional options for writing the infrastructure file
|
|
1526
|
+
*/
|
|
1527
|
+
emitInfrastructure: (code: string, id: string, options?: EmitOptions) => Promise<void>;
|
|
1528
|
+
/**
|
|
1529
|
+
* Synchronously resolves a infrastructure virtual file and writes it to the VFS if it does not already exist
|
|
1530
|
+
*
|
|
1531
|
+
* @param code - The source code of the infrastructure file
|
|
1532
|
+
* @param id - The unique identifier of the infrastructure file
|
|
1533
|
+
* @param options - Additional options for writing the infrastructure file
|
|
1534
|
+
*/
|
|
1535
|
+
emitInfrastructureSync: (code: string, id: string, options?: EmitOptions) => void;
|
|
1536
|
+
/**
|
|
1537
|
+
* Generates a checksum representing the current context state
|
|
1538
|
+
*
|
|
1539
|
+
* @returns A promise that resolves to a string representing the checksum
|
|
1540
|
+
*/
|
|
1541
|
+
generateChecksum: () => Promise<string>;
|
|
1542
|
+
}
|
|
1543
|
+
/**
|
|
1544
|
+
* The resolved Powerlines context.
|
|
1545
|
+
*
|
|
1546
|
+
* @remarks
|
|
1547
|
+
* This context is used after the user configuration has been fully resolved and merged with default values, providing access to the final configuration options and utility functions for interacting with the Powerlines engine.
|
|
1548
|
+
*/
|
|
1549
|
+
type Context<TResolvedConfig extends ResolvedConfig$1 = ResolvedConfig$1, TSystemContext = any> = Omit<UnresolvedContext<TResolvedConfig, TSystemContext>, "config" | "callHook"> & {
|
|
1550
|
+
/**
|
|
1551
|
+
* The fully resolved Powerlines configuration
|
|
1552
|
+
*/
|
|
1553
|
+
config: TResolvedConfig;
|
|
1554
|
+
/**
|
|
1555
|
+
* A setter function to populate the plugin config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the plugin configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any plugin configuration provided during execution.
|
|
1556
|
+
*
|
|
1557
|
+
* @param config - The plugin configuration values to set.
|
|
1558
|
+
* @returns A promise that resolves when the plugin configuration values have been set.
|
|
1559
|
+
*/
|
|
1560
|
+
setPluginConfig: (config: DeepPartial<UserConfig>) => Promise<void>;
|
|
1561
|
+
/**
|
|
1562
|
+
* Invokes the configured plugin hooks
|
|
1563
|
+
*
|
|
1564
|
+
* @remarks
|
|
1565
|
+
* By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
|
|
1566
|
+
*
|
|
1567
|
+
* @param hook - The hook to call
|
|
1568
|
+
* @param options - The options to provide to the hook
|
|
1569
|
+
* @param args - The arguments to pass to the hook
|
|
1570
|
+
* @returns The result of the hook call
|
|
1571
|
+
*/
|
|
1572
|
+
callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
|
|
1573
|
+
environment?: string | EnvironmentContext<any, any>;
|
|
1574
|
+
}, ...args: InferHookParameters<PluginContext<any, any>, TKey>) => Promise<InferHookReturnType<PluginContext<any, any>, TKey> | undefined>;
|
|
1575
|
+
};
|
|
1576
|
+
interface ExecutionContext<TResolvedConfig extends ResolvedConfig$1 = ResolvedConfig$1, TSystemContext = any> extends Context<TResolvedConfig, TSystemContext> {
|
|
1577
|
+
/**
|
|
1578
|
+
* The unique identifier of the execution context, which can be used for logging and other purposes to distinguish between different executions in the same process.
|
|
1579
|
+
*/
|
|
1580
|
+
readonly id: string;
|
|
1581
|
+
/**
|
|
1582
|
+
* The expected plugins options for the Powerlines project.
|
|
1583
|
+
*
|
|
1584
|
+
* @remarks
|
|
1585
|
+
* This is a record of plugin identifiers to their respective options. This field is populated by the Powerlines engine during both plugin initialization and the `init` command.
|
|
1586
|
+
*/
|
|
1587
|
+
plugins: Plugin<PluginContext<TResolvedConfig, TSystemContext>>[];
|
|
1588
|
+
/**
|
|
1589
|
+
* A table for storing the current context for each configured environment
|
|
1590
|
+
*/
|
|
1591
|
+
environments: Record<string, EnvironmentContext<TResolvedConfig, TSystemContext>>;
|
|
1592
|
+
/**
|
|
1593
|
+
* Retrieves the context for a specific environment by name
|
|
1594
|
+
*
|
|
1595
|
+
* @throws Will throw an error if the environment does not exist
|
|
1596
|
+
*
|
|
1597
|
+
* @param name - The name of the environment to retrieve. If not provided, the default environment is returned.
|
|
1598
|
+
* @returns A promise that resolves to the environment context.
|
|
1599
|
+
*
|
|
1600
|
+
* @example
|
|
1601
|
+
* ```ts
|
|
1602
|
+
* const devEnv = await apiContext.getEnvironment("development");
|
|
1603
|
+
* const defaultEnv = await apiContext.getEnvironment();
|
|
1604
|
+
* ```
|
|
1605
|
+
*/
|
|
1606
|
+
getEnvironment: (name?: string) => Promise<EnvironmentContext<TResolvedConfig, TSystemContext>>;
|
|
1607
|
+
/**
|
|
1608
|
+
* Safely retrieves the context for a specific environment by name
|
|
1609
|
+
*
|
|
1610
|
+
* @param name - The name of the environment to retrieve. If not provided, the default environment is returned.
|
|
1611
|
+
* @returns A promise that resolves to the environment context, or undefined if the environment does not exist.
|
|
1612
|
+
*
|
|
1613
|
+
* @example
|
|
1614
|
+
* ```ts
|
|
1615
|
+
* const devEnv = await apiContext.getEnvironmentSafe("development");
|
|
1616
|
+
* const defaultEnv = await apiContext.getEnvironmentSafe();
|
|
1617
|
+
* ```
|
|
1618
|
+
*
|
|
1619
|
+
* @remarks
|
|
1620
|
+
* This method is similar to `getEnvironment`, but it returns `undefined` instead of throwing an error if the specified environment does not exist.
|
|
1621
|
+
* This can be useful in scenarios where the existence of an environment is optional or uncertain.
|
|
1622
|
+
*
|
|
1623
|
+
* ```ts
|
|
1624
|
+
* const testEnv = await apiContext.getEnvironmentSafe("test");
|
|
1625
|
+
* if (testEnv) {
|
|
1626
|
+
* // Environment exists, safe to use it
|
|
1627
|
+
* } else {
|
|
1628
|
+
* // Environment does not exist, handle accordingly
|
|
1629
|
+
* }
|
|
1630
|
+
* ```
|
|
1631
|
+
*
|
|
1632
|
+
* Using this method helps avoid unhandled exceptions in cases where an environment might not be defined.
|
|
1633
|
+
*/
|
|
1634
|
+
getEnvironmentSafe: (name?: string) => Promise<EnvironmentContext<TResolvedConfig, TSystemContext> | undefined>;
|
|
1635
|
+
/**
|
|
1636
|
+
* A function to copy the context and update the fields for a specific environment
|
|
1637
|
+
*
|
|
1638
|
+
* @param environment - The environment configuration to use.
|
|
1639
|
+
* @returns A new context instance with the updated environment.
|
|
1640
|
+
*/
|
|
1641
|
+
createEnvironment: (environment: EnvironmentResolvedConfig<TResolvedConfig>["environment"]) => Promise<EnvironmentContext<TResolvedConfig, TSystemContext>>;
|
|
1642
|
+
/**
|
|
1643
|
+
* A function to merge all configured environments into a single context
|
|
1644
|
+
*
|
|
1645
|
+
* @returns A promise that resolves to the merged environment context.
|
|
1646
|
+
*/
|
|
1647
|
+
toEnvironment: () => Promise<EnvironmentContext<TResolvedConfig, TSystemContext>>;
|
|
1648
|
+
/**
|
|
1649
|
+
* A function used internally to add a plugin to the context and update the configuration options
|
|
1650
|
+
*
|
|
1651
|
+
* @danger
|
|
1652
|
+
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
1653
|
+
*
|
|
1654
|
+
* @internal
|
|
1655
|
+
*/
|
|
1656
|
+
unstable_addPlugin: (plugin: PluginConfig<PluginContext<TResolvedConfig, TSystemContext>>) => Promise<void>;
|
|
1657
|
+
}
|
|
1658
|
+
interface EnvironmentPlugin<TResolvedConfig extends ResolvedConfig$1 = ResolvedConfig$1, TSystemContext = any> extends Plugin<PluginContext<TResolvedConfig, TSystemContext>> {
|
|
1659
|
+
/**
|
|
1660
|
+
* A internal field to store the plugin configuration and context for the environment context
|
|
1661
|
+
*
|
|
1662
|
+
* @danger
|
|
1663
|
+
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
1664
|
+
*
|
|
1665
|
+
* @internal
|
|
1666
|
+
*/
|
|
1667
|
+
"~internal": {
|
|
1668
|
+
/**
|
|
1669
|
+
* The unique identifier of the plugin, which can be used for logging and other purposes to distinguish between different plugins in the same process.
|
|
1670
|
+
*/
|
|
1671
|
+
readonly id: string;
|
|
1672
|
+
/**
|
|
1673
|
+
* The context for the plugin, which provides access to the Powerlines engine and other utilities for interacting with the build process.
|
|
1674
|
+
*
|
|
1675
|
+
* @remarks
|
|
1676
|
+
* This context is specific to the plugin and environment, allowing for environment-specific modifications without affecting the global context.
|
|
1677
|
+
*/
|
|
1678
|
+
readonly context: PluginContext<TResolvedConfig, TSystemContext>;
|
|
1679
|
+
};
|
|
1680
|
+
}
|
|
1681
|
+
type SelectHookResultItem<TContext extends PluginContext, TKey extends string> = HooksListItem<TContext, TKey> & {
|
|
1682
|
+
context: TContext;
|
|
1683
|
+
};
|
|
1684
|
+
type SelectHookResult<TContext extends PluginContext, TKey extends string> = SelectHookResultItem<TContext, TKey>[];
|
|
1685
|
+
interface EnvironmentContext<TResolvedConfig extends ResolvedConfig$1 = ResolvedConfig$1, TSystemContext = any> extends Context<EnvironmentResolvedConfig<TResolvedConfig>, TSystemContext> {
|
|
1686
|
+
/**
|
|
1687
|
+
* The unique identifier of the environment associated with this context, which can be used for logging and other purposes to distinguish between different environments in the same process.
|
|
1688
|
+
*/
|
|
1689
|
+
readonly id: string;
|
|
1690
|
+
/**
|
|
1691
|
+
* The expected plugins options for the Powerlines project.
|
|
1692
|
+
*
|
|
1693
|
+
* @remarks
|
|
1694
|
+
* This is a record of plugin identifiers to their respective options. This field is populated by the Powerlines engine during both plugin initialization and the `init` command.
|
|
1695
|
+
*/
|
|
1696
|
+
plugins: EnvironmentPlugin<TResolvedConfig, TSystemContext>[];
|
|
1697
|
+
/**
|
|
1698
|
+
* A table holding references to hook functions registered by plugins
|
|
1699
|
+
*/
|
|
1700
|
+
hooks: HooksList<PluginContext<TResolvedConfig, TSystemContext>>;
|
|
1701
|
+
/**
|
|
1702
|
+
* The execution context associated with this environment, which provides access to the project configuration, environment, and utility functions for performing the build. The execution context is used to manage the state and behavior of the build process across multiple environments, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.
|
|
1703
|
+
*
|
|
1704
|
+
* @danger
|
|
1705
|
+
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
1706
|
+
*
|
|
1707
|
+
* @internal
|
|
1708
|
+
*/
|
|
1709
|
+
unstable_execution: ExecutionContext<TResolvedConfig, TSystemContext>;
|
|
1710
|
+
/**
|
|
1711
|
+
* Retrieves the hook handlers for a specific hook name
|
|
1712
|
+
*/
|
|
1713
|
+
selectHooks: <TKey extends string>(key: TKey, options?: SelectHooksOptions) => SelectHookResult<PluginContext<TResolvedConfig, TSystemContext>, TKey>;
|
|
1714
|
+
/**
|
|
1715
|
+
* A function used internally to add a plugin to the context and update the configuration options
|
|
1716
|
+
*
|
|
1717
|
+
* @danger
|
|
1718
|
+
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
1719
|
+
*
|
|
1720
|
+
* @internal
|
|
1721
|
+
*/
|
|
1722
|
+
unstable_addPlugin: (plugin: PluginConfig<PluginContext<TResolvedConfig, TSystemContext>>) => Promise<void>;
|
|
1723
|
+
}
|
|
1724
|
+
interface PluginContext<out TResolvedConfig extends ResolvedConfig$1 = ResolvedConfig$1, TSystemContext = any> extends Context<EnvironmentResolvedConfig<TResolvedConfig>, TSystemContext> {
|
|
1725
|
+
/**
|
|
1726
|
+
* The unique identifier of the plugin associated with this context, which can be used for logging and other purposes to distinguish between different plugins in the same process.
|
|
1727
|
+
*/
|
|
1728
|
+
readonly id: string;
|
|
1729
|
+
/**
|
|
1730
|
+
* The context for the environment associated with this plugin context, which provides access to the Powerlines engine and other utilities for interacting with the build process. This context is specific to the plugin and environment, allowing for environment-specific modifications without affecting the global context.
|
|
1731
|
+
*/
|
|
1732
|
+
readonly environment: EnvironmentContext;
|
|
1733
|
+
}
|
|
1734
|
+
type BuildPluginContext<TResolvedConfig extends ResolvedConfig$1 = ResolvedConfig$1> = UnpluginBuildContext & PluginContext<TResolvedConfig>;
|
|
1735
|
+
type WithUnpluginBuildContext<TContext extends PluginContext> = UnpluginBuildContext & TContext;
|
|
1736
|
+
//#endregion
|
|
1737
|
+
//#region src/types/config.d.ts
|
|
1738
|
+
/**
|
|
1739
|
+
* The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
|
|
1740
|
+
*/
|
|
1741
|
+
type WorkspaceConfig = Partial<StormWorkspaceConfig> & Required<Pick<StormWorkspaceConfig, "workspaceRoot">>;
|
|
1742
|
+
type PluginFactory<in out TContext extends PluginContext = PluginContext, TOptions = any> = (options: TOptions) => MaybePromise<Plugin<TContext> | Plugin<TContext>[]>;
|
|
1743
|
+
/**
|
|
1744
|
+
* A configuration tuple for a Powerlines plugin.
|
|
1745
|
+
*/
|
|
1746
|
+
type PluginConfigTuple<TContext extends PluginContext = PluginContext, TOptions = any> = [string | PluginFactory<TContext, TOptions>, TOptions] | [Plugin<TContext>];
|
|
1747
|
+
/**
|
|
1748
|
+
* A configuration object for a Powerlines plugin.
|
|
1749
|
+
*/
|
|
1750
|
+
type PluginConfigObject<TContext extends PluginContext = PluginContext, TOptions = any> = {
|
|
1751
|
+
plugin: string | PluginFactory<TContext, TOptions>;
|
|
1752
|
+
options: TOptions;
|
|
1753
|
+
} | {
|
|
1754
|
+
plugin: Plugin<TContext>;
|
|
1755
|
+
options?: never;
|
|
1756
|
+
};
|
|
1757
|
+
/**
|
|
1758
|
+
* A configuration tuple for a Powerlines plugin.
|
|
1759
|
+
*/
|
|
1760
|
+
type PluginConfig<TContext extends PluginContext = PluginContext> = string | PluginFactory<TContext, void> | Plugin<TContext> | PluginConfigTuple<TContext> | PluginConfigObject<TContext> | Promise<PluginConfig<TContext>> | PluginConfig<TContext>[];
|
|
1761
|
+
type PartialPlugin<TContext extends PluginContext = PluginContext> = DeepPartial<Plugin<TContext>>;
|
|
1762
|
+
type PartialPluginFactory<in out TContext extends PluginContext = PluginContext, TOptions = any> = (options: TOptions) => MaybePromise<PartialPlugin<TContext> | PartialPlugin<TContext>[]>;
|
|
1763
|
+
type ProjectType = "application" | "library";
|
|
1764
|
+
type Mode = "development" | "test" | "production";
|
|
1765
|
+
/**
|
|
1766
|
+
* The configuration options for resolving modules in a Powerlines project.
|
|
1767
|
+
*/
|
|
1768
|
+
interface ResolveConfig {
|
|
1769
|
+
/**
|
|
1770
|
+
* List of fields in `package.json` to try when resolving a package's entry point. Note this takes lower precedence than conditional exports resolved from the exports field: if an entry point is successfully resolved from exports, the main field will be ignored.
|
|
1771
|
+
*
|
|
1772
|
+
* @defaultValue `["browser", "module", "jsnext:main", "jsnext"]`
|
|
1773
|
+
*
|
|
1774
|
+
* @see https://vite.dev/config/shared-options#resolve-mainfields
|
|
1775
|
+
*/
|
|
1776
|
+
mainFields?: string[];
|
|
1777
|
+
/**
|
|
1778
|
+
* Array of strings indicating what conditions should be allowed when resolving [conditional exports](https://nodejs.org/api/packages.html#packages_conditional_exports) from a package.
|
|
1779
|
+
*
|
|
1780
|
+
* @defaultValue `["import", "require", "default"]`
|
|
1781
|
+
*
|
|
1782
|
+
* @see https://vite.dev/config/shared-options#resolve-conditions
|
|
1783
|
+
*/
|
|
1784
|
+
conditions?: string[];
|
|
1785
|
+
/**
|
|
1786
|
+
* List of file extensions to try for imports that omit extensions. Note it is NOT recommended to omit extensions for custom import types (e.g. .vue) since it can interfere with IDE and type support.
|
|
1787
|
+
*
|
|
1788
|
+
* @defaultValue `[".mjs", ".js", ".mts", ".ts", ".jsx", ".tsx", ".json"]`
|
|
1789
|
+
*
|
|
1790
|
+
* @see https://vite.dev/config/shared-options#resolve-extensions
|
|
1791
|
+
*/
|
|
1792
|
+
extensions?: string[];
|
|
1793
|
+
/**
|
|
1794
|
+
* Array of strings indicating what modules should be deduplicated to a single version in the build.
|
|
1795
|
+
*
|
|
1796
|
+
* @remarks
|
|
1797
|
+
* This option is useful for ensuring that only one version of a module is included in the bundle, which can help reduce bundle size and avoid conflicts. If you have duplicated copies of the same dependency in your app (likely due to hoisting or linked packages in monorepos), use this option to force Powerlines to always resolve listed dependencies to the same copy (from project root).
|
|
1798
|
+
*
|
|
1799
|
+
* @see https://vite.dev/config/shared-options#resolve-dedupe
|
|
1800
|
+
*/
|
|
1801
|
+
dedupe?: string[];
|
|
1802
|
+
/**
|
|
1803
|
+
* The alias mappings to use for module resolution during the build process.
|
|
1804
|
+
*
|
|
1805
|
+
* @remarks
|
|
1806
|
+
* This option allows you to define custom path aliases for modules, which can be useful for simplifying imports and managing dependencies.
|
|
1807
|
+
*
|
|
1808
|
+
* @example
|
|
1809
|
+
* ```ts
|
|
1810
|
+
* {
|
|
1811
|
+
* alias: {
|
|
1812
|
+
* "@utils": "./src/utils",
|
|
1813
|
+
* "@components": "./src/components"
|
|
1814
|
+
* }
|
|
1815
|
+
* }
|
|
1816
|
+
* ```
|
|
1817
|
+
*
|
|
1818
|
+
* @see https://vite.dev/config/shared-options#resolve-alias
|
|
1819
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/alias
|
|
1820
|
+
*/
|
|
1821
|
+
alias?: Record<string, string> | Array<{
|
|
1822
|
+
find: string | RegExp;
|
|
1823
|
+
replacement: string;
|
|
1824
|
+
}>;
|
|
1825
|
+
/**
|
|
1826
|
+
* Enabling this setting causes Powerlines to determine file identity by the original file path (i.e. the path without following symlinks) instead of the real file path (i.e. the path after following symlinks).
|
|
1827
|
+
*
|
|
1828
|
+
* @defaultValue false
|
|
1829
|
+
*
|
|
1830
|
+
* @see https://esbuild.github.io/api/#preserve-symlinks
|
|
1831
|
+
* @see https://rollupjs.org/configuration-options/#preservesymlinks
|
|
1832
|
+
* @see https://webpack.js.org/configuration/resolve/#resolvesymlinks
|
|
1833
|
+
* @see https://rolldown.rs/reference/InputOptions.resolve#symlinks
|
|
1834
|
+
* @see https://vite.dev/config/shared-options#resolve-preservesymlinks
|
|
1835
|
+
*/
|
|
1836
|
+
preserveSymlinks?: boolean;
|
|
1837
|
+
/**
|
|
1838
|
+
* A list of modules that should not be bundled, even if they are external dependencies.
|
|
1839
|
+
*
|
|
1840
|
+
* @remarks
|
|
1841
|
+
* This option is useful for excluding specific modules from the bundle, such as Node.js built-in modules or other libraries that should not be bundled.
|
|
1842
|
+
*/
|
|
1843
|
+
external?: (string | RegExp)[];
|
|
1844
|
+
/**
|
|
1845
|
+
* A list of modules that should always be bundled, even if they are external dependencies.
|
|
1846
|
+
*/
|
|
1847
|
+
noExternal?: (string | RegExp)[];
|
|
1848
|
+
/**
|
|
1849
|
+
* Should the Powerlines CLI processes skip bundling the `node_modules` directory?
|
|
1850
|
+
*/
|
|
1851
|
+
skipNodeModulesBundle?: boolean;
|
|
1852
|
+
}
|
|
1853
|
+
interface CopyConfig {
|
|
1854
|
+
/**
|
|
1855
|
+
* An optional path to a secondary/copied output directory for collecting distributable files prior to publishing/deployment.
|
|
1856
|
+
*
|
|
1857
|
+
* @remarks
|
|
1858
|
+
* This option is useful when a separate directory is needed for collecting distributable files that are copied from the project, such as static assets or other non-code files. When using [Nx monorepo tools](https://nx.dev/), it is common for the {@link OutputConfig.path | project's output} to be copied to the `{workspaceRoot}/dist/{root}` directory, so that all of the monorepo's output is consolidated in a single location.
|
|
1859
|
+
*/
|
|
1860
|
+
path: string;
|
|
1861
|
+
/**
|
|
1862
|
+
* A list of assets to copy to the output directory
|
|
1863
|
+
*
|
|
1864
|
+
* @remarks
|
|
1865
|
+
* The assets can be specified as a string (path to the asset) or as an object with a `glob` property (to match multiple files). The paths are relative to the project root directory.
|
|
1866
|
+
*/
|
|
1867
|
+
assets?: Array<string | AssetGlob>;
|
|
1868
|
+
}
|
|
1869
|
+
interface OutputConfig {
|
|
1870
|
+
/**
|
|
1871
|
+
* The output directory path for the project build.
|
|
1872
|
+
*
|
|
1873
|
+
* @remarks
|
|
1874
|
+
* If a value is not provided, Powerlines will attempt to:
|
|
1875
|
+
* 1. Use the `outDir` value in the `tsconfig.json` file.
|
|
1876
|
+
* 2. Use the `dist` directory in the project root directory.
|
|
1877
|
+
*
|
|
1878
|
+
* @defaultValue "\{root\}/dist"
|
|
1879
|
+
*/
|
|
1880
|
+
path?: string;
|
|
1881
|
+
/**
|
|
1882
|
+
* Configuration that specifies a secondary/copied output directory for potentially collecting distributable files prior to publishing/deployment.
|
|
1883
|
+
*
|
|
1884
|
+
* @remarks
|
|
1885
|
+
* These options are useful when a separate directory is needed for collecting distributable files that are copied from the project, such as static assets or other non-code files. When using [Nx monorepo tools](https://nx.dev/), it is common for the {@link OutputConfig.path | project's output} to be copied to the `{workspaceRoot}/dist/{root}` directory, so that all of the monorepo's output is consolidated in a single location.
|
|
1886
|
+
*/
|
|
1887
|
+
copy?: CopyConfig | false;
|
|
1888
|
+
/**
|
|
1889
|
+
* The folder where the generated runtime artifacts will be located
|
|
1890
|
+
*
|
|
1891
|
+
* @remarks
|
|
1892
|
+
* This folder will contain all runtime artifacts and builtins generated during the "prepare" phase.
|
|
1893
|
+
*
|
|
1894
|
+
* @defaultValue "\{root\}/.powerlines"
|
|
1895
|
+
*/
|
|
1896
|
+
artifactsPath?: string;
|
|
1897
|
+
/**
|
|
1898
|
+
* Should typescript declaration modules be generated during the build for the project?
|
|
1899
|
+
*/
|
|
1900
|
+
dts?: boolean;
|
|
1901
|
+
/**
|
|
1902
|
+
* The path of the generated runtime types declaration file relative to the workspace root.
|
|
1903
|
+
*
|
|
1904
|
+
* @remarks
|
|
1905
|
+
* This value will be set to `true` automatically when {@link OutputConfig.dts | dts} is set to `true`.
|
|
1906
|
+
*
|
|
1907
|
+
* @defaultValue "\{root\}/powerlines.d.ts"
|
|
1908
|
+
*/
|
|
1909
|
+
types?: string | false;
|
|
1910
|
+
/**
|
|
1911
|
+
* The module format of the output files
|
|
1912
|
+
*
|
|
1913
|
+
* @remarks
|
|
1914
|
+
* This option can be a single format or an array of formats. If an array is provided, multiple builds will be generated for each format.
|
|
1915
|
+
*
|
|
1916
|
+
* @defaultValue "esm"
|
|
1917
|
+
*/
|
|
1918
|
+
format?: Format | Format[];
|
|
1919
|
+
/**
|
|
1920
|
+
* Generate source maps for the output files
|
|
1921
|
+
*
|
|
1922
|
+
* @remarks
|
|
1923
|
+
* This option can be a boolean or a string specifying the type of source map to generate. If set to `true`, external source maps will be generated. If set to `"inline"`, source maps will be included in the output files as data URIs. If set to `"hidden"`, external source maps will be generated but not referenced in the output files.
|
|
1924
|
+
*/
|
|
1925
|
+
sourceMap?: boolean | "inline" | "hidden";
|
|
1926
|
+
/**
|
|
1927
|
+
* Minify the output files
|
|
1928
|
+
*
|
|
1929
|
+
* @remarks
|
|
1930
|
+
* This option can be a boolean or a string specifying the type of minification to apply. If set to `true`, the output files will be minified. If set to `"terser"`, the Terser minifier will be used. If set to `"esbuild"`, the esbuild minifier will be used.
|
|
1931
|
+
*
|
|
1932
|
+
* @defaultValue false
|
|
1933
|
+
*/
|
|
1934
|
+
minify?: boolean;
|
|
1935
|
+
/**
|
|
1936
|
+
* Control whether built-in Node.js module imports use the `node:` protocol.
|
|
1937
|
+
*
|
|
1938
|
+
* @remarks
|
|
1939
|
+
* If no option is provided, built-in module imports are not transformed. The following options are available for this setting:
|
|
1940
|
+
* - `true`: Add the node: prefix to built-in module imports.
|
|
1941
|
+
* - `"strip"`: Remove the node: prefix from built-in module imports.
|
|
1942
|
+
*
|
|
1943
|
+
* @see https://tsdown.dev/reference/api/Interface.InlineConfig#nodeprotocol
|
|
1944
|
+
* @see https://nodejs.org/api/esm.html#node-imports
|
|
1945
|
+
*/
|
|
1946
|
+
nodeProtocol?: "strip" | true;
|
|
1947
|
+
/**
|
|
1948
|
+
* Whether to overwrite previously generated files in the artifacts directory during the build process.
|
|
1949
|
+
*
|
|
1950
|
+
* @remarks
|
|
1951
|
+
* When set to `true`, Powerlines will overwrite any existing files in the artifacts directory with the newly generated files during the build process. When set to `false`, Powerlines will skip generating files that already exist in the artifacts directory, which can help speed up the build process by avoiding unnecessary file writes. This option is only relevant when the {@link OutputConfig.storage | storage option} is configured to use an adapter that writes files to the local file system. If using a `virtual` storage adapter, this option has no effect.
|
|
1952
|
+
*
|
|
1953
|
+
* @defaultValue true
|
|
1954
|
+
*/
|
|
1955
|
+
overwrite?: boolean;
|
|
1956
|
+
/**
|
|
1957
|
+
* A string preset or a custom {@link StoragePort} to provide fine-grained control over generated/output file storage.
|
|
1958
|
+
*
|
|
1959
|
+
* @remarks
|
|
1960
|
+
* If a string preset is provided, it must be one of the following values:
|
|
1961
|
+
* - `"fs"`: Uses the local file system for storage.
|
|
1962
|
+
* - `"virtual"`: Uses an in-memory virtual file system for storage.
|
|
1963
|
+
*
|
|
1964
|
+
* If a custom {@link StoragePort} is provided, it will be used for all file storage operations during the build process.
|
|
1965
|
+
*
|
|
1966
|
+
* @defaultValue "virtual"
|
|
1967
|
+
*/
|
|
1968
|
+
storage?: StoragePort | StoragePreset;
|
|
1969
|
+
}
|
|
1970
|
+
interface FrameworkOptions {
|
|
1971
|
+
/**
|
|
1972
|
+
* The name of the framework
|
|
1973
|
+
*
|
|
1974
|
+
* @remarks
|
|
1975
|
+
* This value is used to identify the framework in logs, error messages, and other places where the framework's name is needed.
|
|
1976
|
+
*
|
|
1977
|
+
* @defaultValue "powerlines"
|
|
1978
|
+
*/
|
|
1979
|
+
name: string;
|
|
1980
|
+
/**
|
|
1981
|
+
* The version of the framework
|
|
1982
|
+
*
|
|
1983
|
+
* @remarks
|
|
1984
|
+
* This value is used to identify the version of the framework in logs, error messages, and other places where the framework's version is needed.
|
|
1985
|
+
*
|
|
1986
|
+
* @defaultValue "0.0.1"
|
|
1987
|
+
*/
|
|
1988
|
+
version?: string;
|
|
1989
|
+
/**
|
|
1990
|
+
* The organization or author of the framework
|
|
1991
|
+
*
|
|
1992
|
+
* @defaultValue "storm-software"
|
|
1993
|
+
*/
|
|
1994
|
+
orgId: string;
|
|
1995
|
+
}
|
|
1996
|
+
interface Options {
|
|
1997
|
+
/**
|
|
1998
|
+
* The current working directory the Powerlines processes should operate in
|
|
1999
|
+
*
|
|
2000
|
+
* @remarks
|
|
2001
|
+
* If not provided, the {@link WorkspaceConfig.workspaceRoot | workspace root} will be used as the current working directory. If the workspace root cannot be determined, the process's current working directory will be used.
|
|
2002
|
+
*/
|
|
2003
|
+
cwd?: string;
|
|
2004
|
+
/**
|
|
2005
|
+
* The log level label indicating the severity of the log message, or a more detailed log level configuration object that allows for specifying different log levels for different categories of logs.
|
|
2006
|
+
*
|
|
2007
|
+
* @remarks
|
|
2008
|
+
* The log level determines the minimum severity of messages that will be logged. For example, if the log level is set to `LogLevel.INFO`, then messages with a severity of `INFO`, `WARN`, and `ERROR` will be logged, while messages with a severity of `DEBUG` and `TRACE` will be ignored. Setting the log level to `LogLevel.SILENT` will disable all logging. Alternatively, you can provide a more detailed configuration object that allows you to specify different log levels for different categories of logs, providing granular control over the logging behavior for different aspects of the system.
|
|
2009
|
+
*
|
|
2010
|
+
* @defaultValue "info"
|
|
2011
|
+
*/
|
|
2012
|
+
logLevel?: LogLevelUserConfig;
|
|
2013
|
+
/**
|
|
2014
|
+
* Details about the framework being used in the current execution, which can be used by plugins and other parts of the system to customize behavior based on the framework.
|
|
2015
|
+
*/
|
|
2016
|
+
framework?: FrameworkOptions;
|
|
2017
|
+
}
|
|
2018
|
+
interface BaseExecutionOptions extends RequiredKeys<Options, "cwd"> {
|
|
2019
|
+
/**
|
|
2020
|
+
* The root directory of the project
|
|
2021
|
+
*/
|
|
2022
|
+
root: string;
|
|
2023
|
+
}
|
|
2024
|
+
interface ExecutionOptions extends BaseExecutionOptions {
|
|
2025
|
+
/**
|
|
2026
|
+
* A unique identifier for the current execution instance, which can be used for logging and other purposes to distinguish between different executions in the same process.
|
|
2027
|
+
*/
|
|
2028
|
+
executionId?: string;
|
|
2029
|
+
/**
|
|
2030
|
+
* The index of the current execution instance among all configured instances in the Powerlines process
|
|
2031
|
+
*/
|
|
2032
|
+
configIndex?: number;
|
|
2033
|
+
/**
|
|
2034
|
+
* A path to a custom configuration file to be used instead of the default `powerlines.json`, `powerlines.config.js`, or `powerlines.config.ts` files.
|
|
2035
|
+
*
|
|
2036
|
+
* @remarks
|
|
2037
|
+
* This option is useful for running Powerlines commands with different configuration files, such as in CI/CD environments or when testing different configurations.
|
|
2038
|
+
*/
|
|
2039
|
+
configFile: string;
|
|
2040
|
+
/**
|
|
2041
|
+
* A logging function provided by the code invoking the Powerlines execution process, which can be used for logging messages during the build process instead of the default Powerlines logger.
|
|
2042
|
+
*
|
|
2043
|
+
* @remarks
|
|
2044
|
+
* Providing a custom logging function allows you to integrate Powerlines logging with your own logging system or to customize the logging behavior, such as formatting log messages differently or sending logs to an external service. If a custom logging function is not provided, Powerlines will use its default logger implementation.
|
|
2045
|
+
*
|
|
2046
|
+
* @important
|
|
2047
|
+
* This function cannot be provided by the Powerlines engine, as it is not serializable. It must be passed directly to the execution context when creating it, and will not be preserved if the context is cloned or serialized.
|
|
2048
|
+
*/
|
|
2049
|
+
logFn?: LogFn;
|
|
2050
|
+
}
|
|
2051
|
+
interface Config {
|
|
2052
|
+
/**
|
|
2053
|
+
* Defines entries and location(s) of entry modules for the bundle. Relative paths are resolved based on the `root` option.
|
|
2054
|
+
*/
|
|
2055
|
+
input?: FileReferenceInput | FileReferenceInput[] | Record<string, FileReferenceInput | FileReferenceInput[]>;
|
|
2056
|
+
/**
|
|
2057
|
+
* Configuration for the output files generated by processing the source code
|
|
2058
|
+
*/
|
|
2059
|
+
output?: OutputConfig;
|
|
2060
|
+
/**
|
|
2061
|
+
* The date to use for compatibility checks
|
|
2062
|
+
*
|
|
2063
|
+
* @remarks
|
|
2064
|
+
* This date can be used by plugins and build processes to determine compatibility with certain features or APIs. It is recommended to set this date to the date when the project was last known to be compatible with the desired features or APIs. If no value is provided, the latest compatibility date will be used.
|
|
2065
|
+
*
|
|
2066
|
+
* @see https://developers.cloudflare.com/pages/platform/compatibility-dates/
|
|
2067
|
+
* @see https://docs.netlify.com/configure-builds/get-started/#set-a-compatibility-date
|
|
2068
|
+
* @see https://github.com/unjs/compatx
|
|
2069
|
+
*/
|
|
2070
|
+
compatibilityDate?: CompatibilityDateSpec;
|
|
2071
|
+
/**
|
|
2072
|
+
* The log level label indicating the severity of the log message, or a more detailed log level configuration object that allows for specifying different log levels for different categories of logs.
|
|
2073
|
+
*
|
|
2074
|
+
* @remarks
|
|
2075
|
+
* The log level determines the minimum severity of messages that will be logged. For example, if the log level is set to `LogLevel.INFO`, then messages with a severity of `INFO`, `WARN`, and `ERROR` will be logged, while messages with a severity of `DEBUG` and `TRACE` will be ignored. Setting the log level to `LogLevel.SILENT` will disable all logging. Alternatively, you can provide a more detailed configuration object that allows you to specify different log levels for different categories of logs, providing granular control over the logging behavior for different aspects of the system.
|
|
2076
|
+
*
|
|
2077
|
+
* @defaultValue "info"
|
|
2078
|
+
*/
|
|
2079
|
+
logLevel?: LogLevelUserConfig;
|
|
2080
|
+
/**
|
|
2081
|
+
* Configuration for module resolution during processing of the source code
|
|
2082
|
+
*/
|
|
2083
|
+
resolve?: ResolveConfig;
|
|
2084
|
+
/**
|
|
2085
|
+
* The platform to build the project for
|
|
2086
|
+
*
|
|
2087
|
+
* @defaultValue "neutral"
|
|
2088
|
+
*/
|
|
2089
|
+
platform?: "node" | "browser" | "neutral";
|
|
2090
|
+
/**
|
|
2091
|
+
* Define global constant replacements. Entries will be defined as globals during dev and statically replaced during build.
|
|
2092
|
+
*
|
|
2093
|
+
* @remarks
|
|
2094
|
+
* This option allows you to specify global constants that will be replaced in the code during the build process. It is similar to the `define` option in esbuild and Vite, enabling you to replace specific identifiers with constant expressions at build time.
|
|
2095
|
+
*
|
|
2096
|
+
* @example
|
|
2097
|
+
* ```ts
|
|
2098
|
+
* {
|
|
2099
|
+
* define: {
|
|
2100
|
+
* __VERSION__: '"1.0.0"',
|
|
2101
|
+
* __DEV__: 'process.env.NODE_ENV !== "production"'
|
|
2102
|
+
* }
|
|
2103
|
+
* }
|
|
2104
|
+
* ```
|
|
2105
|
+
*
|
|
2106
|
+
* @see https://esbuild.github.io/api/#define
|
|
2107
|
+
* @see https://vitejs.dev/config/build-options.html#define
|
|
2108
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/replace
|
|
2109
|
+
*/
|
|
2110
|
+
define?: Record<string, any>;
|
|
2111
|
+
/**
|
|
2112
|
+
* Global variables that will have import statements injected where necessary
|
|
2113
|
+
*
|
|
2114
|
+
* @remarks
|
|
2115
|
+
* This option allows you to specify global variables that should be automatically imported from specified modules whenever they are used in the code. This is particularly useful for polyfilling Node.js globals in a browser environment.
|
|
2116
|
+
*
|
|
2117
|
+
* @example
|
|
2118
|
+
* ```ts
|
|
2119
|
+
* {
|
|
2120
|
+
* inject: {
|
|
2121
|
+
* process: 'process/browser',
|
|
2122
|
+
* Buffer: ['buffer', 'Buffer'],
|
|
2123
|
+
* }
|
|
2124
|
+
* }
|
|
2125
|
+
* ```
|
|
2126
|
+
*
|
|
2127
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/inject
|
|
2128
|
+
*/
|
|
2129
|
+
inject?: Record<string, string | string[]>;
|
|
2130
|
+
/**
|
|
2131
|
+
* The path to the tsconfig file to be used by the compiler
|
|
2132
|
+
*
|
|
2133
|
+
* @remarks
|
|
2134
|
+
* If a value is not provided, the plugin will attempt to find the `tsconfig.json` file in the project root directory. The parsed tsconfig compiler options will be merged with the {@link Options.tsconfigRaw} value (if provided).
|
|
2135
|
+
*
|
|
2136
|
+
* @defaultValue "\{projectRoot\}/tsconfig.json"
|
|
2137
|
+
*/
|
|
2138
|
+
tsconfig?: string;
|
|
2139
|
+
/**
|
|
2140
|
+
* The raw {@link TSConfig} object to be used by the compiler. This object will be merged with the `tsconfig.json` file.
|
|
2141
|
+
*
|
|
2142
|
+
* @see https://www.typescriptlang.org/tsconfig
|
|
2143
|
+
*
|
|
2144
|
+
* @remarks
|
|
2145
|
+
* If populated, this option takes higher priority than `tsconfig`
|
|
2146
|
+
*/
|
|
2147
|
+
tsconfigRaw?: TSConfig;
|
|
2148
|
+
}
|
|
2149
|
+
interface EnvironmentConfig extends Config {
|
|
2150
|
+
/**
|
|
2151
|
+
* Configuration options for the preview server
|
|
2152
|
+
*/
|
|
2153
|
+
preview?: PreviewOptions;
|
|
2154
|
+
/**
|
|
2155
|
+
* A flag indicating whether the build is for a Server-Side Rendering environment.
|
|
2156
|
+
*/
|
|
2157
|
+
ssr?: boolean;
|
|
2158
|
+
/**
|
|
2159
|
+
* The runtime environment for the build, which can be used by plugins to determine how to process the source code and generate runtime artifacts.
|
|
2160
|
+
*
|
|
2161
|
+
* @remarks
|
|
2162
|
+
* This option can be used to specify the target runtime environment for the build, such as "nodejs", "browser", "workerd", or "edge". Plugins can use this information to determine how to process the source code and generate runtime artifacts that are compatible with the specified environment. If no value is provided, plugins will need to determine the runtime environment based on other factors, such as the presence of certain dependencies or configuration options.
|
|
2163
|
+
*/
|
|
2164
|
+
runtime?: "nodejs" | "browser" | "workerd" | "edge";
|
|
2165
|
+
/**
|
|
2166
|
+
* Define if this environment is used for Server-Side Rendering
|
|
2167
|
+
*
|
|
2168
|
+
* @defaultValue "server" (if it isn't the client environment)
|
|
2169
|
+
*/
|
|
2170
|
+
consumer?: "client" | "server";
|
|
2171
|
+
}
|
|
2172
|
+
interface UserConfig extends Config {
|
|
2173
|
+
/**
|
|
2174
|
+
* The name of the project
|
|
2175
|
+
*/
|
|
2176
|
+
name?: string;
|
|
2177
|
+
/**
|
|
2178
|
+
* The project display title
|
|
2179
|
+
*
|
|
2180
|
+
* @remarks
|
|
2181
|
+
* This option is used in documentation generation and other places where a human-readable title is needed.
|
|
2182
|
+
*/
|
|
2183
|
+
title?: string;
|
|
2184
|
+
/**
|
|
2185
|
+
* A description of the project
|
|
2186
|
+
*
|
|
2187
|
+
* @remarks
|
|
2188
|
+
* If this option is not provided, the build process will try to use the \`description\` value from the `\package.json\` file.
|
|
2189
|
+
*/
|
|
2190
|
+
description?: string;
|
|
2191
|
+
/**
|
|
2192
|
+
* The organization or author of the project
|
|
2193
|
+
*
|
|
2194
|
+
* @remarks
|
|
2195
|
+
* If this option is not provided, the build process will try to use the \`author\` value from the \`package.json\` file. If the \`author\` value cannot be determined, the {@link name | name configuration} will be used.
|
|
2196
|
+
*/
|
|
2197
|
+
organization?: string;
|
|
2198
|
+
/**
|
|
2199
|
+
* Explicitly set a mode to run in. This mode will be used at various points throughout the Powerlines processes, such as when compiling the source code.
|
|
2200
|
+
*
|
|
2201
|
+
* @defaultValue "production"
|
|
2202
|
+
*/
|
|
2203
|
+
mode?: Mode;
|
|
2204
|
+
/**
|
|
2205
|
+
* The type of project being built
|
|
2206
|
+
*
|
|
2207
|
+
* @defaultValue "application"
|
|
2208
|
+
*/
|
|
2209
|
+
projectType?: ProjectType;
|
|
2210
|
+
/**
|
|
2211
|
+
* Should the Powerlines processes automatically install missing package dependencies?
|
|
2212
|
+
*
|
|
2213
|
+
* @remarks
|
|
2214
|
+
* When set to `true`, Powerlines will attempt to install any missing dependencies using the package manager detected in the project (e.g., npm, yarn, pnpm). This can be useful for ensuring that all required packages are available during the build and preparation phases.
|
|
2215
|
+
*
|
|
2216
|
+
* @defaultValue false
|
|
2217
|
+
*/
|
|
2218
|
+
autoInstall?: boolean;
|
|
2219
|
+
/**
|
|
2220
|
+
* Should the compiler processes skip any improvements that make use of cache?
|
|
2221
|
+
*
|
|
2222
|
+
* @defaultValue false
|
|
2223
|
+
*/
|
|
2224
|
+
skipCache?: boolean;
|
|
2225
|
+
/**
|
|
2226
|
+
* A list of resolvable paths to plugins used during the build process
|
|
2227
|
+
*/
|
|
2228
|
+
plugins?: PluginConfig<any>[];
|
|
2229
|
+
/**
|
|
2230
|
+
* Environment-specific configurations
|
|
2231
|
+
*/
|
|
2232
|
+
environments?: Record<string, EnvironmentConfig>;
|
|
2233
|
+
/**
|
|
2234
|
+
* Should a single `build` process be ran for each environment?
|
|
2235
|
+
*
|
|
2236
|
+
* @remarks
|
|
2237
|
+
* This option determines how environments are managed during the `build` process. The available options are:
|
|
2238
|
+
*
|
|
2239
|
+
* - `false`: A separate build is ran for each environment.
|
|
2240
|
+
* - `true`: A single build is ran for all environments.
|
|
2241
|
+
*
|
|
2242
|
+
* @defaultValue false
|
|
2243
|
+
*/
|
|
2244
|
+
singleBuild?: boolean;
|
|
2245
|
+
}
|
|
2246
|
+
type ConfigParams = BaseExecutionOptions & Pick<Required<UserConfig>, "mode"> & {
|
|
2247
|
+
/**
|
|
2248
|
+
* A string identifier for the Powerlines command being executed
|
|
2249
|
+
*/
|
|
2250
|
+
command: string;
|
|
2251
|
+
};
|
|
2252
|
+
type UserConfigFnObject = (env: ConfigParams) => UserConfig | UserConfig[];
|
|
2253
|
+
type UserConfigFnPromise = (env: ConfigParams) => Promise<UserConfig | UserConfig[]>;
|
|
2254
|
+
type UserConfigFn = (env: ConfigParams) => UserConfig | UserConfig[] | Promise<UserConfig | UserConfig[]>;
|
|
2255
|
+
type UserConfigExport = UserConfig | UserConfig[] | Promise<UserConfig | UserConfig[]> | UserConfigFnObject | UserConfigFnPromise | UserConfigFn;
|
|
2256
|
+
type ParsedUserConfig = ResolvedConfig<UserConfig> & {
|
|
2257
|
+
/**
|
|
2258
|
+
* The path to the user configuration file, if it exists.
|
|
2259
|
+
*
|
|
2260
|
+
* @remarks
|
|
2261
|
+
* This is typically the `powerlines.json`, `powerlines.config.js`, or `powerlines.config.ts` file in the project root.
|
|
2262
|
+
*/
|
|
2263
|
+
configFile?: ConfigLayer<UserConfig>["configFile"];
|
|
2264
|
+
};
|
|
2265
|
+
type InlineConfigPaths = {
|
|
2266
|
+
/**
|
|
2267
|
+
* The root directory of the project
|
|
2268
|
+
*/
|
|
2269
|
+
root: string;
|
|
2270
|
+
/**
|
|
2271
|
+
* A path to a custom configuration file to be used instead of the default `powerlines.json`, `powerlines.config.js`, or `powerlines.config.ts` files.
|
|
2272
|
+
*
|
|
2273
|
+
* @remarks
|
|
2274
|
+
* This option is useful for running Powerlines commands with different configuration files, such as in CI/CD environments or when testing different configurations.
|
|
2275
|
+
*/
|
|
2276
|
+
configFile?: string;
|
|
2277
|
+
} | {
|
|
2278
|
+
/**
|
|
2279
|
+
* The root directory of the project
|
|
2280
|
+
*/
|
|
2281
|
+
root?: string;
|
|
2282
|
+
/**
|
|
2283
|
+
* A path to a custom configuration file to be used instead of the default `powerlines.json`, `powerlines.config.js`, or `powerlines.config.ts` files.
|
|
2284
|
+
*
|
|
2285
|
+
* @remarks
|
|
2286
|
+
* This option is useful for running Powerlines commands with different configuration files, such as in CI/CD environments or when testing different configurations.
|
|
2287
|
+
*/
|
|
2288
|
+
configFile?: string;
|
|
2289
|
+
};
|
|
2290
|
+
/**
|
|
2291
|
+
* The configuration provided while executing Powerlines commands.
|
|
2292
|
+
*/
|
|
2293
|
+
type InlineConfig<TUserConfig extends UserConfig = UserConfig> = DeepPartial<TUserConfig> & {
|
|
2294
|
+
/**
|
|
2295
|
+
* The root directory of the project
|
|
2296
|
+
*/
|
|
2297
|
+
root?: string;
|
|
2298
|
+
/**
|
|
2299
|
+
* A path to a custom configuration file to be used instead of the default `powerlines.json`, `powerlines.config.js`, or `powerlines.config.ts` files.
|
|
2300
|
+
*
|
|
2301
|
+
* @remarks
|
|
2302
|
+
* This option is useful for running Powerlines commands with different configuration files, such as in CI/CD environments or when testing different configurations.
|
|
2303
|
+
*/
|
|
2304
|
+
configFile?: string;
|
|
2305
|
+
/**
|
|
2306
|
+
* A string identifier for the Powerlines command being executed
|
|
2307
|
+
*/
|
|
2308
|
+
command: string;
|
|
2309
|
+
/**
|
|
2310
|
+
* Additional arguments provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed.
|
|
2311
|
+
*/
|
|
2312
|
+
additionalArgs?: Record<string, string | string[]>;
|
|
2313
|
+
/**
|
|
2314
|
+
* Details about the framework being used in the current execution, which can be used by plugins and other parts of the system to customize behavior based on the framework.
|
|
2315
|
+
*
|
|
2316
|
+
* @remarks
|
|
2317
|
+
* This should only be used by framework plugins to ensure the correct framework name is applied
|
|
2318
|
+
*
|
|
2319
|
+
* @internal
|
|
2320
|
+
*/
|
|
2321
|
+
framework?: FrameworkOptions;
|
|
2322
|
+
};
|
|
2323
|
+
type CreateInlineConfig<TUserConfig extends UserConfig = UserConfig> = RequiredKeys<InlineConfig<TUserConfig>, "root"> & {
|
|
2324
|
+
/**
|
|
2325
|
+
* The package name (from the \`package.json\`) for the project that will be used in the \`create\` command to create a new project based on this configuration
|
|
2326
|
+
*/
|
|
2327
|
+
packageName?: string;
|
|
2328
|
+
};
|
|
2329
|
+
type CleanInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineConfig<TUserConfig>;
|
|
2330
|
+
type PrepareInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineConfig<TUserConfig>;
|
|
2331
|
+
type TypesInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineConfig<TUserConfig>;
|
|
2332
|
+
type BuildInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineConfig<TUserConfig>;
|
|
2333
|
+
type LintInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineConfig<TUserConfig>;
|
|
2334
|
+
type TestInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineConfig<TUserConfig>;
|
|
2335
|
+
type DocsInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineConfig<TUserConfig>;
|
|
2336
|
+
type DeployInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineConfig<TUserConfig>;
|
|
2337
|
+
interface ResolvedEntryFileReference extends FileReference {
|
|
2338
|
+
/**
|
|
2339
|
+
* The user provided entry point in the source code
|
|
2340
|
+
*/
|
|
2341
|
+
input?: FileReference;
|
|
2342
|
+
/**
|
|
2343
|
+
* An optional name to use in the package export during the build process
|
|
2344
|
+
*/
|
|
2345
|
+
output?: string;
|
|
2346
|
+
}
|
|
2347
|
+
type ResolvedEnvironmentConfig = RequiredKeys<Omit<EnvironmentConfig, "preview">, "input" | "consumer" | "ssr"> & {
|
|
2348
|
+
/**
|
|
2349
|
+
* A string identifier for the environment used by the system and plugins to determine which environment-specific configuration to use during the build process.
|
|
2350
|
+
*/
|
|
2351
|
+
id: string;
|
|
2352
|
+
/**
|
|
2353
|
+
* The name of the environment provided by the user in the {@link UserConfig.environments | environments} configuration.
|
|
2354
|
+
*/
|
|
2355
|
+
name: string;
|
|
2356
|
+
/**
|
|
2357
|
+
* Configuration options for the preview server
|
|
2358
|
+
*/
|
|
2359
|
+
preview?: ResolvedPreviewOptions;
|
|
2360
|
+
};
|
|
2361
|
+
/**
|
|
2362
|
+
* The configuration options for resolving modules in a Powerlines project.
|
|
2363
|
+
*/
|
|
2364
|
+
type ResolvedResolveConfig = Required<Omit<ResolveConfig, "external" | "noExternal">> & {
|
|
2365
|
+
/**
|
|
2366
|
+
* A list of modules that should not be bundled, even if they are external dependencies.
|
|
2367
|
+
*
|
|
2368
|
+
* @remarks
|
|
2369
|
+
* This option is useful for excluding specific modules from the bundle, such as Node.js built-in modules or other libraries that should not be bundled.
|
|
2370
|
+
*/
|
|
2371
|
+
external?: string[];
|
|
2372
|
+
/**
|
|
2373
|
+
* A list of modules that should always be bundled, even if they are external dependencies.
|
|
2374
|
+
*/
|
|
2375
|
+
noExternal?: string[];
|
|
2376
|
+
};
|
|
2377
|
+
type ResolvedAssetGlob = AssetGlob & Required<Pick<AssetGlob, "input">>;
|
|
2378
|
+
type ResolvedCopyConfig = Required<Omit<CopyConfig, "assets">> & {
|
|
2379
|
+
assets: ResolvedAssetGlob[];
|
|
2380
|
+
};
|
|
2381
|
+
type ResolvedOutputConfig = Required<Omit<OutputConfig, "copy" | "storage">> & Pick<OutputConfig, "storage"> & {
|
|
2382
|
+
copy: ResolvedCopyConfig | false;
|
|
2383
|
+
};
|
|
2384
|
+
/**
|
|
2385
|
+
* The base resolved configuration options for a Powerlines project, after being processed and normalized by the configuration loading process.
|
|
2386
|
+
*/
|
|
2387
|
+
type ResolvedConfig$1<TUserConfig extends UserConfig = UserConfig, TExecutionOptions extends ExecutionOptions = ExecutionOptions> = Omit<TExecutionOptions, "logLevel"> & Omit<RequiredKeys<TUserConfig, "input" | "name" | "title" | "plugins" | "mode" | "input" | "tsconfig" | "platform" | "projectType">, "compatibilityDate" | "output" | "resolve" | "logLevel" | "environments"> & {
|
|
2388
|
+
/**
|
|
2389
|
+
* The configuration options read from a configuration file on disk, which may be used to resolve the final configuration for the context. This typically includes the user configuration options defined in the `powerlines.config.ts` file, as well as any inline configuration options provided during execution.
|
|
2390
|
+
*/
|
|
2391
|
+
readonly userConfig: DeepReadonly<TUserConfig>;
|
|
2392
|
+
/**
|
|
2393
|
+
* The configuration options provided by plugins added by the user (and other plugins)
|
|
2394
|
+
*/
|
|
2395
|
+
readonly inlineConfig: DeepReadonly<InlineConfig<TUserConfig>>;
|
|
2396
|
+
/**
|
|
2397
|
+
* The configuration options that were provided by Powerlines plugins, which may have been merged with the user configuration and modified by the configuration loading process.
|
|
2398
|
+
*/
|
|
2399
|
+
readonly pluginConfig: DeepReadonly<DeepPartial<TUserConfig>>;
|
|
2400
|
+
/**
|
|
2401
|
+
* A string identifier for the Powerlines command being executed.
|
|
2402
|
+
*/
|
|
2403
|
+
readonly command: NonUndefined<InlineConfig<TUserConfig>["command"]>;
|
|
2404
|
+
/**
|
|
2405
|
+
* A path to a custom configuration file to be used instead of the default `powerlines.json`, `powerlines.config.js`, or `powerlines.config.ts` files.
|
|
2406
|
+
*
|
|
2407
|
+
* @remarks
|
|
2408
|
+
* This option is useful for running Powerlines commands with different configuration files, such as in CI/CD environments or when testing different configurations.
|
|
2409
|
+
*/
|
|
2410
|
+
readonly configFile: string;
|
|
2411
|
+
/**
|
|
2412
|
+
* The output configuration options to use for the build process
|
|
2413
|
+
*/
|
|
2414
|
+
output: ResolvedOutputConfig;
|
|
2415
|
+
/**
|
|
2416
|
+
* Configuration for module resolution during processing of the source code
|
|
2417
|
+
*/
|
|
2418
|
+
resolve: ResolvedResolveConfig;
|
|
2419
|
+
/**
|
|
2420
|
+
* The date to use for compatibility checks
|
|
2421
|
+
*
|
|
2422
|
+
* @remarks
|
|
2423
|
+
* This date can be used by plugins and build processes to determine compatibility with certain features or APIs. It is recommended to set this date to the date when the project was last known to be compatible with the desired features or APIs.
|
|
2424
|
+
*
|
|
2425
|
+
* @see https://developers.cloudflare.com/pages/platform/compatibility-dates/
|
|
2426
|
+
* @see https://docs.netlify.com/configure-builds/get-started/#set-a-compatibility-date
|
|
2427
|
+
* @see https://github.com/unjs/compatx
|
|
2428
|
+
*/
|
|
2429
|
+
compatibilityDate: CompatibilityDates;
|
|
2430
|
+
/**
|
|
2431
|
+
* The log level label indicating the severity of the log message, or a more detailed log level configuration object that allows for specifying different log levels for different categories of logs.
|
|
2432
|
+
*
|
|
2433
|
+
* @remarks
|
|
2434
|
+
* The log level determines the minimum severity of messages that will be logged. For example, if the log level is set to `LogLevel.INFO`, then messages with a severity of `INFO`, `WARN`, and `ERROR` will be logged, while messages with a severity of `DEBUG` and `TRACE` will be ignored. Setting the log level to `LogLevel.SILENT` will disable all logging. Alternatively, you can provide a more detailed configuration object that allows you to specify different log levels for different categories of logs, providing granular control over the logging behavior for different aspects of the system.
|
|
2435
|
+
*/
|
|
2436
|
+
logLevel: LogLevelResolvedConfig;
|
|
2437
|
+
/**
|
|
2438
|
+
* Environment-specific configurations
|
|
2439
|
+
*/
|
|
2440
|
+
environments: Record<string, ResolvedEnvironmentConfig>;
|
|
2441
|
+
};
|
|
2442
|
+
type InferOverridableConfig<TResolvedConfig extends ResolvedConfig$1 = ResolvedConfig$1> = DeepPartial<Omit<TResolvedConfig, "userConfig" | "inlineConfig" | "pluginConfig" | "cwd" | "configFile" | "command">>;
|
|
2443
|
+
/**
|
|
2444
|
+
* The resolved configuration options for a Powerlines environment, after being processed and normalized by the configuration loading process.
|
|
2445
|
+
*/
|
|
2446
|
+
type EnvironmentResolvedConfig<TResolvedConfig extends ResolvedConfig$1 = ResolvedConfig$1> = TResolvedConfig & {
|
|
2447
|
+
/**
|
|
2448
|
+
* The configuration provided when initializing the Powerlines API.
|
|
2449
|
+
*
|
|
2450
|
+
* @remarks
|
|
2451
|
+
* This configuration is used during the initialization of the Powerlines API.
|
|
2452
|
+
*/
|
|
2453
|
+
readonly environmentConfig: DeepReadonly<EnvironmentConfig>;
|
|
2454
|
+
/**
|
|
2455
|
+
* The resolved configuration options for the environment, which may include additional properties or modifications made during the configuration loading process.
|
|
2456
|
+
*/
|
|
2457
|
+
environment: ResolvedEnvironmentConfig;
|
|
2458
|
+
};
|
|
2459
|
+
//#endregion
|
|
2460
|
+
export { ExecutionContext as $, PluginHook as $t, ResolveConfig as A, LogLevelUserConfig as At, UserConfig as B, HooksList as Bt, PartialPluginFactory as C, VirtualFileSystemInterface as Cn, CustomLoggerMessage as Ct, PluginFactory as D, LogFnOptions as Dt, PluginConfigTuple as E, LogFnMeta as Et, ResolvedEnvironmentConfig as F, LoggerMeta as Ft, WorkspaceConfig as G, InferHookThisType as Gt, UserConfigFn as H, InferHookFunction as Ht, ResolvedOutputConfig as I, LoggerOptions as It, Context as J, TransformHookFilter as Jt, BaseContext as K, NormalizedStringFilter as Kt, ResolvedResolveConfig as L, PowerlinesMessage as Lt, ResolvedConfig$1 as M, LogMeta as Mt, ResolvedCopyConfig as N, Logger as Nt, PrepareInlineConfig as O, LogLevel as Ot, ResolvedEntryFileReference as P, LoggerMessage as Pt, EnvironmentPlugin as Q, Plugin as Qt, TestInlineConfig as R, CallHookOptions as Rt, PartialPlugin as S, VirtualFileMetadata as Sn, CustomLogger as St, PluginConfigObject as T, WriteOptions as Tn, LogFn as Tt, UserConfigFnObject as U, InferHookParameters as Ut, UserConfigExport as V, HooksListItem as Vt, UserConfigFnPromise as W, InferHookReturnType as Wt, EmitOptions as X, HookFunctions as Xt, EmitEntryOptions as Y, BasePlugin as Yt, EnvironmentContext as Z, Hooks as Zt, LintInlineConfig as _, StoragePort as _n, ParsedTypeScriptConfig as _t, ConfigParams as a, BuilderVariant as an, ResolveResult as at, OutputConfig as b, VirtualFileData as bn, TSCompilerOptions as bt, DeployInlineConfig as c, UnpluginOptions$1 as cn, SelectHookResultItem as ct, EnvironmentResolvedConfig as d, CommandType as dn, TransformResult$1 as dt, PluginHookFields as en, FetchOptions as et, ExecutionOptions as f, Commands as fn, UnimportContext as ft, InlineConfigPaths as g, StorageAdapter as gn, Level as gt, InlineConfig as h, ResolveOptions$1 as hn, DeepkitOptions as ht, Config as i, TypesResult as in, PluginContext as it, ResolvedAssetGlob as j, LogMessage as jt, ProjectType as k, LogLevelResolvedConfig as kt, DocsInlineConfig as l, BaseCommandType as ln, SelectHooksOptions as lt, InferOverridableConfig as m, SupportedCommands as mn, WithUnpluginBuildContext as mt, BuildInlineConfig as n, PluginHooks as nn, MetaInfo as nt, CopyConfig as o, UnpluginBuilderVariant as on, Resolver as ot, FrameworkOptions as p, ExecutionApiMethods as pn, UnresolvedContext as pt, BuildPluginContext as q, PluginFilter as qt, CleanInlineConfig as r, PluginNonHookFields as rn, ParseOptions as rt, CreateInlineConfig as s, UnpluginHookFunctions as sn, SelectHookResult as st, BaseExecutionOptions as t, PluginHookObject as tn, InitContextOptions as tt, EnvironmentConfig as u, BaseExecutionApiMethods as un, SourceFile as ut, Mode as v, StoragePreset as vn, RawReflectionMode as vt, PluginConfig as w, WriteData as wn, LogCategory as wt, ParsedUserConfig as x, VirtualFileExtension as xn, TSConfig as xt, Options as y, VirtualFile as yn, ReflectionMode as yt, TypesInlineConfig as z, HookListOrders as zt };
|
|
2461
|
+
//# sourceMappingURL=config-BnV_o0Es.d.cts.map
|