@powerlines/core 0.15.0 → 0.15.2
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/constants/api.cjs +6 -5
- package/dist/constants/api.d.cts +3 -3
- package/dist/constants/api.d.cts.map +1 -1
- package/dist/constants/api.d.mts +3 -3
- package/dist/constants/api.d.mts.map +1 -1
- package/dist/constants/api.mjs +4 -4
- package/dist/constants/api.mjs.map +1 -1
- package/dist/constants/commands.cjs +3 -2
- package/dist/constants/commands.d.cts +1 -1
- package/dist/constants/commands.d.mts +1 -1
- package/dist/constants/commands.mjs +2 -2
- package/dist/constants/commands.mjs.map +1 -1
- package/dist/constants/devtools.cjs +23 -0
- package/dist/constants/devtools.d.cts +13 -0
- package/dist/constants/devtools.d.cts.map +1 -0
- package/dist/constants/devtools.d.mts +13 -0
- package/dist/constants/devtools.d.mts.map +1 -0
- package/dist/constants/devtools.mjs +14 -0
- package/dist/constants/devtools.mjs.map +1 -0
- package/dist/constants/environments.cjs +1 -0
- package/dist/constants/extensions.cjs +21 -0
- package/dist/constants/extensions.d.cts +5 -0
- package/dist/constants/extensions.d.cts.map +1 -0
- package/dist/constants/extensions.d.mts +5 -0
- package/dist/constants/extensions.d.mts.map +1 -0
- package/dist/constants/extensions.mjs +20 -0
- package/dist/constants/extensions.mjs.map +1 -0
- package/dist/constants/fs.cjs +1 -0
- package/dist/constants/hooks.cjs +1 -0
- package/dist/constants/index.cjs +48 -30
- package/dist/constants/index.d.cts +5 -3
- package/dist/constants/index.d.mts +5 -3
- package/dist/constants/index.mjs +5 -3
- package/dist/constants/log-level.cjs +90 -0
- package/dist/constants/log-level.d.cts +63 -0
- package/dist/constants/log-level.d.cts.map +1 -0
- package/dist/constants/log-level.d.mts +63 -0
- package/dist/constants/log-level.d.mts.map +1 -0
- package/dist/constants/log-level.mjs +82 -0
- package/dist/constants/log-level.mjs.map +1 -0
- package/dist/constants/meta.cjs +1 -0
- package/dist/constants/plugin.cjs +3 -2
- package/dist/constants/plugin.d.cts +2 -2
- package/dist/constants/plugin.d.mts +2 -2
- package/dist/context/base-context.cjs +127 -0
- package/dist/context/base-context.d.cts +81 -0
- package/dist/context/base-context.d.cts.map +1 -0
- package/dist/context/base-context.d.mts +81 -0
- package/dist/context/base-context.d.mts.map +1 -0
- package/dist/context/base-context.mjs +125 -0
- package/dist/context/base-context.mjs.map +1 -0
- package/dist/context/context.cjs +934 -0
- package/dist/context/context.d.cts +369 -0
- package/dist/context/context.d.cts.map +1 -0
- package/dist/context/context.d.mts +369 -0
- package/dist/context/context.d.mts.map +1 -0
- package/dist/context/context.mjs +932 -0
- package/dist/context/context.mjs.map +1 -0
- package/dist/context/environment-context.cjs +219 -0
- package/dist/context/environment-context.d.cts +100 -0
- package/dist/context/environment-context.d.cts.map +1 -0
- package/dist/context/environment-context.d.mts +100 -0
- package/dist/context/environment-context.d.mts.map +1 -0
- package/dist/context/environment-context.mjs +218 -0
- package/dist/context/environment-context.mjs.map +1 -0
- package/dist/context/execution-context.cjs +230 -0
- package/dist/context/execution-context.d.cts +101 -0
- package/dist/context/execution-context.d.cts.map +1 -0
- package/dist/context/execution-context.d.mts +101 -0
- package/dist/context/execution-context.d.mts.map +1 -0
- package/dist/context/execution-context.mjs +228 -0
- package/dist/context/execution-context.mjs.map +1 -0
- package/dist/context/index.cjs +12 -0
- package/dist/context/index.d.cts +6 -0
- package/dist/context/index.d.mts +6 -0
- package/dist/context/index.mjs +7 -0
- package/dist/context/plugin-context.cjs +83 -0
- package/dist/context/plugin-context.d.cts +18 -0
- package/dist/context/plugin-context.d.cts.map +1 -0
- package/dist/context/plugin-context.d.mts +18 -0
- package/dist/context/plugin-context.d.mts.map +1 -0
- package/dist/context/plugin-context.mjs +82 -0
- package/dist/context/plugin-context.mjs.map +1 -0
- package/dist/index.cjs +62 -9
- package/dist/index.d.cts +20 -9
- package/dist/index.d.mts +20 -9
- package/dist/index.mjs +17 -5
- package/dist/lib/config.cjs +160 -15
- package/dist/lib/config.d.cts +92 -6
- package/dist/lib/config.d.cts.map +1 -1
- package/dist/lib/config.d.mts +92 -6
- package/dist/lib/config.d.mts.map +1 -1
- package/dist/lib/config.mjs +154 -16
- package/dist/lib/config.mjs.map +1 -1
- package/dist/lib/context-helpers.cjs +43 -0
- package/dist/lib/context-helpers.d.cts +19 -0
- package/dist/lib/context-helpers.d.cts.map +1 -0
- package/dist/lib/context-helpers.d.mts +19 -0
- package/dist/lib/context-helpers.d.mts.map +1 -0
- package/dist/lib/context-helpers.mjs +41 -0
- package/dist/lib/context-helpers.mjs.map +1 -0
- package/dist/lib/entry.cjs +5 -5
- package/dist/lib/entry.d.cts +5 -5
- package/dist/lib/entry.d.cts.map +1 -1
- package/dist/lib/entry.d.mts +5 -5
- package/dist/lib/entry.d.mts.map +1 -1
- package/dist/lib/entry.mjs +5 -5
- package/dist/lib/entry.mjs.map +1 -1
- package/dist/lib/environment.cjs +72 -0
- package/dist/lib/environment.d.cts +12 -0
- package/dist/lib/environment.d.cts.map +1 -0
- package/dist/lib/environment.d.mts +12 -0
- package/dist/lib/environment.d.mts.map +1 -0
- package/dist/lib/environment.mjs +67 -0
- package/dist/lib/environment.mjs.map +1 -0
- package/dist/lib/events.cjs +43 -0
- package/dist/lib/events.d.cts +10 -0
- package/dist/lib/events.d.cts.map +1 -0
- package/dist/lib/events.d.mts +10 -0
- package/dist/lib/events.d.mts.map +1 -0
- package/dist/lib/events.mjs +42 -0
- package/dist/lib/events.mjs.map +1 -0
- package/dist/lib/generate-types.cjs +371 -0
- package/dist/lib/generate-types.d.cts +67 -0
- package/dist/lib/generate-types.d.cts.map +1 -0
- package/dist/lib/generate-types.d.mts +67 -0
- package/dist/lib/generate-types.d.mts.map +1 -0
- package/dist/lib/generate-types.mjs +368 -0
- package/dist/lib/generate-types.mjs.map +1 -0
- package/dist/lib/hooks.cjs +152 -0
- package/dist/lib/hooks.d.cts +28 -0
- package/dist/lib/hooks.d.cts.map +1 -0
- package/dist/lib/hooks.d.mts +28 -0
- package/dist/lib/hooks.d.mts.map +1 -0
- package/dist/lib/hooks.mjs +147 -0
- package/dist/lib/hooks.mjs.map +1 -0
- package/dist/lib/index.cjs +64 -9
- package/dist/lib/index.d.cts +15 -3
- package/dist/lib/index.d.mts +15 -3
- package/dist/lib/index.mjs +19 -5
- package/dist/lib/install-dependencies.cjs +25 -0
- package/dist/lib/install-dependencies.d.cts +12 -0
- package/dist/lib/install-dependencies.d.cts.map +1 -0
- package/dist/lib/install-dependencies.d.mts +12 -0
- package/dist/lib/install-dependencies.d.mts.map +1 -0
- package/dist/lib/install-dependencies.mjs +24 -0
- package/dist/lib/install-dependencies.mjs.map +1 -0
- package/dist/lib/meta.cjs +57 -0
- package/dist/lib/meta.d.cts +34 -0
- package/dist/lib/meta.d.cts.map +1 -0
- package/dist/lib/meta.d.mts +34 -0
- package/dist/lib/meta.d.mts.map +1 -0
- package/dist/lib/meta.mjs +54 -0
- package/dist/lib/meta.mjs.map +1 -0
- package/dist/lib/plugins.cjs +150 -0
- package/dist/lib/plugins.d.cts +40 -0
- package/dist/lib/plugins.d.cts.map +1 -0
- package/dist/lib/plugins.d.mts +40 -0
- package/dist/lib/plugins.d.mts.map +1 -0
- package/dist/lib/plugins.mjs +146 -0
- package/dist/lib/plugins.mjs.map +1 -0
- package/dist/lib/resolver.cjs +35 -0
- package/dist/lib/resolver.d.cts +21 -0
- package/dist/lib/resolver.d.cts.map +1 -0
- package/dist/lib/resolver.d.mts +21 -0
- package/dist/lib/resolver.d.mts.map +1 -0
- package/dist/lib/resolver.mjs +33 -0
- package/dist/lib/resolver.mjs.map +1 -0
- package/dist/lib/schemas.cjs +9 -0
- package/dist/lib/schemas.d.cts +2 -0
- package/dist/lib/schemas.d.mts +2 -0
- package/dist/lib/schemas.mjs +3 -0
- package/dist/lib/streaming-channel.cjs +260 -0
- package/dist/lib/streaming-channel.d.cts +133 -0
- package/dist/lib/streaming-channel.d.cts.map +1 -0
- package/dist/lib/streaming-channel.d.mts +133 -0
- package/dist/lib/streaming-channel.d.mts.map +1 -0
- package/dist/lib/streaming-channel.mjs +258 -0
- package/dist/lib/streaming-channel.mjs.map +1 -0
- package/dist/lib/typescript/index.cjs +16 -0
- package/dist/lib/typescript/index.d.cts +3 -0
- package/dist/lib/typescript/index.d.mts +3 -0
- package/dist/lib/typescript/index.mjs +4 -0
- package/dist/lib/typescript/ts-morph.cjs +105 -0
- package/dist/lib/typescript/ts-morph.d.cts +38 -0
- package/dist/lib/typescript/ts-morph.d.cts.map +1 -0
- package/dist/lib/typescript/ts-morph.d.mts +38 -0
- package/dist/lib/typescript/ts-morph.d.mts.map +1 -0
- package/dist/lib/typescript/ts-morph.mjs +102 -0
- package/dist/lib/typescript/ts-morph.mjs.map +1 -0
- package/dist/lib/typescript/tsconfig.cjs +253 -0
- package/dist/lib/typescript/tsconfig.d.cts +77 -0
- package/dist/lib/typescript/tsconfig.d.cts.map +1 -0
- package/dist/lib/typescript/tsconfig.d.mts +77 -0
- package/dist/lib/typescript/tsconfig.d.mts.map +1 -0
- package/dist/lib/typescript/tsconfig.mjs +240 -0
- package/dist/lib/typescript/tsconfig.mjs.map +1 -0
- package/dist/lib/unplugin/helpers.cjs +2 -2
- package/dist/lib/unplugin/module-resolution.cjs +18 -18
- package/dist/lib/unplugin/module-resolution.d.cts +2 -2
- package/dist/lib/unplugin/module-resolution.d.cts.map +1 -1
- package/dist/lib/unplugin/module-resolution.d.mts +2 -2
- package/dist/lib/unplugin/module-resolution.d.mts.map +1 -1
- package/dist/lib/unplugin/module-resolution.mjs +18 -18
- package/dist/lib/unplugin/module-resolution.mjs.map +1 -1
- package/dist/lib/unplugin/plugin.cjs +55 -62
- package/dist/lib/unplugin/plugin.d.cts +11 -12
- package/dist/lib/unplugin/plugin.d.cts.map +1 -1
- package/dist/lib/unplugin/plugin.d.mts +11 -12
- package/dist/lib/unplugin/plugin.d.mts.map +1 -1
- package/dist/lib/unplugin/plugin.mjs +55 -62
- package/dist/lib/unplugin/plugin.mjs.map +1 -1
- package/dist/lib/utilities/file-header.cjs +2 -2
- package/dist/lib/utilities/file-header.mjs +2 -2
- package/dist/lib/utilities/file-header.mjs.map +1 -1
- package/dist/lib/utilities/format.cjs +1 -1
- package/dist/lib/utilities/format.mjs +1 -1
- package/dist/lib/utilities/index.cjs +2 -2
- package/dist/lib/utilities/index.mjs +2 -2
- package/dist/lib/utilities/write-file.cjs +1 -2
- package/dist/lib/utilities/write-file.d.cts +1 -1
- package/dist/lib/utilities/write-file.d.cts.map +1 -1
- package/dist/lib/utilities/write-file.d.mts +1 -1
- package/dist/lib/utilities/write-file.d.mts.map +1 -1
- package/dist/lib/utilities/write-file.mjs +1 -2
- package/dist/lib/utilities/write-file.mjs.map +1 -1
- package/dist/lib/vfs.cjs +1104 -0
- package/dist/lib/vfs.d.cts +321 -0
- package/dist/lib/vfs.d.cts.map +1 -0
- package/dist/lib/vfs.d.mts +321 -0
- package/dist/lib/vfs.d.mts.map +1 -0
- package/dist/lib/vfs.mjs +1102 -0
- package/dist/lib/vfs.mjs.map +1 -0
- package/dist/plugin-base.cjs +1 -1
- package/dist/plugin-base.mjs +1 -1
- package/dist/plugin-base.mjs.map +1 -1
- package/dist/plugin-utils/build-helpers.cjs +2 -2
- package/dist/plugin-utils/build-helpers.d.cts +2 -2
- package/dist/plugin-utils/build-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/build-helpers.d.mts +2 -2
- package/dist/plugin-utils/build-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/build-helpers.mjs +2 -2
- package/dist/plugin-utils/build-helpers.mjs.map +1 -1
- package/dist/plugin-utils/context-helpers.cjs +22 -12
- package/dist/plugin-utils/context-helpers.d.cts +9 -1
- package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/context-helpers.d.mts +9 -1
- package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/context-helpers.mjs +22 -13
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/filter.cjs +13 -5
- package/dist/plugin-utils/filter.d.cts +2 -1
- package/dist/plugin-utils/filter.d.cts.map +1 -1
- package/dist/plugin-utils/filter.d.mts +2 -1
- package/dist/plugin-utils/filter.d.mts.map +1 -1
- package/dist/plugin-utils/filter.mjs +13 -6
- package/dist/plugin-utils/filter.mjs.map +1 -1
- package/dist/plugin-utils/format.cjs +44 -0
- package/dist/plugin-utils/format.d.cts +11 -0
- package/dist/plugin-utils/format.d.cts.map +1 -0
- package/dist/plugin-utils/format.d.mts +11 -0
- package/dist/plugin-utils/format.d.mts.map +1 -0
- package/dist/plugin-utils/format.mjs +43 -0
- package/dist/plugin-utils/format.mjs.map +1 -0
- package/dist/plugin-utils/helpers.cjs +6 -6
- package/dist/plugin-utils/helpers.d.cts +15 -15
- package/dist/plugin-utils/helpers.d.cts.map +1 -1
- package/dist/plugin-utils/helpers.d.mts +15 -15
- package/dist/plugin-utils/helpers.d.mts.map +1 -1
- package/dist/plugin-utils/helpers.mjs +1 -1
- package/dist/plugin-utils/helpers.mjs.map +1 -1
- package/dist/plugin-utils/index.cjs +34 -4
- package/dist/plugin-utils/index.d.cts +7 -4
- package/dist/plugin-utils/index.d.mts +7 -4
- package/dist/plugin-utils/index.mjs +9 -6
- package/dist/plugin-utils/install.cjs +47 -0
- package/dist/plugin-utils/install.d.cts +23 -0
- package/dist/plugin-utils/install.d.cts.map +1 -0
- package/dist/plugin-utils/install.d.mts +23 -0
- package/dist/plugin-utils/install.d.mts.map +1 -0
- package/dist/plugin-utils/install.mjs +45 -0
- package/dist/plugin-utils/install.mjs.map +1 -0
- package/dist/plugin-utils/logging.cjs +588 -1
- package/dist/plugin-utils/logging.d.cts +93 -1
- package/dist/plugin-utils/logging.d.cts.map +1 -1
- package/dist/plugin-utils/logging.d.mts +93 -1
- package/dist/plugin-utils/logging.d.mts.map +1 -1
- package/dist/plugin-utils/logging.mjs +572 -1
- package/dist/plugin-utils/logging.mjs.map +1 -1
- package/dist/plugin-utils/merge.cjs +1 -1
- package/dist/plugin-utils/merge.mjs +1 -1
- package/dist/plugin-utils/modules.cjs +1 -1
- package/dist/plugin-utils/modules.mjs +1 -1
- package/dist/plugin-utils/modules.mjs.map +1 -1
- package/dist/plugin-utils/paths.cjs +6 -2
- package/dist/plugin-utils/paths.mjs +6 -2
- package/dist/plugin-utils/paths.mjs.map +1 -1
- package/dist/plugin-utils/virtual.cjs +80 -0
- package/dist/plugin-utils/virtual.d.cts +69 -0
- package/dist/plugin-utils/virtual.d.cts.map +1 -0
- package/dist/plugin-utils/virtual.d.mts +69 -0
- package/dist/plugin-utils/virtual.d.mts.map +1 -0
- package/dist/plugin-utils/virtual.mjs +73 -0
- package/dist/plugin-utils/virtual.mjs.map +1 -0
- package/dist/schemas/fs.cjs +232 -0
- package/dist/schemas/fs.d.cts +127 -0
- package/dist/schemas/fs.d.cts.map +1 -0
- package/dist/schemas/fs.d.mts +127 -0
- package/dist/schemas/fs.d.mts.map +1 -0
- package/dist/schemas/fs.mjs +226 -0
- package/dist/schemas/fs.mjs.map +1 -0
- package/dist/storage/base.cjs +216 -0
- package/dist/storage/base.d.cts +201 -0
- package/dist/storage/base.d.cts.map +1 -0
- package/dist/storage/base.d.mts +201 -0
- package/dist/storage/base.d.mts.map +1 -0
- package/dist/storage/base.mjs +215 -0
- package/dist/storage/base.mjs.map +1 -0
- package/dist/storage/file-system.cjs +180 -0
- package/dist/storage/file-system.d.cts +129 -0
- package/dist/storage/file-system.d.cts.map +1 -0
- package/dist/storage/file-system.d.mts +129 -0
- package/dist/storage/file-system.d.mts.map +1 -0
- package/dist/storage/file-system.mjs +179 -0
- package/dist/storage/file-system.mjs.map +1 -0
- package/dist/storage/helpers.cjs +37 -0
- package/dist/storage/helpers.d.cts +25 -0
- package/dist/storage/helpers.d.cts.map +1 -0
- package/dist/storage/helpers.d.mts +25 -0
- package/dist/storage/helpers.d.mts.map +1 -0
- package/dist/storage/helpers.mjs +34 -0
- package/dist/storage/helpers.mjs.map +1 -0
- package/dist/storage/index.cjs +12 -0
- package/dist/storage/index.d.cts +5 -0
- package/dist/storage/index.d.mts +5 -0
- package/dist/storage/index.mjs +6 -0
- package/dist/storage/virtual.cjs +98 -0
- package/dist/storage/virtual.d.cts +80 -0
- package/dist/storage/virtual.d.cts.map +1 -0
- package/dist/storage/virtual.d.mts +80 -0
- package/dist/storage/virtual.d.mts.map +1 -0
- package/dist/storage/virtual.mjs +97 -0
- package/dist/storage/virtual.mjs.map +1 -0
- package/dist/types/api.d.cts +18 -152
- package/dist/types/api.d.cts.map +1 -1
- package/dist/types/api.d.mts +18 -152
- package/dist/types/api.d.mts.map +1 -1
- package/dist/types/config.d.cts +194 -135
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +195 -136
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/context.d.cts +140 -130
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts +143 -133
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/fs.d.mts +1 -1
- package/dist/types/index.d.cts +5 -6
- package/dist/types/index.d.mts +5 -6
- package/dist/types/logging.d.cts +161 -0
- package/dist/types/logging.d.cts.map +1 -0
- package/dist/types/logging.d.mts +161 -0
- package/dist/types/logging.d.mts.map +1 -0
- package/dist/types/plugin.d.cts +6 -9
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +6 -9
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/tsconfig.d.mts +1 -1
- package/dist/types/unplugin.d.cts +6 -27
- package/dist/types/unplugin.d.cts.map +1 -1
- package/dist/types/unplugin.d.mts +6 -27
- package/dist/types/unplugin.d.mts.map +1 -1
- package/package.json +259 -457
- package/schemas/fs.capnp +42 -0
- package/dist/constants/virtual-modules.cjs +0 -8
- package/dist/constants/virtual-modules.d.cts +0 -6
- package/dist/constants/virtual-modules.d.cts.map +0 -1
- package/dist/constants/virtual-modules.d.mts +0 -6
- package/dist/constants/virtual-modules.d.mts.map +0 -1
- package/dist/constants/virtual-modules.mjs +0 -7
- package/dist/constants/virtual-modules.mjs.map +0 -1
- package/dist/lib/logger.cjs +0 -99
- package/dist/lib/logger.d.cts +0 -53
- package/dist/lib/logger.d.cts.map +0 -1
- package/dist/lib/logger.d.mts +0 -53
- package/dist/lib/logger.d.mts.map +0 -1
- package/dist/lib/logger.mjs +0 -93
- package/dist/lib/logger.mjs.map +0 -1
- package/dist/types/_internal.cjs +0 -0
- package/dist/types/_internal.d.cts +0 -106
- package/dist/types/_internal.d.cts.map +0 -1
- package/dist/types/_internal.d.mts +0 -106
- package/dist/types/_internal.d.mts.map +0 -1
- package/dist/types/_internal.mjs +0 -1
- package/dist/types/commands.d.cts +0 -16
- package/dist/types/commands.d.cts.map +0 -1
- package/dist/types/commands.d.mts +0 -16
- package/dist/types/commands.d.mts.map +0 -1
- package/dist/types/utils.d.cts +0 -9
- package/dist/types/utils.d.cts.map +0 -1
- package/dist/types/utils.d.mts +0 -9
- package/dist/types/utils.d.mts.map +0 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { BaseStorageAdapter } from "./base.mjs";
|
|
2
|
+
import { isParentPath } from "@stryke/path/is-parent-path";
|
|
3
|
+
|
|
4
|
+
//#region src/storage/virtual.ts
|
|
5
|
+
/**
|
|
6
|
+
* Virtual/in-memory storage adapter implementation.
|
|
7
|
+
*/
|
|
8
|
+
var VirtualStorageAdapter = class extends BaseStorageAdapter {
|
|
9
|
+
/**
|
|
10
|
+
* A name identifying the storage adapter type.
|
|
11
|
+
*/
|
|
12
|
+
name = "virtual";
|
|
13
|
+
/**
|
|
14
|
+
* The storage preset for the adapter.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* This can be used as an alternate way to identify the type of storage being used.
|
|
18
|
+
*/
|
|
19
|
+
preset = "virtual";
|
|
20
|
+
/**
|
|
21
|
+
* In-memory data storage.
|
|
22
|
+
*/
|
|
23
|
+
data = /* @__PURE__ */ new Map();
|
|
24
|
+
/**
|
|
25
|
+
* Constructor for the VirtualStorageAdapter.
|
|
26
|
+
*
|
|
27
|
+
* @param context - The Powerlines context.
|
|
28
|
+
* @param options - Configuration options for the storage adapter.
|
|
29
|
+
*/
|
|
30
|
+
constructor(context, options) {
|
|
31
|
+
super(context, options);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Synchronously checks if a key exists in the storage.
|
|
35
|
+
*
|
|
36
|
+
* @param key - The key to check for existence.
|
|
37
|
+
* @returns Returns `true` if the key exists, otherwise `false`.
|
|
38
|
+
*/
|
|
39
|
+
existsSync(key) {
|
|
40
|
+
return this.data.has(this.resolve(key));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Synchronously retrieves the value associated with a given key.
|
|
44
|
+
*
|
|
45
|
+
* @param key - The key whose value is to be retrieved.
|
|
46
|
+
* @returns The value associated with the key, or `null` if the key does not exist.
|
|
47
|
+
*/
|
|
48
|
+
getSync(key) {
|
|
49
|
+
return this.data.get(this.resolve(key)) ?? null;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Synchronously sets the value for a given key.
|
|
53
|
+
*
|
|
54
|
+
* @param key - The key to set the value for.
|
|
55
|
+
* @param value - The value to set.
|
|
56
|
+
*/
|
|
57
|
+
setSync(key, value) {
|
|
58
|
+
if (!this.isReadOnly && (!this.existsSync(key) || this.overwrite)) this.data.set(this.resolve(key), value);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Synchronously removes a key from the storage.
|
|
62
|
+
*
|
|
63
|
+
* @param key - The key to remove.
|
|
64
|
+
*/
|
|
65
|
+
removeSync(key) {
|
|
66
|
+
if (!this.isReadOnly && this.overwrite) this.data.delete(this.resolve(key));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Lists all keys under a given base path synchronously.
|
|
70
|
+
*
|
|
71
|
+
* @param base - The base path to list keys from.
|
|
72
|
+
* @returns An array of keys under the specified base path.
|
|
73
|
+
*/
|
|
74
|
+
listSync(base) {
|
|
75
|
+
return [...this.data.keys().filter((key) => !base ? true : isParentPath(key, this.resolve(base)))];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Disposes of the storage adapter, releasing any held resources.
|
|
79
|
+
*
|
|
80
|
+
* @returns A promise that resolves when the disposal is complete.
|
|
81
|
+
*/
|
|
82
|
+
async dispose() {
|
|
83
|
+
return this.clear();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Determines if the storage adapter should overwrite existing keys based on the provided options and context configuration.
|
|
87
|
+
*
|
|
88
|
+
* @returns `true` if the storage adapter should overwrite existing keys, otherwise `false`.
|
|
89
|
+
*/
|
|
90
|
+
get overwrite() {
|
|
91
|
+
return !this.isReadOnly;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
export { VirtualStorageAdapter };
|
|
97
|
+
//# sourceMappingURL=virtual.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual.mjs","names":[],"sources":["../../src/storage/virtual.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 { isParentPath } from \"@stryke/path/is-parent-path\";\nimport type { Context } from \"../types/context\";\nimport { BaseStorageAdapter, StorageAdapterOptions } from \"./base\";\n\n/**\n * Virtual/in-memory storage adapter implementation.\n */\nexport class VirtualStorageAdapter extends BaseStorageAdapter {\n /**\n * A name identifying the storage adapter type.\n */\n public name = \"virtual\";\n\n /**\n * The storage preset for the adapter.\n *\n * @remarks\n * This can be used as an alternate way to identify the type of storage being used.\n */\n public override readonly preset = \"virtual\";\n\n /**\n * In-memory data storage.\n */\n protected data = new Map<string, any>();\n\n /**\n * Constructor for the VirtualStorageAdapter.\n *\n * @param context - The Powerlines context.\n * @param options - Configuration options for the storage adapter.\n */\n public constructor(context: Context, options?: StorageAdapterOptions) {\n super(context, options);\n }\n\n /**\n * Synchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns Returns `true` if the key exists, otherwise `false`.\n */\n public existsSync(key: string): boolean {\n return this.data.has(this.resolve(key));\n }\n\n /**\n * Synchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns The value associated with the key, or `null` if the key does not exist.\n */\n public getSync(key: string): string | null {\n return this.data.get(this.resolve(key)) ?? null;\n }\n\n /**\n * Synchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public setSync(key: string, value: string) {\n if (!this.isReadOnly && (!this.existsSync(key) || this.overwrite)) {\n this.data.set(this.resolve(key), value);\n }\n }\n\n /**\n * Synchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public removeSync(key: string) {\n if (!this.isReadOnly && this.overwrite) {\n this.data.delete(this.resolve(key));\n }\n }\n\n /**\n * Lists all keys under a given base path synchronously.\n *\n * @param base - The base path to list keys from.\n * @returns An array of keys under the specified base path.\n */\n public listSync(base?: string): string[] {\n return [\n ...this.data\n .keys()\n .filter(key => (!base ? true : isParentPath(key, this.resolve(base))))\n ];\n }\n\n /**\n * Disposes of the storage adapter, releasing any held resources.\n *\n * @returns A promise that resolves when the disposal is complete.\n */\n public override async dispose(): Promise<void> {\n return this.clear();\n }\n\n /**\n * Determines if the storage adapter should overwrite existing keys based on the provided options and context configuration.\n *\n * @returns `true` if the storage adapter should overwrite existing keys, otherwise `false`.\n */\n protected override get overwrite() {\n return !this.isReadOnly;\n }\n}\n"],"mappings":";;;;;;;AAyBA,IAAa,wBAAb,cAA2C,mBAAmB;;;;CAI5D,AAAO,OAAO;;;;;;;CAQd,AAAyB,SAAS;;;;CAKlC,AAAU,uBAAO,IAAI,KAAkB;;;;;;;CAQvC,AAAO,YAAY,SAAkB,SAAiC;AACpE,QAAM,SAAS,QAAQ;;;;;;;;CASzB,AAAO,WAAW,KAAsB;AACtC,SAAO,KAAK,KAAK,IAAI,KAAK,QAAQ,IAAI,CAAC;;;;;;;;CASzC,AAAO,QAAQ,KAA4B;AACzC,SAAO,KAAK,KAAK,IAAI,KAAK,QAAQ,IAAI,CAAC,IAAI;;;;;;;;CAS7C,AAAO,QAAQ,KAAa,OAAe;AACzC,MAAI,CAAC,KAAK,eAAe,CAAC,KAAK,WAAW,IAAI,IAAI,KAAK,WACrD,MAAK,KAAK,IAAI,KAAK,QAAQ,IAAI,EAAE,MAAM;;;;;;;CAS3C,AAAO,WAAW,KAAa;AAC7B,MAAI,CAAC,KAAK,cAAc,KAAK,UAC3B,MAAK,KAAK,OAAO,KAAK,QAAQ,IAAI,CAAC;;;;;;;;CAUvC,AAAO,SAAS,MAAyB;AACvC,SAAO,CACL,GAAG,KAAK,KACL,MAAM,CACN,QAAO,QAAQ,CAAC,OAAO,OAAO,aAAa,KAAK,KAAK,QAAQ,KAAK,CAAC,CAAE,CACzE;;;;;;;CAQH,MAAsB,UAAyB;AAC7C,SAAO,KAAK,OAAO;;;;;;;CAQrB,IAAuB,YAAY;AACjC,SAAO,CAAC,KAAK"}
|
package/dist/types/api.d.cts
CHANGED
|
@@ -1,156 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { BASE_EXECUTION_API_METHODS, EXECUTION_API_METHODS } from "../constants/api.cjs";
|
|
2
|
+
import { SUPPORTED_COMMANDS } from "../constants/commands.cjs";
|
|
3
|
+
import { Context } from "./context.cjs";
|
|
4
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
5
|
+
import { ArrayValues } from "@stryke/types/array";
|
|
6
6
|
|
|
7
7
|
//#region src/types/api.d.ts
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
* @param inlineConfig - The inline configuration for the prepare command
|
|
22
|
-
*/
|
|
23
|
-
prepare: (inlineConfig: PrepareInlineConfig | NewInlineConfig | CleanInlineConfig | BuildInlineConfig | LintInlineConfig | DocsInlineConfig | DeployInlineConfig) => Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Generate the Powerlines typescript declaration file
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* This method will only generate the typescript declaration file for the Powerlines project. It is generally recommended to run the full `prepare` command, which will run this method as part of its process.
|
|
29
|
-
*
|
|
30
|
-
* @param inlineConfig - The inline configuration for the types command
|
|
31
|
-
*/
|
|
32
|
-
types: (inlineConfig: TypesInlineConfig) => Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Create a new Powerlines project
|
|
35
|
-
*
|
|
36
|
-
* @remarks
|
|
37
|
-
* This method will create a new Powerlines project in the current directory.
|
|
38
|
-
*
|
|
39
|
-
* @param inlineConfig - The inline configuration for the new command
|
|
40
|
-
* @returns A promise that resolves when the project has been created
|
|
41
|
-
*/
|
|
42
|
-
new: (inlineConfig: NewInlineConfig) => Promise<void>;
|
|
43
|
-
/**
|
|
44
|
-
* Clean any previously prepared artifacts
|
|
45
|
-
*
|
|
46
|
-
* @remarks
|
|
47
|
-
* This method will remove the previous Powerlines artifacts from the project.
|
|
48
|
-
*
|
|
49
|
-
* @param inlineConfig - The inline configuration for the clean command
|
|
50
|
-
* @returns A promise that resolves when the clean command has completed
|
|
51
|
-
*/
|
|
52
|
-
clean: (inlineConfig: CleanInlineConfig | PrepareInlineConfig) => Promise<void>;
|
|
53
|
-
/**
|
|
54
|
-
* Lint the project source code
|
|
55
|
-
*
|
|
56
|
-
* @param inlineConfig - The inline configuration for the lint command
|
|
57
|
-
* @returns A promise that resolves when the lint command has completed
|
|
58
|
-
*/
|
|
59
|
-
lint: (inlineConfig: LintInlineConfig) => Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* Test the project source code
|
|
62
|
-
*
|
|
63
|
-
* @param inlineConfig - The inline configuration for the test command
|
|
64
|
-
* @returns A promise that resolves when the test command has completed
|
|
65
|
-
*/
|
|
66
|
-
test: (inlineConfig: TestInlineConfig) => Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* Build the project
|
|
69
|
-
*
|
|
70
|
-
* @remarks
|
|
71
|
-
* This method will build the Powerlines project, generating the necessary artifacts.
|
|
72
|
-
*
|
|
73
|
-
* @param inlineConfig - The inline configuration for the build command
|
|
74
|
-
* @returns A promise that resolves when the build command has completed
|
|
75
|
-
*/
|
|
76
|
-
build: (inlineConfig: BuildInlineConfig) => Promise<void>;
|
|
77
|
-
/**
|
|
78
|
-
* Prepare the documentation for the project
|
|
79
|
-
*
|
|
80
|
-
* @param inlineConfig - The inline configuration for the docs command
|
|
81
|
-
* @returns A promise that resolves when the documentation generation has completed
|
|
82
|
-
*/
|
|
83
|
-
docs: (inlineConfig: DocsInlineConfig) => Promise<void>;
|
|
84
|
-
/**
|
|
85
|
-
* Deploy the project source code
|
|
86
|
-
*
|
|
87
|
-
* @remarks
|
|
88
|
-
* This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.
|
|
89
|
-
*
|
|
90
|
-
* @param inlineConfig - The inline configuration for the deploy command
|
|
91
|
-
*/
|
|
92
|
-
deploy: (inlineConfig: DeployInlineConfig) => Promise<void>;
|
|
93
|
-
/**
|
|
94
|
-
* Finalization process
|
|
95
|
-
*
|
|
96
|
-
* @remarks
|
|
97
|
-
* This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.
|
|
98
|
-
*
|
|
99
|
-
* @returns A promise that resolves when the finalization process has completed
|
|
100
|
-
*/
|
|
101
|
-
finalize: () => Promise<void>;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Powerlines API Interface
|
|
105
|
-
*
|
|
106
|
-
* @remarks
|
|
107
|
-
* The API interface represents the API available during a single execution of Powerlines. It provides access to the shared context and the ability to call plugin hooks. It extends the base API with additional functionality specific to command execution.
|
|
108
|
-
*/
|
|
109
|
-
interface API<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Execution {
|
|
110
|
-
/**
|
|
111
|
-
* The Powerlines shared API context
|
|
112
|
-
*/
|
|
113
|
-
context: ExecutionContext<TResolvedConfig>;
|
|
114
|
-
/**
|
|
115
|
-
* Invokes the configured plugin hooks
|
|
116
|
-
*
|
|
117
|
-
* @remarks
|
|
118
|
-
* By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
|
|
119
|
-
*
|
|
120
|
-
* @param hook - The hook to call
|
|
121
|
-
* @param options - The options to provide to the hook
|
|
122
|
-
* @param args - The arguments to pass to the hook
|
|
123
|
-
* @returns The result of the hook call
|
|
124
|
-
*/
|
|
125
|
-
callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
|
|
126
|
-
environment?: string | EnvironmentContext<TResolvedConfig>;
|
|
127
|
-
}, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
|
|
128
|
-
}
|
|
129
|
-
interface ExecutionWorkerParams {
|
|
130
|
-
/**
|
|
131
|
-
* The execution options for the current execution instance
|
|
132
|
-
*/
|
|
133
|
-
options: ResolvedExecutionOptions;
|
|
134
|
-
/**
|
|
135
|
-
* The inline configuration for the current execution instance, which is the result of merging the user configuration with any configuration provided by plugins during the "config" hook.
|
|
136
|
-
*/
|
|
137
|
-
config: InlineConfig;
|
|
138
|
-
}
|
|
139
|
-
type ExecutionWorkerProcess = WorkerProcess<ExecutionWorkerParams, typeof POWERLINES_API_FUNCTIONS>;
|
|
140
|
-
/**
|
|
141
|
-
* The Engine API interface represents the API available during the entire lifecycle of the Powerlines engine. It provides access to the shared context and the registered command executions. It extends the base API with additional functionality specific to the engine lifecycle.
|
|
142
|
-
*/
|
|
143
|
-
interface Engine extends Execution {
|
|
144
|
-
/**
|
|
145
|
-
* The Powerlines shared context
|
|
146
|
-
*/
|
|
147
|
-
context: EngineContext;
|
|
148
|
-
}
|
|
149
|
-
declare type __ΩExecution = any[];
|
|
150
|
-
declare type __ΩAPI = any[];
|
|
151
|
-
declare type __ΩExecutionWorkerParams = any[];
|
|
152
|
-
declare type __ΩExecutionWorkerProcess = any[];
|
|
153
|
-
declare type __ΩEngine = any[];
|
|
8
|
+
type BaseCommandType = ArrayValues<typeof BASE_EXECUTION_API_METHODS> | "finalize";
|
|
9
|
+
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
10
|
+
type Commands<TContext extends Context = Context> = Record<CommandType, (this: TContext) => MaybePromise<void>>;
|
|
11
|
+
type BaseExecutionAPIMethods = (typeof BASE_EXECUTION_API_METHODS)[number];
|
|
12
|
+
type PowerlinesExecutionAPIMethods = (typeof EXECUTION_API_METHODS)[number];
|
|
13
|
+
type SupportedCommands = (typeof SUPPORTED_COMMANDS)[number];
|
|
14
|
+
declare type __ΩBaseCommandType = any[];
|
|
15
|
+
declare type __ΩCommandType = any[];
|
|
16
|
+
declare type __ΩCommands = any[];
|
|
17
|
+
declare type __ΩBaseExecutionAPIMethods = any[];
|
|
18
|
+
declare type __ΩPowerlinesExecutionAPIMethods = any[];
|
|
19
|
+
declare type __ΩSupportedCommands = any[];
|
|
154
20
|
//#endregion
|
|
155
|
-
export {
|
|
21
|
+
export { BaseCommandType, BaseExecutionAPIMethods, CommandType, Commands, PowerlinesExecutionAPIMethods, SupportedCommands, __ΩBaseCommandType, __ΩBaseExecutionAPIMethods, __ΩCommandType, __ΩCommands, __ΩPowerlinesExecutionAPIMethods, __ΩSupportedCommands };
|
|
156
22
|
//# sourceMappingURL=api.d.cts.map
|
package/dist/types/api.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.cts","names":[],"sources":["../../src/types/api.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.cts","names":[],"sources":["../../src/types/api.ts"],"mappings":";;;;;;;KA2BY,eAAA,GACR,WAAA,QAAmB,0BAAA;AAAA,KAGX,WAAA,GAAc,WAAA,QAAmB,kBAAA;AAAA,KACjC,QAAA,kBAA0B,OAAA,GAAU,OAAA,IAAW,MAAA,CACzD,WAAA,GACC,IAAA,EAAM,QAAA,KAAa,YAAA;AAAA,KAGV,uBAAA,WACF,0BAAA;AAAA,KACE,6BAAA,WACF,qBAAA;AAAA,KACE,iBAAA,WAA4B,kBAAA;AAAA"}
|
package/dist/types/api.d.mts
CHANGED
|
@@ -1,156 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { BASE_EXECUTION_API_METHODS, EXECUTION_API_METHODS } from "../constants/api.mjs";
|
|
2
|
+
import { SUPPORTED_COMMANDS } from "../constants/commands.mjs";
|
|
3
|
+
import { Context } from "./context.mjs";
|
|
4
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
5
|
+
import { ArrayValues } from "@stryke/types/array";
|
|
6
6
|
|
|
7
7
|
//#region src/types/api.d.ts
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
* @param inlineConfig - The inline configuration for the prepare command
|
|
22
|
-
*/
|
|
23
|
-
prepare: (inlineConfig: PrepareInlineConfig | NewInlineConfig | CleanInlineConfig | BuildInlineConfig | LintInlineConfig | DocsInlineConfig | DeployInlineConfig) => Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Generate the Powerlines typescript declaration file
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* This method will only generate the typescript declaration file for the Powerlines project. It is generally recommended to run the full `prepare` command, which will run this method as part of its process.
|
|
29
|
-
*
|
|
30
|
-
* @param inlineConfig - The inline configuration for the types command
|
|
31
|
-
*/
|
|
32
|
-
types: (inlineConfig: TypesInlineConfig) => Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Create a new Powerlines project
|
|
35
|
-
*
|
|
36
|
-
* @remarks
|
|
37
|
-
* This method will create a new Powerlines project in the current directory.
|
|
38
|
-
*
|
|
39
|
-
* @param inlineConfig - The inline configuration for the new command
|
|
40
|
-
* @returns A promise that resolves when the project has been created
|
|
41
|
-
*/
|
|
42
|
-
new: (inlineConfig: NewInlineConfig) => Promise<void>;
|
|
43
|
-
/**
|
|
44
|
-
* Clean any previously prepared artifacts
|
|
45
|
-
*
|
|
46
|
-
* @remarks
|
|
47
|
-
* This method will remove the previous Powerlines artifacts from the project.
|
|
48
|
-
*
|
|
49
|
-
* @param inlineConfig - The inline configuration for the clean command
|
|
50
|
-
* @returns A promise that resolves when the clean command has completed
|
|
51
|
-
*/
|
|
52
|
-
clean: (inlineConfig: CleanInlineConfig | PrepareInlineConfig) => Promise<void>;
|
|
53
|
-
/**
|
|
54
|
-
* Lint the project source code
|
|
55
|
-
*
|
|
56
|
-
* @param inlineConfig - The inline configuration for the lint command
|
|
57
|
-
* @returns A promise that resolves when the lint command has completed
|
|
58
|
-
*/
|
|
59
|
-
lint: (inlineConfig: LintInlineConfig) => Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* Test the project source code
|
|
62
|
-
*
|
|
63
|
-
* @param inlineConfig - The inline configuration for the test command
|
|
64
|
-
* @returns A promise that resolves when the test command has completed
|
|
65
|
-
*/
|
|
66
|
-
test: (inlineConfig: TestInlineConfig) => Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* Build the project
|
|
69
|
-
*
|
|
70
|
-
* @remarks
|
|
71
|
-
* This method will build the Powerlines project, generating the necessary artifacts.
|
|
72
|
-
*
|
|
73
|
-
* @param inlineConfig - The inline configuration for the build command
|
|
74
|
-
* @returns A promise that resolves when the build command has completed
|
|
75
|
-
*/
|
|
76
|
-
build: (inlineConfig: BuildInlineConfig) => Promise<void>;
|
|
77
|
-
/**
|
|
78
|
-
* Prepare the documentation for the project
|
|
79
|
-
*
|
|
80
|
-
* @param inlineConfig - The inline configuration for the docs command
|
|
81
|
-
* @returns A promise that resolves when the documentation generation has completed
|
|
82
|
-
*/
|
|
83
|
-
docs: (inlineConfig: DocsInlineConfig) => Promise<void>;
|
|
84
|
-
/**
|
|
85
|
-
* Deploy the project source code
|
|
86
|
-
*
|
|
87
|
-
* @remarks
|
|
88
|
-
* This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.
|
|
89
|
-
*
|
|
90
|
-
* @param inlineConfig - The inline configuration for the deploy command
|
|
91
|
-
*/
|
|
92
|
-
deploy: (inlineConfig: DeployInlineConfig) => Promise<void>;
|
|
93
|
-
/**
|
|
94
|
-
* Finalization process
|
|
95
|
-
*
|
|
96
|
-
* @remarks
|
|
97
|
-
* This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.
|
|
98
|
-
*
|
|
99
|
-
* @returns A promise that resolves when the finalization process has completed
|
|
100
|
-
*/
|
|
101
|
-
finalize: () => Promise<void>;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Powerlines API Interface
|
|
105
|
-
*
|
|
106
|
-
* @remarks
|
|
107
|
-
* The API interface represents the API available during a single execution of Powerlines. It provides access to the shared context and the ability to call plugin hooks. It extends the base API with additional functionality specific to command execution.
|
|
108
|
-
*/
|
|
109
|
-
interface API<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Execution {
|
|
110
|
-
/**
|
|
111
|
-
* The Powerlines shared API context
|
|
112
|
-
*/
|
|
113
|
-
context: ExecutionContext<TResolvedConfig>;
|
|
114
|
-
/**
|
|
115
|
-
* Invokes the configured plugin hooks
|
|
116
|
-
*
|
|
117
|
-
* @remarks
|
|
118
|
-
* By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
|
|
119
|
-
*
|
|
120
|
-
* @param hook - The hook to call
|
|
121
|
-
* @param options - The options to provide to the hook
|
|
122
|
-
* @param args - The arguments to pass to the hook
|
|
123
|
-
* @returns The result of the hook call
|
|
124
|
-
*/
|
|
125
|
-
callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
|
|
126
|
-
environment?: string | EnvironmentContext<TResolvedConfig>;
|
|
127
|
-
}, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
|
|
128
|
-
}
|
|
129
|
-
interface ExecutionWorkerParams {
|
|
130
|
-
/**
|
|
131
|
-
* The execution options for the current execution instance
|
|
132
|
-
*/
|
|
133
|
-
options: ResolvedExecutionOptions;
|
|
134
|
-
/**
|
|
135
|
-
* The inline configuration for the current execution instance, which is the result of merging the user configuration with any configuration provided by plugins during the "config" hook.
|
|
136
|
-
*/
|
|
137
|
-
config: InlineConfig;
|
|
138
|
-
}
|
|
139
|
-
type ExecutionWorkerProcess = WorkerProcess<ExecutionWorkerParams, typeof POWERLINES_API_FUNCTIONS>;
|
|
140
|
-
/**
|
|
141
|
-
* The Engine API interface represents the API available during the entire lifecycle of the Powerlines engine. It provides access to the shared context and the registered command executions. It extends the base API with additional functionality specific to the engine lifecycle.
|
|
142
|
-
*/
|
|
143
|
-
interface Engine extends Execution {
|
|
144
|
-
/**
|
|
145
|
-
* The Powerlines shared context
|
|
146
|
-
*/
|
|
147
|
-
context: EngineContext;
|
|
148
|
-
}
|
|
149
|
-
declare type __ΩExecution = any[];
|
|
150
|
-
declare type __ΩAPI = any[];
|
|
151
|
-
declare type __ΩExecutionWorkerParams = any[];
|
|
152
|
-
declare type __ΩExecutionWorkerProcess = any[];
|
|
153
|
-
declare type __ΩEngine = any[];
|
|
8
|
+
type BaseCommandType = ArrayValues<typeof BASE_EXECUTION_API_METHODS> | "finalize";
|
|
9
|
+
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
10
|
+
type Commands<TContext extends Context = Context> = Record<CommandType, (this: TContext) => MaybePromise<void>>;
|
|
11
|
+
type BaseExecutionAPIMethods = (typeof BASE_EXECUTION_API_METHODS)[number];
|
|
12
|
+
type PowerlinesExecutionAPIMethods = (typeof EXECUTION_API_METHODS)[number];
|
|
13
|
+
type SupportedCommands = (typeof SUPPORTED_COMMANDS)[number];
|
|
14
|
+
declare type __ΩBaseCommandType = any[];
|
|
15
|
+
declare type __ΩCommandType = any[];
|
|
16
|
+
declare type __ΩCommands = any[];
|
|
17
|
+
declare type __ΩBaseExecutionAPIMethods = any[];
|
|
18
|
+
declare type __ΩPowerlinesExecutionAPIMethods = any[];
|
|
19
|
+
declare type __ΩSupportedCommands = any[];
|
|
154
20
|
//#endregion
|
|
155
|
-
export {
|
|
21
|
+
export { BaseCommandType, BaseExecutionAPIMethods, CommandType, Commands, PowerlinesExecutionAPIMethods, SupportedCommands, __ΩBaseCommandType, __ΩBaseExecutionAPIMethods, __ΩCommandType, __ΩCommands, __ΩPowerlinesExecutionAPIMethods, __ΩSupportedCommands };
|
|
156
22
|
//# sourceMappingURL=api.d.mts.map
|
package/dist/types/api.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.mts","names":[],"sources":["../../src/types/api.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.mts","names":[],"sources":["../../src/types/api.ts"],"mappings":";;;;;;;KA2BY,eAAA,GACR,WAAA,QAAmB,0BAAA;AAAA,KAGX,WAAA,GAAc,WAAA,QAAmB,kBAAA;AAAA,KACjC,QAAA,kBAA0B,OAAA,GAAU,OAAA,IAAW,MAAA,CACzD,WAAA,GACC,IAAA,EAAM,QAAA,KAAa,YAAA;AAAA,KAGV,uBAAA,WACF,0BAAA;AAAA,KACE,6BAAA,WACF,qBAAA;AAAA,KACE,iBAAA,WAA4B,kBAAA;AAAA"}
|