@powerlines/core 0.48.31 → 0.48.33
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/{chunk-C_NdSu1c.cjs → _virtual/_rolldown/runtime.cjs} +1 -6
- package/dist/constants/api.d.cts +6 -2
- package/dist/constants/api.d.cts.map +1 -0
- package/dist/constants/api.d.mts +6 -2
- package/dist/constants/api.d.mts.map +1 -0
- package/dist/constants/commands.d.cts +5 -2
- package/dist/constants/commands.d.cts.map +1 -0
- package/dist/constants/commands.d.mts +5 -2
- package/dist/constants/commands.d.mts.map +1 -0
- package/dist/constants/devtools.d.cts +13 -2
- package/dist/constants/devtools.d.cts.map +1 -0
- package/dist/constants/devtools.d.mts +13 -2
- package/dist/constants/devtools.d.mts.map +1 -0
- package/dist/constants/environments.d.cts +10 -2
- package/dist/constants/environments.d.cts.map +1 -0
- package/dist/constants/environments.d.mts +10 -2
- package/dist/constants/environments.d.mts.map +1 -0
- package/dist/constants/extensions.d.cts +5 -2
- package/dist/constants/extensions.d.cts.map +1 -0
- package/dist/constants/extensions.d.mts +5 -2
- package/dist/constants/extensions.d.mts.map +1 -0
- package/dist/constants/fs.d.cts +7 -2
- package/dist/constants/fs.d.cts.map +1 -0
- package/dist/constants/fs.d.mts +7 -2
- package/dist/constants/fs.d.mts.map +1 -0
- package/dist/constants/hooks.d.cts +5 -2
- package/dist/constants/hooks.d.cts.map +1 -0
- package/dist/constants/hooks.d.mts +5 -2
- package/dist/constants/hooks.d.mts.map +1 -0
- package/dist/constants/index.d.cts +10 -10
- package/dist/constants/index.d.mts +10 -10
- package/dist/constants/log-level.d.cts +67 -2
- package/dist/constants/log-level.d.cts.map +1 -0
- package/dist/constants/log-level.d.mts +67 -2
- package/dist/constants/log-level.d.mts.map +1 -0
- package/dist/constants/meta.d.cts +6 -2
- package/dist/constants/meta.d.cts.map +1 -0
- package/dist/constants/meta.d.mts +6 -2
- package/dist/constants/meta.d.mts.map +1 -0
- package/dist/constants/plugin.d.cts +9 -2
- package/dist/constants/plugin.d.cts.map +1 -0
- package/dist/constants/plugin.d.mts +9 -2
- package/dist/constants/plugin.d.mts.map +1 -0
- package/dist/context/base-context.cjs +2 -2
- package/dist/context/base-context.d.cts +81 -2
- package/dist/context/base-context.d.cts.map +1 -0
- package/dist/context/base-context.d.mts +81 -2
- package/dist/context/base-context.d.mts.map +1 -0
- package/dist/context/context.cjs +2 -2
- package/dist/context/context.d.cts +373 -2
- package/dist/context/context.d.cts.map +1 -0
- package/dist/context/context.d.mts +373 -2
- package/dist/context/context.d.mts.map +1 -0
- package/dist/context/environment-context.d.cts +5 -2
- package/dist/context/environment-context.d.cts.map +1 -1
- package/dist/context/environment-context.d.mts +5 -2
- package/dist/context/environment-context.d.mts.map +1 -1
- package/dist/context/execution-context.cjs +2 -2
- package/dist/context/execution-context.d.cts +6 -2
- package/dist/context/execution-context.d.cts.map +1 -1
- package/dist/context/execution-context.d.mts +6 -2
- package/dist/context/execution-context.d.mts.map +1 -1
- package/dist/context/index.d.cts +2 -2
- package/dist/context/index.d.mts +2 -2
- package/dist/context/plugin-context.d.cts +3 -1
- package/dist/context/plugin-context.d.cts.map +1 -1
- package/dist/context/plugin-context.d.mts +3 -1
- package/dist/context/plugin-context.d.mts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +32 -24
- package/dist/index.d.mts +32 -24
- package/dist/index.mjs +1 -1
- package/dist/lib/config.cjs +2 -2
- package/dist/lib/config.d.cts +140 -2
- package/dist/lib/config.d.cts.map +1 -0
- package/dist/lib/config.d.mts +140 -2
- package/dist/lib/config.d.mts.map +1 -0
- package/dist/lib/context-helpers.d.cts +16 -2
- package/dist/lib/context-helpers.d.cts.map +1 -0
- package/dist/lib/context-helpers.d.mts +16 -2
- package/dist/lib/context-helpers.d.mts.map +1 -0
- package/dist/lib/entry.d.cts +47 -2
- package/dist/lib/entry.d.cts.map +1 -0
- package/dist/lib/entry.d.mts +47 -2
- package/dist/lib/entry.d.mts.map +1 -0
- package/dist/lib/environment.cjs +2 -2
- package/dist/lib/environment.d.cts +2 -1
- package/dist/lib/environment.d.cts.map +1 -1
- package/dist/lib/environment.d.mts +2 -1
- package/dist/lib/environment.d.mts.map +1 -1
- package/dist/lib/events.d.cts +10 -2
- package/dist/lib/events.d.cts.map +1 -0
- package/dist/lib/events.d.mts +10 -2
- package/dist/lib/events.d.mts.map +1 -0
- package/dist/lib/generate-types.d.cts +66 -2
- package/dist/lib/generate-types.d.cts.map +1 -0
- package/dist/lib/generate-types.d.mts +66 -2
- package/dist/lib/generate-types.d.mts.map +1 -0
- package/dist/lib/hooks.cjs +2 -2
- package/dist/lib/hooks.d.cts +28 -2
- package/dist/lib/hooks.d.cts.map +1 -0
- package/dist/lib/hooks.d.mts +28 -2
- package/dist/lib/hooks.d.mts.map +1 -0
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.d.cts +23 -23
- package/dist/lib/index.d.mts +23 -23
- package/dist/lib/index.mjs +1 -1
- package/dist/lib/install-dependencies.d.cts +12 -2
- package/dist/lib/install-dependencies.d.cts.map +1 -0
- package/dist/lib/install-dependencies.d.mts +12 -2
- package/dist/lib/install-dependencies.d.mts.map +1 -0
- package/dist/lib/meta.d.cts +33 -2
- package/dist/lib/meta.d.cts.map +1 -0
- package/dist/lib/meta.d.mts +33 -2
- package/dist/lib/meta.d.mts.map +1 -0
- package/dist/lib/plugins.cjs +2 -2
- package/dist/lib/plugins.d.cts +39 -2
- package/dist/lib/plugins.d.cts.map +1 -0
- package/dist/lib/plugins.d.mts +39 -2
- package/dist/lib/plugins.d.mts.map +1 -0
- package/dist/lib/resolver.cjs +2 -2
- package/dist/lib/resolver.d.cts +20 -2
- package/dist/lib/resolver.d.cts.map +1 -0
- package/dist/lib/resolver.d.mts +20 -2
- package/dist/lib/resolver.d.mts.map +1 -0
- package/dist/lib/schemas.cjs +1 -1
- package/dist/lib/schemas.d.cts +1 -1
- package/dist/lib/schemas.d.mts +1 -1
- package/dist/lib/schemas.mjs +1 -1
- package/dist/lib/streaming-channel.d.cts +126 -2
- package/dist/lib/streaming-channel.d.cts.map +1 -0
- package/dist/lib/streaming-channel.d.mts +126 -2
- package/dist/lib/streaming-channel.d.mts.map +1 -0
- package/dist/lib/typescript/index.d.cts +2 -2
- package/dist/lib/typescript/index.d.mts +2 -2
- package/dist/lib/typescript/ts-morph.cjs +2 -2
- package/dist/lib/typescript/ts-morph.d.cts +38 -2
- package/dist/lib/typescript/ts-morph.d.cts.map +1 -0
- package/dist/lib/typescript/ts-morph.d.mts +38 -2
- package/dist/lib/typescript/ts-morph.d.mts.map +1 -0
- package/dist/lib/typescript/tsconfig.cjs +4 -4
- package/dist/lib/typescript/tsconfig.d.cts +77 -2
- package/dist/lib/typescript/tsconfig.d.cts.map +1 -0
- package/dist/lib/typescript/tsconfig.d.mts +77 -2
- package/dist/lib/typescript/tsconfig.d.mts.map +1 -0
- package/dist/lib/unplugin/helpers.d.cts +23 -2
- package/dist/lib/unplugin/helpers.d.cts.map +1 -0
- package/dist/lib/unplugin/helpers.d.mts +23 -2
- package/dist/lib/unplugin/helpers.d.mts.map +1 -0
- package/dist/lib/unplugin/index.d.cts +3 -3
- package/dist/lib/unplugin/index.d.mts +3 -3
- package/dist/lib/unplugin/module-resolution.cjs +2 -2
- package/dist/lib/unplugin/module-resolution.d.cts +41 -2
- package/dist/lib/unplugin/module-resolution.d.cts.map +1 -0
- package/dist/lib/unplugin/module-resolution.d.mts +41 -2
- package/dist/lib/unplugin/module-resolution.d.mts.map +1 -0
- package/dist/lib/unplugin/plugin.d.cts +40 -2
- package/dist/lib/unplugin/plugin.d.cts.map +1 -0
- package/dist/lib/unplugin/plugin.d.mts +40 -2
- package/dist/lib/unplugin/plugin.d.mts.map +1 -0
- package/dist/lib/utilities/file-header.d.cts +41 -2
- package/dist/lib/utilities/file-header.d.cts.map +1 -0
- package/dist/lib/utilities/file-header.d.mts +41 -2
- package/dist/lib/utilities/file-header.d.mts.map +1 -0
- package/dist/lib/utilities/format.cjs +2 -2
- package/dist/lib/utilities/format.d.cts +24 -2
- package/dist/lib/utilities/format.d.cts.map +1 -0
- package/dist/lib/utilities/format.d.mts +24 -2
- package/dist/lib/utilities/format.d.mts.map +1 -0
- package/dist/lib/utilities/index.d.cts +5 -5
- package/dist/lib/utilities/index.d.mts +5 -5
- package/dist/lib/utilities/source-file.cjs +2 -2
- package/dist/lib/utilities/source-file.d.cts +30 -2
- package/dist/lib/utilities/source-file.d.cts.map +1 -0
- package/dist/lib/utilities/source-file.d.mts +30 -2
- package/dist/lib/utilities/source-file.d.mts.map +1 -0
- package/dist/lib/utilities/source-map.cjs +2 -2
- package/dist/lib/utilities/source-map.d.cts +16 -2
- package/dist/lib/utilities/source-map.d.cts.map +1 -0
- package/dist/lib/utilities/source-map.d.mts +16 -2
- package/dist/lib/utilities/source-map.d.mts.map +1 -0
- package/dist/lib/utilities/write-file.d.cts +15 -2
- package/dist/lib/utilities/write-file.d.cts.map +1 -0
- package/dist/lib/utilities/write-file.d.mts +15 -2
- package/dist/lib/utilities/write-file.d.mts.map +1 -0
- package/dist/lib/vfs.cjs +3 -3
- package/dist/lib/vfs.d.cts +321 -2
- package/dist/lib/vfs.d.cts.map +1 -0
- package/dist/lib/vfs.d.mts +321 -2
- package/dist/lib/vfs.d.mts.map +1 -0
- package/dist/lib/vfs.mjs +1 -1
- package/dist/plugin-base.d.cts +3 -1
- package/dist/plugin-base.d.cts.map +1 -1
- package/dist/plugin-base.d.mts +3 -1
- package/dist/plugin-base.d.mts.map +1 -1
- package/dist/plugin-utils/build-helpers.d.cts +2 -1
- package/dist/plugin-utils/build-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/build-helpers.d.mts +2 -1
- package/dist/plugin-utils/build-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/combine-plugins.d.cts +1 -1
- package/dist/plugin-utils/combine-plugins.d.mts +1 -1
- package/dist/plugin-utils/context-helpers.d.cts +1 -1
- package/dist/plugin-utils/context-helpers.d.mts +1 -1
- package/dist/plugin-utils/enable-plugin.d.cts +2 -1
- package/dist/plugin-utils/enable-plugin.d.cts.map +1 -1
- package/dist/plugin-utils/enable-plugin.d.mts +2 -1
- package/dist/plugin-utils/enable-plugin.d.mts.map +1 -1
- package/dist/plugin-utils/extend.d.cts +3 -1
- package/dist/plugin-utils/extend.d.cts.map +1 -1
- package/dist/plugin-utils/extend.d.mts +3 -1
- package/dist/plugin-utils/extend.d.mts.map +1 -1
- package/dist/plugin-utils/filter.cjs +2 -2
- package/dist/plugin-utils/filter.d.cts +1 -1
- package/dist/plugin-utils/filter.d.mts +1 -1
- package/dist/plugin-utils/format-package-json.d.cts +1 -1
- package/dist/plugin-utils/format-package-json.d.mts +1 -1
- package/dist/plugin-utils/get-config-path.d.cts +1 -1
- package/dist/plugin-utils/get-config-path.d.mts +1 -1
- package/dist/plugin-utils/helpers.d.cts +5 -1
- package/dist/plugin-utils/helpers.d.cts.map +1 -1
- package/dist/plugin-utils/helpers.d.mts +5 -1
- package/dist/plugin-utils/helpers.d.mts.map +1 -1
- package/dist/plugin-utils/install.d.cts +1 -1
- package/dist/plugin-utils/install.d.mts +1 -1
- package/dist/plugin-utils/logging.cjs +2 -2
- package/dist/plugin-utils/logging.d.cts +3 -1
- package/dist/plugin-utils/logging.d.cts.map +1 -1
- package/dist/plugin-utils/logging.d.mts +3 -1
- package/dist/plugin-utils/logging.d.mts.map +1 -1
- package/dist/plugin-utils/merge.cjs +2 -2
- package/dist/plugin-utils/merge.d.cts +3 -1
- package/dist/plugin-utils/merge.d.cts.map +1 -1
- package/dist/plugin-utils/merge.d.mts +3 -1
- package/dist/plugin-utils/merge.d.mts.map +1 -1
- package/dist/plugin-utils/modules.d.cts +1 -1
- package/dist/plugin-utils/modules.d.mts +1 -1
- package/dist/plugin-utils/paths.d.cts +1 -1
- package/dist/plugin-utils/paths.d.mts +1 -1
- package/dist/{fs-C2lru696.cjs → schemas/fs.cjs} +8 -38
- package/dist/{schemas-Zvqwdrw_.d.mts → schemas/fs.d.cts} +2 -2
- package/dist/schemas/fs.d.cts.map +1 -0
- package/dist/{schemas-Zvqwdrw_.d.cts → schemas/fs.d.mts} +2 -2
- package/dist/schemas/fs.d.mts.map +1 -0
- package/dist/{fs-DqLn15uU.mjs → schemas/fs.mjs} +2 -2
- package/dist/schemas/fs.mjs.map +1 -0
- package/dist/storage/base.d.cts +2 -1
- package/dist/storage/base.d.cts.map +1 -1
- package/dist/storage/base.d.mts +2 -1
- package/dist/storage/base.d.mts.map +1 -1
- package/dist/storage/file-system.d.cts +1 -1
- package/dist/storage/file-system.d.mts +1 -1
- package/dist/storage/virtual.d.cts +1 -1
- package/dist/storage/virtual.d.mts +1 -1
- package/dist/types/api.d.cts +16 -0
- package/dist/types/api.d.cts.map +1 -0
- package/dist/types/api.d.mts +16 -0
- package/dist/types/api.d.mts.map +1 -0
- package/dist/types/config.d.cts +739 -0
- package/dist/types/config.d.cts.map +1 -0
- package/dist/types/config.d.mts +739 -0
- package/dist/types/config.d.mts.map +1 -0
- package/dist/types/context.d.cts +682 -0
- package/dist/types/context.d.cts.map +1 -0
- package/dist/types/context.d.mts +682 -0
- package/dist/types/context.d.mts.map +1 -0
- package/dist/types/fs.d.cts +538 -0
- package/dist/types/fs.d.cts.map +1 -0
- package/dist/types/fs.d.mts +538 -0
- package/dist/types/fs.d.mts.map +1 -0
- package/dist/types/hooks.d.cts +96 -0
- package/dist/types/hooks.d.cts.map +1 -0
- package/dist/types/hooks.d.mts +96 -0
- package/dist/types/hooks.d.mts.map +1 -0
- package/dist/types/index.d.cts +9 -0
- package/dist/types/index.d.mts +9 -0
- package/dist/types/logging.d.cts +145 -0
- package/dist/types/logging.d.cts.map +1 -0
- package/dist/types/logging.d.mts +145 -0
- package/dist/types/logging.d.mts.map +1 -0
- package/dist/types/plugin.d.cts +207 -0
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +207 -0
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/tsconfig.d.cts +73 -0
- package/dist/types/tsconfig.d.cts.map +1 -0
- package/dist/types/tsconfig.d.mts +73 -0
- package/dist/types/tsconfig.d.mts.map +1 -0
- package/dist/types/unplugin.d.cts +22 -0
- package/dist/types/unplugin.d.cts.map +1 -0
- package/dist/types/unplugin.d.mts +22 -0
- package/dist/types/unplugin.d.mts.map +1 -0
- package/package.json +14 -14
- package/dist/api-DTCbbtSH.d.cts +0 -6
- package/dist/api-DTCbbtSH.d.cts.map +0 -1
- package/dist/api-DTCbbtSH.d.mts +0 -6
- package/dist/api-DTCbbtSH.d.mts.map +0 -1
- package/dist/base-context-BmxgDD3S.d.mts +0 -79
- package/dist/base-context-BmxgDD3S.d.mts.map +0 -1
- package/dist/base-context-mHoSEqHf.d.cts +0 -79
- package/dist/base-context-mHoSEqHf.d.cts.map +0 -1
- package/dist/commands-DzGd8pnR.d.cts +0 -5
- package/dist/commands-DzGd8pnR.d.cts.map +0 -1
- package/dist/commands-DzGd8pnR.d.mts +0 -5
- package/dist/commands-DzGd8pnR.d.mts.map +0 -1
- package/dist/config-BnV_o0Es.d.cts +0 -2461
- package/dist/config-BnV_o0Es.d.cts.map +0 -1
- package/dist/config-DKeDSykZ.d.cts +0 -138
- package/dist/config-DKeDSykZ.d.cts.map +0 -1
- package/dist/config-DbOP5nVu.d.mts +0 -138
- package/dist/config-DbOP5nVu.d.mts.map +0 -1
- package/dist/config-DboKmDhl.d.mts +0 -2461
- package/dist/config-DboKmDhl.d.mts.map +0 -1
- package/dist/context-C6oL3mPw.d.mts +0 -368
- package/dist/context-C6oL3mPw.d.mts.map +0 -1
- package/dist/context-DcY6YqBQ.d.cts +0 -368
- package/dist/context-DcY6YqBQ.d.cts.map +0 -1
- package/dist/context-helpers-BKxpDArS.d.mts +0 -15
- package/dist/context-helpers-BKxpDArS.d.mts.map +0 -1
- package/dist/context-helpers-zXovPE7i.d.cts +0 -15
- package/dist/context-helpers-zXovPE7i.d.cts.map +0 -1
- package/dist/devtools-h0du-bSj.d.cts +0 -13
- package/dist/devtools-h0du-bSj.d.cts.map +0 -1
- package/dist/devtools-h0du-bSj.d.mts +0 -13
- package/dist/devtools-h0du-bSj.d.mts.map +0 -1
- package/dist/entry-BC_V2K2U.d.cts +0 -46
- package/dist/entry-BC_V2K2U.d.cts.map +0 -1
- package/dist/entry-CHIaWcmk.d.mts +0 -46
- package/dist/entry-CHIaWcmk.d.mts.map +0 -1
- package/dist/environments-BYv_kHRG.d.cts +0 -10
- package/dist/environments-BYv_kHRG.d.cts.map +0 -1
- package/dist/environments-BYv_kHRG.d.mts +0 -10
- package/dist/environments-BYv_kHRG.d.mts.map +0 -1
- package/dist/events-NA1XM2Vz.d.cts +0 -10
- package/dist/events-NA1XM2Vz.d.cts.map +0 -1
- package/dist/events-NA1XM2Vz.d.mts +0 -10
- package/dist/events-NA1XM2Vz.d.mts.map +0 -1
- package/dist/extensions-ctxXzgay.d.cts +0 -5
- package/dist/extensions-ctxXzgay.d.cts.map +0 -1
- package/dist/extensions-ctxXzgay.d.mts +0 -5
- package/dist/extensions-ctxXzgay.d.mts.map +0 -1
- package/dist/file-header-Co9oo7aI.d.cts +0 -41
- package/dist/file-header-Co9oo7aI.d.cts.map +0 -1
- package/dist/file-header-rHqeXgRV.d.mts +0 -41
- package/dist/file-header-rHqeXgRV.d.mts.map +0 -1
- package/dist/format-Cf-cgZ-s.d.cts +0 -24
- package/dist/format-Cf-cgZ-s.d.cts.map +0 -1
- package/dist/format-IQPqgWIe.d.mts +0 -24
- package/dist/format-IQPqgWIe.d.mts.map +0 -1
- package/dist/fs-BzXT5ZPj.d.cts +0 -7
- package/dist/fs-BzXT5ZPj.d.cts.map +0 -1
- package/dist/fs-BzXT5ZPj.d.mts +0 -7
- package/dist/fs-BzXT5ZPj.d.mts.map +0 -1
- package/dist/fs-DqLn15uU.mjs.map +0 -1
- package/dist/generate-types-CDkVosrS.d.cts +0 -65
- package/dist/generate-types-CDkVosrS.d.cts.map +0 -1
- package/dist/generate-types-Dw6p3cB_.d.mts +0 -65
- package/dist/generate-types-Dw6p3cB_.d.mts.map +0 -1
- package/dist/helpers-CrRRFQl5.d.mts +0 -22
- package/dist/helpers-CrRRFQl5.d.mts.map +0 -1
- package/dist/helpers-DBLIQW3U.d.cts +0 -22
- package/dist/helpers-DBLIQW3U.d.cts.map +0 -1
- package/dist/hooks-Dhc3ahex.d.cts +0 -5
- package/dist/hooks-Dhc3ahex.d.cts.map +0 -1
- package/dist/hooks-Dhc3ahex.d.mts +0 -5
- package/dist/hooks-Dhc3ahex.d.mts.map +0 -1
- package/dist/index-BKZ67WMa.d.cts +0 -1
- package/dist/index-BKZ67WMa.d.mts +0 -1
- package/dist/index-BVVgDSdq.d.cts +0 -1
- package/dist/index-BVVgDSdq.d.mts +0 -1
- package/dist/index-Den-MsLx.d.cts +0 -1
- package/dist/index-Den-MsLx.d.mts +0 -1
- package/dist/index-DmtQKWjk.d.cts +0 -1
- package/dist/index-DmtQKWjk.d.mts +0 -1
- package/dist/index-LtpXjuJR.d.mts +0 -25
- package/dist/index-LtpXjuJR.d.mts.map +0 -1
- package/dist/index-_6s0AX1B.d.cts +0 -1
- package/dist/index-_6s0AX1B.d.mts +0 -1
- package/dist/index-xk4vSgtB.d.cts +0 -25
- package/dist/index-xk4vSgtB.d.cts.map +0 -1
- package/dist/install-dependencies-CCjZfS9Y.d.mts +0 -12
- package/dist/install-dependencies-CCjZfS9Y.d.mts.map +0 -1
- package/dist/install-dependencies-CyeYsrfz.d.cts +0 -12
- package/dist/install-dependencies-CyeYsrfz.d.cts.map +0 -1
- package/dist/log-level-BC8g4BBL.d.cts +0 -67
- package/dist/log-level-BC8g4BBL.d.cts.map +0 -1
- package/dist/log-level-BC8g4BBL.d.mts +0 -67
- package/dist/log-level-BC8g4BBL.d.mts.map +0 -1
- package/dist/meta-CdDd2ykC.d.cts +0 -33
- package/dist/meta-CdDd2ykC.d.cts.map +0 -1
- package/dist/meta-CfTCHU_o.d.mts +0 -33
- package/dist/meta-CfTCHU_o.d.mts.map +0 -1
- package/dist/meta-QA_SN1j3.d.cts +0 -6
- package/dist/meta-QA_SN1j3.d.cts.map +0 -1
- package/dist/meta-QA_SN1j3.d.mts +0 -6
- package/dist/meta-QA_SN1j3.d.mts.map +0 -1
- package/dist/module-resolution-CRMNPsdn.d.mts +0 -40
- package/dist/module-resolution-CRMNPsdn.d.mts.map +0 -1
- package/dist/module-resolution-D-w-EZaK.d.cts +0 -40
- package/dist/module-resolution-D-w-EZaK.d.cts.map +0 -1
- package/dist/plugin-B_b7XqaN.d.mts +0 -39
- package/dist/plugin-B_b7XqaN.d.mts.map +0 -1
- package/dist/plugin-CzV-aFwU.d.cts +0 -39
- package/dist/plugin-CzV-aFwU.d.cts.map +0 -1
- package/dist/plugin-fhBG7SSQ.d.cts +0 -9
- package/dist/plugin-fhBG7SSQ.d.cts.map +0 -1
- package/dist/plugin-fhBG7SSQ.d.mts +0 -9
- package/dist/plugin-fhBG7SSQ.d.mts.map +0 -1
- package/dist/plugins-DfL1fBZi.d.cts +0 -37
- package/dist/plugins-DfL1fBZi.d.cts.map +0 -1
- package/dist/plugins-zG2X2LA8.d.mts +0 -37
- package/dist/plugins-zG2X2LA8.d.mts.map +0 -1
- package/dist/resolver-CdBAh8dA.d.mts +0 -19
- package/dist/resolver-CdBAh8dA.d.mts.map +0 -1
- package/dist/resolver-CfCl--Eh.d.cts +0 -19
- package/dist/resolver-CfCl--Eh.d.cts.map +0 -1
- package/dist/schemas-Zvqwdrw_.d.cts.map +0 -1
- package/dist/schemas-Zvqwdrw_.d.mts.map +0 -1
- package/dist/source-file-CLw13fKE.d.mts +0 -30
- package/dist/source-file-CLw13fKE.d.mts.map +0 -1
- package/dist/source-file-CuuHaBL5.d.cts +0 -30
- package/dist/source-file-CuuHaBL5.d.cts.map +0 -1
- package/dist/source-map-Cy0aqSpe.d.mts +0 -16
- package/dist/source-map-Cy0aqSpe.d.mts.map +0 -1
- package/dist/source-map-HU4IoICc.d.cts +0 -16
- package/dist/source-map-HU4IoICc.d.cts.map +0 -1
- package/dist/streaming-channel-CiyFd_6l.d.cts +0 -126
- package/dist/streaming-channel-CiyFd_6l.d.cts.map +0 -1
- package/dist/streaming-channel-CiyFd_6l.d.mts +0 -126
- package/dist/streaming-channel-CiyFd_6l.d.mts.map +0 -1
- package/dist/ts-morph-BGgjbOgM.d.cts +0 -38
- package/dist/ts-morph-BGgjbOgM.d.cts.map +0 -1
- package/dist/ts-morph-zLvdifpA.d.mts +0 -38
- package/dist/ts-morph-zLvdifpA.d.mts.map +0 -1
- package/dist/tsconfig-DExoZEQ0.d.cts +0 -75
- package/dist/tsconfig-DExoZEQ0.d.cts.map +0 -1
- package/dist/tsconfig-De09cBeX.d.mts +0 -75
- package/dist/tsconfig-De09cBeX.d.mts.map +0 -1
- package/dist/vfs-B9Vhnajc.d.cts +0 -320
- package/dist/vfs-B9Vhnajc.d.cts.map +0 -1
- package/dist/vfs-Dl6nPqdS.d.mts +0 -320
- package/dist/vfs-Dl6nPqdS.d.mts.map +0 -1
- package/dist/write-file-BVMnXVPo.d.cts +0 -15
- package/dist/write-file-BVMnXVPo.d.cts.map +0 -1
- package/dist/write-file-CWf9Xxwd.d.mts +0 -15
- package/dist/write-file-CWf9Xxwd.d.mts.map +0 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { UnpluginBuilderVariant, UnpluginHookFunctions } from "./unplugin.mjs";
|
|
2
|
+
import { BasePlugin, Plugin, PluginHook, PluginHooks } from "./plugin.mjs";
|
|
3
|
+
import { PluginContext, SelectHooksOptions } from "./context.mjs";
|
|
4
|
+
import { StringOrRegExp, UnpluginOptions } from "unplugin";
|
|
5
|
+
import { AnyFunction, MaybePromise } from "@stryke/types/base";
|
|
6
|
+
|
|
7
|
+
//#region src/types/hooks.d.ts
|
|
8
|
+
type HookListOrders = "preOrdered" | "preEnforced" | "normal" | "postEnforced" | "postOrdered";
|
|
9
|
+
interface HooksListItem<TContext extends PluginContext = PluginContext, TFields extends string = string> {
|
|
10
|
+
plugin: Plugin<TContext>;
|
|
11
|
+
handler: InferHookFunction<TContext, TFields>;
|
|
12
|
+
}
|
|
13
|
+
type PluginFilter = (input: string) => boolean;
|
|
14
|
+
type TransformHookFilter = (id: string, code: string) => boolean;
|
|
15
|
+
interface NormalizedStringFilter {
|
|
16
|
+
include?: StringOrRegExp[];
|
|
17
|
+
exclude?: StringOrRegExp[];
|
|
18
|
+
}
|
|
19
|
+
type HooksList<TContext extends PluginContext = PluginContext, TFields extends string = string> = { [TKey in HookListOrders]?: HooksListItem<TContext, TFields>[] | undefined };
|
|
20
|
+
type InferPluginFunction<TObject, TKey extends keyof Required<TObject>> = InferPluginFunctionKey<Required<TObject>[TKey]>;
|
|
21
|
+
type InferPluginFunctionKey<TValue> = TValue extends AnyFunction ? TValue : TValue extends PluginHook<infer THookFunction, any> ? THookFunction : never;
|
|
22
|
+
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;
|
|
23
|
+
type InferHookReturnType<TContext extends PluginContext, TKey extends string> = ReturnType<InferHookFunction<TContext, TKey>>;
|
|
24
|
+
type InferHookParameters<TContext extends PluginContext, TKey extends string> = Parameters<InferHookFunction<TContext, TKey>>;
|
|
25
|
+
type InferHookThisType<TContext extends PluginContext, TKey extends string> = ThisParameterType<InferHookFunction<TContext, TKey>>;
|
|
26
|
+
type CallHookOptions<TResult = any> = SelectHooksOptions & (({
|
|
27
|
+
/**
|
|
28
|
+
* Whether to call the hooks sequentially or in parallel.
|
|
29
|
+
*
|
|
30
|
+
* @defaultValue true
|
|
31
|
+
*/
|
|
32
|
+
sequential?: true;
|
|
33
|
+
} & ({
|
|
34
|
+
/**
|
|
35
|
+
* How to handle multiple return values from hooks.
|
|
36
|
+
* - "merge": Merge all non-undefined return values (if they are objects).
|
|
37
|
+
* - "first": Return the first non-undefined value.
|
|
38
|
+
* - "last": Return the last non-undefined value.
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* Merging only works if the return values are objects.
|
|
42
|
+
*
|
|
43
|
+
* @defaultValue "merge"
|
|
44
|
+
*/
|
|
45
|
+
result: "first";
|
|
46
|
+
} | ({
|
|
47
|
+
/**
|
|
48
|
+
* 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
|
|
49
|
+
*/
|
|
50
|
+
asNextParam?: false | ((previousResult: TResult) => MaybePromise<TResult>);
|
|
51
|
+
} & ({
|
|
52
|
+
/**
|
|
53
|
+
* How to handle multiple return values from hooks.
|
|
54
|
+
* - "merge": Merge all non-undefined return values (if they are objects).
|
|
55
|
+
* - "first": Return the first non-undefined value.
|
|
56
|
+
* - "last": Return the last non-undefined value.
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* Merging only works if the return values are objects.
|
|
60
|
+
*
|
|
61
|
+
* @defaultValue "merge"
|
|
62
|
+
*/
|
|
63
|
+
result?: "merge";
|
|
64
|
+
/**
|
|
65
|
+
* A custom function to merge two sets of return values from hooks.
|
|
66
|
+
*
|
|
67
|
+
* @remarks
|
|
68
|
+
* If not provided, the {@link mergeResults} function will be used by default, which merges string results by concatenation and object results by deep merging.
|
|
69
|
+
*
|
|
70
|
+
* @param currentResult - The current hook result to merge with the previous results.
|
|
71
|
+
* @param previousResult - The previous hook result to merge with the current result.
|
|
72
|
+
* @returns The merged result.
|
|
73
|
+
*/
|
|
74
|
+
merge?: (currentResult: TResult, previousResult: TResult) => MaybePromise<TResult>;
|
|
75
|
+
} | {
|
|
76
|
+
/**
|
|
77
|
+
* How to handle multiple return values from hooks.
|
|
78
|
+
* - "merge": Merge all non-undefined return values (if they are objects).
|
|
79
|
+
* - "first": Return the first non-undefined value.
|
|
80
|
+
* - "last": Return the last non-undefined value.
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* Merging only works if the return values are objects.
|
|
84
|
+
*
|
|
85
|
+
* @defaultValue "merge"
|
|
86
|
+
*/
|
|
87
|
+
result?: "last";
|
|
88
|
+
})))) | {
|
|
89
|
+
/**
|
|
90
|
+
* Whether to call the hooks sequentially or in parallel.
|
|
91
|
+
*/
|
|
92
|
+
sequential: false;
|
|
93
|
+
});
|
|
94
|
+
//#endregion
|
|
95
|
+
export { CallHookOptions, HookListOrders, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, NormalizedStringFilter, PluginFilter, TransformHookFilter };
|
|
96
|
+
//# sourceMappingURL=hooks.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.mts","names":[],"sources":["../../src/types/hooks.ts"],"mappings":";;;;;;;KAwBY,cAAA;AAAA,UAOK,aAAA,kBACE,aAAA,GAAgB,aAAA;EAGjC,MAAA,EAAQ,MAAA,CAAO,QAAA;EACf,OAAA,EAAS,iBAAA,CAAkB,QAAA,EAAU,OAAA;AAAA;AAAA,KAG3B,YAAA,IAAgB,KAAa;AAAA,KAC7B,mBAAA,IAAuB,EAAA,UAAY,IAAY;AAAA,UAE1C,sBAAA;EACf,OAAA,GAAU,cAAA;EACV,OAAA,GAAU,cAAc;AAAA;AAAA,KAGd,SAAA,kBACO,aAAA,GAAgB,aAAA,gDAGxB,cAAA,IAAkB,aAAA,CAAc,QAAA,EAAU,OAAA;AAAA,KAGhD,mBAAA,6BAEgB,QAAA,CAAS,OAAA,KAC1B,sBAAA,CAAuB,QAAA,CAAS,OAAA,EAAS,IAAA;AAAA,KAExC,sBAAA,WAAiC,MAAA,SAAe,WAAA,GACjD,MAAA,GACA,MAAA,SAAe,UAAA,6BACb,aAAA;AAAA,KAGM,iBAAA,kBACO,aAAA,yBAEf,IAAA,+CACA,QAAA,eAAuB,QAAA,CAAS,UAAA,CAAW,QAAA,KACzC,MAAA,eAAqB,QAAA,CAAS,UAAA,CAAW,QAAA,GAAW,QAAA,IAClD,mBAAA,CAAoB,QAAA,CAAS,UAAA,CAAW,QAAA,GAAW,QAAA,GAAW,MAAA,IAC9D,QAAA,eAAuB,QAAA,CAAS,WAAA,CAAY,QAAA,KAC1C,MAAA,eAAqB,QAAA,CAAS,WAAA,CAAY,QAAA,GAAW,QAAA,IACnD,mBAAA,CACE,QAAA,CAAS,WAAA,CAAY,QAAA,GAAW,QAAA,GAChC,MAAA,oBAIR,QAAA,SAAiB,sBAAA,GACf,MAAA,eAAqB,QAAA,CAAS,eAAA,EAAiB,QAAA,IAC7C,qBAAA,CAAsB,QAAA,EAAU,QAAA,EAAU,MAAA,oBAGhD,IAAA,eAAmB,QAAA,CAAS,UAAA,CAAW,QAAA,KACrC,mBAAA,CAAoB,QAAA,CAAS,UAAA,CAAW,QAAA,IAAY,IAAA,IACpD,IAAA,eAAmB,QAAA,CAAS,WAAA,CAAY,QAAA,KACtC,mBAAA,CAAoB,QAAA,CAAS,WAAA,CAAY,QAAA,IAAY,IAAA;AAAA,KAGjD,mBAAA,kBACO,aAAA,yBAEf,UAAA,CAAW,iBAAA,CAAkB,QAAA,EAAU,IAAA;AAAA,KAE/B,mBAAA,kBACO,aAAA,yBAEf,UAAA,CAAW,iBAAA,CAAkB,QAAA,EAAU,IAAA;AAAA,KAE/B,iBAAA,kBACO,aAAA,yBAEf,iBAAA,CAAkB,iBAAA,CAAkB,QAAA,EAAU,IAAA;AAAA,KAEtC,eAAA,kBAAiC,kBAAA;EA1EV;;;;;EAkF3B,UAAA;AAAA;EA9EqB;;;AAAiB;AAG9C;;;;AAAyC;AACzC;;EAwFY,MAAA;AAAA;EAxF+C;AAE3D;;EA4FY,WAAA,aAEM,cAAA,EAAgB,OAAA,KAAY,YAAA,CAAa,OAAA;AAAA;EA7FzD;;;;;AACwB;AAG1B;;;;;EAuGgB,MAAA;EAnG2B;;;;;;;;;;EA+G3B,KAAA,IACE,aAAA,EAAe,OAAA,EACf,cAAA,EAAgB,OAAA,KACb,YAAA,CAAa,OAAA;AAAA;EAlHS;;;AAAiB;AAC1D;;;;;;;EA+Hc,MAAA;AAAA;EA1HU;;;EAkIlB,UAAA;AAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WriteData, WriteOptions } from "./fs.cjs";
|
|
2
|
+
import { BaseCommandType, BaseExecutionApiMethods, CommandType, Commands, ExecutionApiMethods, SupportedCommands } from "./api.cjs";
|
|
3
|
+
import { BuilderVariant, UnpluginBuilderVariant, UnpluginHookFunctions, UnpluginOptions } from "./unplugin.cjs";
|
|
4
|
+
import { BasePlugin, HookFunctions, Hooks, Plugin, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, PluginNonHookFields, TypesResult } from "./plugin.cjs";
|
|
5
|
+
import { CallHookOptions, HookListOrders, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, NormalizedStringFilter, PluginFilter, TransformHookFilter } from "./hooks.cjs";
|
|
6
|
+
import { CustomLogger, CustomLoggerMessage, LogCategory, LogFn, LogFnMeta, LogFnOptions, LogLevel, LogLevelResolvedConfig, LogLevelUserConfig, LogMessage, LogMeta, Logger, LoggerMessage, LoggerMeta, LoggerOptions, PowerlinesMessage } from "./logging.cjs";
|
|
7
|
+
import { DeepkitOptions, Level, ParsedTypeScriptConfig, RawReflectionMode, ReflectionMode, TSCompilerOptions, TSConfig } from "./tsconfig.cjs";
|
|
8
|
+
import { BaseContext, BuildPluginContext, Context, EmitEntryOptions, EmitOptions, EnvironmentContext, EnvironmentPlugin, ExecutionContext, FetchOptions, InitContextOptions, MetaInfo, ParseOptions, PluginContext, ResolveResult, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, TransformResult, UnimportContext, UnresolvedContext, WithUnpluginBuildContext } from "./context.cjs";
|
|
9
|
+
import { BaseExecutionOptions, BuildInlineConfig, CleanInlineConfig, Config, ConfigParams, CopyConfig, CreateInlineConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, ExecutionOptions, FrameworkOptions, InferOverridableConfig, InlineConfig, InlineConfigPaths, LintInlineConfig, Mode, Options, OutputConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PrepareInlineConfig, ProjectType, ResolveConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedCopyConfig, ResolvedEntryFileReference, ResolvedEnvironmentConfig, ResolvedOutputConfig, ResolvedResolveConfig, TestInlineConfig, TypesInlineConfig, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnObject, UserConfigFnPromise, WorkspaceConfig } from "./config.cjs";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileExtension, VirtualFileMetadata, VirtualFileSystemInterface, WriteData, WriteOptions } from "./fs.mjs";
|
|
2
|
+
import { BaseCommandType, BaseExecutionApiMethods, CommandType, Commands, ExecutionApiMethods, SupportedCommands } from "./api.mjs";
|
|
3
|
+
import { BuilderVariant, UnpluginBuilderVariant, UnpluginHookFunctions, UnpluginOptions } from "./unplugin.mjs";
|
|
4
|
+
import { BasePlugin, HookFunctions, Hooks, Plugin, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, PluginNonHookFields, TypesResult } from "./plugin.mjs";
|
|
5
|
+
import { CallHookOptions, HookListOrders, HooksList, HooksListItem, InferHookFunction, InferHookParameters, InferHookReturnType, InferHookThisType, NormalizedStringFilter, PluginFilter, TransformHookFilter } from "./hooks.mjs";
|
|
6
|
+
import { CustomLogger, CustomLoggerMessage, LogCategory, LogFn, LogFnMeta, LogFnOptions, LogLevel, LogLevelResolvedConfig, LogLevelUserConfig, LogMessage, LogMeta, Logger, LoggerMessage, LoggerMeta, LoggerOptions, PowerlinesMessage } from "./logging.mjs";
|
|
7
|
+
import { DeepkitOptions, Level, ParsedTypeScriptConfig, RawReflectionMode, ReflectionMode, TSCompilerOptions, TSConfig } from "./tsconfig.mjs";
|
|
8
|
+
import { BaseContext, BuildPluginContext, Context, EmitEntryOptions, EmitOptions, EnvironmentContext, EnvironmentPlugin, ExecutionContext, FetchOptions, InitContextOptions, MetaInfo, ParseOptions, PluginContext, ResolveResult, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, TransformResult, UnimportContext, UnresolvedContext, WithUnpluginBuildContext } from "./context.mjs";
|
|
9
|
+
import { BaseExecutionOptions, BuildInlineConfig, CleanInlineConfig, Config, ConfigParams, CopyConfig, CreateInlineConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, ExecutionOptions, FrameworkOptions, InferOverridableConfig, InlineConfig, InlineConfigPaths, LintInlineConfig, Mode, Options, OutputConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PrepareInlineConfig, ProjectType, ResolveConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedCopyConfig, ResolvedEntryFileReference, ResolvedEnvironmentConfig, ResolvedOutputConfig, ResolvedResolveConfig, TestInlineConfig, TypesInlineConfig, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnObject, UserConfigFnPromise, WorkspaceConfig } from "./config.mjs";
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { LOG_CATEGORIES, LOG_LEVELS } from "../constants/log-level.cjs";
|
|
2
|
+
import { Mode } from "./config.cjs";
|
|
3
|
+
import { PartialKeys, RequiredKeys } from "@stryke/types/base";
|
|
4
|
+
import { UnpluginMessage } from "unplugin";
|
|
5
|
+
|
|
6
|
+
//#region src/types/logging.d.ts
|
|
7
|
+
type LogLevel = (typeof LOG_LEVELS)[number];
|
|
8
|
+
type LogCategory = (typeof LOG_CATEGORIES)[number];
|
|
9
|
+
interface LogMeta {
|
|
10
|
+
/**
|
|
11
|
+
* 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.
|
|
12
|
+
*/
|
|
13
|
+
logId: string;
|
|
14
|
+
/**
|
|
15
|
+
* 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.
|
|
16
|
+
*/
|
|
17
|
+
type: LogLevel;
|
|
18
|
+
/**
|
|
19
|
+
* The category of the log message, which can be used to classify and filter log entries based on their purpose or origin.
|
|
20
|
+
*/
|
|
21
|
+
category: LogCategory;
|
|
22
|
+
/**
|
|
23
|
+
* The timestamp when the RPC message was created, represented as the number of milliseconds since the Unix epoch.
|
|
24
|
+
*/
|
|
25
|
+
timestamp: number;
|
|
26
|
+
/**
|
|
27
|
+
* 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.
|
|
28
|
+
*/
|
|
29
|
+
name?: string;
|
|
30
|
+
/**
|
|
31
|
+
* 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.
|
|
32
|
+
*/
|
|
33
|
+
executionId?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The zero-based index of the current execution within the sequence of executions in the same process.
|
|
36
|
+
*/
|
|
37
|
+
configIndex?: number;
|
|
38
|
+
/**
|
|
39
|
+
* 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.
|
|
40
|
+
*/
|
|
41
|
+
command?: string;
|
|
42
|
+
/**
|
|
43
|
+
* 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.
|
|
44
|
+
*/
|
|
45
|
+
hook?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Optional environment identifier to specify the context or environment in which the message is being processed.
|
|
48
|
+
*/
|
|
49
|
+
environment?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Optional plugin name to specify the source plugin of the log message.
|
|
52
|
+
*/
|
|
53
|
+
plugin?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The name of the logger or source of the log message, which can be used to identify the origin of the log entry.
|
|
56
|
+
*/
|
|
57
|
+
source?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Indicates whether the log message is related to inter-process communication (IPC).
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
$$ipc?: boolean;
|
|
64
|
+
}
|
|
65
|
+
type LogFnOptions = Omit<Partial<LogMeta>, "logId" | "timestamp" | "name" | "type"> & {
|
|
66
|
+
mode?: Mode;
|
|
67
|
+
logLevel?: LogLevelUserConfig;
|
|
68
|
+
};
|
|
69
|
+
type LogFnMeta = LogLevel | PartialKeys<LogMeta, "logId" | "timestamp" | "name" | "category">;
|
|
70
|
+
type LogFn = (meta: LogFnMeta, message: string) => void;
|
|
71
|
+
type LoggerMeta = PartialKeys<Omit<LogMeta, "type">, "logId" | "timestamp" | "name" | "category">;
|
|
72
|
+
type LoggerOptions = Omit<LoggerMeta, "logId" | "timestamp" | "type"> & {
|
|
73
|
+
mode?: Mode;
|
|
74
|
+
logLevel?: LogLevelUserConfig;
|
|
75
|
+
};
|
|
76
|
+
interface PowerlinesMessage<TMeta> extends UnpluginMessage {
|
|
77
|
+
meta: TMeta;
|
|
78
|
+
error?: Error;
|
|
79
|
+
}
|
|
80
|
+
type LogMessage = PowerlinesMessage<Partial<LogMeta>>;
|
|
81
|
+
/**
|
|
82
|
+
* 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.
|
|
83
|
+
*/
|
|
84
|
+
type LoggerMessage = PowerlinesMessage<LoggerMeta>;
|
|
85
|
+
/**
|
|
86
|
+
* 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.
|
|
87
|
+
*/
|
|
88
|
+
interface Logger {
|
|
89
|
+
options: LoggerOptions;
|
|
90
|
+
error: (message: string | LoggerMessage | Error) => void;
|
|
91
|
+
warn: (message: string | LoggerMessage) => void;
|
|
92
|
+
info: (message: string | LoggerMessage) => void;
|
|
93
|
+
debug: (message: string | LoggerMessage) => void;
|
|
94
|
+
trace: (message: string | LoggerMessage) => void;
|
|
95
|
+
log: (type: LogLevel, message: string | LoggerMessage) => void;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* 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.
|
|
99
|
+
*/
|
|
100
|
+
type CustomLoggerMessage = PowerlinesMessage<Omit<LogMeta, "type">>;
|
|
101
|
+
/**
|
|
102
|
+
* 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.
|
|
103
|
+
*/
|
|
104
|
+
interface CustomLogger {
|
|
105
|
+
/**
|
|
106
|
+
* 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.
|
|
107
|
+
*
|
|
108
|
+
* @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.
|
|
109
|
+
* @returns void
|
|
110
|
+
*/
|
|
111
|
+
error?: (message: CustomLoggerMessage) => void;
|
|
112
|
+
/**
|
|
113
|
+
* 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.
|
|
114
|
+
*
|
|
115
|
+
* @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.
|
|
116
|
+
* @returns void
|
|
117
|
+
*/
|
|
118
|
+
warn?: (message: CustomLoggerMessage) => void;
|
|
119
|
+
/**
|
|
120
|
+
* 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.
|
|
121
|
+
*
|
|
122
|
+
* @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.
|
|
123
|
+
* @returns void
|
|
124
|
+
*/
|
|
125
|
+
info?: (message: CustomLoggerMessage) => void;
|
|
126
|
+
/**
|
|
127
|
+
* 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.
|
|
128
|
+
*
|
|
129
|
+
* @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.
|
|
130
|
+
* @returns void
|
|
131
|
+
*/
|
|
132
|
+
debug?: (message: CustomLoggerMessage) => void;
|
|
133
|
+
/**
|
|
134
|
+
* 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.
|
|
135
|
+
*
|
|
136
|
+
* @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.
|
|
137
|
+
* @returns void
|
|
138
|
+
*/
|
|
139
|
+
trace?: (message: CustomLoggerMessage) => void;
|
|
140
|
+
}
|
|
141
|
+
type LogLevelUserConfig = LogLevel | RequiredKeys<Partial<Record<LogCategory, LogLevel | boolean | undefined>>, "general">;
|
|
142
|
+
type LogLevelResolvedConfig = Record<LogCategory, LogLevel>;
|
|
143
|
+
//#endregion
|
|
144
|
+
export { CustomLogger, CustomLoggerMessage, LogCategory, LogFn, LogFnMeta, LogFnOptions, LogLevel, LogLevelResolvedConfig, LogLevelUserConfig, LogMessage, LogMeta, Logger, LoggerMessage, LoggerMeta, LoggerOptions, PowerlinesMessage };
|
|
145
|
+
//# sourceMappingURL=logging.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logging.d.cts","names":[],"sources":["../../src/types/logging.ts"],"mappings":";;;;;;KAuBY,QAAA,WAAmB,UAAU;AAAA,KAE7B,WAAA,WAAsB,cAAc;AAAA,UAE/B,OAAA;EAJG;;;EAQlB,KAAA;EANU;;;EAUV,IAAA,EAAM,QAAA;EAVwC;AAEhD;;EAYE,QAAA,EAAU,WAAW;EAAA;;;EAIrB,SAAA;EAJA;;;EAQA,IAAA;EAIA;;;EAAA,WAAA;EAgBA;;;EAZA,WAAA;EA0BK;AAAA;AAGP;EAzBE,OAAA;;;;EAIA,IAAA;EAyBO;;;EArBP,WAAA;EAiByB;;;EAbzB,MAAA;EAiBO;;;EAbP,MAAA;EAc6B;AAG/B;;;;EAXE,KAAA;AAAA;AAAA,KAGU,YAAA,GAAe,IAAA,CACzB,OAAA,CAAQ,OAAA;EAGR,IAAA,GAAO,IAAA;EACP,QAAA,GAAW,kBAAA;AAAA;AAAA,KAGD,SAAA,GACR,QAAA,GACA,WAAA,CAAY,OAAA;AAAA,KAEJ,KAAA,IAAS,IAAA,EAAM,SAAS,EAAE,OAAA;AAAA,KAE1B,UAAA,GAAa,WAAA,CACvB,IAAA,CAAK,OAAA;AAAA,KAIK,aAAA,GAAgB,IAAA,CAAK,UAAA;EAC/B,IAAA,GAAO,IAAA;EACP,QAAA,GAAW,kBAAA;AAAA;AAAA,UAGI,iBAAA,gBAAiC,eAAA;EAChD,IAAA,EAAM,KAAA;EACN,KAAA,GAAQ,KAAA;AAAA;AAAA,KAGE,UAAA,GAAa,iBAAA,CAAkB,OAAA,CAAQ,OAAA;AAfnD;;;AAAA,KAoBY,aAAA,GAAgB,iBAAiB,CAAC,UAAA;;;;UAK7B,MAAA;EACf,OAAA,EAAS,aAAA;EACT,KAAA,GAAQ,OAAA,WAAkB,aAAA,GAAgB,KAAA;EAC1C,IAAA,GAAO,OAAA,WAAkB,aAAA;EACzB,IAAA,GAAO,OAAA,WAAkB,aAAA;EACzB,KAAA,GAAQ,OAAA,WAAkB,aAAA;EAC1B,KAAA,GAAQ,OAAA,WAAkB,aAAA;EAC1B,GAAA,GAAM,IAAA,EAAM,QAAA,EAAU,OAAA,WAAkB,aAAA;AAAA;;;;KAM9B,mBAAA,GAAsB,iBAAA,CAAkB,IAAA,CAAK,OAAA;;;;UAKxC,YAAA;EArCf;;;;;AAC6B;EA2C7B,KAAA,IAAS,OAAA,EAAS,mBAAA;EAxCc;;;;;;EA+ChC,IAAA,IAAQ,OAAA,EAAS,mBAAA;EA/CgB;;;;;;EAsDjC,IAAA,IAAQ,OAAA,EAAS,mBAAA;EApDJ;AAGf;;;;;EAwDE,KAAA,IAAS,OAAA,EAAS,mBAAA;EAxDsB;;;;;;EA+DxC,KAAA,IAAS,OAAA,EAAS,mBAAA;AAAA;AAAA,KAGR,kBAAA,GACR,QAAA,GACA,YAAA,CACE,OAAA,CAAQ,MAAA,CAAO,WAAA,EAAa,QAAA;AAAA,KAItB,sBAAA,GAAyB,MAAA,CAAO,WAAA,EAAa,QAAA"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { LOG_CATEGORIES, LOG_LEVELS } from "../constants/log-level.mjs";
|
|
2
|
+
import { Mode } from "./config.mjs";
|
|
3
|
+
import { UnpluginMessage } from "unplugin";
|
|
4
|
+
import { PartialKeys, RequiredKeys } from "@stryke/types/base";
|
|
5
|
+
|
|
6
|
+
//#region src/types/logging.d.ts
|
|
7
|
+
type LogLevel = (typeof LOG_LEVELS)[number];
|
|
8
|
+
type LogCategory = (typeof LOG_CATEGORIES)[number];
|
|
9
|
+
interface LogMeta {
|
|
10
|
+
/**
|
|
11
|
+
* 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.
|
|
12
|
+
*/
|
|
13
|
+
logId: string;
|
|
14
|
+
/**
|
|
15
|
+
* 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.
|
|
16
|
+
*/
|
|
17
|
+
type: LogLevel;
|
|
18
|
+
/**
|
|
19
|
+
* The category of the log message, which can be used to classify and filter log entries based on their purpose or origin.
|
|
20
|
+
*/
|
|
21
|
+
category: LogCategory;
|
|
22
|
+
/**
|
|
23
|
+
* The timestamp when the RPC message was created, represented as the number of milliseconds since the Unix epoch.
|
|
24
|
+
*/
|
|
25
|
+
timestamp: number;
|
|
26
|
+
/**
|
|
27
|
+
* 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.
|
|
28
|
+
*/
|
|
29
|
+
name?: string;
|
|
30
|
+
/**
|
|
31
|
+
* 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.
|
|
32
|
+
*/
|
|
33
|
+
executionId?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The zero-based index of the current execution within the sequence of executions in the same process.
|
|
36
|
+
*/
|
|
37
|
+
configIndex?: number;
|
|
38
|
+
/**
|
|
39
|
+
* 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.
|
|
40
|
+
*/
|
|
41
|
+
command?: string;
|
|
42
|
+
/**
|
|
43
|
+
* 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.
|
|
44
|
+
*/
|
|
45
|
+
hook?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Optional environment identifier to specify the context or environment in which the message is being processed.
|
|
48
|
+
*/
|
|
49
|
+
environment?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Optional plugin name to specify the source plugin of the log message.
|
|
52
|
+
*/
|
|
53
|
+
plugin?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The name of the logger or source of the log message, which can be used to identify the origin of the log entry.
|
|
56
|
+
*/
|
|
57
|
+
source?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Indicates whether the log message is related to inter-process communication (IPC).
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
$$ipc?: boolean;
|
|
64
|
+
}
|
|
65
|
+
type LogFnOptions = Omit<Partial<LogMeta>, "logId" | "timestamp" | "name" | "type"> & {
|
|
66
|
+
mode?: Mode;
|
|
67
|
+
logLevel?: LogLevelUserConfig;
|
|
68
|
+
};
|
|
69
|
+
type LogFnMeta = LogLevel | PartialKeys<LogMeta, "logId" | "timestamp" | "name" | "category">;
|
|
70
|
+
type LogFn = (meta: LogFnMeta, message: string) => void;
|
|
71
|
+
type LoggerMeta = PartialKeys<Omit<LogMeta, "type">, "logId" | "timestamp" | "name" | "category">;
|
|
72
|
+
type LoggerOptions = Omit<LoggerMeta, "logId" | "timestamp" | "type"> & {
|
|
73
|
+
mode?: Mode;
|
|
74
|
+
logLevel?: LogLevelUserConfig;
|
|
75
|
+
};
|
|
76
|
+
interface PowerlinesMessage<TMeta> extends UnpluginMessage {
|
|
77
|
+
meta: TMeta;
|
|
78
|
+
error?: Error;
|
|
79
|
+
}
|
|
80
|
+
type LogMessage = PowerlinesMessage<Partial<LogMeta>>;
|
|
81
|
+
/**
|
|
82
|
+
* 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.
|
|
83
|
+
*/
|
|
84
|
+
type LoggerMessage = PowerlinesMessage<LoggerMeta>;
|
|
85
|
+
/**
|
|
86
|
+
* 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.
|
|
87
|
+
*/
|
|
88
|
+
interface Logger {
|
|
89
|
+
options: LoggerOptions;
|
|
90
|
+
error: (message: string | LoggerMessage | Error) => void;
|
|
91
|
+
warn: (message: string | LoggerMessage) => void;
|
|
92
|
+
info: (message: string | LoggerMessage) => void;
|
|
93
|
+
debug: (message: string | LoggerMessage) => void;
|
|
94
|
+
trace: (message: string | LoggerMessage) => void;
|
|
95
|
+
log: (type: LogLevel, message: string | LoggerMessage) => void;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* 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.
|
|
99
|
+
*/
|
|
100
|
+
type CustomLoggerMessage = PowerlinesMessage<Omit<LogMeta, "type">>;
|
|
101
|
+
/**
|
|
102
|
+
* 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.
|
|
103
|
+
*/
|
|
104
|
+
interface CustomLogger {
|
|
105
|
+
/**
|
|
106
|
+
* 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.
|
|
107
|
+
*
|
|
108
|
+
* @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.
|
|
109
|
+
* @returns void
|
|
110
|
+
*/
|
|
111
|
+
error?: (message: CustomLoggerMessage) => void;
|
|
112
|
+
/**
|
|
113
|
+
* 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.
|
|
114
|
+
*
|
|
115
|
+
* @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.
|
|
116
|
+
* @returns void
|
|
117
|
+
*/
|
|
118
|
+
warn?: (message: CustomLoggerMessage) => void;
|
|
119
|
+
/**
|
|
120
|
+
* 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.
|
|
121
|
+
*
|
|
122
|
+
* @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.
|
|
123
|
+
* @returns void
|
|
124
|
+
*/
|
|
125
|
+
info?: (message: CustomLoggerMessage) => void;
|
|
126
|
+
/**
|
|
127
|
+
* 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.
|
|
128
|
+
*
|
|
129
|
+
* @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.
|
|
130
|
+
* @returns void
|
|
131
|
+
*/
|
|
132
|
+
debug?: (message: CustomLoggerMessage) => void;
|
|
133
|
+
/**
|
|
134
|
+
* 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.
|
|
135
|
+
*
|
|
136
|
+
* @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.
|
|
137
|
+
* @returns void
|
|
138
|
+
*/
|
|
139
|
+
trace?: (message: CustomLoggerMessage) => void;
|
|
140
|
+
}
|
|
141
|
+
type LogLevelUserConfig = LogLevel | RequiredKeys<Partial<Record<LogCategory, LogLevel | boolean | undefined>>, "general">;
|
|
142
|
+
type LogLevelResolvedConfig = Record<LogCategory, LogLevel>;
|
|
143
|
+
//#endregion
|
|
144
|
+
export { CustomLogger, CustomLoggerMessage, LogCategory, LogFn, LogFnMeta, LogFnOptions, LogLevel, LogLevelResolvedConfig, LogLevelUserConfig, LogMessage, LogMeta, Logger, LoggerMessage, LoggerMeta, LoggerOptions, PowerlinesMessage };
|
|
145
|
+
//# sourceMappingURL=logging.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logging.d.mts","names":[],"sources":["../../src/types/logging.ts"],"mappings":";;;;;;KAuBY,QAAA,WAAmB,UAAU;AAAA,KAE7B,WAAA,WAAsB,cAAc;AAAA,UAE/B,OAAA;EAJG;;;EAQlB,KAAA;EANU;;;EAUV,IAAA,EAAM,QAAA;EAVwC;AAEhD;;EAYE,QAAA,EAAU,WAAW;EAAA;;;EAIrB,SAAA;EAJA;;;EAQA,IAAA;EAIA;;;EAAA,WAAA;EAgBA;;;EAZA,WAAA;EA0BK;AAAA;AAGP;EAzBE,OAAA;;;;EAIA,IAAA;EAyBO;;;EArBP,WAAA;EAiByB;;;EAbzB,MAAA;EAiBO;;;EAbP,MAAA;EAc6B;AAG/B;;;;EAXE,KAAA;AAAA;AAAA,KAGU,YAAA,GAAe,IAAA,CACzB,OAAA,CAAQ,OAAA;EAGR,IAAA,GAAO,IAAA;EACP,QAAA,GAAW,kBAAA;AAAA;AAAA,KAGD,SAAA,GACR,QAAA,GACA,WAAA,CAAY,OAAA;AAAA,KAEJ,KAAA,IAAS,IAAA,EAAM,SAAS,EAAE,OAAA;AAAA,KAE1B,UAAA,GAAa,WAAA,CACvB,IAAA,CAAK,OAAA;AAAA,KAIK,aAAA,GAAgB,IAAA,CAAK,UAAA;EAC/B,IAAA,GAAO,IAAA;EACP,QAAA,GAAW,kBAAA;AAAA;AAAA,UAGI,iBAAA,gBAAiC,eAAA;EAChD,IAAA,EAAM,KAAA;EACN,KAAA,GAAQ,KAAA;AAAA;AAAA,KAGE,UAAA,GAAa,iBAAA,CAAkB,OAAA,CAAQ,OAAA;AAfnD;;;AAAA,KAoBY,aAAA,GAAgB,iBAAiB,CAAC,UAAA;;;;UAK7B,MAAA;EACf,OAAA,EAAS,aAAA;EACT,KAAA,GAAQ,OAAA,WAAkB,aAAA,GAAgB,KAAA;EAC1C,IAAA,GAAO,OAAA,WAAkB,aAAA;EACzB,IAAA,GAAO,OAAA,WAAkB,aAAA;EACzB,KAAA,GAAQ,OAAA,WAAkB,aAAA;EAC1B,KAAA,GAAQ,OAAA,WAAkB,aAAA;EAC1B,GAAA,GAAM,IAAA,EAAM,QAAA,EAAU,OAAA,WAAkB,aAAA;AAAA;;;;KAM9B,mBAAA,GAAsB,iBAAA,CAAkB,IAAA,CAAK,OAAA;;;;UAKxC,YAAA;EArCf;;;;;AAC6B;EA2C7B,KAAA,IAAS,OAAA,EAAS,mBAAA;EAxCc;;;;;;EA+ChC,IAAA,IAAQ,OAAA,EAAS,mBAAA;EA/CgB;;;;;;EAsDjC,IAAA,IAAQ,OAAA,EAAS,mBAAA;EApDJ;AAGf;;;;;EAwDE,KAAA,IAAS,OAAA,EAAS,mBAAA;EAxDsB;;;;;;EA+DxC,KAAA,IAAS,OAAA,EAAS,mBAAA;AAAA;AAAA,KAGR,kBAAA,GACR,QAAA,GACA,YAAA,CACE,OAAA,CAAQ,MAAA,CAAO,WAAA,EAAa,QAAA;AAAA,KAItB,sBAAA,GAAyB,MAAA,CAAO,WAAA,EAAa,QAAA"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { PLUGIN_NON_HOOK_FIELDS } from "../constants/plugin.cjs";
|
|
2
|
+
import { BaseCommandType } from "./api.cjs";
|
|
3
|
+
import { UnpluginBuilderVariant, UnpluginOptions as UnpluginOptions$1 } from "./unplugin.cjs";
|
|
4
|
+
import { BuildPluginContext, PluginContext, ResolveResult, UnresolvedContext } from "./context.cjs";
|
|
5
|
+
import { EnvironmentConfig, PluginConfig, ResolvedEnvironmentConfig } from "./config.cjs";
|
|
6
|
+
import { AnyFunction, MaybePromise } from "@stryke/types/base";
|
|
7
|
+
import { HookFilter, TransformResult } from "unplugin";
|
|
8
|
+
import { ArrayValues } from "@stryke/types/array";
|
|
9
|
+
import { LoadResult } from "rollup";
|
|
10
|
+
|
|
11
|
+
//#region src/types/plugin.d.ts
|
|
12
|
+
interface PluginHookObject<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> {
|
|
13
|
+
/**
|
|
14
|
+
* The order in which the plugin should be applied.
|
|
15
|
+
*/
|
|
16
|
+
order?: "pre" | "post" | null | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* A filter to determine when the hook should be called.
|
|
19
|
+
*/
|
|
20
|
+
filter?: Pick<HookFilter, TFilter>;
|
|
21
|
+
/**
|
|
22
|
+
* The hook function to be called.
|
|
23
|
+
*/
|
|
24
|
+
handler: THookFunction;
|
|
25
|
+
}
|
|
26
|
+
type PluginHook<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> = THookFunction | PluginHookObject<THookFunction, TFilter>;
|
|
27
|
+
/**
|
|
28
|
+
* A result returned by the plugin from the `types` hook that describes the declaration types output file.
|
|
29
|
+
*/
|
|
30
|
+
interface TypesResult {
|
|
31
|
+
directives?: string[];
|
|
32
|
+
code: string;
|
|
33
|
+
}
|
|
34
|
+
interface Hooks<TContext extends PluginContext> {
|
|
35
|
+
/**
|
|
36
|
+
* A function that returns configuration options to be merged with the build context's options.
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* 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.
|
|
40
|
+
*
|
|
41
|
+
* @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect.
|
|
42
|
+
*
|
|
43
|
+
* @see https://vitejs.dev/guide/api-plugin#config
|
|
44
|
+
*
|
|
45
|
+
* @param this - The build context.
|
|
46
|
+
* @param config - The partial configuration object to be modified.
|
|
47
|
+
* @returns A promise that resolves to a partial configuration object.
|
|
48
|
+
*/
|
|
49
|
+
config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial$1<TContext["config"]> & Record<string, any>>;
|
|
50
|
+
/**
|
|
51
|
+
* 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.
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* 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.
|
|
55
|
+
*
|
|
56
|
+
* @see https://vitejs.dev/guide/api-plugin#configenvironment
|
|
57
|
+
*
|
|
58
|
+
* @param this - The build context.
|
|
59
|
+
* @param name - The name of the environment being configured.
|
|
60
|
+
* @param environment - The Vite-like environment object containing information about the current build environment.
|
|
61
|
+
* @returns A promise that resolves when the hook is complete.
|
|
62
|
+
*/
|
|
63
|
+
configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<ResolvedEnvironmentConfig> | undefined | null>;
|
|
64
|
+
/**
|
|
65
|
+
* A hook that is called when the plugin is resolved.
|
|
66
|
+
*
|
|
67
|
+
* @see https://vitejs.dev/guide/api-plugin#configresolved
|
|
68
|
+
*
|
|
69
|
+
* @param this - The build context.
|
|
70
|
+
* @returns A promise that resolves when the hook is complete.
|
|
71
|
+
*/
|
|
72
|
+
configResolved: (this: TContext) => MaybePromise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* 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.
|
|
75
|
+
*
|
|
76
|
+
* @param this - The build context.
|
|
77
|
+
* @param code - The source code to generate types for.
|
|
78
|
+
* @returns A promise that resolves when the hook is complete.
|
|
79
|
+
*/
|
|
80
|
+
types: (this: TContext, code: string) => MaybePromise<TypesResult | string | undefined | null>;
|
|
81
|
+
/**
|
|
82
|
+
* A hook that is called at the start of the build process.
|
|
83
|
+
*
|
|
84
|
+
* @param this - The build context and unplugin build context.
|
|
85
|
+
* @returns A promise that resolves when the hook is complete.
|
|
86
|
+
*/
|
|
87
|
+
buildStart: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* A hook that is called at the end of the build process.
|
|
90
|
+
*
|
|
91
|
+
* @param this - The build context and unplugin build context.
|
|
92
|
+
* @returns A promise that resolves when the hook is complete.
|
|
93
|
+
*/
|
|
94
|
+
buildEnd: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* A hook that is called to transform the source code.
|
|
97
|
+
*
|
|
98
|
+
* @param this - The build context, unplugin build context, and unplugin context.
|
|
99
|
+
* @param code - The source code to transform.
|
|
100
|
+
* @param id - The identifier of the source code.
|
|
101
|
+
* @returns A promise that resolves when the hook is complete.
|
|
102
|
+
*/
|
|
103
|
+
transform: (this: BuildPluginContext<TContext["config"]> & TContext, code: string, id: string) => MaybePromise<TransformResult>;
|
|
104
|
+
/**
|
|
105
|
+
* A hook that is called to load the source code.
|
|
106
|
+
*
|
|
107
|
+
* @param this - The build context, unplugin build context, and unplugin context.
|
|
108
|
+
* @param id - The identifier of the source code.
|
|
109
|
+
* @returns A promise that resolves when the hook is complete.
|
|
110
|
+
*/
|
|
111
|
+
load: (this: BuildPluginContext<TContext["config"]> & TContext, id: string) => MaybePromise<LoadResult>;
|
|
112
|
+
/**
|
|
113
|
+
* A hook that is called to resolve the identifier of the source code.
|
|
114
|
+
*
|
|
115
|
+
* @param this - The build context, unplugin build context, and unplugin context.
|
|
116
|
+
* @param id - The identifier of the source code.
|
|
117
|
+
* @param importer - The importer of the source code.
|
|
118
|
+
* @param options - The options for resolving the identifier.
|
|
119
|
+
* @returns A promise that resolves when the hook is complete.
|
|
120
|
+
*/
|
|
121
|
+
resolveId: (this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
|
|
122
|
+
isEntry: boolean;
|
|
123
|
+
}) => MaybePromise<string | ResolveResult | null | undefined>;
|
|
124
|
+
/**
|
|
125
|
+
* A hook that is called to write the bundle to disk.
|
|
126
|
+
*
|
|
127
|
+
* @param this - The build context.
|
|
128
|
+
* @returns A promise that resolves when the hook is complete.
|
|
129
|
+
*/
|
|
130
|
+
writeBundle: (this: TContext) => MaybePromise<void>;
|
|
131
|
+
}
|
|
132
|
+
type HookFunctions<TContext extends PluginContext> = { [TCommandType in BaseCommandType]: (this: TContext) => MaybePromise<void> } & Hooks<TContext>;
|
|
133
|
+
type DeepPartial$1<T> = { [K in keyof T]?: DeepPartial$1<T[K]> };
|
|
134
|
+
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;
|
|
135
|
+
type PluginHooks<TContext extends PluginContext> = { [TKey in keyof HookFunctions<TContext>]?: InferPluginHookFunction<TContext, TKey> } & {
|
|
136
|
+
types?: PluginHook<HookFunctions<TContext>["types"], never>;
|
|
137
|
+
transform?: PluginHook<HookFunctions<TContext>["transform"], "code" | "id">;
|
|
138
|
+
load?: PluginHook<HookFunctions<TContext>["load"], "id">;
|
|
139
|
+
resolveId?: PluginHook<HookFunctions<TContext>["resolveId"], "id">;
|
|
140
|
+
};
|
|
141
|
+
interface BasePlugin<TContext extends PluginContext> {
|
|
142
|
+
/**
|
|
143
|
+
* The name of the plugin, for use in deduplication, error messages and logs.
|
|
144
|
+
*/
|
|
145
|
+
name: string;
|
|
146
|
+
/**
|
|
147
|
+
* An API object that can be used for inter-plugin communication.
|
|
148
|
+
*
|
|
149
|
+
* @see https://rollupjs.org/plugin-development/#direct-plugin-communication
|
|
150
|
+
*/
|
|
151
|
+
api?: Record<string, any>;
|
|
152
|
+
/**
|
|
153
|
+
* Enforce plugin invocation tier similar to webpack loaders. Hooks ordering is still subject to the `order` property in the hook object.
|
|
154
|
+
*
|
|
155
|
+
* @remarks
|
|
156
|
+
* The Plugin invocation order is as follows:
|
|
157
|
+
* - `enforce: 'pre'` plugins
|
|
158
|
+
* - `order: 'pre'` plugin hooks
|
|
159
|
+
* - any other plugins (normal)
|
|
160
|
+
* - `order: 'post'` plugin hooks
|
|
161
|
+
* - `enforce: 'post'` plugins
|
|
162
|
+
*
|
|
163
|
+
* @see https://vitejs.dev/guide/api-plugin.html#plugin-ordering
|
|
164
|
+
* @see https://rollupjs.org/plugin-development/#build-hooks
|
|
165
|
+
* @see https://webpack.js.org/concepts/loaders/#enforce---pre-and-post
|
|
166
|
+
* @see https://esbuild.github.io/plugins/#concepts
|
|
167
|
+
*/
|
|
168
|
+
enforce?: "pre" | "post";
|
|
169
|
+
/**
|
|
170
|
+
* A function to determine if two plugins are the same and can be de-duplicated.
|
|
171
|
+
*
|
|
172
|
+
* @remarks
|
|
173
|
+
* If this is not provided, plugins are de-duplicated by comparing their names.
|
|
174
|
+
*
|
|
175
|
+
* @param other - The other plugin to compare against.
|
|
176
|
+
* @returns `true` if the two plugins are the same, `false` otherwise.
|
|
177
|
+
*/
|
|
178
|
+
dedupe?: false | ((other: Plugin<any>) => boolean);
|
|
179
|
+
/**
|
|
180
|
+
* Define environments where this plugin should be active. By default, the plugin is active in all environments.
|
|
181
|
+
*
|
|
182
|
+
* @param environment - The environment to check.
|
|
183
|
+
* @returns `true` if the plugin should be active in the specified environment, `false` otherwise.
|
|
184
|
+
*/
|
|
185
|
+
applyToEnvironment?: (environment: ResolvedEnvironmentConfig) => boolean | PluginConfig<any>;
|
|
186
|
+
/**
|
|
187
|
+
* A function that returns configuration options to be merged with the build context's options.
|
|
188
|
+
*
|
|
189
|
+
* @remarks
|
|
190
|
+
* 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.
|
|
191
|
+
*
|
|
192
|
+
* @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.
|
|
193
|
+
*
|
|
194
|
+
* @see https://vitejs.dev/guide/api-plugin#config
|
|
195
|
+
*
|
|
196
|
+
* @param this - The build context.
|
|
197
|
+
* @param config - The partial configuration object to be modified.
|
|
198
|
+
* @returns A promise that resolves to a partial configuration object.
|
|
199
|
+
*/
|
|
200
|
+
config?: PluginHook<(this: UnresolvedContext<TContext["config"], TContext["system"]>) => MaybePromise<DeepPartial$1<TContext["config"]> & Record<string, any>>> | (DeepPartial$1<TContext["config"]> & Record<string, any>);
|
|
201
|
+
}
|
|
202
|
+
type Plugin<TContext extends PluginContext> = Partial<PluginHooks<TContext>> & BasePlugin<TContext> & Pick<UnpluginOptions$1<TContext>, UnpluginBuilderVariant>;
|
|
203
|
+
type PluginNonHookFields = ArrayValues<typeof PLUGIN_NON_HOOK_FIELDS>;
|
|
204
|
+
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;
|
|
205
|
+
//#endregion
|
|
206
|
+
export { BasePlugin, HookFunctions, Hooks, Plugin, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, PluginNonHookFields, TypesResult };
|
|
207
|
+
//# sourceMappingURL=plugin.d.cts.map
|