@powerlines/engine 0.47.3 → 0.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/build.cjs +66 -0
- package/dist/api/build.d.cts +14 -0
- package/dist/api/build.d.cts.map +1 -0
- package/dist/api/build.d.mts +14 -0
- package/dist/api/build.d.mts.map +1 -0
- package/dist/api/build.mjs +64 -0
- package/dist/api/build.mjs.map +1 -0
- package/dist/api/clean.cjs +28 -0
- package/dist/api/clean.d.cts +14 -0
- package/dist/api/clean.d.cts.map +1 -0
- package/dist/api/clean.d.mts +14 -0
- package/dist/api/clean.d.mts.map +1 -0
- package/dist/api/clean.mjs +28 -0
- package/dist/api/clean.mjs.map +1 -0
- package/dist/api/create.cjs +59 -0
- package/dist/api/create.d.cts +14 -0
- package/dist/api/create.d.cts.map +1 -0
- package/dist/api/create.d.mts +14 -0
- package/dist/api/create.d.mts.map +1 -0
- package/dist/api/create.mjs +57 -0
- package/dist/api/create.mjs.map +1 -0
- package/dist/api/deploy.cjs +24 -0
- package/dist/api/deploy.d.cts +17 -0
- package/dist/api/deploy.d.cts.map +1 -0
- package/dist/api/deploy.d.mts +17 -0
- package/dist/api/deploy.d.mts.map +1 -0
- package/dist/api/deploy.mjs +24 -0
- package/dist/api/deploy.mjs.map +1 -0
- package/dist/api/docs.cjs +24 -0
- package/dist/api/docs.d.cts +17 -0
- package/dist/api/docs.d.cts.map +1 -0
- package/dist/api/docs.d.mts +17 -0
- package/dist/api/docs.d.mts.map +1 -0
- package/dist/api/docs.mjs +24 -0
- package/dist/api/docs.mjs.map +1 -0
- package/dist/api/lint.cjs +27 -0
- package/dist/api/lint.d.cts +17 -0
- package/dist/api/lint.d.cts.map +1 -0
- package/dist/api/lint.d.mts +17 -0
- package/dist/api/lint.d.mts.map +1 -0
- package/dist/api/lint.mjs +27 -0
- package/dist/api/lint.mjs.map +1 -0
- package/dist/api/prepare.cjs +68 -0
- package/dist/api/prepare.d.cts +14 -0
- package/dist/api/prepare.d.cts.map +1 -0
- package/dist/api/prepare.d.mts +14 -0
- package/dist/api/prepare.d.mts.map +1 -0
- package/dist/api/prepare.mjs +68 -0
- package/dist/api/prepare.mjs.map +1 -0
- package/dist/api/test.cjs +27 -0
- package/dist/api/test.d.cts +17 -0
- package/dist/api/test.d.cts.map +1 -0
- package/dist/api/test.d.mts +17 -0
- package/dist/api/test.d.mts.map +1 -0
- package/dist/api/test.mjs +27 -0
- package/dist/api/test.mjs.map +1 -0
- package/dist/api/types.cjs +70 -0
- package/dist/api/types.d.cts +17 -0
- package/dist/api/types.d.cts.map +1 -0
- package/dist/api/types.d.mts +17 -0
- package/dist/api/types.d.mts.map +1 -0
- package/dist/api/types.mjs +70 -0
- package/dist/api/types.mjs.map +1 -0
- package/dist/api-BgyEi2hF.d.mts +138 -0
- package/dist/api-BgyEi2hF.d.mts.map +1 -0
- package/dist/api-DcHfCjQK.d.cts +138 -0
- package/dist/api-DcHfCjQK.d.cts.map +1 -0
- package/dist/api.cjs +39 -1268
- package/dist/api.d.cts +11 -300
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +11 -300
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +31 -1264
- package/dist/api.mjs.map +1 -1
- package/dist/config-ByLyzMI0.d.mts +204 -0
- package/dist/config-ByLyzMI0.d.mts.map +1 -0
- package/dist/config-DKEmqMrh.d.cts +204 -0
- package/dist/config-DKEmqMrh.d.cts.map +1 -0
- package/dist/context/engine-context.cjs +177 -0
- package/dist/context/engine-context.d.cts +2 -0
- package/dist/context/engine-context.d.mts +2 -0
- package/dist/context/engine-context.mjs +175 -0
- package/dist/context/engine-context.mjs.map +1 -0
- package/dist/context/index.cjs +2 -9
- package/dist/context/index.d.cts +2 -150
- package/dist/context/index.d.mts +2 -150
- package/dist/context/index.mjs +2 -4
- package/dist/context-D0_a0kRO.d.cts +149 -0
- package/dist/context-D0_a0kRO.d.cts.map +1 -0
- package/dist/context-DcXV6_GL.d.mts +149 -0
- package/dist/context-DcXV6_GL.d.mts.map +1 -0
- package/dist/engine-Dz6BvkFY.cjs +590 -0
- package/dist/engine-context-B8K6Jtkk.d.cts +53 -0
- package/dist/engine-context-B8K6Jtkk.d.cts.map +1 -0
- package/dist/engine-context-DKlA5Pgu.d.mts +53 -0
- package/dist/engine-context-DKlA5Pgu.d.mts.map +1 -0
- package/dist/engine-q6YKXXcB.mjs +571 -0
- package/dist/engine-q6YKXXcB.mjs.map +1 -0
- package/dist/engine.cjs +6 -0
- package/dist/engine.d.cts +143 -0
- package/dist/engine.d.cts.map +1 -0
- package/dist/engine.d.mts +143 -0
- package/dist/engine.d.mts.map +1 -0
- package/dist/engine.mjs +3 -0
- package/dist/helpers/create-execution-host.cjs +57 -0
- package/dist/helpers/create-execution-host.d.cts +20 -0
- package/dist/helpers/create-execution-host.d.cts.map +1 -0
- package/dist/helpers/create-execution-host.d.mts +20 -0
- package/dist/helpers/create-execution-host.d.mts.map +1 -0
- package/dist/helpers/create-execution-host.mjs +57 -0
- package/dist/helpers/create-execution-host.mjs.map +1 -0
- package/dist/helpers/finalize.cjs +26 -0
- package/dist/helpers/finalize.d.cts +12 -0
- package/dist/helpers/finalize.d.cts.map +1 -0
- package/dist/helpers/finalize.d.mts +12 -0
- package/dist/helpers/finalize.d.mts.map +1 -0
- package/dist/helpers/finalize.mjs +26 -0
- package/dist/helpers/finalize.mjs.map +1 -0
- package/dist/helpers/index.cjs +12 -0
- package/dist/helpers/index.d.cts +5 -0
- package/dist/helpers/index.d.mts +5 -0
- package/dist/helpers/index.mjs +6 -0
- package/dist/helpers/rpc.cjs +139 -0
- package/dist/helpers/rpc.d.cts +7 -0
- package/dist/helpers/rpc.d.cts.map +1 -0
- package/dist/helpers/rpc.d.mts +7 -0
- package/dist/helpers/rpc.d.mts.map +1 -0
- package/dist/helpers/rpc.mjs +139 -0
- package/dist/helpers/rpc.mjs.map +1 -0
- package/dist/helpers/stream.cjs +119 -0
- package/dist/helpers/stream.d.cts +45 -0
- package/dist/helpers/stream.d.cts.map +1 -0
- package/dist/helpers/stream.d.mts +45 -0
- package/dist/helpers/stream.d.mts.map +1 -0
- package/dist/helpers/stream.mjs +117 -0
- package/dist/helpers/stream.mjs.map +1 -0
- package/dist/index-BVVgDSdq.d.cts +1 -0
- package/dist/index-BVVgDSdq.d.mts +1 -0
- package/dist/index.cjs +8 -748
- package/dist/index.d.cts +6 -140
- package/dist/index.d.mts +6 -140
- package/dist/index.mjs +4 -747
- package/package.json +102 -132
- package/dist/_internal/worker.cjs +0 -5192
- package/dist/_internal/worker.d.cts +0 -46
- package/dist/_internal/worker.d.cts.map +0 -1
- package/dist/_internal/worker.d.mts +0 -46
- package/dist/_internal/worker.d.mts.map +0 -1
- package/dist/_internal/worker.mjs +0 -5153
- package/dist/_internal/worker.mjs.map +0 -1
- package/dist/base-context-DLemGRbd.cjs +0 -322
- package/dist/base-context-DUha4Lz-.mjs +0 -315
- package/dist/base-context-DUha4Lz-.mjs.map +0 -1
- package/dist/context/index.d.cts.map +0 -1
- package/dist/context/index.d.mts.map +0 -1
- package/dist/engine-context-BfFiKN53.mjs +0 -86
- package/dist/engine-context-BfFiKN53.mjs.map +0 -1
- package/dist/engine-context-D0y88i_J.cjs +0 -91
- package/dist/execution-context-CE5H90Um.mjs +0 -2845
- package/dist/execution-context-CE5H90Um.mjs.map +0 -1
- package/dist/execution-context-CnyaM3Ul.cjs +0 -2889
- package/dist/execution-context-NyDjVZ6T.d.cts +0 -647
- package/dist/execution-context-NyDjVZ6T.d.cts.map +0 -1
- package/dist/execution-context-YrjFeD9k.d.mts +0 -647
- package/dist/execution-context-YrjFeD9k.d.mts.map +0 -1
- package/dist/fs-CeEdzPKE.cjs +0 -262
- package/dist/fs-Dcle8lUp.mjs +0 -226
- package/dist/fs-Dcle8lUp.mjs.map +0 -1
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/rpc/client.cjs +0 -74
- package/dist/rpc/client.d.cts +0 -31
- package/dist/rpc/client.d.cts.map +0 -1
- package/dist/rpc/client.d.mts +0 -31
- package/dist/rpc/client.d.mts.map +0 -1
- package/dist/rpc/client.mjs +0 -71
- package/dist/rpc/client.mjs.map +0 -1
- package/dist/rpc/serialization.cjs +0 -82
- package/dist/rpc/serialization.d.cts +0 -46
- package/dist/rpc/serialization.d.cts.map +0 -1
- package/dist/rpc/serialization.d.mts +0 -46
- package/dist/rpc/serialization.d.mts.map +0 -1
- package/dist/rpc/serialization.mjs +0 -76
- package/dist/rpc/serialization.mjs.map +0 -1
- package/dist/rpc/server.cjs +0 -69
- package/dist/rpc/server.d.cts +0 -29
- package/dist/rpc/server.d.cts.map +0 -1
- package/dist/rpc/server.d.mts +0 -29
- package/dist/rpc/server.d.mts.map +0 -1
- package/dist/rpc/server.mjs +0 -66
- package/dist/rpc/server.mjs.map +0 -1
- package/dist/rpc/types.cjs +0 -0
- package/dist/rpc/types.d.cts +0 -70
- package/dist/rpc/types.d.cts.map +0 -1
- package/dist/rpc/types.d.mts +0 -70
- package/dist/rpc/types.d.mts.map +0 -1
- package/dist/rpc/types.mjs +0 -1
- package/dist/schemas.cjs +0 -9
- package/dist/schemas.d.cts +0 -127
- package/dist/schemas.d.cts.map +0 -1
- package/dist/schemas.d.mts +0 -127
- package/dist/schemas.d.mts.map +0 -1
- package/dist/schemas.mjs +0 -3
- package/dist/storage/base.cjs +0 -216
- package/dist/storage/base.d.cts +0 -199
- package/dist/storage/base.d.cts.map +0 -1
- package/dist/storage/base.d.mts +0 -199
- package/dist/storage/base.d.mts.map +0 -1
- package/dist/storage/base.mjs +0 -215
- package/dist/storage/base.mjs.map +0 -1
- package/dist/storage/file-system.cjs +0 -180
- package/dist/storage/file-system.d.cts +0 -127
- package/dist/storage/file-system.d.cts.map +0 -1
- package/dist/storage/file-system.d.mts +0 -127
- package/dist/storage/file-system.d.mts.map +0 -1
- package/dist/storage/file-system.mjs +0 -179
- package/dist/storage/file-system.mjs.map +0 -1
- package/dist/storage/helpers.cjs +0 -37
- package/dist/storage/helpers.d.cts +0 -25
- package/dist/storage/helpers.d.cts.map +0 -1
- package/dist/storage/helpers.d.mts +0 -25
- package/dist/storage/helpers.d.mts.map +0 -1
- package/dist/storage/helpers.mjs +0 -34
- package/dist/storage/helpers.mjs.map +0 -1
- package/dist/storage/index.cjs +0 -12
- package/dist/storage/index.d.cts +0 -5
- package/dist/storage/index.d.mts +0 -5
- package/dist/storage/index.mjs +0 -6
- package/dist/storage/virtual.cjs +0 -98
- package/dist/storage/virtual.d.cts +0 -80
- package/dist/storage/virtual.d.cts.map +0 -1
- package/dist/storage/virtual.d.mts +0 -80
- package/dist/storage/virtual.d.mts.map +0 -1
- package/dist/storage/virtual.mjs +0 -97
- package/dist/storage/virtual.mjs.map +0 -1
- package/dist/ts-morph-BbM83PT9.cjs +0 -114
- package/dist/ts-morph-C6YBNc46.mjs +0 -102
- package/dist/ts-morph-C6YBNc46.mjs.map +0 -1
- package/dist/tsconfig-DeKMGasE.cjs +0 -198
- package/dist/tsconfig-HzJsMUrr.mjs +0 -155
- package/dist/tsconfig-HzJsMUrr.mjs.map +0 -1
- package/dist/typescript/index.cjs +0 -13
- package/dist/typescript/index.d.cts +0 -106
- package/dist/typescript/index.d.cts.map +0 -1
- package/dist/typescript/index.d.mts +0 -106
- package/dist/typescript/index.d.mts.map +0 -1
- package/dist/typescript/index.mjs +0 -4
- /package/dist/{chunk-C0xms8kb.cjs → chunk-C_NdSu1c.cjs} +0 -0
package/dist/context/index.d.cts
CHANGED
|
@@ -1,150 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { DeepPartial, RequiredKeys } from "@stryke/types/base";
|
|
4
|
-
import { Unstable_ContextInternal, Unstable_EnvironmentContext, Unstable_PluginContext } from "@powerlines/core/types/_internal";
|
|
5
|
-
|
|
6
|
-
//#region src/context/engine-context.d.ts
|
|
7
|
-
declare class PowerlinesEngineContext extends PowerlinesBaseContext implements EngineContext {
|
|
8
|
-
#private;
|
|
9
|
-
/**
|
|
10
|
-
* Creates a new instance of the PowerlinesEngineContext class.
|
|
11
|
-
*
|
|
12
|
-
* @param options - The options to initialize the context with.
|
|
13
|
-
* @returns A promise that resolves to an instance of the PowerlinesEngineContext class.
|
|
14
|
-
*/
|
|
15
|
-
static fromInitialConfig(options: EngineOptions, initialConfig?: DeepPartial<UserConfig>): Promise<PowerlinesEngineContext>;
|
|
16
|
-
/**
|
|
17
|
-
* The initial options provided to the Powerlines process before any resolution or merging. This is typically the user configuration provided in the Powerlines configuration file, but may also include additional configuration options provided by plugins or other sources.
|
|
18
|
-
*/
|
|
19
|
-
readonly initialOptions: EngineOptions;
|
|
20
|
-
/**
|
|
21
|
-
* The initial user configuration provided to the Powerlines process before any resolution or merging. This is typically the user configuration provided in the Powerlines configuration file, but may also include additional configuration options provided by plugins or other sources.
|
|
22
|
-
*/
|
|
23
|
-
readonly initialConfig: DeepPartial<UserConfig>;
|
|
24
|
-
/**
|
|
25
|
-
* The options provided to the Powerlines process
|
|
26
|
-
*/
|
|
27
|
-
options: RequiredKeys<Omit<EngineOptions, "logLevel">, "name" | "root" | "cwd" | "mode" | "framework"> & {
|
|
28
|
-
/**
|
|
29
|
-
* The log level to use for logging messages during the build process. This can be a string indicating the log level or a more detailed configuration object that allows for specifying different log levels for different categories of logs.
|
|
30
|
-
*/
|
|
31
|
-
logLevel: LogLevelResolvedConfig;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Creates a new Context instance.
|
|
35
|
-
*
|
|
36
|
-
* @param options - The options to use for creating the context, including the resolved configuration and workspace settings.
|
|
37
|
-
* @param initialConfig - The initial configuration provided by the user, which can be used to resolve the final configuration for the context. This typically includes the user configuration options defined in the `powerlines.config.ts` file, as well as any inline configuration options provided during execution.
|
|
38
|
-
*/
|
|
39
|
-
protected constructor(options: EngineOptions, initialConfig?: DeepPartial<UserConfig>);
|
|
40
|
-
/**
|
|
41
|
-
* Initialize the context with the provided configuration options
|
|
42
|
-
*
|
|
43
|
-
* @remarks
|
|
44
|
-
* This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.
|
|
45
|
-
*/
|
|
46
|
-
protected init(): Promise<void>;
|
|
47
|
-
/**
|
|
48
|
-
* A list of all command executions that will be run during the lifecycle of the engine
|
|
49
|
-
*
|
|
50
|
-
* @returns An array of {@link ExecutionState} representing each execution context for the engine.
|
|
51
|
-
*/
|
|
52
|
-
get executions(): ExecutionState[];
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region src/context/environment-context.d.ts
|
|
56
|
-
declare class PowerlinesEnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PowerlinesContext<EnvironmentResolvedConfig<TResolvedConfig>> implements Unstable_EnvironmentContext<TResolvedConfig> {
|
|
57
|
-
#private;
|
|
58
|
-
/**
|
|
59
|
-
* Create a new context from the config.
|
|
60
|
-
*
|
|
61
|
-
* @param initialOptions - The resolved execution options.
|
|
62
|
-
* @param config - The user configuration options.
|
|
63
|
-
* @param overriddenConfig - The configuration options that should override all other configuration sources, such as CLI flags or environment variables. This is used to ensure that certain configuration values take precedence over any other settings defined in the user configuration or environment configuration, allowing for dynamic overrides based on the execution context.
|
|
64
|
-
* @param environment - The resolved environment configuration, which may include additional properties or modifications made during the configuration loading process. This is used to provide context about the environment in which the command is being executed, allowing for environment-specific behavior and configuration resolution.
|
|
65
|
-
* @returns A promise that resolves to an instance of the PowerlinesEnvironmentContext class, initialized with the provided configuration and environment data.
|
|
66
|
-
*/
|
|
67
|
-
static createEnvironment<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(initialOptions: ExecutionOptions, config: TResolvedConfig, overriddenConfig: InferOverridableConfig<EnvironmentResolvedConfig<TResolvedConfig>>, environment: EnvironmentResolvedConfig<TResolvedConfig>["environment"]): Promise<PowerlinesEnvironmentContext<TResolvedConfig>>;
|
|
68
|
-
/**
|
|
69
|
-
* The configuration options provided by plugins added by the user (and other plugins)
|
|
70
|
-
*/
|
|
71
|
-
protected environmentConfig: EnvironmentResolvedConfig<TResolvedConfig>["environment"];
|
|
72
|
-
/**
|
|
73
|
-
* The list of plugins applied to this environment
|
|
74
|
-
*/
|
|
75
|
-
plugins: EnvironmentContextPlugin<TResolvedConfig>[];
|
|
76
|
-
/**
|
|
77
|
-
* Internal context fields and methods
|
|
78
|
-
*
|
|
79
|
-
* @danger
|
|
80
|
-
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
81
|
-
*
|
|
82
|
-
* @internal
|
|
83
|
-
*/
|
|
84
|
-
get $$internal(): Unstable_ContextInternal<TResolvedConfig>;
|
|
85
|
-
/**
|
|
86
|
-
* Internal context fields and methods
|
|
87
|
-
*
|
|
88
|
-
* @danger
|
|
89
|
-
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
90
|
-
*
|
|
91
|
-
* @internal
|
|
92
|
-
*/
|
|
93
|
-
set $$internal(value: Unstable_ContextInternal<TResolvedConfig>);
|
|
94
|
-
/**
|
|
95
|
-
* The unique identifier of the environment associated with this context, which can be used for logging and other purposes to distinguish between different environments in the same process.
|
|
96
|
-
*/
|
|
97
|
-
get id(): string;
|
|
98
|
-
/**
|
|
99
|
-
* The hooks registered by plugins in this environment
|
|
100
|
-
*/
|
|
101
|
-
get hooks(): Record<string, HooksList<PluginContext<TResolvedConfig>>>;
|
|
102
|
-
/**
|
|
103
|
-
* A setter function to populate the environment config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the environment configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any environment configuration provided during execution.
|
|
104
|
-
*
|
|
105
|
-
* @param config - The environment configuration values to set.
|
|
106
|
-
* @returns A promise that resolves when the environment configuration values have been set.
|
|
107
|
-
*/
|
|
108
|
-
protected setEnvironmentConfig(config: EnvironmentResolvedConfig<TResolvedConfig>["environment"]): Promise<void>;
|
|
109
|
-
/**
|
|
110
|
-
* Create a new logger instance
|
|
111
|
-
*
|
|
112
|
-
* @param options - The configuration options to use for the logger instance, which can be used to customize the appearance and behavior of the log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance.
|
|
113
|
-
* @param logFn - The custom logging function to use for logging messages, which can be used to override the default logging behavior of the original logger.
|
|
114
|
-
* @returns A logger client instance that can be used to generate log messages with consistent formatting and metadata.
|
|
115
|
-
*/
|
|
116
|
-
createLogger(options: LoggerOptions, logFn?: LogFn): Logger;
|
|
117
|
-
/**
|
|
118
|
-
* Extend the base logger with additional configuration options
|
|
119
|
-
*
|
|
120
|
-
* @param options - The configuration options to extend the base logger with, which can be used to add additional metadata or customize the appearance of log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance, as well as any additional metadata such as the plugin category or environment.
|
|
121
|
-
* @returns A new logger client instance that extends the base logger with the provided configuration options.
|
|
122
|
-
*/
|
|
123
|
-
extendLogger(options: LoggerOptions): Logger;
|
|
124
|
-
addPlugin(plugin: Plugin<PluginContext<TResolvedConfig>>): Promise<void>;
|
|
125
|
-
/**
|
|
126
|
-
* Retrieves the hook handlers for a specific hook name
|
|
127
|
-
*/
|
|
128
|
-
selectHooks<TKey extends string>(key: TKey, options?: SelectHooksOptions): SelectHookResult<PluginContext<TResolvedConfig>, TKey>;
|
|
129
|
-
protected constructor(options: ExecutionOptions, config: TResolvedConfig, overriddenConfig: InferOverridableConfig<EnvironmentResolvedConfig<TResolvedConfig>>);
|
|
130
|
-
/**
|
|
131
|
-
* A function to merge the various configuration objects (initial, user, inline, and plugin) into a single resolved configuration object that can be used throughout the Powerlines process. This function takes into account the different sources of configuration and their respective priorities, ensuring that the final configuration reflects the intended settings for the project. The merged configuration is then returned as a new object that can be accessed through the `config` property of the context.
|
|
132
|
-
*
|
|
133
|
-
* @returns The merged configuration object that combines the initial, user, inline, and plugin configurations.
|
|
134
|
-
*/
|
|
135
|
-
protected mergeConfig(): EnvironmentResolvedConfig<TResolvedConfig>;
|
|
136
|
-
}
|
|
137
|
-
//#endregion
|
|
138
|
-
//#region src/context/plugin-context.d.ts
|
|
139
|
-
/**
|
|
140
|
-
* Create a Proxy-based PluginContext
|
|
141
|
-
*
|
|
142
|
-
* @param pluginId - The unique identifier of the plugin
|
|
143
|
-
* @param plugin - The plugin instance
|
|
144
|
-
* @param environment - The environment context
|
|
145
|
-
* @returns The proxied plugin context
|
|
146
|
-
*/
|
|
147
|
-
declare function createPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(pluginId: string, plugin: Plugin<PluginContext<TResolvedConfig>>, environment: PowerlinesEnvironmentContext<TResolvedConfig>): Unstable_PluginContext<TResolvedConfig>;
|
|
148
|
-
//#endregion
|
|
149
|
-
export { PowerlinesBaseContext, PowerlinesContext, PowerlinesEngineContext, PowerlinesEnvironmentContext, PowerlinesExecutionContext, createPluginContext };
|
|
150
|
-
//# sourceMappingURL=index.d.cts.map
|
|
1
|
+
import { t as PowerlinesEngineContext } from "../engine-context-B8K6Jtkk.cjs";
|
|
2
|
+
export { PowerlinesEngineContext };
|
package/dist/context/index.d.mts
CHANGED
|
@@ -1,150 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { DeepPartial, RequiredKeys } from "@stryke/types/base";
|
|
4
|
-
import { Unstable_ContextInternal, Unstable_EnvironmentContext, Unstable_PluginContext } from "@powerlines/core/types/_internal";
|
|
5
|
-
|
|
6
|
-
//#region src/context/engine-context.d.ts
|
|
7
|
-
declare class PowerlinesEngineContext extends PowerlinesBaseContext implements EngineContext {
|
|
8
|
-
#private;
|
|
9
|
-
/**
|
|
10
|
-
* Creates a new instance of the PowerlinesEngineContext class.
|
|
11
|
-
*
|
|
12
|
-
* @param options - The options to initialize the context with.
|
|
13
|
-
* @returns A promise that resolves to an instance of the PowerlinesEngineContext class.
|
|
14
|
-
*/
|
|
15
|
-
static fromInitialConfig(options: EngineOptions, initialConfig?: DeepPartial<UserConfig>): Promise<PowerlinesEngineContext>;
|
|
16
|
-
/**
|
|
17
|
-
* The initial options provided to the Powerlines process before any resolution or merging. This is typically the user configuration provided in the Powerlines configuration file, but may also include additional configuration options provided by plugins or other sources.
|
|
18
|
-
*/
|
|
19
|
-
readonly initialOptions: EngineOptions;
|
|
20
|
-
/**
|
|
21
|
-
* The initial user configuration provided to the Powerlines process before any resolution or merging. This is typically the user configuration provided in the Powerlines configuration file, but may also include additional configuration options provided by plugins or other sources.
|
|
22
|
-
*/
|
|
23
|
-
readonly initialConfig: DeepPartial<UserConfig>;
|
|
24
|
-
/**
|
|
25
|
-
* The options provided to the Powerlines process
|
|
26
|
-
*/
|
|
27
|
-
options: RequiredKeys<Omit<EngineOptions, "logLevel">, "name" | "root" | "cwd" | "mode" | "framework"> & {
|
|
28
|
-
/**
|
|
29
|
-
* The log level to use for logging messages during the build process. This can be a string indicating the log level or a more detailed configuration object that allows for specifying different log levels for different categories of logs.
|
|
30
|
-
*/
|
|
31
|
-
logLevel: LogLevelResolvedConfig;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Creates a new Context instance.
|
|
35
|
-
*
|
|
36
|
-
* @param options - The options to use for creating the context, including the resolved configuration and workspace settings.
|
|
37
|
-
* @param initialConfig - The initial configuration provided by the user, which can be used to resolve the final configuration for the context. This typically includes the user configuration options defined in the `powerlines.config.ts` file, as well as any inline configuration options provided during execution.
|
|
38
|
-
*/
|
|
39
|
-
protected constructor(options: EngineOptions, initialConfig?: DeepPartial<UserConfig>);
|
|
40
|
-
/**
|
|
41
|
-
* Initialize the context with the provided configuration options
|
|
42
|
-
*
|
|
43
|
-
* @remarks
|
|
44
|
-
* This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.
|
|
45
|
-
*/
|
|
46
|
-
protected init(): Promise<void>;
|
|
47
|
-
/**
|
|
48
|
-
* A list of all command executions that will be run during the lifecycle of the engine
|
|
49
|
-
*
|
|
50
|
-
* @returns An array of {@link ExecutionState} representing each execution context for the engine.
|
|
51
|
-
*/
|
|
52
|
-
get executions(): ExecutionState[];
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region src/context/environment-context.d.ts
|
|
56
|
-
declare class PowerlinesEnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PowerlinesContext<EnvironmentResolvedConfig<TResolvedConfig>> implements Unstable_EnvironmentContext<TResolvedConfig> {
|
|
57
|
-
#private;
|
|
58
|
-
/**
|
|
59
|
-
* Create a new context from the config.
|
|
60
|
-
*
|
|
61
|
-
* @param initialOptions - The resolved execution options.
|
|
62
|
-
* @param config - The user configuration options.
|
|
63
|
-
* @param overriddenConfig - The configuration options that should override all other configuration sources, such as CLI flags or environment variables. This is used to ensure that certain configuration values take precedence over any other settings defined in the user configuration or environment configuration, allowing for dynamic overrides based on the execution context.
|
|
64
|
-
* @param environment - The resolved environment configuration, which may include additional properties or modifications made during the configuration loading process. This is used to provide context about the environment in which the command is being executed, allowing for environment-specific behavior and configuration resolution.
|
|
65
|
-
* @returns A promise that resolves to an instance of the PowerlinesEnvironmentContext class, initialized with the provided configuration and environment data.
|
|
66
|
-
*/
|
|
67
|
-
static createEnvironment<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(initialOptions: ExecutionOptions, config: TResolvedConfig, overriddenConfig: InferOverridableConfig<EnvironmentResolvedConfig<TResolvedConfig>>, environment: EnvironmentResolvedConfig<TResolvedConfig>["environment"]): Promise<PowerlinesEnvironmentContext<TResolvedConfig>>;
|
|
68
|
-
/**
|
|
69
|
-
* The configuration options provided by plugins added by the user (and other plugins)
|
|
70
|
-
*/
|
|
71
|
-
protected environmentConfig: EnvironmentResolvedConfig<TResolvedConfig>["environment"];
|
|
72
|
-
/**
|
|
73
|
-
* The list of plugins applied to this environment
|
|
74
|
-
*/
|
|
75
|
-
plugins: EnvironmentContextPlugin<TResolvedConfig>[];
|
|
76
|
-
/**
|
|
77
|
-
* Internal context fields and methods
|
|
78
|
-
*
|
|
79
|
-
* @danger
|
|
80
|
-
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
81
|
-
*
|
|
82
|
-
* @internal
|
|
83
|
-
*/
|
|
84
|
-
get $$internal(): Unstable_ContextInternal<TResolvedConfig>;
|
|
85
|
-
/**
|
|
86
|
-
* Internal context fields and methods
|
|
87
|
-
*
|
|
88
|
-
* @danger
|
|
89
|
-
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
90
|
-
*
|
|
91
|
-
* @internal
|
|
92
|
-
*/
|
|
93
|
-
set $$internal(value: Unstable_ContextInternal<TResolvedConfig>);
|
|
94
|
-
/**
|
|
95
|
-
* The unique identifier of the environment associated with this context, which can be used for logging and other purposes to distinguish between different environments in the same process.
|
|
96
|
-
*/
|
|
97
|
-
get id(): string;
|
|
98
|
-
/**
|
|
99
|
-
* The hooks registered by plugins in this environment
|
|
100
|
-
*/
|
|
101
|
-
get hooks(): Record<string, HooksList<PluginContext<TResolvedConfig>>>;
|
|
102
|
-
/**
|
|
103
|
-
* A setter function to populate the environment config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the environment configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any environment configuration provided during execution.
|
|
104
|
-
*
|
|
105
|
-
* @param config - The environment configuration values to set.
|
|
106
|
-
* @returns A promise that resolves when the environment configuration values have been set.
|
|
107
|
-
*/
|
|
108
|
-
protected setEnvironmentConfig(config: EnvironmentResolvedConfig<TResolvedConfig>["environment"]): Promise<void>;
|
|
109
|
-
/**
|
|
110
|
-
* Create a new logger instance
|
|
111
|
-
*
|
|
112
|
-
* @param options - The configuration options to use for the logger instance, which can be used to customize the appearance and behavior of the log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance.
|
|
113
|
-
* @param logFn - The custom logging function to use for logging messages, which can be used to override the default logging behavior of the original logger.
|
|
114
|
-
* @returns A logger client instance that can be used to generate log messages with consistent formatting and metadata.
|
|
115
|
-
*/
|
|
116
|
-
createLogger(options: LoggerOptions, logFn?: LogFn): Logger;
|
|
117
|
-
/**
|
|
118
|
-
* Extend the base logger with additional configuration options
|
|
119
|
-
*
|
|
120
|
-
* @param options - The configuration options to extend the base logger with, which can be used to add additional metadata or customize the appearance of log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance, as well as any additional metadata such as the plugin category or environment.
|
|
121
|
-
* @returns A new logger client instance that extends the base logger with the provided configuration options.
|
|
122
|
-
*/
|
|
123
|
-
extendLogger(options: LoggerOptions): Logger;
|
|
124
|
-
addPlugin(plugin: Plugin<PluginContext<TResolvedConfig>>): Promise<void>;
|
|
125
|
-
/**
|
|
126
|
-
* Retrieves the hook handlers for a specific hook name
|
|
127
|
-
*/
|
|
128
|
-
selectHooks<TKey extends string>(key: TKey, options?: SelectHooksOptions): SelectHookResult<PluginContext<TResolvedConfig>, TKey>;
|
|
129
|
-
protected constructor(options: ExecutionOptions, config: TResolvedConfig, overriddenConfig: InferOverridableConfig<EnvironmentResolvedConfig<TResolvedConfig>>);
|
|
130
|
-
/**
|
|
131
|
-
* A function to merge the various configuration objects (initial, user, inline, and plugin) into a single resolved configuration object that can be used throughout the Powerlines process. This function takes into account the different sources of configuration and their respective priorities, ensuring that the final configuration reflects the intended settings for the project. The merged configuration is then returned as a new object that can be accessed through the `config` property of the context.
|
|
132
|
-
*
|
|
133
|
-
* @returns The merged configuration object that combines the initial, user, inline, and plugin configurations.
|
|
134
|
-
*/
|
|
135
|
-
protected mergeConfig(): EnvironmentResolvedConfig<TResolvedConfig>;
|
|
136
|
-
}
|
|
137
|
-
//#endregion
|
|
138
|
-
//#region src/context/plugin-context.d.ts
|
|
139
|
-
/**
|
|
140
|
-
* Create a Proxy-based PluginContext
|
|
141
|
-
*
|
|
142
|
-
* @param pluginId - The unique identifier of the plugin
|
|
143
|
-
* @param plugin - The plugin instance
|
|
144
|
-
* @param environment - The environment context
|
|
145
|
-
* @returns The proxied plugin context
|
|
146
|
-
*/
|
|
147
|
-
declare function createPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(pluginId: string, plugin: Plugin<PluginContext<TResolvedConfig>>, environment: PowerlinesEnvironmentContext<TResolvedConfig>): Unstable_PluginContext<TResolvedConfig>;
|
|
148
|
-
//#endregion
|
|
149
|
-
export { PowerlinesBaseContext, PowerlinesContext, PowerlinesEngineContext, PowerlinesEnvironmentContext, PowerlinesExecutionContext, createPluginContext };
|
|
150
|
-
//# sourceMappingURL=index.d.mts.map
|
|
1
|
+
import { t as PowerlinesEngineContext } from "../engine-context-DKlA5Pgu.mjs";
|
|
2
|
+
export { PowerlinesEngineContext };
|
package/dist/context/index.mjs
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as PowerlinesBaseContext } from "../base-context-DUha4Lz-.mjs";
|
|
3
|
-
import { t as PowerlinesEngineContext } from "../engine-context-BfFiKN53.mjs";
|
|
1
|
+
import { PowerlinesEngineContext } from "./engine-context.mjs";
|
|
4
2
|
|
|
5
|
-
export {
|
|
3
|
+
export { PowerlinesEngineContext };
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { n as EngineOptions, t as EngineExecutionOptions, u as RpcClient } from "./config-DKEmqMrh.cjs";
|
|
2
|
+
import { BaseContext, InlineConfig, ParsedUserConfig } from "@powerlines/core";
|
|
3
|
+
import { ConnectionMeta, DevToolsNodeContext } from "devframe/types";
|
|
4
|
+
|
|
5
|
+
//#region src/types/context.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* The execution scope state represents the current state of a command, hook, or plugin execution within the Powerlines engine. It includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
|
|
8
|
+
*/
|
|
9
|
+
type ExecutionScopeType = "command" | "hook" | "plugin";
|
|
10
|
+
/**
|
|
11
|
+
* The execution state for a command, hook, or plugin execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
|
|
12
|
+
*/
|
|
13
|
+
interface ExecutionScopeState {
|
|
14
|
+
/**
|
|
15
|
+
* The timestamp when the command, hook, or plugin execution started
|
|
16
|
+
*/
|
|
17
|
+
timestamp: number;
|
|
18
|
+
/**
|
|
19
|
+
* The name of the command, hook, or plugin being executed
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
|
|
24
|
+
*/
|
|
25
|
+
type: ExecutionScopeType;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The execution state for a command execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
|
|
29
|
+
*/
|
|
30
|
+
interface ExecutionCommandScopeState extends ExecutionScopeState {
|
|
31
|
+
/**
|
|
32
|
+
* The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
|
|
33
|
+
*/
|
|
34
|
+
type: "command";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The execution state for a hook execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
|
|
38
|
+
*/
|
|
39
|
+
interface ExecutionHookScopeState extends ExecutionScopeState {
|
|
40
|
+
/**
|
|
41
|
+
* The order of the hook being executed, which can be "pre", "post", or "normal". This indicates whether the hook is being executed
|
|
42
|
+
*/
|
|
43
|
+
order?: "pre" | "post";
|
|
44
|
+
/**
|
|
45
|
+
* The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
|
|
46
|
+
*/
|
|
47
|
+
type: "hook";
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The execution state for a plugin execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
|
|
51
|
+
*/
|
|
52
|
+
interface ExecutionPluginScopeState extends ExecutionScopeState {
|
|
53
|
+
/**
|
|
54
|
+
* The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
|
|
55
|
+
*/
|
|
56
|
+
type: "plugin";
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The execution state for the Powerlines engine, which includes information about the currently active command, hook, and plugin executions. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
|
|
60
|
+
*/
|
|
61
|
+
interface ExecutionState {
|
|
62
|
+
/**
|
|
63
|
+
* The currently active command execution for this execution context
|
|
64
|
+
*/
|
|
65
|
+
command: ExecutionCommandScopeState | null;
|
|
66
|
+
/**
|
|
67
|
+
* The currently active hook execution for this execution context, if any
|
|
68
|
+
*/
|
|
69
|
+
hook: ExecutionHookScopeState | null;
|
|
70
|
+
/**
|
|
71
|
+
* The currently active plugin execution for this execution context, if any
|
|
72
|
+
*/
|
|
73
|
+
plugin: ExecutionPluginScopeState | null;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The execution context for a command, hook, or plugin execution within the Powerlines engine. This context includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This context can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
|
|
77
|
+
*/
|
|
78
|
+
interface EngineExecutionItem {
|
|
79
|
+
/**
|
|
80
|
+
* A unique identifier for the current invocation (a single invocation can include multiple executions).
|
|
81
|
+
*/
|
|
82
|
+
invocationId: string;
|
|
83
|
+
/**
|
|
84
|
+
* The method being executed, which can be one of the supported Powerlines execution API methods such as "build", "docs", or "deploy". This indicates the specific command or action that is being executed within the Powerlines engine.
|
|
85
|
+
*/
|
|
86
|
+
method: string;
|
|
87
|
+
/**
|
|
88
|
+
* The options provided to the Powerlines process for this execution
|
|
89
|
+
*/
|
|
90
|
+
options: EngineExecutionOptions;
|
|
91
|
+
/**
|
|
92
|
+
* The parsed user configuration file provided to the Powerlines process before any resolution or merging
|
|
93
|
+
*/
|
|
94
|
+
configFile: ParsedUserConfig;
|
|
95
|
+
/**
|
|
96
|
+
* An object representing the currently active command, hook, and plugin executions for this execution context
|
|
97
|
+
*/
|
|
98
|
+
state: ExecutionState;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The Powerlines engine context.
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* This context is used during the execution of the Powerlines engine, providing access to the input user configurations.
|
|
105
|
+
*/
|
|
106
|
+
interface EngineContext<TSystemContext = unknown> extends BaseContext<TSystemContext>, Pick<Required<EngineOptions>, "framework"> {
|
|
107
|
+
/**
|
|
108
|
+
* The options provided to the Powerlines process
|
|
109
|
+
*/
|
|
110
|
+
options: EngineOptions;
|
|
111
|
+
/**
|
|
112
|
+
* The metadata information for the RPC connection
|
|
113
|
+
*/
|
|
114
|
+
connection: ConnectionMeta;
|
|
115
|
+
/**
|
|
116
|
+
* The [Devframe](https://devtools.vite.dev/devframe/guide/) context for interacting with the DevTools.
|
|
117
|
+
*
|
|
118
|
+
* @see https://devtools.vite.dev/devframe/guide/
|
|
119
|
+
* @see https://github.com/vitejs/devtools/blob/main/devframe
|
|
120
|
+
*/
|
|
121
|
+
devtools: DevToolsNodeContext;
|
|
122
|
+
/**
|
|
123
|
+
* A list of all command executions that will be run during the lifecycle of the engine
|
|
124
|
+
*/
|
|
125
|
+
executions: EngineExecutionItem[];
|
|
126
|
+
/**
|
|
127
|
+
* Initialize the context with the provided configuration options
|
|
128
|
+
*
|
|
129
|
+
* @remarks
|
|
130
|
+
* This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.
|
|
131
|
+
*/
|
|
132
|
+
loadExecutions: (method: string, inlineConfig: InlineConfig) => Promise<EngineExecutionItem[]>;
|
|
133
|
+
/**
|
|
134
|
+
* Complete an execution by removing it from the list of active executions based on the provided invocation ID and execution ID. This method is typically called when an execution has finished or has been terminated, allowing the context to clean up any resources associated with that execution and update its internal state accordingly.
|
|
135
|
+
*
|
|
136
|
+
* @param invocationId - The unique identifier for the invocation of the execution to be completed.
|
|
137
|
+
* @param executionId - The unique identifier for the specific execution to be completed.
|
|
138
|
+
*/
|
|
139
|
+
completeExecution: (invocationId: string, executionId: string) => void;
|
|
140
|
+
}
|
|
141
|
+
interface EngineSystemContext {
|
|
142
|
+
/**
|
|
143
|
+
* The RPC client instance used for communication between the engine and its worker threads, allowing for remote procedure calls to be made between the main thread and worker threads for tasks such as logging, file system operations, and other interactions that require communication between the different execution contexts within the Powerlines engine.
|
|
144
|
+
*/
|
|
145
|
+
rpc: RpcClient;
|
|
146
|
+
}
|
|
147
|
+
//#endregion
|
|
148
|
+
export { ExecutionHookScopeState as a, ExecutionScopeType as c, ExecutionCommandScopeState as i, ExecutionState as l, EngineExecutionItem as n, ExecutionPluginScopeState as o, EngineSystemContext as r, ExecutionScopeState as s, EngineContext as t };
|
|
149
|
+
//# sourceMappingURL=context-D0_a0kRO.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-D0_a0kRO.d.cts","names":[],"sources":["../src/types/context.ts"],"mappings":";;;;;;AA0BA;;KAAY,kBAAA;;AAAkB;AAK9B;UAAiB,mBAAA;;;;EAIf,SAAA;EAUA;;;EALA,IAAA;EAWe;;;EANf,IAAA,EAAM,kBAAkB;AAAA;AAgB1B;;;AAAA,UAViB,0BAAA,SAAmC,mBAAmB;EAUtB;;;EAN/C,IAAI;AAAA;AAqBN;;;AAAA,UAfiB,uBAAA,SAAgC,mBAAmB;EAmB9D;AAMN;;EArBE,KAAA;EAyBS;;;EApBT,IAAA;AAAA;;;;UAMe,yBAAA,SAAkC,mBAAmB;EAwBpE;;;EApBA,IAAI;AAAA;;;;UAMW,cAAA;EA4CR;;;EAxCP,OAAA,EAAS,0BAAA;EAyBT;;;EApBA,IAAA,EAAM,uBAAA;EA8BM;;;EAzBZ,MAAA,EAAQ,yBAAA;AAAA;AAuCV;;;AAAA,UAjCiB,mBAAA;EAoCC;;;EAhChB,YAAA;EAiDU;;;EA5CV,MAAA;EA4DK;;;EAvDL,OAAA,EAAS,sBAAA;EAsBH;;;EAjBN,UAAA,EAAY,gBAAA;EAiBV;;;EAZF,KAAA,EAAO,cAAA;AAAA;;;;;;;UASQ,aAAA,mCAEb,WAAA,CAAY,cAAA,GACZ,IAAA,CAAK,QAAA,CAAS,aAAA;EA+Bd;;;EA3BF,OAAA,EAAS,aAAA;EA6BI;;;EAxBb,UAAA,EAAY,cAAA;EAgCiD;AAAA;AAG/D;;;;EA3BE,QAAA,EAAU,mBAAA;;;;EAKV,UAAA,EAAY,mBAAA;;;;;;;EAQZ,cAAA,GACE,MAAA,UACA,YAAA,EAAc,YAAA,KACX,OAAA,CAAQ,mBAAA;;;;;;;EAQb,iBAAA,GAAoB,YAAA,UAAsB,WAAA;AAAA;AAAA,UAG3B,mBAAA;;;;EAIf,GAAA,EAAK,SAAS;AAAA"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { n as EngineOptions, t as EngineExecutionOptions, u as RpcClient } from "./config-ByLyzMI0.mjs";
|
|
2
|
+
import { BaseContext, InlineConfig, ParsedUserConfig } from "@powerlines/core";
|
|
3
|
+
import { ConnectionMeta, DevToolsNodeContext } from "devframe/types";
|
|
4
|
+
|
|
5
|
+
//#region src/types/context.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* The execution scope state represents the current state of a command, hook, or plugin execution within the Powerlines engine. It includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
|
|
8
|
+
*/
|
|
9
|
+
type ExecutionScopeType = "command" | "hook" | "plugin";
|
|
10
|
+
/**
|
|
11
|
+
* The execution state for a command, hook, or plugin execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
|
|
12
|
+
*/
|
|
13
|
+
interface ExecutionScopeState {
|
|
14
|
+
/**
|
|
15
|
+
* The timestamp when the command, hook, or plugin execution started
|
|
16
|
+
*/
|
|
17
|
+
timestamp: number;
|
|
18
|
+
/**
|
|
19
|
+
* The name of the command, hook, or plugin being executed
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
|
|
24
|
+
*/
|
|
25
|
+
type: ExecutionScopeType;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The execution state for a command execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
|
|
29
|
+
*/
|
|
30
|
+
interface ExecutionCommandScopeState extends ExecutionScopeState {
|
|
31
|
+
/**
|
|
32
|
+
* The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
|
|
33
|
+
*/
|
|
34
|
+
type: "command";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The execution state for a hook execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
|
|
38
|
+
*/
|
|
39
|
+
interface ExecutionHookScopeState extends ExecutionScopeState {
|
|
40
|
+
/**
|
|
41
|
+
* The order of the hook being executed, which can be "pre", "post", or "normal". This indicates whether the hook is being executed
|
|
42
|
+
*/
|
|
43
|
+
order?: "pre" | "post";
|
|
44
|
+
/**
|
|
45
|
+
* The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
|
|
46
|
+
*/
|
|
47
|
+
type: "hook";
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The execution state for a plugin execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
|
|
51
|
+
*/
|
|
52
|
+
interface ExecutionPluginScopeState extends ExecutionScopeState {
|
|
53
|
+
/**
|
|
54
|
+
* The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
|
|
55
|
+
*/
|
|
56
|
+
type: "plugin";
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The execution state for the Powerlines engine, which includes information about the currently active command, hook, and plugin executions. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
|
|
60
|
+
*/
|
|
61
|
+
interface ExecutionState {
|
|
62
|
+
/**
|
|
63
|
+
* The currently active command execution for this execution context
|
|
64
|
+
*/
|
|
65
|
+
command: ExecutionCommandScopeState | null;
|
|
66
|
+
/**
|
|
67
|
+
* The currently active hook execution for this execution context, if any
|
|
68
|
+
*/
|
|
69
|
+
hook: ExecutionHookScopeState | null;
|
|
70
|
+
/**
|
|
71
|
+
* The currently active plugin execution for this execution context, if any
|
|
72
|
+
*/
|
|
73
|
+
plugin: ExecutionPluginScopeState | null;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The execution context for a command, hook, or plugin execution within the Powerlines engine. This context includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This context can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
|
|
77
|
+
*/
|
|
78
|
+
interface EngineExecutionItem {
|
|
79
|
+
/**
|
|
80
|
+
* A unique identifier for the current invocation (a single invocation can include multiple executions).
|
|
81
|
+
*/
|
|
82
|
+
invocationId: string;
|
|
83
|
+
/**
|
|
84
|
+
* The method being executed, which can be one of the supported Powerlines execution API methods such as "build", "docs", or "deploy". This indicates the specific command or action that is being executed within the Powerlines engine.
|
|
85
|
+
*/
|
|
86
|
+
method: string;
|
|
87
|
+
/**
|
|
88
|
+
* The options provided to the Powerlines process for this execution
|
|
89
|
+
*/
|
|
90
|
+
options: EngineExecutionOptions;
|
|
91
|
+
/**
|
|
92
|
+
* The parsed user configuration file provided to the Powerlines process before any resolution or merging
|
|
93
|
+
*/
|
|
94
|
+
configFile: ParsedUserConfig;
|
|
95
|
+
/**
|
|
96
|
+
* An object representing the currently active command, hook, and plugin executions for this execution context
|
|
97
|
+
*/
|
|
98
|
+
state: ExecutionState;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The Powerlines engine context.
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* This context is used during the execution of the Powerlines engine, providing access to the input user configurations.
|
|
105
|
+
*/
|
|
106
|
+
interface EngineContext<TSystemContext = unknown> extends BaseContext<TSystemContext>, Pick<Required<EngineOptions>, "framework"> {
|
|
107
|
+
/**
|
|
108
|
+
* The options provided to the Powerlines process
|
|
109
|
+
*/
|
|
110
|
+
options: EngineOptions;
|
|
111
|
+
/**
|
|
112
|
+
* The metadata information for the RPC connection
|
|
113
|
+
*/
|
|
114
|
+
connection: ConnectionMeta;
|
|
115
|
+
/**
|
|
116
|
+
* The [Devframe](https://devtools.vite.dev/devframe/guide/) context for interacting with the DevTools.
|
|
117
|
+
*
|
|
118
|
+
* @see https://devtools.vite.dev/devframe/guide/
|
|
119
|
+
* @see https://github.com/vitejs/devtools/blob/main/devframe
|
|
120
|
+
*/
|
|
121
|
+
devtools: DevToolsNodeContext;
|
|
122
|
+
/**
|
|
123
|
+
* A list of all command executions that will be run during the lifecycle of the engine
|
|
124
|
+
*/
|
|
125
|
+
executions: EngineExecutionItem[];
|
|
126
|
+
/**
|
|
127
|
+
* Initialize the context with the provided configuration options
|
|
128
|
+
*
|
|
129
|
+
* @remarks
|
|
130
|
+
* This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.
|
|
131
|
+
*/
|
|
132
|
+
loadExecutions: (method: string, inlineConfig: InlineConfig) => Promise<EngineExecutionItem[]>;
|
|
133
|
+
/**
|
|
134
|
+
* Complete an execution by removing it from the list of active executions based on the provided invocation ID and execution ID. This method is typically called when an execution has finished or has been terminated, allowing the context to clean up any resources associated with that execution and update its internal state accordingly.
|
|
135
|
+
*
|
|
136
|
+
* @param invocationId - The unique identifier for the invocation of the execution to be completed.
|
|
137
|
+
* @param executionId - The unique identifier for the specific execution to be completed.
|
|
138
|
+
*/
|
|
139
|
+
completeExecution: (invocationId: string, executionId: string) => void;
|
|
140
|
+
}
|
|
141
|
+
interface EngineSystemContext {
|
|
142
|
+
/**
|
|
143
|
+
* The RPC client instance used for communication between the engine and its worker threads, allowing for remote procedure calls to be made between the main thread and worker threads for tasks such as logging, file system operations, and other interactions that require communication between the different execution contexts within the Powerlines engine.
|
|
144
|
+
*/
|
|
145
|
+
rpc: RpcClient;
|
|
146
|
+
}
|
|
147
|
+
//#endregion
|
|
148
|
+
export { ExecutionHookScopeState as a, ExecutionScopeType as c, ExecutionCommandScopeState as i, ExecutionState as l, EngineExecutionItem as n, ExecutionPluginScopeState as o, EngineSystemContext as r, ExecutionScopeState as s, EngineContext as t };
|
|
149
|
+
//# sourceMappingURL=context-DcXV6_GL.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-DcXV6_GL.d.mts","names":[],"sources":["../src/types/context.ts"],"mappings":";;;;;;AA0BA;;KAAY,kBAAA;;AAAkB;AAK9B;UAAiB,mBAAA;;;;EAIf,SAAA;EAUA;;;EALA,IAAA;EAWe;;;EANf,IAAA,EAAM,kBAAkB;AAAA;AAgB1B;;;AAAA,UAViB,0BAAA,SAAmC,mBAAmB;EAUtB;;;EAN/C,IAAI;AAAA;AAqBN;;;AAAA,UAfiB,uBAAA,SAAgC,mBAAmB;EAmB9D;AAMN;;EArBE,KAAA;EAyBS;;;EApBT,IAAA;AAAA;;;;UAMe,yBAAA,SAAkC,mBAAmB;EAwBpE;;;EApBA,IAAI;AAAA;;;;UAMW,cAAA;EA4CR;;;EAxCP,OAAA,EAAS,0BAAA;EAyBT;;;EApBA,IAAA,EAAM,uBAAA;EA8BM;;;EAzBZ,MAAA,EAAQ,yBAAA;AAAA;AAuCV;;;AAAA,UAjCiB,mBAAA;EAoCC;;;EAhChB,YAAA;EAiDU;;;EA5CV,MAAA;EA4DK;;;EAvDL,OAAA,EAAS,sBAAA;EAsBH;;;EAjBN,UAAA,EAAY,gBAAA;EAiBV;;;EAZF,KAAA,EAAO,cAAA;AAAA;;;;;;;UASQ,aAAA,mCAEb,WAAA,CAAY,cAAA,GACZ,IAAA,CAAK,QAAA,CAAS,aAAA;EA+Bd;;;EA3BF,OAAA,EAAS,aAAA;EA6BI;;;EAxBb,UAAA,EAAY,cAAA;EAgCiD;AAAA;AAG/D;;;;EA3BE,QAAA,EAAU,mBAAA;;;;EAKV,UAAA,EAAY,mBAAA;;;;;;;EAQZ,cAAA,GACE,MAAA,UACA,YAAA,EAAc,YAAA,KACX,OAAA,CAAQ,mBAAA;;;;;;;EAQb,iBAAA,GAAoB,YAAA,UAAsB,WAAA;AAAA;AAAA,UAG3B,mBAAA;;;;EAIf,GAAA,EAAK,SAAS;AAAA"}
|