@powerlines/core 0.48.32 → 0.48.34
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.cjs +1 -1
- 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/generate-types.mjs +1 -1
- package/dist/lib/generate-types.mjs.map +1 -1
- 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.cjs +2 -1
- 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/meta.mjs +2 -1
- package/dist/lib/meta.mjs.map +1 -1
- package/dist/lib/plugins.cjs +3 -3
- 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/plugins.mjs +1 -1
- package/dist/lib/plugins.mjs.map +1 -1
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-types.mjs","names":[],"sources":["../../src/lib/generate-types.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { resolvePackage } from \"@stryke/fs/resolve\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { prettyBytes } from \"@stryke/string-format/pretty-bytes\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { DiagnosticCategory, Node, Project, SourceFile } from \"ts-morph\";\nimport { ResolvedConfig } from \"../types/config\";\nimport {\n Context,\n EnvironmentContext,\n ExecutionContext\n} from \"../types/context\";\nimport { TypesResult } from \"../types/plugin\";\nimport { callHook } from \"./hooks\";\nimport { createProgram } from \"./typescript/ts-morph\";\nimport { getTypescriptFileHeader } from \"./utilities/file-header\";\nimport { format } from \"./utilities/format\";\n\ninterface ModuleExportSpecifier {\n name: string;\n alias?: string;\n default?: boolean;\n type?: boolean;\n}\n\ninterface ModuleReference {\n name?: string;\n specifiers?: ModuleExportSpecifier[];\n all?: boolean;\n}\n\ninterface ImportModuleReference extends ModuleReference {\n name: string;\n ambient?: boolean;\n}\n\ninterface ExportModuleReference extends ModuleReference {\n text: string;\n fullText: string;\n comment?: string;\n}\n\ninterface ModuleDeclaration {\n name: string;\n text: string;\n sourceFile: SourceFile;\n comment?: string;\n exports: (ExportModuleReference | string)[];\n imports: ImportModuleReference[];\n}\n\nexport interface TypegenContext {\n context: Context;\n emitted: Map<string, string>;\n modules: ModuleDeclaration[];\n}\n\n/**\n * Formats the generated TypeScript types source code.\n *\n * @param code - The generated TypeScript code.\n * @returns The formatted TypeScript code.\n */\nexport function formatTypes(code = \"\"): string {\n return code.replaceAll(\"#private;\", \"\").replace(/__Ω/g, \"\");\n}\n\nasync function extractModuleDeclarations(\n ctx: TypegenContext,\n filePath: string,\n name: string,\n text: string\n): Promise<ModuleDeclaration> {\n const imports: ImportModuleReference[] = [];\n const exports: (ExportModuleReference | string)[] = [];\n\n const comment = text\n .match(\n new RegExp(\n `\\\\/\\\\*\\\\*(?s:.)*?@module\\\\s+${\n ctx.context.config.framework?.name ?? \"powerlines\"\n }:${name}(?s:.)*?\\\\*\\\\/\\\\s+`\n )\n )\n ?.find(comment => isSetString(comment?.trim()));\n\n // Parse the emitted .d.ts content using an in-memory ts-morph project\n const project = new Project({ useInMemoryFileSystem: true });\n const sourceFile = project.createSourceFile(\"module.d.ts\", text);\n\n // Collect /// <reference types=\"...\" /> directives as ambient dependencies\n for (const ref of sourceFile.getTypeReferenceDirectives()) {\n if (\n ref.getFileName() &&\n !ctx.context.builtins.some(builtin => ref.getFileName().endsWith(builtin))\n ) {\n imports.push({\n name: ref.getFileName(),\n ambient: true\n });\n }\n }\n\n for (const statement of sourceFile.getStatements()) {\n // --- Import declarations ---\n if (Node.isImportDeclaration(statement)) {\n const moduleSpec = statement.getModuleSpecifierValue();\n\n // Namespace import: import * as X from '...'\n if (statement.getNamespaceImport()) {\n imports.push({\n name: moduleSpec,\n specifiers: [\n {\n name: statement.getNamespaceImport()!.getText()\n }\n ],\n all: true\n });\n }\n\n // Named imports: import X from '...' or import { A, B as C } from '...'\n else if (\n statement.getNamedImports().length > 0 ||\n statement.getDefaultImport()\n ) {\n const specifiers: ModuleExportSpecifier[] = [];\n if (statement.getDefaultImport()) {\n specifiers.push({\n name: statement.getDefaultImport()!.getText(),\n default: true,\n type: statement.isTypeOnly()\n });\n }\n\n statement.getNamedImports().forEach(named => {\n specifiers.push({\n name: named.getName(),\n alias: named.getAliasNode()?.getText(),\n type: statement.isTypeOnly()\n });\n });\n\n imports.push({\n name: moduleSpec,\n specifiers\n });\n }\n }\n\n // --- Export declarations ---\n else if (Node.isExportDeclaration(statement)) {\n const moduleSpec = statement.getModuleSpecifierValue();\n if (moduleSpec) {\n // Resolve the module specifier\n let resolvedSpec = moduleSpec;\n if (!ctx.context.builtins.includes(moduleSpec)) {\n if (ctx.emitted.has(moduleSpec)) {\n resolvedSpec = ctx.emitted.get(moduleSpec)!;\n } else {\n const resolvedModule = await ctx.context.resolve(\n moduleSpec,\n filePath\n );\n if (isSetString(resolvedModule?.id)) {\n resolvedSpec = resolvedModule.id;\n }\n }\n }\n\n // Re-export from another module\n const namedExports = statement.getNamedExports();\n if (namedExports.length > 0) {\n exports.push({\n name: resolvedSpec,\n text: statement.getText(),\n fullText: statement.getFullText(),\n specifiers: namedExports.map(named => ({\n name: named.getName(),\n alias: named.getAliasNode()?.getText(),\n type: statement.isTypeOnly()\n })),\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n .trim()\n });\n } else {\n // export * from '...'\n exports.push({\n name: resolvedSpec,\n text: statement.getText(),\n fullText: statement.getFullText(),\n all: true,\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n .trim()\n });\n }\n } else {\n const specifiers = statement.getNamedExports().map(named => ({\n name: named.getName(),\n alias: named.getAliasNode()?.getText(),\n type: statement.isTypeOnly()\n }));\n if (specifiers.length > 0) {\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n specifiers,\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n }\n }\n\n // --- Export assignments (export default ...) ---\n else if (Node.isExportAssignment(statement)) {\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n\n // --- Function declarations (export declare function ...) ---\n else if (\n Node.isFunctionDeclaration(statement) &&\n statement.isExported() &&\n statement.getNameNode()\n ) {\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n specifiers: [\n {\n name: statement.getNameNode()!.getText()\n }\n ],\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n\n // --- Variable statements (export declare const ...) ---\n else if (Node.isVariableStatement(statement) && statement.isExported()) {\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n specifiers: statement\n .getDeclarationList()\n .getDeclarations()\n .filter(\n decl => decl.getNameNode() && Node.isIdentifier(decl.getNameNode())\n )\n .map(decl => ({ name: decl.getNameNode().getText() })),\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n\n // --- Class declarations (export declare class ...) ---\n else if (Node.isClassDeclaration(statement) && statement.isExported()) {\n const nameNode = statement.getNameNode();\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n specifiers: nameNode ? [{ name: nameNode.getText() }] : undefined,\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n\n // --- Interface declarations (export declare interface ...) ---\n else if (Node.isInterfaceDeclaration(statement) && statement.isExported()) {\n const nameNode = statement.getNameNode();\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n specifiers: nameNode ? [{ name: nameNode.getText() }] : undefined,\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n\n // --- Type alias declarations (export declare type ...) ---\n else if (Node.isTypeAliasDeclaration(statement) && statement.isExported()) {\n const nameNode = statement.getNameNode();\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n specifiers: nameNode ? [{ name: nameNode.getText() }] : undefined,\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n\n // --- All other statements (declarations) ---\n else if (\n ctx.context.config.output.sourceMap ||\n !statement.getFullText().includes(\"//# sourceMappingURL=\")\n ) {\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n }\n\n return {\n name,\n text,\n sourceFile,\n comment,\n imports,\n exports\n };\n}\n\n/**\n * Emits TypeScript declaration types for the provided files using the given TypeScript configuration.\n *\n * @param context - The context containing options and environment paths.\n * @param files - The list of files to generate types for.\n * @returns A promise that resolves to the generated TypeScript declaration types.\n */\nexport async function emitBuiltinTypes<TContext extends Context>(\n context: TContext,\n files: string[]\n): Promise<{ code: string; directives: string[] }> {\n if (files.length === 0) {\n context.debug(\n \"No files provided for TypeScript types generation. Typescript compilation for built-in modules will be skipped.\"\n );\n return { code: \"\", directives: [] };\n }\n\n context.debug(\n `Running the TypeScript compiler for ${\n files.length\n } generated built-in module files.`\n );\n\n const program = createProgram(context, {\n skipAddingFilesFromTsConfig: true,\n compilerOptions: {\n declaration: true,\n declarationMap: false,\n emitDeclarationOnly: true,\n sourceMap: false,\n outDir: replacePath(context.builtinsPath, context.config.cwd),\n composite: false,\n incremental: false,\n tsBuildInfoFile: undefined\n }\n });\n\n program.addSourceFilesAtPaths(files);\n const emitResult = program.emitToMemory({ emitOnlyDtsFiles: true });\n\n const diagnostics = emitResult.getDiagnostics();\n if (diagnostics && diagnostics.length > 0) {\n if (diagnostics.some(d => d.getCategory() === DiagnosticCategory.Error)) {\n throw new Error(\n `The Typescript emit process failed while generating built-in types: \\n ${diagnostics\n .filter(d => d.getCategory() === DiagnosticCategory.Error)\n .map(\n d =>\n `-${d.getSourceFile() ? `${d.getSourceFile()?.getFilePath()}:` : \"\"} ${String(\n d.getMessageText()\n )} (at ${d.getStart()}:${d.getLength()})`\n )\n .join(\"\\n\")}`\n );\n } else if (\n diagnostics.some(d => d.getCategory() === DiagnosticCategory.Warning)\n ) {\n context.warn(\n `The Typescript emit process completed with warnings while generating built-in types: \\n ${diagnostics\n .filter(d => d.getCategory() === DiagnosticCategory.Warning)\n .map(\n d =>\n `-${d.getSourceFile() ? `${d.getSourceFile()?.getFilePath()}:` : \"\"} ${String(\n d.getMessageText()\n )} (at ${d.getStart()}:${d.getLength()})`\n )\n .join(\"\\n\")}`\n );\n } else {\n context.debug(\n `The Typescript emit process completed with diagnostic messages while generating built-in types: \\n ${diagnostics\n .map(\n d =>\n `-${d.getSourceFile() ? `${d.getSourceFile()?.getFilePath()}:` : \"\"} ${String(\n d.getMessageText()\n )} (at ${d.getStart()}:${d.getLength()})`\n )\n .join(\"\\n\")}`\n );\n }\n }\n\n const emittedFiles = emitResult.getFiles();\n context.debug(\n `The TypeScript compiler emitted ${\n emittedFiles.length\n } files for built-in types.`\n );\n\n if (emittedFiles.length === 0) {\n context.warn(\n \"The TypeScript compiler did not emit any files for built-in types. This may indicate an issue with the TypeScript configuration or the provided files.\"\n );\n return { code: \"\", directives: [] };\n }\n\n const ctx = {\n context,\n modules: [] as ModuleDeclaration[],\n emitted: new Map<string, string>()\n };\n\n await Promise.all(\n emittedFiles.map(async emittedFile => {\n const filePath = appendPath(emittedFile.filePath, context.config.cwd);\n if (\n !filePath.endsWith(\".map\") &&\n findFileName(filePath) !== \"tsconfig.tsbuildinfo\" &&\n isParentPath(filePath, context.builtinsPath)\n ) {\n const moduleName = replaceExtension(\n replacePath(\n replacePath(filePath, context.builtinsPath),\n replacePath(context.builtinsPath, context.config.cwd)\n ),\n \"\",\n {\n fullExtension: true\n }\n );\n if (context.builtins.includes(moduleName)) {\n ctx.emitted.set(filePath, moduleName);\n ctx.modules.push(\n await extractModuleDeclarations(\n ctx,\n filePath,\n moduleName,\n emittedFile.text\n )\n );\n }\n }\n })\n );\n\n const commonDeclarations = [] as ExportModuleReference[];\n for (const mod of ctx.modules) {\n for (const importRef of mod.imports.filter(importRef =>\n context.builtins.some(builtin => importRef.name.endsWith(`:${builtin}`))\n )) {\n const moduleRef = ctx.modules.find(moduleRef =>\n importRef.name.endsWith(`:${moduleRef.name}`)\n );\n if (moduleRef) {\n let declaration: ExportModuleReference | undefined;\n for (const decl of moduleRef.exports.filter(decl =>\n isSetObject(decl)\n )) {\n const specifiers = decl.specifiers?.filter(specifier =>\n importRef.specifiers?.some(\n s =>\n (specifier.alias ? specifier.alias : specifier.name) ===\n (s.alias ? s.alias : s.name)\n )\n );\n if (specifiers && specifiers.length > 0) {\n importRef.specifiers = importRef.specifiers?.filter(\n s =>\n !specifiers.some(\n specifier =>\n (specifier.alias ? specifier.alias : specifier.name) ===\n (s.alias ? s.alias : s.name)\n )\n );\n if (\n importRef.specifiers &&\n importRef.specifiers.length === 0 &&\n !importRef.all &&\n !importRef.ambient\n ) {\n mod.imports = mod.imports.filter(\n imp => imp.name !== importRef.name\n );\n }\n\n declaration = decl;\n break;\n }\n }\n\n if (declaration) {\n for (const decl of moduleRef.exports.filter(\n decl =>\n isSetObject(decl) &&\n !decl.specifiers?.some(s =>\n declaration?.specifiers?.some(\n specifier =>\n (specifier.alias ? specifier.alias : specifier.name) ===\n (s.alias ? s.alias : s.name)\n )\n )\n )) {\n const exportModuleRef = decl as ExportModuleReference;\n if (\n (exportModuleRef.specifiers?.some(s => s.alias || s.name) ||\n exportModuleRef.name) &&\n new RegExp(\n `(^|\\\\s|\\\\n|\\\\r\\\\n|\\\\(|\\\\)|<|>|{|}|\\\\[|\\\\]|\\\\!|\\\\?|\\\\.|,|\\\\*|&|:)(${\n exportModuleRef.specifiers\n ?.map(s => `${s.alias ? `${s.alias}|` : \"\"}${s.name}`)\n .join(\"|\") || exportModuleRef.name\n })($|\\\\s|\\\\n|\\\\r\\\\n|\\\\(|\\\\)|<|>|{|}|\\\\[|\\\\]|\\\\!|\\\\?|\\\\.|,|\\\\*|&|:|;)`\n ).test(declaration.text)\n ) {\n commonDeclarations.push(exportModuleRef);\n }\n }\n commonDeclarations.push(declaration);\n }\n }\n }\n }\n\n let code = \"\";\n const directives: string[] = [];\n\n for (const commonDeclaration of commonDeclarations) {\n code += formatTypes(\n `${\n commonDeclaration.comment?.trim()\n ? commonDeclaration.comment.trim()\n : \"\"\n }${commonDeclaration.comment?.trim() ? \"\\n\" : \"\"}${formatTypes(\n commonDeclaration.text\n .replace(/\\s*export\\s*/, \"\")\n .replace(/\\s*declare\\s*interface\\s*/, \"interface \")\n .replace(/\\s*declare\\s*type\\s*/, \"type \")\n )}`\n );\n code += \"\\n\\n\";\n }\n\n for (const mod of ctx.modules) {\n code += mod.comment ? `${mod.comment.trim()}\\n` : \"\";\n code += `declare module \"${context.config.framework?.name ?? \"powerlines\"}:${mod.name}\" { \\n`;\n for (const importRef of mod.imports) {\n if (importRef.ambient) {\n code += directives.push(importRef.name);\n } else if (importRef.all) {\n code += `\\timport * as ${findFileName(importRef.name)} from \"${importRef.name}\";\\n`;\n } else if (importRef.specifiers) {\n const typeOnly = importRef.specifiers.every(s => s.type) ? \" type\" : \"\";\n const specifiers = importRef.specifiers\n .map(s => (s.alias ? `${s.name} as ${s.alias}` : s.name))\n .join(\", \");\n code += `\\timport${typeOnly} { ${specifiers} } from \"${importRef.name}\";\\n`;\n }\n }\n\n if (mod.imports.length > 0) {\n code += \"\\n\";\n }\n\n for (const exportRef of mod.exports.filter(\n e =>\n isString(e) ||\n !e.specifiers ||\n !commonDeclarations.some(\n commonDecl =>\n commonDecl.specifiers &&\n commonDecl.specifiers.some(specifier =>\n e.specifiers?.some(\n s =>\n (s.alias ? s.alias : s.name) ===\n (specifier.alias ? specifier.alias : specifier.name)\n )\n )\n )\n )) {\n if (isSetString(exportRef)) {\n code += `${exportRef}\\n`;\n } else if (exportRef.name) {\n if (exportRef.all) {\n code += `${\n exportRef.comment?.trim() ? exportRef.comment.trim() : \"\"\n }${\n exportRef.comment?.trim() ? \"\\n\" : \"\"\n }export * from \"${exportRef.name}\";\\n`;\n } else if (exportRef.specifiers) {\n if (exportRef.comment?.trim()) {\n code += `${exportRef.comment.trim()}\\n`;\n }\n\n code += `\\texport${\n exportRef.specifiers.every(s => s.type) ? \" type\" : \"\"\n } { ${exportRef.specifiers\n .map(s => (s.alias ? `${s.name} as ${s.alias}` : s.name))\n .join(\", \")} } from \"${exportRef.name}\";\\n`;\n }\n } else {\n code += `${exportRef.comment?.trim() ? exportRef.comment.trim() : \"\"}${\n exportRef.comment?.trim() ? \"\\n\" : \"\"\n }${formatTypes(\n exportRef.text\n .replace(/\\s*export\\s*declare\\s*/, \"export \")\n .replace(/\\s*declare\\s*/, \" \")\n )}\\n`;\n }\n }\n\n mod.exports\n .filter(\n e =>\n !isString(e) &&\n e.specifiers &&\n commonDeclarations.some(\n commonDeclaration =>\n commonDeclaration.specifiers &&\n commonDeclaration.specifiers.some(specifier =>\n e.specifiers?.some(\n s =>\n (s.alias ? s.alias : s.name) ===\n (specifier.alias ? specifier.alias : specifier.name)\n )\n )\n )\n )\n .forEach((e, i, arr) => {\n if (i === 0) {\n code += \"\\nexport { \";\n } else {\n code += \", \";\n }\n\n code += `${\n (e as ExportModuleReference)?.specifiers\n ?.filter(s =>\n commonDeclarations.some(\n commonDeclaration =>\n commonDeclaration.specifiers &&\n commonDeclaration.specifiers.some(\n specifier =>\n (s.alias ? s.alias : s.name) ===\n (specifier.alias ? specifier.alias : specifier.name)\n )\n )\n )\n .map(s => (s.alias ? `${s.name} as ${s.alias}` : s.name))\n .join(\", \") || \"\"\n }`;\n\n if (i === arr.length - 1) {\n code += ` };\\n`;\n }\n });\n\n code += \"}\";\n code += \"\\n\\n\";\n }\n\n code = await format(context, context.typesPath, code);\n\n context.debug(\n `A TypeScript declaration file (size: ${prettyBytes(\n new Blob(toArray(code)).size\n )}) emitted for the built-in modules types.`\n );\n\n return { code, directives };\n}\n\n/**\n * Generate the Powerlines TypeScript declaration file\n *\n * @param context - The execution context for generating the TypeScript declaration file, which provides access to the project configuration, environment, and utility functions for performing the generation. The context is used to manage the state and behavior of the generation process, allowing for hooks to be called at different stages and for environment-specific configurations to be applied.\n * @param env - The environment context to use for generating the TypeScript declaration file\n */\nexport async function handleTypes<\n TResolvedConfig extends ResolvedConfig,\n TSystemContext = unknown\n>(\n context: ExecutionContext<TResolvedConfig, TSystemContext>,\n env: EnvironmentContext<TResolvedConfig, TSystemContext>\n) {\n env.debug(`Preparing the TypeScript definitions for the Powerlines project.`);\n\n if (env.fs.existsSync(env.typesPath)) {\n await env.fs.remove(env.typesPath);\n }\n\n const typescriptPath = await resolvePackage(\"typescript\");\n if (!typescriptPath) {\n throw new Error(\n \"Could not resolve TypeScript package location. Please ensure TypeScript is installed.\"\n );\n }\n\n env.debug(\"Running TypeScript compiler for built-in runtime module files.\");\n\n let { code, directives } = await emitBuiltinTypes(\n env,\n (await env.getBuiltins()).reduce<string[]>((ret, builtin) => {\n const formatted = replacePath(builtin.path, env.config.cwd);\n if (!ret.includes(formatted)) {\n ret.push(formatted);\n }\n\n return ret;\n }, [])\n );\n\n env.debug(`Generating TypeScript declaration file ${env.typesPath}.`);\n\n const merge = async (\n currentResult: string | TypesResult,\n previousResult: string | TypesResult\n ): Promise<string | TypesResult> => {\n if (\n !isSetString(currentResult) &&\n !isSetObject(currentResult) &&\n !isSetString(previousResult) &&\n !isSetObject(previousResult)\n ) {\n return { code, directives };\n }\n\n const previous = (\n await format(\n env,\n env.typesPath,\n isSetString(previousResult)\n ? previousResult\n : isSetObject(previousResult)\n ? previousResult.code\n : \"\"\n )\n )\n .trim()\n .replace(code, \"\")\n .trim();\n const current = (\n await format(\n env,\n env.typesPath,\n isSetString(currentResult)\n ? currentResult\n : isSetObject(currentResult)\n ? currentResult.code\n : \"\"\n )\n )\n .trim()\n .replace(previous, \"\")\n .trim()\n .replace(code, \"\")\n .trim();\n\n return {\n directives: [\n ...(isSetObject(currentResult) && currentResult.directives\n ? currentResult.directives\n : []),\n ...(isSetObject(previousResult) && previousResult.directives\n ? previousResult.directives\n : [])\n ],\n code: await format(\n env,\n env.typesPath,\n `${\n !previous.includes(getTypescriptFileHeader(env)) &&\n !current.includes(getTypescriptFileHeader(env))\n ? `${code}\\n`\n : \"\"\n }${previous}\\n${current}`.trim()\n )\n };\n };\n const asNextParam = (\n previousResult: string | TypesResult | null | undefined\n ) => (isObject(previousResult) ? previousResult.code : previousResult);\n\n let result = await callHook(\n context,\n \"types\",\n {\n environment: env,\n sequential: true,\n order: \"pre\",\n result: \"merge\",\n merge,\n asNextParam\n },\n code\n );\n if (result) {\n if (isSetObject(result)) {\n code = result.code;\n if (Array.isArray(result.directives) && result.directives.length > 0) {\n directives = getUnique([...directives, ...result.directives]).filter(\n Boolean\n );\n }\n } else if (isSetString(result)) {\n code = result;\n }\n }\n\n result = await callHook(\n context,\n \"types\",\n {\n environment: env,\n sequential: true,\n order: \"normal\",\n result: \"merge\",\n merge,\n asNextParam\n },\n code\n );\n if (result) {\n if (isSetObject(result)) {\n code = result.code;\n if (Array.isArray(result.directives) && result.directives.length > 0) {\n directives = getUnique([...directives, ...result.directives]).filter(\n Boolean\n );\n }\n } else if (isSetString(result)) {\n code = result;\n }\n }\n\n result = await callHook(\n context,\n \"types\",\n {\n environment: env,\n sequential: true,\n order: \"post\",\n result: \"merge\",\n merge,\n asNextParam\n },\n code\n );\n if (result) {\n if (isSetObject(result)) {\n code = result.code;\n if (Array.isArray(result.directives) && result.directives.length > 0) {\n directives = getUnique([...directives, ...result.directives]).filter(\n Boolean\n );\n }\n } else if (isSetString(result)) {\n code = result;\n }\n }\n\n if (isSetString(code?.trim()) || directives.length > 0) {\n await env.fs.write(\n env.typesPath,\n `${\n directives.length > 0\n ? `${directives.map(directive => `/// <reference types=\"${directive}\" />`).join(\"\\n\")}\n\n`\n : \"\"\n }${getTypescriptFileHeader(env, { directive: null, prettierIgnore: false })}\n\n${formatTypes(code)}\n`\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwFA,SAAgB,YAAY,OAAO,IAAY;CAC7C,OAAO,KAAK,WAAW,aAAa,EAAE,EAAE,QAAQ,QAAQ,EAAE;AAC5D;AAEA,eAAe,0BACb,KACA,UACA,MACA,MAC4B;CAC5B,MAAM,UAAmC,CAAC;CAC1C,MAAM,UAA8C,CAAC;CAErD,MAAM,UAAU,KACb,MACC,IAAI,OACF,+BACE,IAAI,QAAQ,OAAO,WAAW,QAAQ,aACvC,GAAG,KAAK,mBACX,CACF,GACE,MAAK,YAAW,YAAY,SAAS,KAAK,CAAC,CAAC;CAIhD,MAAM,aAAa,IADC,QAAQ,EAAE,uBAAuB,KAAK,CACjC,EAAE,iBAAiB,eAAe,IAAI;CAG/D,KAAK,MAAM,OAAO,WAAW,2BAA2B,GACtD,IACE,IAAI,YAAY,KAChB,CAAC,IAAI,QAAQ,SAAS,MAAK,YAAW,IAAI,YAAY,EAAE,SAAS,OAAO,CAAC,GAEzE,QAAQ,KAAK;EACX,MAAM,IAAI,YAAY;EACtB,SAAS;CACX,CAAC;CAIL,KAAK,MAAM,aAAa,WAAW,cAAc,GAE/C,IAAI,KAAK,oBAAoB,SAAS,GAAG;EACvC,MAAM,aAAa,UAAU,wBAAwB;EAGrD,I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AI,QACF;MAAI,YAAY,MAAM,GAAG;GACvB,OAAO,OAAO;GACd,IAAI,MAAM,QAAQ,OAAO,UAAU,KAAK,OAAO,WAAW,SAAS,GACjE,aAAa,UAAU,CAAC,GAAG,YAAY,GAAG,OAAO,UAAU,CAAC,EAAE,OAC5D,OACF;EAEJ,OAAO,IAAI,YAAY,MAAM,GAC3B,OAAO;CACT;CAGF,SAAS,MAAM,SACb,SACA,SACA;EACE,aAAa;EACb,YAAY;EACZ,OAAO;EACP,QAAQ;EACR;EACA;CACF,GACA,IACF;CACA,IAAI,QACF;MAAI,YAAY,MAAM,GAAG;GACvB,OAAO,OAAO;GACd,IAAI,MAAM,QAAQ,OAAO,UAAU,KAAK,OAAO,WAAW,SAAS,GACjE,aAAa,UAAU,CAAC,GAAG,YAAY,GAAG,OAAO,UAAU,CAAC,EAAE,OAC5D,OACF;EAEJ,OAAO,IAAI,YAAY,MAAM,GAC3B,OAAO;CACT;CAGF,IAAI,YAAY,MAAM,KAAK,CAAC,KAAK,WAAW,SAAS,GACnD,MAAM,IAAI,GAAG,MACX,IAAI,WACJ,GACE,WAAW,SAAS,IAChB,GAAG,WAAW,KAAI,cAAa,yBAAyB,UAAU,KAAK,EAAE,KAAK,IAAI,EAAE;;IAGpF,KACH,wBAAwB,KAAK;EAAE,WAAW;EAAM,gBAAgB;CAAM,CAAC,EAAE;;EAEhF,YAAY,IAAI,EAAE;CAEhB;AAEJ"}
|
|
1
|
+
{"version":3,"file":"generate-types.mjs","names":[],"sources":["../../src/lib/generate-types.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { resolvePackage } from \"@stryke/fs/resolve\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { prettyBytes } from \"@stryke/string-format/pretty-bytes\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { DiagnosticCategory, Node, Project, SourceFile } from \"ts-morph\";\nimport { ResolvedConfig } from \"../types/config\";\nimport {\n Context,\n EnvironmentContext,\n ExecutionContext\n} from \"../types/context\";\nimport { TypesResult } from \"../types/plugin\";\nimport { callHook } from \"./hooks\";\nimport { createProgram } from \"./typescript/ts-morph\";\nimport { getTypescriptFileHeader } from \"./utilities/file-header\";\nimport { format } from \"./utilities/format\";\n\ninterface ModuleExportSpecifier {\n name: string;\n alias?: string;\n default?: boolean;\n type?: boolean;\n}\n\ninterface ModuleReference {\n name?: string;\n specifiers?: ModuleExportSpecifier[];\n all?: boolean;\n}\n\ninterface ImportModuleReference extends ModuleReference {\n name: string;\n ambient?: boolean;\n}\n\ninterface ExportModuleReference extends ModuleReference {\n text: string;\n fullText: string;\n comment?: string;\n}\n\ninterface ModuleDeclaration {\n name: string;\n text: string;\n sourceFile: SourceFile;\n comment?: string;\n exports: (ExportModuleReference | string)[];\n imports: ImportModuleReference[];\n}\n\nexport interface TypegenContext {\n context: Context;\n emitted: Map<string, string>;\n modules: ModuleDeclaration[];\n}\n\n/**\n * Formats the generated TypeScript types source code.\n *\n * @param code - The generated TypeScript code.\n * @returns The formatted TypeScript code.\n */\nexport function formatTypes(code = \"\"): string {\n return code.replaceAll(\"#private;\", \"\").replace(/__Ω/g, \"\");\n}\n\nasync function extractModuleDeclarations(\n ctx: TypegenContext,\n filePath: string,\n name: string,\n text: string\n): Promise<ModuleDeclaration> {\n const imports: ImportModuleReference[] = [];\n const exports: (ExportModuleReference | string)[] = [];\n\n const comment = text\n .match(\n new RegExp(\n `\\\\/\\\\*\\\\*(?s:.)*?@module\\\\s+${\n ctx.context.config.framework?.name ?? \"powerlines\"\n }:${name}(?s:.)*?\\\\*\\\\/\\\\s+`\n )\n )\n ?.find(comment => isSetString(comment?.trim()));\n\n // Parse the emitted .d.ts content using an in-memory ts-morph project\n const project = new Project({ useInMemoryFileSystem: true });\n const sourceFile = project.createSourceFile(\"module.d.ts\", text);\n\n // Collect /// <reference types=\"...\" /> directives as ambient dependencies\n for (const ref of sourceFile.getTypeReferenceDirectives()) {\n if (\n ref.getFileName() &&\n !ctx.context.builtins.some(builtin => ref.getFileName().endsWith(builtin))\n ) {\n imports.push({\n name: ref.getFileName(),\n ambient: true\n });\n }\n }\n\n for (const statement of sourceFile.getStatements()) {\n // --- Import declarations ---\n if (Node.isImportDeclaration(statement)) {\n const moduleSpec = statement.getModuleSpecifierValue();\n\n // Namespace import: import * as X from '...'\n if (statement.getNamespaceImport()) {\n imports.push({\n name: moduleSpec,\n specifiers: [\n {\n name: statement.getNamespaceImport()!.getText()\n }\n ],\n all: true\n });\n }\n\n // Named imports: import X from '...' or import { A, B as C } from '...'\n else if (\n statement.getNamedImports().length > 0 ||\n statement.getDefaultImport()\n ) {\n const specifiers: ModuleExportSpecifier[] = [];\n if (statement.getDefaultImport()) {\n specifiers.push({\n name: statement.getDefaultImport()!.getText(),\n default: true,\n type: statement.isTypeOnly()\n });\n }\n\n statement.getNamedImports().forEach(named => {\n specifiers.push({\n name: named.getName(),\n alias: named.getAliasNode()?.getText(),\n type: statement.isTypeOnly()\n });\n });\n\n imports.push({\n name: moduleSpec,\n specifiers\n });\n }\n }\n\n // --- Export declarations ---\n else if (Node.isExportDeclaration(statement)) {\n const moduleSpec = statement.getModuleSpecifierValue();\n if (moduleSpec) {\n // Resolve the module specifier\n let resolvedSpec = moduleSpec;\n if (!ctx.context.builtins.includes(moduleSpec)) {\n if (ctx.emitted.has(moduleSpec)) {\n resolvedSpec = ctx.emitted.get(moduleSpec)!;\n } else {\n const resolvedModule = await ctx.context.resolve(\n moduleSpec,\n filePath\n );\n if (isSetString(resolvedModule?.id)) {\n resolvedSpec = resolvedModule.id;\n }\n }\n }\n\n // Re-export from another module\n const namedExports = statement.getNamedExports();\n if (namedExports.length > 0) {\n exports.push({\n name: resolvedSpec,\n text: statement.getText(),\n fullText: statement.getFullText(),\n specifiers: namedExports.map(named => ({\n name: named.getName(),\n alias: named.getAliasNode()?.getText(),\n type: statement.isTypeOnly()\n })),\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n .trim()\n });\n } else {\n // export * from '...'\n exports.push({\n name: resolvedSpec,\n text: statement.getText(),\n fullText: statement.getFullText(),\n all: true,\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n .trim()\n });\n }\n } else {\n const specifiers = statement.getNamedExports().map(named => ({\n name: named.getName(),\n alias: named.getAliasNode()?.getText(),\n type: statement.isTypeOnly()\n }));\n if (specifiers.length > 0) {\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n specifiers,\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n }\n }\n\n // --- Export assignments (export default ...) ---\n else if (Node.isExportAssignment(statement)) {\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n\n // --- Function declarations (export declare function ...) ---\n else if (\n Node.isFunctionDeclaration(statement) &&\n statement.isExported() &&\n statement.getNameNode()\n ) {\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n specifiers: [\n {\n name: statement.getNameNode()!.getText()\n }\n ],\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n\n // --- Variable statements (export declare const ...) ---\n else if (Node.isVariableStatement(statement) && statement.isExported()) {\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n specifiers: statement\n .getDeclarationList()\n .getDeclarations()\n .filter(\n decl => decl.getNameNode() && Node.isIdentifier(decl.getNameNode())\n )\n .map(decl => ({ name: decl.getNameNode().getText() })),\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n\n // --- Class declarations (export declare class ...) ---\n else if (Node.isClassDeclaration(statement) && statement.isExported()) {\n const nameNode = statement.getNameNode();\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n specifiers: nameNode ? [{ name: nameNode.getText() }] : undefined,\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n\n // --- Interface declarations (export declare interface ...) ---\n else if (Node.isInterfaceDeclaration(statement) && statement.isExported()) {\n const nameNode = statement.getNameNode();\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n specifiers: nameNode ? [{ name: nameNode.getText() }] : undefined,\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n\n // --- Type alias declarations (export declare type ...) ---\n else if (Node.isTypeAliasDeclaration(statement) && statement.isExported()) {\n const nameNode = statement.getNameNode();\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n specifiers: nameNode ? [{ name: nameNode.getText() }] : undefined,\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n\n // --- All other statements (declarations) ---\n else if (\n ctx.context.config.output.sourceMap ||\n !statement.getFullText().includes(\"//# sourceMappingURL=\")\n ) {\n exports.push({\n text: statement.getText(),\n fullText: statement.getFullText(),\n comment: statement\n .getLeadingCommentRanges()\n .filter(\n c =>\n isSetString(c.getText().trim()) &&\n !c.getText().includes(\"@module\")\n )\n .map(c => c.getText().trim())\n .join(\"\\n\")\n });\n }\n }\n\n return {\n name,\n text,\n sourceFile,\n comment,\n imports,\n exports\n };\n}\n\n/**\n * Emits TypeScript declaration types for the provided files using the given TypeScript configuration.\n *\n * @param context - The context containing options and environment paths.\n * @param files - The list of files to generate types for.\n * @returns A promise that resolves to the generated TypeScript declaration types.\n */\nexport async function emitBuiltinTypes<TContext extends Context>(\n context: TContext,\n files: string[]\n): Promise<{ code: string; directives: string[] }> {\n if (files.length === 0) {\n context.debug(\n \"No files provided for TypeScript types generation. Typescript compilation for built-in modules will be skipped.\"\n );\n return { code: \"\", directives: [] };\n }\n\n context.debug(\n `Running the TypeScript compiler for ${\n files.length\n } generated built-in module files.`\n );\n\n const program = createProgram(context, {\n skipAddingFilesFromTsConfig: true,\n compilerOptions: {\n declaration: true,\n declarationMap: false,\n emitDeclarationOnly: true,\n sourceMap: false,\n outDir: replacePath(context.builtinsPath, context.config.cwd),\n composite: false,\n incremental: false,\n tsBuildInfoFile: undefined\n }\n });\n\n program.addSourceFilesAtPaths(files);\n const emitResult = program.emitToMemory({ emitOnlyDtsFiles: true });\n\n const diagnostics = emitResult.getDiagnostics();\n if (diagnostics && diagnostics.length > 0) {\n if (diagnostics.some(d => d.getCategory() === DiagnosticCategory.Error)) {\n throw new Error(\n `The Typescript emit process failed while generating built-in types: \\n ${diagnostics\n .filter(d => d.getCategory() === DiagnosticCategory.Error)\n .map(\n d =>\n `-${d.getSourceFile() ? `${d.getSourceFile()?.getFilePath()}:` : \"\"} ${String(\n d.getMessageText()\n )} (at ${d.getStart()}:${d.getLength()})`\n )\n .join(\"\\n\")}`\n );\n } else if (\n diagnostics.some(d => d.getCategory() === DiagnosticCategory.Warning)\n ) {\n context.warn(\n `The Typescript emit process completed with warnings while generating built-in types: \\n ${diagnostics\n .filter(d => d.getCategory() === DiagnosticCategory.Warning)\n .map(\n d =>\n `-${d.getSourceFile() ? `${d.getSourceFile()?.getFilePath()}:` : \"\"} ${String(\n d.getMessageText()\n )} (at ${d.getStart()}:${d.getLength()})`\n )\n .join(\"\\n\")}`\n );\n } else {\n context.debug(\n `The Typescript emit process completed with diagnostic messages while generating built-in types: \\n ${diagnostics\n .map(\n d =>\n `-${d.getSourceFile() ? `${d.getSourceFile()?.getFilePath()}:` : \"\"} ${String(\n d.getMessageText()\n )} (at ${d.getStart()}:${d.getLength()})`\n )\n .join(\"\\n\")}`\n );\n }\n }\n\n const emittedFiles = emitResult.getFiles();\n context.debug(\n `The TypeScript compiler emitted ${\n emittedFiles.length\n } files for built-in types.`\n );\n\n if (emittedFiles.length === 0) {\n context.warn(\n \"The TypeScript compiler did not emit any files for built-in types. This may indicate an issue with the TypeScript configuration or the provided files.\"\n );\n return { code: \"\", directives: [] };\n }\n\n const ctx = {\n context,\n modules: [] as ModuleDeclaration[],\n emitted: new Map<string, string>()\n };\n\n await Promise.all(\n emittedFiles.map(async emittedFile => {\n const filePath = appendPath(emittedFile.filePath, context.config.cwd);\n if (\n !filePath.endsWith(\".map\") &&\n findFileName(filePath) !== \"tsconfig.tsbuildinfo\" &&\n isParentPath(filePath, context.builtinsPath)\n ) {\n const moduleName = replaceExtension(\n replacePath(\n replacePath(filePath, context.builtinsPath),\n replacePath(context.builtinsPath, context.config.cwd)\n ),\n \"\",\n {\n fullExtension: true\n }\n );\n if (context.builtins.includes(moduleName)) {\n ctx.emitted.set(filePath, moduleName);\n ctx.modules.push(\n await extractModuleDeclarations(\n ctx,\n filePath,\n moduleName,\n emittedFile.text\n )\n );\n }\n }\n })\n );\n\n const commonDeclarations = [] as ExportModuleReference[];\n for (const mod of ctx.modules) {\n for (const importRef of mod.imports.filter(importRef =>\n context.builtins.some(builtin => importRef.name.endsWith(`:${builtin}`))\n )) {\n const moduleRef = ctx.modules.find(moduleRef =>\n importRef.name.endsWith(`:${moduleRef.name}`)\n );\n if (moduleRef) {\n let declaration: ExportModuleReference | undefined;\n for (const decl of moduleRef.exports.filter(decl =>\n isSetObject(decl)\n )) {\n const specifiers = decl.specifiers?.filter(specifier =>\n importRef.specifiers?.some(\n s =>\n (specifier.alias ? specifier.alias : specifier.name) ===\n (s.alias ? s.alias : s.name)\n )\n );\n if (specifiers && specifiers.length > 0) {\n importRef.specifiers = importRef.specifiers?.filter(\n s =>\n !specifiers.some(\n specifier =>\n (specifier.alias ? specifier.alias : specifier.name) ===\n (s.alias ? s.alias : s.name)\n )\n );\n if (\n importRef.specifiers &&\n importRef.specifiers.length === 0 &&\n !importRef.all &&\n !importRef.ambient\n ) {\n mod.imports = mod.imports.filter(\n imp => imp.name !== importRef.name\n );\n }\n\n declaration = decl;\n break;\n }\n }\n\n if (declaration) {\n for (const decl of moduleRef.exports.filter(\n decl =>\n isSetObject(decl) &&\n !decl.specifiers?.some(s =>\n declaration?.specifiers?.some(\n specifier =>\n (specifier.alias ? specifier.alias : specifier.name) ===\n (s.alias ? s.alias : s.name)\n )\n )\n )) {\n const exportModuleRef = decl as ExportModuleReference;\n if (\n (exportModuleRef.specifiers?.some(s => s.alias || s.name) ||\n exportModuleRef.name) &&\n new RegExp(\n `(^|\\\\s|\\\\n|\\\\r\\\\n|\\\\(|\\\\)|<|>|{|}|\\\\[|\\\\]|\\\\!|\\\\?|\\\\.|,|\\\\*|&|:)(${\n exportModuleRef.specifiers\n ?.map(s => `${s.alias ? `${s.alias}|` : \"\"}${s.name}`)\n .join(\"|\") || exportModuleRef.name\n })($|\\\\s|\\\\n|\\\\r\\\\n|\\\\(|\\\\)|<|>|{|}|\\\\[|\\\\]|\\\\!|\\\\?|\\\\.|,|\\\\*|&|:|;)`\n ).test(declaration.text)\n ) {\n commonDeclarations.push(exportModuleRef);\n }\n }\n commonDeclarations.push(declaration);\n }\n }\n }\n }\n\n let code = \"\";\n const directives: string[] = [];\n\n for (const commonDeclaration of commonDeclarations) {\n code += formatTypes(\n `${\n commonDeclaration.comment?.trim()\n ? commonDeclaration.comment.trim()\n : \"\"\n }${commonDeclaration.comment?.trim() ? \"\\n\" : \"\"}${formatTypes(\n commonDeclaration.text\n .replace(/\\s*export\\s*/, \"\")\n .replace(/\\s*declare\\s*interface\\s*/, \"interface \")\n .replace(/\\s*declare\\s*type\\s*/, \"type \")\n )}`\n );\n code += \"\\n\\n\";\n }\n\n for (const mod of ctx.modules) {\n code += mod.comment ? `${mod.comment.trim()}\\n` : \"\";\n code += `declare module \"${context.config.framework?.name ?? \"powerlines\"}:${mod.name}\" { \\n`;\n for (const importRef of mod.imports) {\n if (importRef.ambient) {\n code += directives.push(importRef.name);\n } else if (importRef.all) {\n code += `\\timport * as ${findFileName(importRef.name)} from \"${importRef.name}\";\\n`;\n } else if (importRef.specifiers) {\n const typeOnly = importRef.specifiers.every(s => s.type) ? \" type\" : \"\";\n const specifiers = importRef.specifiers\n .map(s => (s.alias ? `${s.name} as ${s.alias}` : s.name))\n .join(\", \");\n code += `\\timport${typeOnly} { ${specifiers} } from \"${importRef.name}\";\\n`;\n }\n }\n\n if (mod.imports.length > 0) {\n code += \"\\n\";\n }\n\n for (const exportRef of mod.exports.filter(\n e =>\n isString(e) ||\n !e.specifiers ||\n !commonDeclarations.some(\n commonDecl =>\n commonDecl.specifiers &&\n commonDecl.specifiers.some(specifier =>\n e.specifiers?.some(\n s =>\n (s.alias ? s.alias : s.name) ===\n (specifier.alias ? specifier.alias : specifier.name)\n )\n )\n )\n )) {\n if (isSetString(exportRef)) {\n code += `${exportRef}\\n`;\n } else if (exportRef.name) {\n if (exportRef.all) {\n code += `${\n exportRef.comment?.trim() ? exportRef.comment.trim() : \"\"\n }${\n exportRef.comment?.trim() ? \"\\n\" : \"\"\n }export * from \"${exportRef.name}\";\\n`;\n } else if (exportRef.specifiers) {\n if (exportRef.comment?.trim()) {\n code += `${exportRef.comment.trim()}\\n`;\n }\n\n code += `\\texport${\n exportRef.specifiers.every(s => s.type) ? \" type\" : \"\"\n } { ${exportRef.specifiers\n .map(s => (s.alias ? `${s.name} as ${s.alias}` : s.name))\n .join(\", \")} } from \"${exportRef.name}\";\\n`;\n }\n } else {\n code += `${exportRef.comment?.trim() ? exportRef.comment.trim() : \"\"}${\n exportRef.comment?.trim() ? \"\\n\" : \"\"\n }${formatTypes(\n exportRef.text\n .replace(/\\s*export\\s*declare\\s*/, \"export \")\n .replace(/\\s*declare\\s*/, \" \")\n )}\\n`;\n }\n }\n\n mod.exports\n .filter(\n e =>\n !isString(e) &&\n e.specifiers &&\n commonDeclarations.some(\n commonDeclaration =>\n commonDeclaration.specifiers &&\n commonDeclaration.specifiers.some(specifier =>\n e.specifiers?.some(\n s =>\n (s.alias ? s.alias : s.name) ===\n (specifier.alias ? specifier.alias : specifier.name)\n )\n )\n )\n )\n .forEach((e, i, arr) => {\n if (i === 0) {\n code += \"\\nexport { \";\n } else {\n code += \", \";\n }\n\n code += `${\n (e as ExportModuleReference)?.specifiers\n ?.filter(s =>\n commonDeclarations.some(\n commonDeclaration =>\n commonDeclaration.specifiers &&\n commonDeclaration.specifiers.some(\n specifier =>\n (s.alias ? s.alias : s.name) ===\n (specifier.alias ? specifier.alias : specifier.name)\n )\n )\n )\n .map(s => (s.alias ? `${s.name} as ${s.alias}` : s.name))\n .join(\", \") || \"\"\n }`;\n\n if (i === arr.length - 1) {\n code += ` };\\n`;\n }\n });\n\n code += \"}\";\n code += \"\\n\\n\";\n }\n\n code = await format(context, context.typesPath, code);\n\n context.debug(\n `A TypeScript declaration file (size: ${prettyBytes(\n new Blob(toArray(code)).size\n )}) emitted for the built-in modules types.`\n );\n\n return { code, directives };\n}\n\n/**\n * Generate the Powerlines TypeScript declaration file\n *\n * @param context - The execution context for generating the TypeScript declaration file, which provides access to the project configuration, environment, and utility functions for performing the generation. The context is used to manage the state and behavior of the generation process, allowing for hooks to be called at different stages and for environment-specific configurations to be applied.\n * @param env - The environment context to use for generating the TypeScript declaration file\n */\nexport async function handleTypes<\n TResolvedConfig extends ResolvedConfig,\n TSystemContext = unknown\n>(\n context: ExecutionContext<TResolvedConfig, TSystemContext>,\n env: EnvironmentContext<TResolvedConfig, TSystemContext>\n) {\n env.debug(`Preparing the TypeScript definitions for the Powerlines project.`);\n\n if (env.fs.existsSync(env.typesPath)) {\n await env.fs.remove(env.typesPath);\n }\n\n const typescriptPath = await resolvePackage(\"typescript\");\n if (!typescriptPath) {\n throw new Error(\n \"Could not resolve TypeScript package location. Please ensure TypeScript is installed.\"\n );\n }\n\n env.debug(\"Running TypeScript compiler for built-in runtime module files.\");\n\n let { code, directives } = await emitBuiltinTypes(\n env,\n (await env.getBuiltins()).reduce<string[]>((ret, builtin) => {\n const formatted = replacePath(builtin.path, env.config.cwd);\n if (!ret.includes(formatted)) {\n ret.push(formatted);\n }\n\n return ret;\n }, [])\n );\n\n env.debug(\n `Generating TypeScript declaration file ${replacePath(\n env.typesPath,\n context.config.cwd\n )}.`\n );\n\n const merge = async (\n currentResult: string | TypesResult,\n previousResult: string | TypesResult\n ): Promise<string | TypesResult> => {\n if (\n !isSetString(currentResult) &&\n !isSetObject(currentResult) &&\n !isSetString(previousResult) &&\n !isSetObject(previousResult)\n ) {\n return { code, directives };\n }\n\n const previous = (\n await format(\n env,\n env.typesPath,\n isSetString(previousResult)\n ? previousResult\n : isSetObject(previousResult)\n ? previousResult.code\n : \"\"\n )\n )\n .trim()\n .replace(code, \"\")\n .trim();\n const current = (\n await format(\n env,\n env.typesPath,\n isSetString(currentResult)\n ? currentResult\n : isSetObject(currentResult)\n ? currentResult.code\n : \"\"\n )\n )\n .trim()\n .replace(previous, \"\")\n .trim()\n .replace(code, \"\")\n .trim();\n\n return {\n directives: [\n ...(isSetObject(currentResult) && currentResult.directives\n ? currentResult.directives\n : []),\n ...(isSetObject(previousResult) && previousResult.directives\n ? previousResult.directives\n : [])\n ],\n code: await format(\n env,\n env.typesPath,\n `${\n !previous.includes(getTypescriptFileHeader(env)) &&\n !current.includes(getTypescriptFileHeader(env))\n ? `${code}\\n`\n : \"\"\n }${previous}\\n${current}`.trim()\n )\n };\n };\n const asNextParam = (\n previousResult: string | TypesResult | null | undefined\n ) => (isObject(previousResult) ? previousResult.code : previousResult);\n\n let result = await callHook(\n context,\n \"types\",\n {\n environment: env,\n sequential: true,\n order: \"pre\",\n result: \"merge\",\n merge,\n asNextParam\n },\n code\n );\n if (result) {\n if (isSetObject(result)) {\n code = result.code;\n if (Array.isArray(result.directives) && result.directives.length > 0) {\n directives = getUnique([...directives, ...result.directives]).filter(\n Boolean\n );\n }\n } else if (isSetString(result)) {\n code = result;\n }\n }\n\n result = await callHook(\n context,\n \"types\",\n {\n environment: env,\n sequential: true,\n order: \"normal\",\n result: \"merge\",\n merge,\n asNextParam\n },\n code\n );\n if (result) {\n if (isSetObject(result)) {\n code = result.code;\n if (Array.isArray(result.directives) && result.directives.length > 0) {\n directives = getUnique([...directives, ...result.directives]).filter(\n Boolean\n );\n }\n } else if (isSetString(result)) {\n code = result;\n }\n }\n\n result = await callHook(\n context,\n \"types\",\n {\n environment: env,\n sequential: true,\n order: \"post\",\n result: \"merge\",\n merge,\n asNextParam\n },\n code\n );\n if (result) {\n if (isSetObject(result)) {\n code = result.code;\n if (Array.isArray(result.directives) && result.directives.length > 0) {\n directives = getUnique([...directives, ...result.directives]).filter(\n Boolean\n );\n }\n } else if (isSetString(result)) {\n code = result;\n }\n }\n\n if (isSetString(code?.trim()) || directives.length > 0) {\n await env.fs.write(\n env.typesPath,\n `${\n directives.length > 0\n ? `${directives.map(directive => `/// <reference types=\"${directive}\" />`).join(\"\\n\")}\n\n`\n : \"\"\n }${getTypescriptFileHeader(env, { directive: null, prettierIgnore: false })}\n\n${formatTypes(code)}\n`\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwFA,SAAgB,YAAY,OAAO,IAAY;CAC7C,OAAO,KAAK,WAAW,aAAa,EAAE,EAAE,QAAQ,QAAQ,EAAE;AAC5D;AAEA,eAAe,0BACb,KACA,UACA,MACA,MAC4B;CAC5B,MAAM,UAAmC,CAAC;CAC1C,MAAM,UAA8C,CAAC;CAErD,MAAM,UAAU,KACb,MACC,IAAI,OACF,+BACE,IAAI,QAAQ,OAAO,WAAW,QAAQ,aACvC,GAAG,KAAK,mBACX,CACF,GACE,MAAK,YAAW,YAAY,SAAS,KAAK,CAAC,CAAC;CAIhD,MAAM,aAAa,IADC,QAAQ,EAAE,uBAAuB,KAAK,CACjC,EAAE,iBAAiB,eAAe,IAAI;CAG/D,KAAK,MAAM,OAAO,WAAW,2BAA2B,GACtD,IACE,IAAI,YAAY,KAChB,CAAC,IAAI,QAAQ,SAAS,MAAK,YAAW,IAAI,YAAY,EAAE,SAAS,OAAO,CAAC,GAEzE,QAAQ,KAAK;EACX,MAAM,IAAI,YAAY;EACtB,SAAS;CACX,CAAC;CAIL,KAAK,MAAM,aAAa,WAAW,cAAc,GAE/C,IAAI,KAAK,oBAAoB,SAAS,GAAG;EACvC,MAAM,aAAa,UAAU,wBAAwB;EAGrD,IAAI,UAAU,mBAAmB,GAC/B,QAAQ,KAAK;GACX,MAAM;GACN,YAAY,CACV,EACE,MAAM,UAAU,mBAAmB,EAAG,QAAQ,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AAO,UAAU,KAAK,OAAO,WAAW,SAAS,GACjE,aAAa,UAAU,CAAC,GAAG,YAAY,GAAG,OAAO,UAAU,CAAC,EAAE,OAC5D,OACF;EAEJ,OAAO,IAAI,YAAY,MAAM,GAC3B,OAAO;CACT;CAGF,SAAS,MAAM,SACb,SACA,SACA;EACE,aAAa;EACb,YAAY;EACZ,OAAO;EACP,QAAQ;EACR;EACA;CACF,GACA,IACF;CACA,IAAI,QACF;MAAI,YAAY,MAAM,GAAG;GACvB,OAAO,OAAO;GACd,IAAI,MAAM,QAAQ,OAAO,UAAU,KAAK,OAAO,WAAW,SAAS,GACjE,aAAa,UAAU,CAAC,GAAG,YAAY,GAAG,OAAO,UAAU,CAAC,EAAE,OAC5D,OACF;EAEJ,OAAO,IAAI,YAAY,MAAM,GAC3B,OAAO;CACT;CAGF,IAAI,YAAY,MAAM,KAAK,CAAC,KAAK,WAAW,SAAS,GACnD,MAAM,IAAI,GAAG,MACX,IAAI,WACJ,GACE,WAAW,SAAS,IAChB,GAAG,WAAW,KAAI,cAAa,yBAAyB,UAAU,KAAK,EAAE,KAAK,IAAI,EAAE;;IAGpF,KACH,wBAAwB,KAAK;EAAE,WAAW;EAAM,gBAAgB;CAAM,CAAC,EAAE;;EAEhF,YAAY,IAAI,EAAE;CAEhB;AAEJ"}
|
package/dist/lib/hooks.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_plugin_utils_logging = require('../plugin-utils/logging.cjs');
|
|
4
4
|
const require_plugin_utils_helpers = require('../plugin-utils/helpers.cjs');
|
|
5
5
|
const require_plugin_utils_merge = require('../plugin-utils/merge.cjs');
|
|
@@ -10,7 +10,7 @@ let defu = require("defu");
|
|
|
10
10
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
11
11
|
let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
12
12
|
let chalk = require("chalk");
|
|
13
|
-
chalk =
|
|
13
|
+
chalk = require_runtime.__toESM(chalk, 1);
|
|
14
14
|
let _stryke_helpers_get_field = require("@stryke/helpers/get-field");
|
|
15
15
|
let _stryke_type_checks_is_object = require("@stryke/type-checks/is-object");
|
|
16
16
|
let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
|
package/dist/lib/hooks.d.cts
CHANGED
|
@@ -1,2 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Plugin } from "../types/plugin.cjs";
|
|
2
|
+
import { CallHookOptions, HooksList, InferHookFunction, InferHookParameters } from "../types/hooks.cjs";
|
|
3
|
+
import { EnvironmentContext, ExecutionContext, PluginContext } from "../types/context.cjs";
|
|
4
|
+
import { ResolvedConfig } from "../types/config.cjs";
|
|
5
|
+
//#region src/lib/hooks.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Merges the current hook result with the previous results based on their types.
|
|
8
|
+
*
|
|
9
|
+
* @param currentResult - The current hook result to merge with the previous results.
|
|
10
|
+
* @param previousResults - The previous hook results to merge with the current result.
|
|
11
|
+
* @returns The merged result.
|
|
12
|
+
*/
|
|
13
|
+
declare function mergeResults<T extends Record<string | number | symbol, any> | string>(currentResult: T, previousResults: T[]): T[];
|
|
14
|
+
/**
|
|
15
|
+
* Merges multiple hook results together, with special handling for string values and object values.
|
|
16
|
+
*
|
|
17
|
+
* @param currentResult - The current hook result to merge with the previous results.
|
|
18
|
+
* @param previousResults - The previous hook results to merge with the current result.
|
|
19
|
+
* @returns The merged result.
|
|
20
|
+
*/
|
|
21
|
+
declare function mergeConfigs<T>(currentResult: T, previousResults: T): T;
|
|
22
|
+
declare function extractHooks<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = unknown>(context: PluginContext<TResolvedConfig, TSystemContext>, hooks: Record<string, HooksList<PluginContext<TResolvedConfig, TSystemContext>>>, plugin: Plugin<PluginContext<TResolvedConfig, TSystemContext>>, key: string, parentKey?: string): Record<string, HooksList<PluginContext<TResolvedConfig, TSystemContext>>>;
|
|
23
|
+
declare function callHook<TKey extends string, TResolvedConfig extends ResolvedConfig, TSystemContext = unknown>(context: ExecutionContext<TResolvedConfig, TSystemContext>, key: TKey, options: CallHookOptions & {
|
|
24
|
+
environment?: string | EnvironmentContext<TResolvedConfig, TSystemContext>;
|
|
25
|
+
}, ...args: InferHookParameters<PluginContext<TResolvedConfig, TSystemContext>, TKey>): Promise<ReturnType<InferHookFunction<PluginContext<TResolvedConfig, TSystemContext>, TKey>> | undefined>;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { callHook, extractHooks, mergeConfigs, mergeResults };
|
|
28
|
+
//# sourceMappingURL=hooks.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.cts","names":[],"sources":["../../src/lib/hooks.ts"],"mappings":";;;;;;;;;;;;iBA0DgB,YAAA,WACJ,MAAA,0CACV,aAAA,EAAe,CAAA,EAAG,eAAA,EAAiB,CAAA,KAAM,CAAA;;;;;;;;iBA8B3B,YAAA,IAAgB,aAAA,EAAe,CAAA,EAAG,eAAA,EAAiB,CAAA,GAAI,CAAA;AAAA,iBAyKvD,YAAA,yBACU,cAAA,GAAiB,cAAA,4BAGzC,OAAA,EAAS,aAAA,CAAc,eAAA,EAAiB,cAAA,GACxC,KAAA,EAAO,MAAA,SAEL,SAAA,CAAU,aAAA,CAAc,eAAA,EAAiB,cAAA,KAE3C,MAAA,EAAQ,MAAA,CAAO,aAAA,CAAc,eAAA,EAAiB,cAAA,IAC9C,GAAA,UACA,SAAA,YACC,MAAA,SAAe,SAAA,CAAU,aAAA,CAAc,eAAA,EAAiB,cAAA;AAAA,iBAwIrC,QAAA,8CAEI,cAAA,4BAGxB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,GAC3C,GAAA,EAAK,IAAA,EACL,OAAA,EAAS,eAAA;EACP,WAAA,YAAuB,kBAAA,CAAmB,eAAA,EAAiB,cAAA;AAAA,MAE1D,IAAA,EAAM,mBAAA,CACP,aAAA,CAAc,eAAA,EAAiB,cAAA,GAC/B,IAAA,IACD,OAAA,CAAA,UAAA,CAAA,iBAAA,CAAA,aAAA,CAAA,eAAA,EAAA,cAAA,GAAA,IAAA"}
|
package/dist/lib/hooks.d.mts
CHANGED
|
@@ -1,2 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Plugin } from "../types/plugin.mjs";
|
|
2
|
+
import { CallHookOptions, HooksList, InferHookFunction, InferHookParameters } from "../types/hooks.mjs";
|
|
3
|
+
import { EnvironmentContext, ExecutionContext, PluginContext } from "../types/context.mjs";
|
|
4
|
+
import { ResolvedConfig } from "../types/config.mjs";
|
|
5
|
+
//#region src/lib/hooks.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Merges the current hook result with the previous results based on their types.
|
|
8
|
+
*
|
|
9
|
+
* @param currentResult - The current hook result to merge with the previous results.
|
|
10
|
+
* @param previousResults - The previous hook results to merge with the current result.
|
|
11
|
+
* @returns The merged result.
|
|
12
|
+
*/
|
|
13
|
+
declare function mergeResults<T extends Record<string | number | symbol, any> | string>(currentResult: T, previousResults: T[]): T[];
|
|
14
|
+
/**
|
|
15
|
+
* Merges multiple hook results together, with special handling for string values and object values.
|
|
16
|
+
*
|
|
17
|
+
* @param currentResult - The current hook result to merge with the previous results.
|
|
18
|
+
* @param previousResults - The previous hook results to merge with the current result.
|
|
19
|
+
* @returns The merged result.
|
|
20
|
+
*/
|
|
21
|
+
declare function mergeConfigs<T>(currentResult: T, previousResults: T): T;
|
|
22
|
+
declare function extractHooks<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = unknown>(context: PluginContext<TResolvedConfig, TSystemContext>, hooks: Record<string, HooksList<PluginContext<TResolvedConfig, TSystemContext>>>, plugin: Plugin<PluginContext<TResolvedConfig, TSystemContext>>, key: string, parentKey?: string): Record<string, HooksList<PluginContext<TResolvedConfig, TSystemContext>>>;
|
|
23
|
+
declare function callHook<TKey extends string, TResolvedConfig extends ResolvedConfig, TSystemContext = unknown>(context: ExecutionContext<TResolvedConfig, TSystemContext>, key: TKey, options: CallHookOptions & {
|
|
24
|
+
environment?: string | EnvironmentContext<TResolvedConfig, TSystemContext>;
|
|
25
|
+
}, ...args: InferHookParameters<PluginContext<TResolvedConfig, TSystemContext>, TKey>): Promise<ReturnType<InferHookFunction<PluginContext<TResolvedConfig, TSystemContext>, TKey>> | undefined>;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { callHook, extractHooks, mergeConfigs, mergeResults };
|
|
28
|
+
//# sourceMappingURL=hooks.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.mts","names":[],"sources":["../../src/lib/hooks.ts"],"mappings":";;;;;;;;;;;;iBA0DgB,YAAA,WACJ,MAAA,0CACV,aAAA,EAAe,CAAA,EAAG,eAAA,EAAiB,CAAA,KAAM,CAAA;;;;;;;;iBA8B3B,YAAA,IAAgB,aAAA,EAAe,CAAA,EAAG,eAAA,EAAiB,CAAA,GAAI,CAAA;AAAA,iBAyKvD,YAAA,yBACU,cAAA,GAAiB,cAAA,4BAGzC,OAAA,EAAS,aAAA,CAAc,eAAA,EAAiB,cAAA,GACxC,KAAA,EAAO,MAAA,SAEL,SAAA,CAAU,aAAA,CAAc,eAAA,EAAiB,cAAA,KAE3C,MAAA,EAAQ,MAAA,CAAO,aAAA,CAAc,eAAA,EAAiB,cAAA,IAC9C,GAAA,UACA,SAAA,YACC,MAAA,SAAe,SAAA,CAAU,aAAA,CAAc,eAAA,EAAiB,cAAA;AAAA,iBAwIrC,QAAA,8CAEI,cAAA,4BAGxB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,GAC3C,GAAA,EAAK,IAAA,EACL,OAAA,EAAS,eAAA;EACP,WAAA,YAAuB,kBAAA,CAAmB,eAAA,EAAiB,cAAA;AAAA,MAE1D,IAAA,EAAM,mBAAA,CACP,aAAA,CAAc,eAAA,EAAiB,cAAA,GAC/B,IAAA,IACD,OAAA,CAAA,UAAA,CAAA,iBAAA,CAAA,aAAA,CAAA,eAAA,EAAA,cAAA,GAAA,IAAA"}
|
package/dist/lib/index.cjs
CHANGED
|
@@ -12,7 +12,7 @@ const require_lib_generate_types = require('./generate-types.cjs');
|
|
|
12
12
|
const require_lib_install_dependencies = require('./install-dependencies.cjs');
|
|
13
13
|
const require_lib_meta = require('./meta.cjs');
|
|
14
14
|
const require_lib_plugins = require('./plugins.cjs');
|
|
15
|
-
const require_fs = require('../fs
|
|
15
|
+
const require_fs = require('../schemas/fs.cjs');
|
|
16
16
|
require('./schemas.cjs');
|
|
17
17
|
const require_lib_streaming_channel = require('./streaming-channel.cjs');
|
|
18
18
|
const require_lib_typescript_tsconfig = require('./typescript/tsconfig.cjs');
|
package/dist/lib/index.d.cts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
1
|
+
import { PartiallyResolvedContext, ResolvePackageConfigsResult, defineConfig, getDefaultLogLevel, getDefaultMode, loadParsedConfig, loadUserConfigFile, loadWorkspaceConfig, normalizeBasePath, resolvePackageConfigs, resolveRoot, tryResolveWorkspaceConfig } from "./config.cjs";
|
|
2
|
+
import { getConfigProps, resolvePluginConfig } from "./context-helpers.cjs";
|
|
3
|
+
import { getUniqueInputs, isFileReference, isResolvedEntryFileReference, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync } from "./entry.cjs";
|
|
4
|
+
import { createEventEmitter } from "./events.cjs";
|
|
5
|
+
import { TypegenContext, emitBuiltinTypes, formatTypes, handleTypes } from "./generate-types.cjs";
|
|
6
|
+
import { callHook, extractHooks, mergeConfigs, mergeResults } from "./hooks.cjs";
|
|
7
|
+
import { installDependencies } from "./install-dependencies.cjs";
|
|
8
|
+
import { CreateContextOptions, getPersistedMeta, getPrefixedRootHash, writeMetaFile } from "./meta.cjs";
|
|
9
|
+
import { ResolvePluginsOptions, initPlugin, resolvePlugin, resolvePlugins } from "./plugins.cjs";
|
|
10
|
+
import { CreateResolverOptions, createResolver } from "./resolver.cjs";
|
|
11
|
+
import { FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, _capnpFileId } from "../schemas/fs.cjs";
|
|
12
|
+
import { BufferedChunk, CreateStreamReaderOptions, CreateStreamSinkOptions, StreamErrorPayload, StreamReader, StreamSink, StreamSinkEvents, createStreamReader, createStreamSink } from "./streaming-channel.cjs";
|
|
13
|
+
import { VirtualFileSystemHost, createProgram } from "./typescript/ts-morph.cjs";
|
|
14
|
+
import { findIncludeMatch, findMatch, getParsedTypeScriptConfig, getTsconfigDtsPath, getTsconfigFilePath, initializeTsconfig, isIncludeMatchFound, isMatchFound, resolveTsconfig, tryTsconfigFilePath } from "./typescript/tsconfig.cjs";
|
|
15
|
+
import { combineContexts, isUnpluginBuilderVariant } from "./unplugin/helpers.cjs";
|
|
16
|
+
import { CreateUnpluginModuleResolutionFunctionsOptions, createUnpluginModuleResolutionFunctions } from "./unplugin/module-resolution.cjs";
|
|
17
|
+
import { CreateUnpluginOptions, CreateUnpluginResolverOptions, createUnplugin, createUnpluginResolver } from "./unplugin/plugin.cjs";
|
|
18
|
+
import { FileHeaderOptions, getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getTypescriptFileHeader } from "./utilities/file-header.cjs";
|
|
19
|
+
import { format, formatFolder } from "./utilities/format.cjs";
|
|
20
|
+
import { getMagicString, getSourceFile, getString } from "./utilities/source-file.cjs";
|
|
21
|
+
import { generateSourceMap } from "./utilities/source-map.cjs";
|
|
22
|
+
import { writeFile } from "./utilities/write-file.cjs";
|
|
23
|
+
import { VirtualFileSystem } from "./vfs.cjs";
|
|
24
24
|
export { BufferedChunk, CreateContextOptions, CreateResolverOptions, CreateStreamReaderOptions, CreateStreamSinkOptions, CreateUnpluginModuleResolutionFunctionsOptions, CreateUnpluginOptions, CreateUnpluginResolverOptions, FileHeaderOptions, FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, PartiallyResolvedContext, ResolvePackageConfigsResult, ResolvePluginsOptions, StreamErrorPayload, StreamReader, StreamSink, StreamSinkEvents, TypegenContext, VirtualFileSystem, VirtualFileSystemHost, _capnpFileId, callHook, combineContexts, createEventEmitter, createProgram, createResolver, createStreamReader, createStreamSink, createUnplugin, createUnpluginModuleResolutionFunctions, createUnpluginResolver, defineConfig, emitBuiltinTypes, extractHooks, findIncludeMatch, findMatch, format, formatFolder, formatTypes, generateSourceMap, getConfigProps, getDefaultLogLevel, getDefaultMode, getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getMagicString, getParsedTypeScriptConfig, getPersistedMeta, getPrefixedRootHash, getSourceFile, getString, getTsconfigDtsPath, getTsconfigFilePath, getTypescriptFileHeader, getUniqueInputs, handleTypes, initPlugin, initializeTsconfig, installDependencies, isFileReference, isIncludeMatchFound, isMatchFound, isResolvedEntryFileReference, isUnpluginBuilderVariant, loadParsedConfig, loadUserConfigFile, loadWorkspaceConfig, mergeConfigs, mergeResults, normalizeBasePath, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync, resolvePackageConfigs, resolvePlugin, resolvePluginConfig, resolvePlugins, resolveRoot, resolveTsconfig, tryResolveWorkspaceConfig, tryTsconfigFilePath, writeFile, writeMetaFile };
|
package/dist/lib/index.d.mts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
1
|
+
import { PartiallyResolvedContext, ResolvePackageConfigsResult, defineConfig, getDefaultLogLevel, getDefaultMode, loadParsedConfig, loadUserConfigFile, loadWorkspaceConfig, normalizeBasePath, resolvePackageConfigs, resolveRoot, tryResolveWorkspaceConfig } from "./config.mjs";
|
|
2
|
+
import { getConfigProps, resolvePluginConfig } from "./context-helpers.mjs";
|
|
3
|
+
import { getUniqueInputs, isFileReference, isResolvedEntryFileReference, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync } from "./entry.mjs";
|
|
4
|
+
import { createEventEmitter } from "./events.mjs";
|
|
5
|
+
import { TypegenContext, emitBuiltinTypes, formatTypes, handleTypes } from "./generate-types.mjs";
|
|
6
|
+
import { callHook, extractHooks, mergeConfigs, mergeResults } from "./hooks.mjs";
|
|
7
|
+
import { installDependencies } from "./install-dependencies.mjs";
|
|
8
|
+
import { CreateContextOptions, getPersistedMeta, getPrefixedRootHash, writeMetaFile } from "./meta.mjs";
|
|
9
|
+
import { ResolvePluginsOptions, initPlugin, resolvePlugin, resolvePlugins } from "./plugins.mjs";
|
|
10
|
+
import { CreateResolverOptions, createResolver } from "./resolver.mjs";
|
|
11
|
+
import { FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, _capnpFileId } from "../schemas/fs.mjs";
|
|
12
|
+
import { BufferedChunk, CreateStreamReaderOptions, CreateStreamSinkOptions, StreamErrorPayload, StreamReader, StreamSink, StreamSinkEvents, createStreamReader, createStreamSink } from "./streaming-channel.mjs";
|
|
13
|
+
import { VirtualFileSystemHost, createProgram } from "./typescript/ts-morph.mjs";
|
|
14
|
+
import { findIncludeMatch, findMatch, getParsedTypeScriptConfig, getTsconfigDtsPath, getTsconfigFilePath, initializeTsconfig, isIncludeMatchFound, isMatchFound, resolveTsconfig, tryTsconfigFilePath } from "./typescript/tsconfig.mjs";
|
|
15
|
+
import { combineContexts, isUnpluginBuilderVariant } from "./unplugin/helpers.mjs";
|
|
16
|
+
import { CreateUnpluginModuleResolutionFunctionsOptions, createUnpluginModuleResolutionFunctions } from "./unplugin/module-resolution.mjs";
|
|
17
|
+
import { CreateUnpluginOptions, CreateUnpluginResolverOptions, createUnplugin, createUnpluginResolver } from "./unplugin/plugin.mjs";
|
|
18
|
+
import { FileHeaderOptions, getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getTypescriptFileHeader } from "./utilities/file-header.mjs";
|
|
19
|
+
import { format, formatFolder } from "./utilities/format.mjs";
|
|
20
|
+
import { getMagicString, getSourceFile, getString } from "./utilities/source-file.mjs";
|
|
21
|
+
import { generateSourceMap } from "./utilities/source-map.mjs";
|
|
22
|
+
import { writeFile } from "./utilities/write-file.mjs";
|
|
23
|
+
import { VirtualFileSystem } from "./vfs.mjs";
|
|
24
24
|
export { BufferedChunk, CreateContextOptions, CreateResolverOptions, CreateStreamReaderOptions, CreateStreamSinkOptions, CreateUnpluginModuleResolutionFunctionsOptions, CreateUnpluginOptions, CreateUnpluginResolverOptions, FileHeaderOptions, FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, PartiallyResolvedContext, ResolvePackageConfigsResult, ResolvePluginsOptions, StreamErrorPayload, StreamReader, StreamSink, StreamSinkEvents, TypegenContext, VirtualFileSystem, VirtualFileSystemHost, _capnpFileId, callHook, combineContexts, createEventEmitter, createProgram, createResolver, createStreamReader, createStreamSink, createUnplugin, createUnpluginModuleResolutionFunctions, createUnpluginResolver, defineConfig, emitBuiltinTypes, extractHooks, findIncludeMatch, findMatch, format, formatFolder, formatTypes, generateSourceMap, getConfigProps, getDefaultLogLevel, getDefaultMode, getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getMagicString, getParsedTypeScriptConfig, getPersistedMeta, getPrefixedRootHash, getSourceFile, getString, getTsconfigDtsPath, getTsconfigFilePath, getTypescriptFileHeader, getUniqueInputs, handleTypes, initPlugin, initializeTsconfig, installDependencies, isFileReference, isIncludeMatchFound, isMatchFound, isResolvedEntryFileReference, isUnpluginBuilderVariant, loadParsedConfig, loadUserConfigFile, loadWorkspaceConfig, mergeConfigs, mergeResults, normalizeBasePath, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync, resolvePackageConfigs, resolvePlugin, resolvePluginConfig, resolvePlugins, resolveRoot, resolveTsconfig, tryResolveWorkspaceConfig, tryTsconfigFilePath, writeFile, writeMetaFile };
|
package/dist/lib/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { emitBuiltinTypes, formatTypes, handleTypes } from "./generate-types.mjs
|
|
|
11
11
|
import { installDependencies } from "./install-dependencies.mjs";
|
|
12
12
|
import { getPersistedMeta, getPrefixedRootHash, writeMetaFile } from "./meta.mjs";
|
|
13
13
|
import { initPlugin, resolvePlugin, resolvePlugins } from "./plugins.mjs";
|
|
14
|
-
import {
|
|
14
|
+
import { FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, _capnpFileId } from "../schemas/fs.mjs";
|
|
15
15
|
import "./schemas.mjs";
|
|
16
16
|
import { createStreamReader, createStreamSink } from "./streaming-channel.mjs";
|
|
17
17
|
import { findIncludeMatch, findMatch, getParsedTypeScriptConfig, getTsconfigDtsPath, getTsconfigFilePath, initializeTsconfig, isIncludeMatchFound, isMatchFound, resolveTsconfig, tryTsconfigFilePath } from "./typescript/tsconfig.mjs";
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Context } from "../types/context.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/install-dependencies.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Install missing project dependencies.
|
|
6
|
+
*
|
|
7
|
+
* @param context - The build context.
|
|
8
|
+
*/
|
|
9
|
+
declare function installDependencies<TContext extends Context = Context>(context: TContext): Promise<void>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { installDependencies };
|
|
12
|
+
//# sourceMappingURL=install-dependencies.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-dependencies.d.cts","names":[],"sources":["../../src/lib/install-dependencies.ts"],"mappings":";;;;;AA2BA;;;iBAAsB,mBAAA,kBAAqC,OAAA,GAAU,OAAA,EACnE,OAAA,EAAS,QAAA,GACR,OAAA"}
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Context } from "../types/context.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/install-dependencies.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Install missing project dependencies.
|
|
6
|
+
*
|
|
7
|
+
* @param context - The build context.
|
|
8
|
+
*/
|
|
9
|
+
declare function installDependencies<TContext extends Context = Context>(context: TContext): Promise<void>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { installDependencies };
|
|
12
|
+
//# sourceMappingURL=install-dependencies.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-dependencies.d.mts","names":[],"sources":["../../src/lib/install-dependencies.ts"],"mappings":";;;;;AA2BA;;;iBAAsB,mBAAA,kBAAqC,OAAA,GAAU,OAAA,EACnE,OAAA,EAAS,QAAA,GACR,OAAA"}
|
package/dist/lib/meta.cjs
CHANGED
|
@@ -4,6 +4,7 @@ require('../constants/index.cjs');
|
|
|
4
4
|
let _stryke_fs_exists = require("@stryke/fs/exists");
|
|
5
5
|
let _stryke_fs_json = require("@stryke/fs/json");
|
|
6
6
|
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
7
|
+
let _stryke_path_replace = require("@stryke/path/replace");
|
|
7
8
|
let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
8
9
|
let _stryke_fs_remove_file = require("@stryke/fs/remove-file");
|
|
9
10
|
|
|
@@ -46,7 +47,7 @@ async function getPersistedMeta(context) {
|
|
|
46
47
|
*/
|
|
47
48
|
async function writeMetaFile(context) {
|
|
48
49
|
const metaFilePath = (0, _stryke_path_join_paths.joinPaths)(context.dataPath, "meta.json");
|
|
49
|
-
context.debug(`Writing runtime metadata to ${metaFilePath}`);
|
|
50
|
+
context.debug(`Writing runtime metadata to ${(0, _stryke_path_replace.replacePath)(metaFilePath, context.config.cwd)}`);
|
|
50
51
|
await context.fs.write(metaFilePath, JSON.stringify(context.meta, null, 2));
|
|
51
52
|
}
|
|
52
53
|
|
package/dist/lib/meta.d.cts
CHANGED
|
@@ -1,2 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Context, MetaInfo } from "../types/context.cjs";
|
|
2
|
+
//#region src/lib/meta.d.ts
|
|
3
|
+
interface CreateContextOptions {
|
|
4
|
+
name?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Generates a prefixed project root hash object.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This function returns a string where the project root hash is prefixed with the project name plus a hyphen. If the total length of this string combination exceeds 45 characters, it will truncate the hash.
|
|
11
|
+
*
|
|
12
|
+
* @param name - The name of the project.
|
|
13
|
+
* @param rootHash - The hash of the project root.
|
|
14
|
+
* @returns An object containing the name and project root hash.
|
|
15
|
+
*/
|
|
16
|
+
declare function getPrefixedRootHash(name: string, rootHash: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves the persisted meta information from the context's data path.
|
|
19
|
+
*
|
|
20
|
+
* @param context - The build context.
|
|
21
|
+
* @returns A promise that resolves to the persisted meta information, or undefined if not found.
|
|
22
|
+
*/
|
|
23
|
+
declare function getPersistedMeta(context: Context): Promise<MetaInfo | undefined>;
|
|
24
|
+
/**
|
|
25
|
+
* Writes the meta file for the context.
|
|
26
|
+
*
|
|
27
|
+
* @param context - The context to write the meta file for.
|
|
28
|
+
* @returns A promise that resolves when the meta file has been written.
|
|
29
|
+
*/
|
|
30
|
+
declare function writeMetaFile(context: Context): Promise<void>;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { CreateContextOptions, getPersistedMeta, getPrefixedRootHash, writeMetaFile };
|
|
33
|
+
//# sourceMappingURL=meta.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.cts","names":[],"sources":["../../src/lib/meta.ts"],"mappings":";;UA2BiB,oBAAA;EACf,IAAI;AAAA;AADN;;;;AACM;AAaN;;;;AAAkE;AAdlE,iBAcgB,mBAAA,CAAoB,IAAA,UAAc,QAAgB;;;;;;;iBAc5C,gBAAA,CACpB,OAAA,EAAS,OAAA,GACR,OAAA,CAAQ,QAAA;;;;;;AAAQ;iBAwBG,aAAA,CAAc,OAAA,EAAS,OAAA,GAAU,OAAO"}
|
package/dist/lib/meta.d.mts
CHANGED
|
@@ -1,2 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Context, MetaInfo } from "../types/context.mjs";
|
|
2
|
+
//#region src/lib/meta.d.ts
|
|
3
|
+
interface CreateContextOptions {
|
|
4
|
+
name?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Generates a prefixed project root hash object.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This function returns a string where the project root hash is prefixed with the project name plus a hyphen. If the total length of this string combination exceeds 45 characters, it will truncate the hash.
|
|
11
|
+
*
|
|
12
|
+
* @param name - The name of the project.
|
|
13
|
+
* @param rootHash - The hash of the project root.
|
|
14
|
+
* @returns An object containing the name and project root hash.
|
|
15
|
+
*/
|
|
16
|
+
declare function getPrefixedRootHash(name: string, rootHash: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves the persisted meta information from the context's data path.
|
|
19
|
+
*
|
|
20
|
+
* @param context - The build context.
|
|
21
|
+
* @returns A promise that resolves to the persisted meta information, or undefined if not found.
|
|
22
|
+
*/
|
|
23
|
+
declare function getPersistedMeta(context: Context): Promise<MetaInfo | undefined>;
|
|
24
|
+
/**
|
|
25
|
+
* Writes the meta file for the context.
|
|
26
|
+
*
|
|
27
|
+
* @param context - The context to write the meta file for.
|
|
28
|
+
* @returns A promise that resolves when the meta file has been written.
|
|
29
|
+
*/
|
|
30
|
+
declare function writeMetaFile(context: Context): Promise<void>;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { CreateContextOptions, getPersistedMeta, getPrefixedRootHash, writeMetaFile };
|
|
33
|
+
//# sourceMappingURL=meta.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.mts","names":[],"sources":["../../src/lib/meta.ts"],"mappings":";;UA2BiB,oBAAA;EACf,IAAI;AAAA;AADN;;;;AACM;AAaN;;;;AAAkE;AAdlE,iBAcgB,mBAAA,CAAoB,IAAA,UAAc,QAAgB;;;;;;;iBAc5C,gBAAA,CACpB,OAAA,EAAS,OAAA,GACR,OAAA,CAAQ,QAAA;;;;;;AAAQ;iBAwBG,aAAA,CAAc,OAAA,EAAS,OAAA,GAAU,OAAO"}
|