@powerlines/core 0.48.32 → 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 +7 -7
- 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-BRt-Eq-v.d.mts +0 -15
- package/dist/context-helpers-BRt-Eq-v.d.mts.map +0 -1
- package/dist/context-helpers-Cnsku6fQ.d.cts +0 -15
- package/dist/context-helpers-Cnsku6fQ.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,682 @@
|
|
|
1
|
+
import { ResolveOptions, VirtualFile, VirtualFileSystemInterface, WriteOptions } from "./fs.cjs";
|
|
2
|
+
import { Plugin } from "./plugin.cjs";
|
|
3
|
+
import { CallHookOptions, HooksList, HooksListItem, InferHookParameters, InferHookReturnType } from "./hooks.cjs";
|
|
4
|
+
import { LogFn, LogMessage, Logger, LoggerOptions } from "./logging.cjs";
|
|
5
|
+
import { ParsedTypeScriptConfig } from "./tsconfig.cjs";
|
|
6
|
+
import { EnvironmentResolvedConfig, ExecutionOptions, Options, PluginConfig, ResolvedConfig, ResolvedEntryFileReference, UserConfig } from "./config.cjs";
|
|
7
|
+
import { EnvPaths } from "@stryke/env/get-env-paths";
|
|
8
|
+
import { DeepPartial } from "@stryke/types/base";
|
|
9
|
+
import { PackageJson } from "@stryke/types/package-json";
|
|
10
|
+
import { Jiti } from "jiti";
|
|
11
|
+
import MagicString, { SourceMap } from "magic-string";
|
|
12
|
+
import { ParseResult, ParserOptions } from "oxc-parser";
|
|
13
|
+
import { Range } from "semver";
|
|
14
|
+
import { RequestInfo, Response } from "undici";
|
|
15
|
+
import { Unimport } from "unimport";
|
|
16
|
+
import { ExternalIdResult, UnpluginBuildContext } from "unplugin";
|
|
17
|
+
|
|
18
|
+
//#region src/types/context.d.ts
|
|
19
|
+
type MetaInfo = Record<string, any> & {
|
|
20
|
+
/**
|
|
21
|
+
* The checksum generated from the resolved options
|
|
22
|
+
*/
|
|
23
|
+
checksum: string;
|
|
24
|
+
/**
|
|
25
|
+
* The unique identifier of the execution, which can be used for logging and other purposes to distinguish between different executions in the same process.
|
|
26
|
+
*/
|
|
27
|
+
executionId: string;
|
|
28
|
+
/**
|
|
29
|
+
* 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.
|
|
30
|
+
*/
|
|
31
|
+
buildId: string;
|
|
32
|
+
/**
|
|
33
|
+
* 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.
|
|
34
|
+
*/
|
|
35
|
+
releaseId: string;
|
|
36
|
+
/**
|
|
37
|
+
* The timestamp when the execution context was initialized
|
|
38
|
+
*/
|
|
39
|
+
timestamp: number;
|
|
40
|
+
/**
|
|
41
|
+
* A hash that represents the path to the project root directory
|
|
42
|
+
*/
|
|
43
|
+
rootHash: string;
|
|
44
|
+
/**
|
|
45
|
+
* A hash that represents the path to the configuration root directory
|
|
46
|
+
*/
|
|
47
|
+
configHash: string;
|
|
48
|
+
};
|
|
49
|
+
interface Resolver extends Jiti {
|
|
50
|
+
plugin: Jiti;
|
|
51
|
+
}
|
|
52
|
+
interface TransformResult$1 {
|
|
53
|
+
code: string;
|
|
54
|
+
map: SourceMap | null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The format for providing source code to the compiler
|
|
58
|
+
*/
|
|
59
|
+
interface SourceFile {
|
|
60
|
+
/**
|
|
61
|
+
* The name of the file to be compiled
|
|
62
|
+
*/
|
|
63
|
+
id: string;
|
|
64
|
+
/**
|
|
65
|
+
* The source code to be compiled
|
|
66
|
+
*/
|
|
67
|
+
code: MagicString;
|
|
68
|
+
/**
|
|
69
|
+
* The environment variables used in the source code
|
|
70
|
+
*/
|
|
71
|
+
env: string[];
|
|
72
|
+
/**
|
|
73
|
+
* The result of the transformation
|
|
74
|
+
*/
|
|
75
|
+
result?: TransformResult$1;
|
|
76
|
+
}
|
|
77
|
+
type UnimportContext = Omit<Unimport, "injectImports"> & {
|
|
78
|
+
dumpImports: () => Promise<void>;
|
|
79
|
+
injectImports: (source: SourceFile) => Promise<SourceFile>;
|
|
80
|
+
refreshRuntimeImports: () => Promise<void>;
|
|
81
|
+
};
|
|
82
|
+
interface SelectHooksOptions {
|
|
83
|
+
order?: "pre" | "post" | "normal";
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Options for initializing or updating the context with new configuration values
|
|
87
|
+
*/
|
|
88
|
+
interface InitContextOptions {
|
|
89
|
+
/**
|
|
90
|
+
* If false, the plugin will be loaded after all other plugins.
|
|
91
|
+
*
|
|
92
|
+
* @defaultValue true
|
|
93
|
+
*/
|
|
94
|
+
isHighPriority: boolean;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Options for fetch requests made via the context's {@link Context.fetch} method
|
|
98
|
+
*/
|
|
99
|
+
interface FetchOptions extends RequestInit {
|
|
100
|
+
/**
|
|
101
|
+
* An indicator specifying that the request should bypass any caching
|
|
102
|
+
*/
|
|
103
|
+
skipCache?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* The maximum time in milliseconds to wait for the request to complete.
|
|
106
|
+
*
|
|
107
|
+
* @defaultValue 30000
|
|
108
|
+
*/
|
|
109
|
+
timeout?: number;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Options for parsing code using [Oxc-Parser](https://github.com/oxc/oxc)
|
|
113
|
+
*/
|
|
114
|
+
interface ParseOptions extends ParserOptions {
|
|
115
|
+
/**
|
|
116
|
+
* When true this allows return statements to be outside functions to e.g. support parsing CommonJS code.
|
|
117
|
+
*/
|
|
118
|
+
allowReturnOutsideFunction?: boolean;
|
|
119
|
+
}
|
|
120
|
+
interface EmitOptions extends WriteOptions {
|
|
121
|
+
/**
|
|
122
|
+
* The file extension to use when emitting the file
|
|
123
|
+
*/
|
|
124
|
+
extension?: string;
|
|
125
|
+
/**
|
|
126
|
+
* If true, will emit the file using {@link UnpluginBuildContext.emitFile | the bundler's emit function}.
|
|
127
|
+
*/
|
|
128
|
+
emitWithBundler?: boolean;
|
|
129
|
+
needsCodeReference?: Parameters<UnpluginBuildContext["emitFile"]>[0]["needsCodeReference"];
|
|
130
|
+
originalFileName?: Parameters<UnpluginBuildContext["emitFile"]>[0]["originalFileName"];
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Options for emitting entry virtual files
|
|
134
|
+
*/
|
|
135
|
+
type EmitEntryOptions = EmitOptions & Omit<ResolvedEntryFileReference, "file">;
|
|
136
|
+
interface ResolveResult extends ExternalIdResult {
|
|
137
|
+
/**
|
|
138
|
+
* A flag indicating whether the resolved module is part of the generated runtime modules
|
|
139
|
+
*/
|
|
140
|
+
virtual?: boolean;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* The base Powerlines context.
|
|
144
|
+
*
|
|
145
|
+
* @remarks
|
|
146
|
+
* This context provides the foundational structure for interacting with the Powerlines engine.
|
|
147
|
+
*/
|
|
148
|
+
interface BaseContext<TSystemContext = any> extends Pick<Required<Options>, "cwd"> {
|
|
149
|
+
/**
|
|
150
|
+
* 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.
|
|
151
|
+
*/
|
|
152
|
+
system: TSystemContext;
|
|
153
|
+
/**
|
|
154
|
+
* The timestamp when the context was initialized
|
|
155
|
+
*/
|
|
156
|
+
timestamp: number;
|
|
157
|
+
/**
|
|
158
|
+
* The Powerlines environment paths
|
|
159
|
+
*/
|
|
160
|
+
envPaths: EnvPaths;
|
|
161
|
+
/**
|
|
162
|
+
* The file system path to the Powerlines package installation
|
|
163
|
+
*/
|
|
164
|
+
powerlinesPath: string;
|
|
165
|
+
/**
|
|
166
|
+
* The options provided to the Powerlines process.
|
|
167
|
+
*/
|
|
168
|
+
options: Options;
|
|
169
|
+
/**
|
|
170
|
+
* An instance of the Powerlines logger client that can be used to generate log messages with consistent formatting and metadata.
|
|
171
|
+
*/
|
|
172
|
+
logger: Logger;
|
|
173
|
+
/**
|
|
174
|
+
* A logging function for fatal messages
|
|
175
|
+
*/
|
|
176
|
+
fatal: (message: string | LogMessage | Error) => void;
|
|
177
|
+
/**
|
|
178
|
+
* A logging function for error messages
|
|
179
|
+
*/
|
|
180
|
+
error: (message: string | LogMessage | Error) => void;
|
|
181
|
+
/**
|
|
182
|
+
* A logging function for warning messages
|
|
183
|
+
*/
|
|
184
|
+
warn: (message: string | LogMessage) => void;
|
|
185
|
+
/**
|
|
186
|
+
* A logging function for informational messages
|
|
187
|
+
*/
|
|
188
|
+
info: (message: string | LogMessage) => void;
|
|
189
|
+
/**
|
|
190
|
+
* A logging function for debug messages
|
|
191
|
+
*/
|
|
192
|
+
debug: (message: string | LogMessage) => void;
|
|
193
|
+
/**
|
|
194
|
+
* A logging function for trace messages
|
|
195
|
+
*/
|
|
196
|
+
trace: (message: string | LogMessage) => void;
|
|
197
|
+
/**
|
|
198
|
+
* A function to create a timer for measuring the duration of asynchronous operations
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```ts
|
|
202
|
+
* const stopTimer = context.timer("Your Async Operation");
|
|
203
|
+
* await performAsyncOperation();
|
|
204
|
+
* stopTimer(); // "Your Async Operation completed in 123.45 milliseconds"
|
|
205
|
+
* ```
|
|
206
|
+
*
|
|
207
|
+
* @param name - The name of the timer.
|
|
208
|
+
* @returns A function that, when called, stops the timer and logs the duration.
|
|
209
|
+
*/
|
|
210
|
+
timer: (name: string) => () => void;
|
|
211
|
+
/**
|
|
212
|
+
* Create a new logger instance
|
|
213
|
+
*
|
|
214
|
+
* @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.
|
|
215
|
+
* @returns A logger client instance that can be used to generate log messages with consistent formatting and metadata.
|
|
216
|
+
*/
|
|
217
|
+
createLogger: (options: LoggerOptions, logFn?: LogFn) => Logger;
|
|
218
|
+
/**
|
|
219
|
+
* Extend the current logger instance with a new source
|
|
220
|
+
*
|
|
221
|
+
* @param options - The overlay metadata to use for the badge in the log output.
|
|
222
|
+
* @returns A logger client instance that extends the current logger with the provided configuration options.
|
|
223
|
+
*/
|
|
224
|
+
extendLogger: (options: LoggerOptions, logFn?: LogFn) => Logger;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* The unresolved Powerlines context.
|
|
228
|
+
*
|
|
229
|
+
* @remarks
|
|
230
|
+
* This context is used before the user configuration has been fully resolved after the `config`.
|
|
231
|
+
*/
|
|
232
|
+
interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = any> extends BaseContext<TSystemContext> {
|
|
233
|
+
/**
|
|
234
|
+
* 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.
|
|
235
|
+
*/
|
|
236
|
+
options: ExecutionOptions;
|
|
237
|
+
/**
|
|
238
|
+
* An object containing the options provided to Powerlines
|
|
239
|
+
*/
|
|
240
|
+
config: Omit<TResolvedConfig, "pluginConfig">;
|
|
241
|
+
/**
|
|
242
|
+
* 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.
|
|
243
|
+
*/
|
|
244
|
+
meta: MetaInfo;
|
|
245
|
+
/**
|
|
246
|
+
* The metadata information currently written to disk
|
|
247
|
+
*/
|
|
248
|
+
persistedMeta?: MetaInfo;
|
|
249
|
+
/**
|
|
250
|
+
* The path to a directory where the reflection data buffers (used by the build processes) are stored
|
|
251
|
+
*/
|
|
252
|
+
readonly dataPath: string;
|
|
253
|
+
/**
|
|
254
|
+
* The path to a directory where the project cache (used by the build processes) is stored
|
|
255
|
+
*/
|
|
256
|
+
readonly cachePath: string;
|
|
257
|
+
/**
|
|
258
|
+
* The Powerlines artifacts directory
|
|
259
|
+
*/
|
|
260
|
+
readonly artifactsPath: string;
|
|
261
|
+
/**
|
|
262
|
+
* The path to the Powerlines builtin runtime modules directory
|
|
263
|
+
*/
|
|
264
|
+
readonly builtinsPath: string;
|
|
265
|
+
/**
|
|
266
|
+
* The path to the Powerlines entry modules directory
|
|
267
|
+
*/
|
|
268
|
+
readonly entryPath: string;
|
|
269
|
+
/**
|
|
270
|
+
* The path to the Powerlines infrastructure modules directory
|
|
271
|
+
*/
|
|
272
|
+
readonly infrastructurePath: string;
|
|
273
|
+
/**
|
|
274
|
+
* The path to the Powerlines TypeScript declaration files directory
|
|
275
|
+
*/
|
|
276
|
+
readonly typesPath: string;
|
|
277
|
+
/**
|
|
278
|
+
* Invokes the configured plugin hooks
|
|
279
|
+
*
|
|
280
|
+
* @remarks
|
|
281
|
+
* By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
|
|
282
|
+
*
|
|
283
|
+
* @param hook - The hook to call
|
|
284
|
+
* @param options - The options to provide to the hook
|
|
285
|
+
* @param args - The arguments to pass to the hook
|
|
286
|
+
* @returns The result of the hook call
|
|
287
|
+
*/
|
|
288
|
+
callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
|
|
289
|
+
environment?: string | EnvironmentContext<TResolvedConfig>;
|
|
290
|
+
}, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
|
|
291
|
+
/**
|
|
292
|
+
* The virtual file system interface for managing files during the build process
|
|
293
|
+
*/
|
|
294
|
+
fs: VirtualFileSystemInterface;
|
|
295
|
+
/**
|
|
296
|
+
* The project's `package.json` file content
|
|
297
|
+
*/
|
|
298
|
+
packageJson: PackageJson & Record<string, any>;
|
|
299
|
+
/**
|
|
300
|
+
* The project's `project.json` file content
|
|
301
|
+
*/
|
|
302
|
+
projectJson?: Record<string, any>;
|
|
303
|
+
/**
|
|
304
|
+
* The dependency installations required by the project
|
|
305
|
+
*/
|
|
306
|
+
dependencies: Record<string, string | Range>;
|
|
307
|
+
/**
|
|
308
|
+
* The development dependency installations required by the project
|
|
309
|
+
*/
|
|
310
|
+
devDependencies: Record<string, string | Range>;
|
|
311
|
+
/**
|
|
312
|
+
* The parsed TypeScript configuration from the `tsconfig.json` file
|
|
313
|
+
*/
|
|
314
|
+
tsconfig: ParsedTypeScriptConfig;
|
|
315
|
+
/**
|
|
316
|
+
* The entry points of the source code
|
|
317
|
+
*/
|
|
318
|
+
entry: ResolvedEntryFileReference[];
|
|
319
|
+
/**
|
|
320
|
+
* The Jiti module resolver
|
|
321
|
+
*/
|
|
322
|
+
resolver: Resolver;
|
|
323
|
+
/**
|
|
324
|
+
* The builtin module id that exist in the Powerlines virtual file system
|
|
325
|
+
*/
|
|
326
|
+
builtins: string[];
|
|
327
|
+
/**
|
|
328
|
+
* The alias mappings for the project used during module resolution
|
|
329
|
+
*
|
|
330
|
+
* @remarks
|
|
331
|
+
* This includes both the built-in module aliases as well as any custom aliases defined in the build configuration.
|
|
332
|
+
*/
|
|
333
|
+
alias: Record<string, string>;
|
|
334
|
+
/**
|
|
335
|
+
* The resolved tsconfig file paths for the project
|
|
336
|
+
*/
|
|
337
|
+
resolvePatterns: RegExp[];
|
|
338
|
+
/**
|
|
339
|
+
* Additional arguments provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed.
|
|
340
|
+
*/
|
|
341
|
+
additionalArgs: Record<string, string | string[]>;
|
|
342
|
+
/**
|
|
343
|
+
* A function to perform HTTP fetch requests
|
|
344
|
+
*
|
|
345
|
+
* @remarks
|
|
346
|
+
* This function uses a caching layer to avoid duplicate requests during the Powerlines process.
|
|
347
|
+
*
|
|
348
|
+
* @example
|
|
349
|
+
* ```ts
|
|
350
|
+
* const response = await context.fetch("https://api.example.com/data");
|
|
351
|
+
* const data = await response.json();
|
|
352
|
+
* ```
|
|
353
|
+
*
|
|
354
|
+
* @see https://github.com/nodejs/undici
|
|
355
|
+
*
|
|
356
|
+
* @param input - The URL to fetch.
|
|
357
|
+
* @param options - The fetch request options.
|
|
358
|
+
* @returns A promise that resolves to a response returned by the fetch.
|
|
359
|
+
*/
|
|
360
|
+
fetch: (input: RequestInfo, options?: FetchOptions) => Promise<Response>;
|
|
361
|
+
/**
|
|
362
|
+
* Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
363
|
+
*
|
|
364
|
+
* @remarks
|
|
365
|
+
* This function can be used to parse TypeScript code into an AST for further analysis or transformation.
|
|
366
|
+
*
|
|
367
|
+
* @example
|
|
368
|
+
* ```ts
|
|
369
|
+
* const ast = context.parse("const x: number = 42;");
|
|
370
|
+
* ```
|
|
371
|
+
*
|
|
372
|
+
* @see https://rollupjs.org/plugin-development/#this-parse
|
|
373
|
+
* @see https://github.com/oxc/oxc
|
|
374
|
+
*
|
|
375
|
+
* @param code - The source code to parse.
|
|
376
|
+
* @param options - The options to pass to the parser.
|
|
377
|
+
* @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
378
|
+
*/
|
|
379
|
+
parse: (code: string, options?: ParseOptions) => Promise<ParseResult>;
|
|
380
|
+
/**
|
|
381
|
+
* A helper function to resolve modules using the Jiti resolver
|
|
382
|
+
*
|
|
383
|
+
* @remarks
|
|
384
|
+
* This function can be used to resolve modules relative to the project root directory.
|
|
385
|
+
*
|
|
386
|
+
* @example
|
|
387
|
+
* ```ts
|
|
388
|
+
* const resolvedPath = await context.resolve("some-module", "/path/to/importer");
|
|
389
|
+
* ```
|
|
390
|
+
*
|
|
391
|
+
* @param id - The module to resolve.
|
|
392
|
+
* @param importer - An optional path to the importer module.
|
|
393
|
+
* @param options - Additional resolution options.
|
|
394
|
+
* @returns A promise that resolves to the resolved module path.
|
|
395
|
+
*/
|
|
396
|
+
resolve: (id: string, importer?: string, options?: ResolveOptions) => Promise<ResolveResult | undefined>;
|
|
397
|
+
/**
|
|
398
|
+
* A helper function to load modules using the Jiti resolver
|
|
399
|
+
*
|
|
400
|
+
* @remarks
|
|
401
|
+
* This function can be used to load modules relative to the project root directory.
|
|
402
|
+
*
|
|
403
|
+
* @example
|
|
404
|
+
* ```ts
|
|
405
|
+
* const module = await context.load("some-module", "/path/to/importer");
|
|
406
|
+
* ```
|
|
407
|
+
*
|
|
408
|
+
* @param id - The module to load.
|
|
409
|
+
* @returns A promise that resolves to the loaded module.
|
|
410
|
+
*/
|
|
411
|
+
load: (id: string) => Promise<TransformResult$1 | undefined>;
|
|
412
|
+
/**
|
|
413
|
+
* The Powerlines builtin virtual files
|
|
414
|
+
*/
|
|
415
|
+
getBuiltins: () => Promise<VirtualFile[]>;
|
|
416
|
+
/**
|
|
417
|
+
* Resolves a file and writes it to the VFS if it does not already exist
|
|
418
|
+
*
|
|
419
|
+
* @param code - The source code of the file
|
|
420
|
+
* @param path - The path to write the file to
|
|
421
|
+
* @param options - Additional options for writing the file
|
|
422
|
+
*/
|
|
423
|
+
emit: (code: string, path: string, options?: EmitOptions) => Promise<void>;
|
|
424
|
+
/**
|
|
425
|
+
* Synchronously resolves a file and writes it to the VFS if it does not already exist
|
|
426
|
+
*
|
|
427
|
+
* @param code - The source code of the file
|
|
428
|
+
* @param path - The path to write the file to
|
|
429
|
+
* @param options - Additional options for writing the file
|
|
430
|
+
*/
|
|
431
|
+
emitSync: (code: string, path: string, options?: EmitOptions) => void;
|
|
432
|
+
/**
|
|
433
|
+
* Resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
434
|
+
*
|
|
435
|
+
* @param code - The source code of the builtin file
|
|
436
|
+
* @param id - The unique identifier of the builtin file
|
|
437
|
+
* @param options - Additional options for writing the builtin file
|
|
438
|
+
*/
|
|
439
|
+
emitBuiltin: (code: string, id: string, options?: EmitOptions) => Promise<void>;
|
|
440
|
+
/**
|
|
441
|
+
* Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
442
|
+
*
|
|
443
|
+
* @param code - The source code of the builtin file
|
|
444
|
+
* @param id - The unique identifier of the builtin file
|
|
445
|
+
* @param options - Additional options for writing the builtin file
|
|
446
|
+
*/
|
|
447
|
+
emitBuiltinSync: (code: string, id: string, options?: EmitOptions) => void;
|
|
448
|
+
/**
|
|
449
|
+
* Resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
450
|
+
*
|
|
451
|
+
* @param code - The source code of the entry file
|
|
452
|
+
* @param path - An optional path to write the entry file to
|
|
453
|
+
* @param options - Additional options for writing the entry file
|
|
454
|
+
*/
|
|
455
|
+
emitEntry: (code: string, path: string, options?: EmitEntryOptions) => Promise<void>;
|
|
456
|
+
/**
|
|
457
|
+
* Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
458
|
+
*
|
|
459
|
+
* @param code - The source code of the entry file
|
|
460
|
+
* @param path - An optional path to write the entry file to
|
|
461
|
+
* @param options - Additional options for writing the entry file
|
|
462
|
+
*/
|
|
463
|
+
emitEntrySync: (code: string, path: string, options?: EmitEntryOptions) => void;
|
|
464
|
+
/**
|
|
465
|
+
* Resolves a infrastructure virtual file and writes it to the VFS if it does not already exist
|
|
466
|
+
*
|
|
467
|
+
* @param code - The source code of the infrastructure file
|
|
468
|
+
* @param id - The unique identifier of the infrastructure file
|
|
469
|
+
* @param options - Additional options for writing the infrastructure file
|
|
470
|
+
*/
|
|
471
|
+
emitInfrastructure: (code: string, id: string, options?: EmitOptions) => Promise<void>;
|
|
472
|
+
/**
|
|
473
|
+
* Synchronously resolves a infrastructure virtual file and writes it to the VFS if it does not already exist
|
|
474
|
+
*
|
|
475
|
+
* @param code - The source code of the infrastructure file
|
|
476
|
+
* @param id - The unique identifier of the infrastructure file
|
|
477
|
+
* @param options - Additional options for writing the infrastructure file
|
|
478
|
+
*/
|
|
479
|
+
emitInfrastructureSync: (code: string, id: string, options?: EmitOptions) => void;
|
|
480
|
+
/**
|
|
481
|
+
* Generates a checksum representing the current context state
|
|
482
|
+
*
|
|
483
|
+
* @returns A promise that resolves to a string representing the checksum
|
|
484
|
+
*/
|
|
485
|
+
generateChecksum: () => Promise<string>;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* The resolved Powerlines context.
|
|
489
|
+
*
|
|
490
|
+
* @remarks
|
|
491
|
+
* 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.
|
|
492
|
+
*/
|
|
493
|
+
type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = any> = Omit<UnresolvedContext<TResolvedConfig, TSystemContext>, "config" | "callHook"> & {
|
|
494
|
+
/**
|
|
495
|
+
* The fully resolved Powerlines configuration
|
|
496
|
+
*/
|
|
497
|
+
config: TResolvedConfig;
|
|
498
|
+
/**
|
|
499
|
+
* 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.
|
|
500
|
+
*
|
|
501
|
+
* @param config - The plugin configuration values to set.
|
|
502
|
+
* @returns A promise that resolves when the plugin configuration values have been set.
|
|
503
|
+
*/
|
|
504
|
+
setPluginConfig: (config: DeepPartial<UserConfig>) => Promise<void>;
|
|
505
|
+
/**
|
|
506
|
+
* Invokes the configured plugin hooks
|
|
507
|
+
*
|
|
508
|
+
* @remarks
|
|
509
|
+
* By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
|
|
510
|
+
*
|
|
511
|
+
* @param hook - The hook to call
|
|
512
|
+
* @param options - The options to provide to the hook
|
|
513
|
+
* @param args - The arguments to pass to the hook
|
|
514
|
+
* @returns The result of the hook call
|
|
515
|
+
*/
|
|
516
|
+
callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
|
|
517
|
+
environment?: string | EnvironmentContext<any, any>;
|
|
518
|
+
}, ...args: InferHookParameters<PluginContext<any, any>, TKey>) => Promise<InferHookReturnType<PluginContext<any, any>, TKey> | undefined>;
|
|
519
|
+
};
|
|
520
|
+
interface ExecutionContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = any> extends Context<TResolvedConfig, TSystemContext> {
|
|
521
|
+
/**
|
|
522
|
+
* 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.
|
|
523
|
+
*/
|
|
524
|
+
readonly id: string;
|
|
525
|
+
/**
|
|
526
|
+
* The expected plugins options for the Powerlines project.
|
|
527
|
+
*
|
|
528
|
+
* @remarks
|
|
529
|
+
* 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.
|
|
530
|
+
*/
|
|
531
|
+
plugins: Plugin<PluginContext<TResolvedConfig, TSystemContext>>[];
|
|
532
|
+
/**
|
|
533
|
+
* A table for storing the current context for each configured environment
|
|
534
|
+
*/
|
|
535
|
+
environments: Record<string, EnvironmentContext<TResolvedConfig, TSystemContext>>;
|
|
536
|
+
/**
|
|
537
|
+
* Retrieves the context for a specific environment by name
|
|
538
|
+
*
|
|
539
|
+
* @throws Will throw an error if the environment does not exist
|
|
540
|
+
*
|
|
541
|
+
* @param name - The name of the environment to retrieve. If not provided, the default environment is returned.
|
|
542
|
+
* @returns A promise that resolves to the environment context.
|
|
543
|
+
*
|
|
544
|
+
* @example
|
|
545
|
+
* ```ts
|
|
546
|
+
* const devEnv = await apiContext.getEnvironment("development");
|
|
547
|
+
* const defaultEnv = await apiContext.getEnvironment();
|
|
548
|
+
* ```
|
|
549
|
+
*/
|
|
550
|
+
getEnvironment: (name?: string) => Promise<EnvironmentContext<TResolvedConfig, TSystemContext>>;
|
|
551
|
+
/**
|
|
552
|
+
* Safely retrieves the context for a specific environment by name
|
|
553
|
+
*
|
|
554
|
+
* @param name - The name of the environment to retrieve. If not provided, the default environment is returned.
|
|
555
|
+
* @returns A promise that resolves to the environment context, or undefined if the environment does not exist.
|
|
556
|
+
*
|
|
557
|
+
* @example
|
|
558
|
+
* ```ts
|
|
559
|
+
* const devEnv = await apiContext.getEnvironmentSafe("development");
|
|
560
|
+
* const defaultEnv = await apiContext.getEnvironmentSafe();
|
|
561
|
+
* ```
|
|
562
|
+
*
|
|
563
|
+
* @remarks
|
|
564
|
+
* This method is similar to `getEnvironment`, but it returns `undefined` instead of throwing an error if the specified environment does not exist.
|
|
565
|
+
* This can be useful in scenarios where the existence of an environment is optional or uncertain.
|
|
566
|
+
*
|
|
567
|
+
* ```ts
|
|
568
|
+
* const testEnv = await apiContext.getEnvironmentSafe("test");
|
|
569
|
+
* if (testEnv) {
|
|
570
|
+
* // Environment exists, safe to use it
|
|
571
|
+
* } else {
|
|
572
|
+
* // Environment does not exist, handle accordingly
|
|
573
|
+
* }
|
|
574
|
+
* ```
|
|
575
|
+
*
|
|
576
|
+
* Using this method helps avoid unhandled exceptions in cases where an environment might not be defined.
|
|
577
|
+
*/
|
|
578
|
+
getEnvironmentSafe: (name?: string) => Promise<EnvironmentContext<TResolvedConfig, TSystemContext> | undefined>;
|
|
579
|
+
/**
|
|
580
|
+
* A function to copy the context and update the fields for a specific environment
|
|
581
|
+
*
|
|
582
|
+
* @param environment - The environment configuration to use.
|
|
583
|
+
* @returns A new context instance with the updated environment.
|
|
584
|
+
*/
|
|
585
|
+
createEnvironment: (environment: EnvironmentResolvedConfig<TResolvedConfig>["environment"]) => Promise<EnvironmentContext<TResolvedConfig, TSystemContext>>;
|
|
586
|
+
/**
|
|
587
|
+
* A function to merge all configured environments into a single context
|
|
588
|
+
*
|
|
589
|
+
* @returns A promise that resolves to the merged environment context.
|
|
590
|
+
*/
|
|
591
|
+
toEnvironment: () => Promise<EnvironmentContext<TResolvedConfig, TSystemContext>>;
|
|
592
|
+
/**
|
|
593
|
+
* A function used internally to add a plugin to the context and update the configuration options
|
|
594
|
+
*
|
|
595
|
+
* @danger
|
|
596
|
+
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
597
|
+
*
|
|
598
|
+
* @internal
|
|
599
|
+
*/
|
|
600
|
+
unstable_addPlugin: (plugin: PluginConfig<PluginContext<TResolvedConfig, TSystemContext>>) => Promise<void>;
|
|
601
|
+
}
|
|
602
|
+
interface EnvironmentPlugin<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = any> extends Plugin<PluginContext<TResolvedConfig, TSystemContext>> {
|
|
603
|
+
/**
|
|
604
|
+
* A internal field to store the plugin configuration and context for the environment context
|
|
605
|
+
*
|
|
606
|
+
* @danger
|
|
607
|
+
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
608
|
+
*
|
|
609
|
+
* @internal
|
|
610
|
+
*/
|
|
611
|
+
"~internal": {
|
|
612
|
+
/**
|
|
613
|
+
* The unique identifier of the plugin, which can be used for logging and other purposes to distinguish between different plugins in the same process.
|
|
614
|
+
*/
|
|
615
|
+
readonly id: string;
|
|
616
|
+
/**
|
|
617
|
+
* The context for the plugin, which provides access to the Powerlines engine and other utilities for interacting with the build process.
|
|
618
|
+
*
|
|
619
|
+
* @remarks
|
|
620
|
+
* This context is specific to the plugin and environment, allowing for environment-specific modifications without affecting the global context.
|
|
621
|
+
*/
|
|
622
|
+
readonly context: PluginContext<TResolvedConfig, TSystemContext>;
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
type SelectHookResultItem<TContext extends PluginContext, TKey extends string> = HooksListItem<TContext, TKey> & {
|
|
626
|
+
context: TContext;
|
|
627
|
+
};
|
|
628
|
+
type SelectHookResult<TContext extends PluginContext, TKey extends string> = SelectHookResultItem<TContext, TKey>[];
|
|
629
|
+
interface EnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = any> extends Context<EnvironmentResolvedConfig<TResolvedConfig>, TSystemContext> {
|
|
630
|
+
/**
|
|
631
|
+
* 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.
|
|
632
|
+
*/
|
|
633
|
+
readonly id: string;
|
|
634
|
+
/**
|
|
635
|
+
* The expected plugins options for the Powerlines project.
|
|
636
|
+
*
|
|
637
|
+
* @remarks
|
|
638
|
+
* 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.
|
|
639
|
+
*/
|
|
640
|
+
plugins: EnvironmentPlugin<TResolvedConfig, TSystemContext>[];
|
|
641
|
+
/**
|
|
642
|
+
* A table holding references to hook functions registered by plugins
|
|
643
|
+
*/
|
|
644
|
+
hooks: HooksList<PluginContext<TResolvedConfig, TSystemContext>>;
|
|
645
|
+
/**
|
|
646
|
+
* 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.
|
|
647
|
+
*
|
|
648
|
+
* @danger
|
|
649
|
+
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
650
|
+
*
|
|
651
|
+
* @internal
|
|
652
|
+
*/
|
|
653
|
+
unstable_execution: ExecutionContext<TResolvedConfig, TSystemContext>;
|
|
654
|
+
/**
|
|
655
|
+
* Retrieves the hook handlers for a specific hook name
|
|
656
|
+
*/
|
|
657
|
+
selectHooks: <TKey extends string>(key: TKey, options?: SelectHooksOptions) => SelectHookResult<PluginContext<TResolvedConfig, TSystemContext>, TKey>;
|
|
658
|
+
/**
|
|
659
|
+
* A function used internally to add a plugin to the context and update the configuration options
|
|
660
|
+
*
|
|
661
|
+
* @danger
|
|
662
|
+
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
663
|
+
*
|
|
664
|
+
* @internal
|
|
665
|
+
*/
|
|
666
|
+
unstable_addPlugin: (plugin: PluginConfig<PluginContext<TResolvedConfig, TSystemContext>>) => Promise<void>;
|
|
667
|
+
}
|
|
668
|
+
interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = any> extends Context<EnvironmentResolvedConfig<TResolvedConfig>, TSystemContext> {
|
|
669
|
+
/**
|
|
670
|
+
* 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.
|
|
671
|
+
*/
|
|
672
|
+
readonly id: string;
|
|
673
|
+
/**
|
|
674
|
+
* 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.
|
|
675
|
+
*/
|
|
676
|
+
readonly environment: EnvironmentContext;
|
|
677
|
+
}
|
|
678
|
+
type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = UnpluginBuildContext & PluginContext<TResolvedConfig>;
|
|
679
|
+
type WithUnpluginBuildContext<TContext extends PluginContext> = UnpluginBuildContext & TContext;
|
|
680
|
+
//#endregion
|
|
681
|
+
export { BaseContext, BuildPluginContext, Context, EmitEntryOptions, EmitOptions, EnvironmentContext, EnvironmentPlugin, ExecutionContext, FetchOptions, InitContextOptions, MetaInfo, ParseOptions, PluginContext, ResolveResult, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, SourceFile, TransformResult$1 as TransformResult, UnimportContext, UnresolvedContext, WithUnpluginBuildContext };
|
|
682
|
+
//# sourceMappingURL=context.d.cts.map
|