@powerlines/engine 0.47.4 → 0.49.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/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
|
@@ -1,647 +0,0 @@
|
|
|
1
|
-
import { EnvPaths } from "@stryke/env/get-env-paths";
|
|
2
|
-
import { FlatCache } from "flat-cache";
|
|
3
|
-
import { ParseResult } from "oxc-parser";
|
|
4
|
-
import { RequestInfo, Response } from "undici";
|
|
5
|
-
import { BaseContext, Context, EmitEntryOptions, EmitOptions, EngineOptions, EnvironmentContext, EnvironmentResolvedConfig, ExecutionContext, ExecutionOptions, FetchOptions, InferOverridableConfig, LogFn, LogLevelResolvedConfig, LogMessage, Logger, LoggerOptions, MetaInfo, Mode, ParseOptions, ParsedTypeScriptConfig, ParsedUserConfig, Plugin, PluginContext, ResolveOptions, ResolveResult, ResolvedConfig, ResolvedEntryTypeDefinition, Resolver, TransformResult, UserConfig, VirtualFile, VirtualFileSystemInterface, WorkspaceConfig } from "@powerlines/core";
|
|
6
|
-
import { DeepPartial, RequiredKeys } from "@stryke/types/base";
|
|
7
|
-
import { Unstable_ContextInternal, Unstable_EnvironmentContext } from "@powerlines/core/types/_internal";
|
|
8
|
-
import { Range } from "semver";
|
|
9
|
-
import { PackageJson } from "@stryke/types/package-json";
|
|
10
|
-
|
|
11
|
-
//#region src/context/base-context.d.ts
|
|
12
|
-
declare class PowerlinesBaseContext implements BaseContext {
|
|
13
|
-
#private;
|
|
14
|
-
/**
|
|
15
|
-
* The path to the Powerlines package
|
|
16
|
-
*/
|
|
17
|
-
powerlinesPath: string;
|
|
18
|
-
/**
|
|
19
|
-
* The module resolver for the project
|
|
20
|
-
*/
|
|
21
|
-
resolver: Resolver;
|
|
22
|
-
/**
|
|
23
|
-
* The options provided to the Powerlines process, resolved with default values and merged with any configuration provided by plugins or other sources. This is typically the final configuration used during the build process, but may also include additional options that are relevant to the context and its interactions with the Powerlines engine.
|
|
24
|
-
*/
|
|
25
|
-
options: RequiredKeys<EngineOptions, "mode" | "cwd" | "root" | "framework">;
|
|
26
|
-
/**
|
|
27
|
-
* The parsed `package.json` file for the project
|
|
28
|
-
*/
|
|
29
|
-
packageJson: PackageJson;
|
|
30
|
-
/**
|
|
31
|
-
* The parsed `project.json` file for the project
|
|
32
|
-
*/
|
|
33
|
-
projectJson: Record<string, any> | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* The parsed configuration file for the project
|
|
36
|
-
*/
|
|
37
|
-
configFile: ParsedUserConfig;
|
|
38
|
-
/**
|
|
39
|
-
* The logger instance for the context, which can be used to create log messages with consistent formatting and metadata. This logger is extended by plugin contexts to include additional metadata such as the plugin name and category, which can be used to filter and format log messages in a more granular way.
|
|
40
|
-
*/
|
|
41
|
-
get logger(): Logger;
|
|
42
|
-
/**
|
|
43
|
-
* A timestamp representing when the context was initialized
|
|
44
|
-
*/
|
|
45
|
-
get timestamp(): number;
|
|
46
|
-
get logLevel(): LogLevelResolvedConfig;
|
|
47
|
-
/**
|
|
48
|
-
* The environment paths for the project
|
|
49
|
-
*/
|
|
50
|
-
get envPaths(): EnvPaths;
|
|
51
|
-
/**
|
|
52
|
-
* A logging function for fatal messages
|
|
53
|
-
*
|
|
54
|
-
* @param message - The message to log.
|
|
55
|
-
*/
|
|
56
|
-
fatal(message: string | LogMessage): void;
|
|
57
|
-
/**
|
|
58
|
-
* A logging function for error messages
|
|
59
|
-
*
|
|
60
|
-
* @param message - The message to log.
|
|
61
|
-
*/
|
|
62
|
-
error(message: string | LogMessage): void;
|
|
63
|
-
/**
|
|
64
|
-
* A logging function for warning messages
|
|
65
|
-
*
|
|
66
|
-
* @param message - The message to log.
|
|
67
|
-
*/
|
|
68
|
-
warn(message: string | LogMessage): void;
|
|
69
|
-
/**
|
|
70
|
-
* A logging function for informational messages
|
|
71
|
-
*
|
|
72
|
-
* @param message - The message to log.
|
|
73
|
-
*/
|
|
74
|
-
info(message: string | LogMessage): void;
|
|
75
|
-
/**
|
|
76
|
-
* A logging function for debug messages
|
|
77
|
-
*
|
|
78
|
-
* @param message - The message to log.
|
|
79
|
-
*/
|
|
80
|
-
debug(message: string | LogMessage): void;
|
|
81
|
-
/**
|
|
82
|
-
* A logging function for trace messages
|
|
83
|
-
*
|
|
84
|
-
* @param message - The message to log.
|
|
85
|
-
*/
|
|
86
|
-
trace(message: string | LogMessage): void;
|
|
87
|
-
/**
|
|
88
|
-
* A function to create a timer for measuring the duration of asynchronous operations
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```ts
|
|
92
|
-
* const stopTimer = context.timer("Your Async Operation");
|
|
93
|
-
* await performAsyncOperation();
|
|
94
|
-
* stopTimer(); // "Your Async Operation completed in 123.45 milliseconds"
|
|
95
|
-
* ```
|
|
96
|
-
*
|
|
97
|
-
* @param name - The name of the timer.
|
|
98
|
-
* @returns A function that, when called, stops the timer and logs the duration.
|
|
99
|
-
*/
|
|
100
|
-
timer(name: string): () => void;
|
|
101
|
-
/**
|
|
102
|
-
* Create a new logger instance
|
|
103
|
-
*
|
|
104
|
-
* @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.
|
|
105
|
-
* @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.
|
|
106
|
-
* @returns A logger client instance that can be used to generate log messages with consistent formatting and metadata.
|
|
107
|
-
*/
|
|
108
|
-
createLogger(options: LoggerOptions, logFn?: LogFn): Logger;
|
|
109
|
-
/**
|
|
110
|
-
* Extend the base logger with additional configuration options
|
|
111
|
-
*
|
|
112
|
-
* @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.
|
|
113
|
-
* @returns A new logger client instance that extends the base logger with the provided configuration options.
|
|
114
|
-
*/
|
|
115
|
-
extendLogger(options: LoggerOptions): Logger;
|
|
116
|
-
/**
|
|
117
|
-
* The input options used to initialize the context, which may be used when cloning the context to ensure the same configuration is applied to the new context
|
|
118
|
-
*/
|
|
119
|
-
protected initialOptions: EngineOptions;
|
|
120
|
-
/**
|
|
121
|
-
* The initial configuration provided when initializing the context, which may be used during the setup process to ensure that the configuration is properly merged and applied to the context. 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.
|
|
122
|
-
*/
|
|
123
|
-
protected initialConfig: DeepPartial<UserConfig>;
|
|
124
|
-
/**
|
|
125
|
-
* Initialize the context with the provided configuration options and set up the resolver and user configuration file. This method 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 as the original context.
|
|
126
|
-
*
|
|
127
|
-
* @param options - The configuration options to initialize the context with, which can include properties such as the project root, mode, log level, and other settings that affect the behavior of the context and its plugins.
|
|
128
|
-
* @param initialConfig - The initial configuration to initialize the context with, which is typically the user configuration provided in the Powerlines configuration file. This can also include additional configuration options provided by plugins or other sources that should be merged with the user configuration during initialization
|
|
129
|
-
*/
|
|
130
|
-
protected constructor(options: EngineOptions, initialConfig?: DeepPartial<UserConfig>);
|
|
131
|
-
/**
|
|
132
|
-
* Retrieve the workspace configuration for the current project, if it exists. This function will look for a configuration file in the project root and return its contents as a JavaScript object. If no configuration file is found, it will return undefined.
|
|
133
|
-
*
|
|
134
|
-
* @returns A promise that resolves to the workspace configuration object, or undefined if no configuration file is found.
|
|
135
|
-
*/
|
|
136
|
-
protected getWorkspaceConfig(): Promise<WorkspaceConfig | undefined>;
|
|
137
|
-
/**
|
|
138
|
-
* Initialize the context with the provided configuration options
|
|
139
|
-
*
|
|
140
|
-
* @remarks
|
|
141
|
-
* 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.
|
|
142
|
-
*/
|
|
143
|
-
protected init(): Promise<void>;
|
|
144
|
-
/**
|
|
145
|
-
* Resolve the package configurations for the project by loading the `package.json` and `project.json` files, if they exist. This function will look for these files in the project root and parse their contents as JavaScript objects. The parsed contents will be stored in the context for later use by plugins and other parts of the build process.
|
|
146
|
-
*
|
|
147
|
-
* @remarks
|
|
148
|
-
* The `package.json` file is typically used to store metadata about the project, such as its name, version, dependencies, and other information. The `project.json` file is an optional file that can be used to store additional configuration or metadata specific to the project, and is not required for all projects.
|
|
149
|
-
*
|
|
150
|
-
* @param cwd - The current working directory to look for the package configurations. Defaults to the `cwd` specified in the context configuration.
|
|
151
|
-
* @param root - The root directory of the project to look for the package configurations. Defaults to the `root` specified in the context configuration.
|
|
152
|
-
* @returns A promise that resolves when the package configurations have been loaded and stored in the context.
|
|
153
|
-
*/
|
|
154
|
-
protected resolvePackageConfigs(cwd?: string, root?: string): Promise<void>;
|
|
155
|
-
/**
|
|
156
|
-
* Determine the default mode for the current execution based on the environment and workspace configuration. This function will check the `NODE_ENV` environment variable to determine if the current environment is development, production, or test. If `NODE_ENV` is not set, it will look for a `mode` property in the workspace configuration file. If no mode is specified in the workspace configuration, it will default to "production".
|
|
157
|
-
*
|
|
158
|
-
* @returns A promise that resolves to the default mode for the current execution, which can be "development", "production", or "test".
|
|
159
|
-
*/
|
|
160
|
-
protected getDefaultMode(): Promise<Mode>;
|
|
161
|
-
/**
|
|
162
|
-
* Determine the default log level for the current execution based on the environment and workspace configuration. This function will check the `logLevel` property in the workspace configuration file and resolve it to a `LogLevelResolvedConfig` value. If no log level is specified in the workspace configuration, it will default to "info" for development mode and "warn" for production mode.
|
|
163
|
-
*
|
|
164
|
-
* @returns A promise that resolves to the default log level for the current execution, which can be "fatal", "error", "warn", "info", "debug", or "trace".
|
|
165
|
-
*/
|
|
166
|
-
protected getDefaultLogLevel(): Promise<LogLevelResolvedConfig>;
|
|
167
|
-
}
|
|
168
|
-
//#endregion
|
|
169
|
-
//#region src/context/context.d.ts
|
|
170
|
-
declare class PowerlinesContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PowerlinesBaseContext implements Context<TResolvedConfig> {
|
|
171
|
-
#private;
|
|
172
|
-
/**
|
|
173
|
-
* Create a new context from the workspace root and user config.
|
|
174
|
-
*
|
|
175
|
-
* @param options - The options for resolving the context.
|
|
176
|
-
* @returns A promise that resolves to the new context.
|
|
177
|
-
*/
|
|
178
|
-
static fromInitialConfig<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(options: ExecutionOptions, initialConfig: TResolvedConfig["initialConfig"]): Promise<PowerlinesContext<TResolvedConfig>>;
|
|
179
|
-
/**
|
|
180
|
-
* The options provided to the Powerlines process, resolved with default values and merged with any configuration provided by plugins or other sources. This is typically the final configuration used during the build process, but may also include additional options that are relevant to the context and its interactions with the Powerlines engine.
|
|
181
|
-
*/
|
|
182
|
-
options: RequiredKeys<ExecutionOptions, "mode" | "cwd" | "root" | "framework" | "logLevel">;
|
|
183
|
-
/**
|
|
184
|
-
* An object containing the dependencies that should be installed for the project
|
|
185
|
-
*/
|
|
186
|
-
dependencies: Record<string, string | Range>;
|
|
187
|
-
/**
|
|
188
|
-
* An object containing the development dependencies that should be installed for the project
|
|
189
|
-
*/
|
|
190
|
-
devDependencies: Record<string, string | Range>;
|
|
191
|
-
/**
|
|
192
|
-
* The persisted meta information about the current build
|
|
193
|
-
*/
|
|
194
|
-
persistedMeta: MetaInfo | undefined;
|
|
195
|
-
/**
|
|
196
|
-
* The resolved tsconfig file paths for the project
|
|
197
|
-
*/
|
|
198
|
-
resolvePatterns: RegExp[];
|
|
199
|
-
/**
|
|
200
|
-
* The input options used to initialize the context, which may be used when cloning the context to ensure the same configuration is applied to the new context
|
|
201
|
-
*/
|
|
202
|
-
protected initialOptions: ExecutionOptions;
|
|
203
|
-
/**
|
|
204
|
-
* The resolved configuration for this context
|
|
205
|
-
*/
|
|
206
|
-
protected resolvedConfig: TResolvedConfig;
|
|
207
|
-
/**
|
|
208
|
-
* The configuration options that were overridden by plugins during the build process, which may include additional properties or modifications made during the configuration loading process.
|
|
209
|
-
*/
|
|
210
|
-
protected overriddenConfig: InferOverridableConfig<TResolvedConfig>;
|
|
211
|
-
/**
|
|
212
|
-
* The configuration options provided inline during execution, such as CLI flags or other parameters that may be relevant to the command being executed. These options can be used to override or supplement the configuration options defined in a configuration file on disk, and are typically provided as part of the execution context when running a Powerlines command.
|
|
213
|
-
*/
|
|
214
|
-
protected inlineConfig: TResolvedConfig["inlineConfig"];
|
|
215
|
-
/**
|
|
216
|
-
* The configuration options read from a configuration file on disk, which may 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.
|
|
217
|
-
*/
|
|
218
|
-
protected userConfig: TResolvedConfig["userConfig"];
|
|
219
|
-
/**
|
|
220
|
-
* The configuration options provided by plugins added by the user (and other plugins)
|
|
221
|
-
*/
|
|
222
|
-
protected pluginConfig: TResolvedConfig["pluginConfig"];
|
|
223
|
-
/**
|
|
224
|
-
* The configuration options provided by the environment
|
|
225
|
-
*/
|
|
226
|
-
protected environmentConfig: any;
|
|
227
|
-
/**
|
|
228
|
-
* The resolved entry type definitions for the project
|
|
229
|
-
*/
|
|
230
|
-
get entry(): ResolvedEntryTypeDefinition[];
|
|
231
|
-
/**
|
|
232
|
-
* The TypeScript configuration parsed from the tsconfig file
|
|
233
|
-
*/
|
|
234
|
-
get tsconfig(): ParsedTypeScriptConfig;
|
|
235
|
-
/**
|
|
236
|
-
* Sets the TypeScript configuration parsed from the tsconfig file
|
|
237
|
-
*/
|
|
238
|
-
set tsconfig(value: ParsedTypeScriptConfig);
|
|
239
|
-
/**
|
|
240
|
-
* The virtual file system interface for the project
|
|
241
|
-
*/
|
|
242
|
-
get fs(): VirtualFileSystemInterface;
|
|
243
|
-
/**
|
|
244
|
-
* Get the checksum of the project's current state
|
|
245
|
-
*/
|
|
246
|
-
get checksum(): string | null;
|
|
247
|
-
/**
|
|
248
|
-
* The meta information about the current build
|
|
249
|
-
*/
|
|
250
|
-
get meta(): MetaInfo;
|
|
251
|
-
/**
|
|
252
|
-
* The resolved configuration options
|
|
253
|
-
*/
|
|
254
|
-
get config(): TResolvedConfig;
|
|
255
|
-
/**
|
|
256
|
-
* Get the path to the artifacts directory for the project
|
|
257
|
-
*/
|
|
258
|
-
get artifactsPath(): string;
|
|
259
|
-
/**
|
|
260
|
-
* Get the path to the builtin modules used by the project
|
|
261
|
-
*/
|
|
262
|
-
get builtinsPath(): string;
|
|
263
|
-
/**
|
|
264
|
-
* Get the path to the entry directory for the project
|
|
265
|
-
*/
|
|
266
|
-
get entryPath(): string;
|
|
267
|
-
/**
|
|
268
|
-
* Get the path to the infrastructure modules used by the project
|
|
269
|
-
*/
|
|
270
|
-
get infrastructurePath(): string;
|
|
271
|
-
/**
|
|
272
|
-
* Get the path to the data directory for the project
|
|
273
|
-
*/
|
|
274
|
-
get dataPath(): string;
|
|
275
|
-
/**
|
|
276
|
-
* Get the path to the cache directory for the project
|
|
277
|
-
*/
|
|
278
|
-
get cachePath(): string;
|
|
279
|
-
/**
|
|
280
|
-
* Get the path to the generated declaration file for the project
|
|
281
|
-
*/
|
|
282
|
-
get typesPath(): string;
|
|
283
|
-
/**
|
|
284
|
-
* Get the project root relative to the workspace root
|
|
285
|
-
*/
|
|
286
|
-
get relativeToWorkspaceRoot(): string;
|
|
287
|
-
/**
|
|
288
|
-
* The builtin module id that exist in the Powerlines virtual file system
|
|
289
|
-
*/
|
|
290
|
-
get builtins(): string[];
|
|
291
|
-
/**
|
|
292
|
-
* Additional arguments provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed.
|
|
293
|
-
*/
|
|
294
|
-
get additionalArgs(): Record<string, string | string[]>;
|
|
295
|
-
/**
|
|
296
|
-
* The alias mappings for the project used during module resolution
|
|
297
|
-
*
|
|
298
|
-
* @remarks
|
|
299
|
-
* This includes both the built-in module aliases as well as any custom aliases defined in the build configuration.
|
|
300
|
-
*/
|
|
301
|
-
get alias(): Record<string, string>;
|
|
302
|
-
/**
|
|
303
|
-
* The log level for the context, which determines the minimum level of log messages that will be emitted by the logger. This is resolved based on the configuration options provided by the user, and can be set to different levels for development, production, and test environments. The log level can also be overridden by plugins or other parts of the build process to provide more granular control over logging output.
|
|
304
|
-
*/
|
|
305
|
-
get logLevel(): LogLevelResolvedConfig;
|
|
306
|
-
/**
|
|
307
|
-
* The environment paths for the project, which provide the locations of various directories and files used by the Powerlines framework. These paths are resolved based on the organization ID, application ID, and workspace root directory, and can be used to access configuration files, cache directories, and other resources in a consistent manner.
|
|
308
|
-
*/
|
|
309
|
-
get envPaths(): EnvPaths;
|
|
310
|
-
/**
|
|
311
|
-
* Gets the parser cache.
|
|
312
|
-
*/
|
|
313
|
-
protected get parserCache(): FlatCache;
|
|
314
|
-
/**
|
|
315
|
-
* Gets the request cache.
|
|
316
|
-
*/
|
|
317
|
-
protected get requestCache(): FlatCache;
|
|
318
|
-
/**
|
|
319
|
-
* The entry points that exist in the Powerlines virtual file system
|
|
320
|
-
*/
|
|
321
|
-
protected get resolvedEntry(): ResolvedEntryTypeDefinition[];
|
|
322
|
-
/**
|
|
323
|
-
* Creates a new Context instance.
|
|
324
|
-
*
|
|
325
|
-
* @param options - The options to use for creating the context, including the resolved configuration and workspace settings.
|
|
326
|
-
* @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.
|
|
327
|
-
*/
|
|
328
|
-
protected constructor(options: ExecutionOptions, initialConfig: TResolvedConfig["initialConfig"]);
|
|
329
|
-
/**
|
|
330
|
-
* Create a new logger instance
|
|
331
|
-
*
|
|
332
|
-
* @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.
|
|
333
|
-
* @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.
|
|
334
|
-
* @returns A logger client instance that can be used to generate log messages with consistent formatting and metadata.
|
|
335
|
-
*/
|
|
336
|
-
createLogger(options: LoggerOptions, logFn?: LogFn): Logger;
|
|
337
|
-
/**
|
|
338
|
-
* A function to perform HTTP fetch requests
|
|
339
|
-
*
|
|
340
|
-
* @remarks
|
|
341
|
-
* This function uses a caching layer to avoid duplicate requests during the Powerlines process.
|
|
342
|
-
*
|
|
343
|
-
* @example
|
|
344
|
-
* ```ts
|
|
345
|
-
* const response = await context.fetch("https://api.example.com/data");
|
|
346
|
-
* const data = await response.json();
|
|
347
|
-
* ```
|
|
348
|
-
*
|
|
349
|
-
* @see https://github.com/nodejs/undici
|
|
350
|
-
*
|
|
351
|
-
* @param input - The URL to fetch.
|
|
352
|
-
* @param options - The fetch request options.
|
|
353
|
-
* @returns A promise that resolves to a response returned by the fetch.
|
|
354
|
-
*/
|
|
355
|
-
fetch(input: RequestInfo, options?: FetchOptions): Promise<Response>;
|
|
356
|
-
/**
|
|
357
|
-
* Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
358
|
-
*
|
|
359
|
-
* @remarks
|
|
360
|
-
* This function can be used to parse TypeScript code into an AST for further analysis or transformation.
|
|
361
|
-
*
|
|
362
|
-
* @example
|
|
363
|
-
* ```ts
|
|
364
|
-
* const ast = context.parse("const x: number = 42;");
|
|
365
|
-
* ```
|
|
366
|
-
*
|
|
367
|
-
* @see https://rollupjs.org/plugin-development/#this-parse
|
|
368
|
-
* @see https://github.com/oxc/oxc
|
|
369
|
-
*
|
|
370
|
-
* @param code - The source code to parse.
|
|
371
|
-
* @param options - The options to pass to the parser.
|
|
372
|
-
* @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
373
|
-
*/
|
|
374
|
-
parse(code: string, options?: ParseOptions): Promise<ParseResult>;
|
|
375
|
-
/**
|
|
376
|
-
* A helper function to resolve modules in the Virtual File System
|
|
377
|
-
*
|
|
378
|
-
* @remarks
|
|
379
|
-
* This function can be used to resolve modules relative to the project root directory.
|
|
380
|
-
*
|
|
381
|
-
* @example
|
|
382
|
-
* ```ts
|
|
383
|
-
* const resolved = await context.resolve("some-module", "/path/to/importer");
|
|
384
|
-
* ```
|
|
385
|
-
*
|
|
386
|
-
* @param id - The module to resolve.
|
|
387
|
-
* @param importer - An optional path to the importer module.
|
|
388
|
-
* @param options - Additional resolution options.
|
|
389
|
-
* @returns A promise that resolves to the resolved module path.
|
|
390
|
-
*/
|
|
391
|
-
resolve(id: string, importer?: string, options?: ResolveOptions): Promise<ResolveResult | undefined>;
|
|
392
|
-
/**
|
|
393
|
-
* A helper function to load modules from the Virtual File System
|
|
394
|
-
*
|
|
395
|
-
* @remarks
|
|
396
|
-
* This function can be used to load modules relative to the project root directory.
|
|
397
|
-
*
|
|
398
|
-
* @example
|
|
399
|
-
* ```ts
|
|
400
|
-
* const module = await context.load("some-module", "/path/to/importer");
|
|
401
|
-
* ```
|
|
402
|
-
*
|
|
403
|
-
* @param id - The module to load.
|
|
404
|
-
* @returns A promise that resolves to the loaded module.
|
|
405
|
-
*/
|
|
406
|
-
load(id: string): Promise<TransformResult | undefined>;
|
|
407
|
-
/**
|
|
408
|
-
* Get the builtin virtual files that exist in the Powerlines virtual file system
|
|
409
|
-
*/
|
|
410
|
-
getBuiltins(): Promise<VirtualFile[]>;
|
|
411
|
-
/**
|
|
412
|
-
* Resolves a file and writes it to the VFS if it does not already exist
|
|
413
|
-
*
|
|
414
|
-
* @param code - The source code of the file
|
|
415
|
-
* @param path - The path to write the file to
|
|
416
|
-
* @param options - Additional options for writing the file
|
|
417
|
-
*/
|
|
418
|
-
emit(code: string, path: string, options?: EmitOptions): Promise<void>;
|
|
419
|
-
/**
|
|
420
|
-
* Synchronously resolves a file and writes it to the VFS if it does not already exist
|
|
421
|
-
*
|
|
422
|
-
* @param code - The source code of the file
|
|
423
|
-
* @param path - The path to write the file to
|
|
424
|
-
* @param options - Additional options for writing the file
|
|
425
|
-
*/
|
|
426
|
-
emitSync(code: string, path: string, options?: EmitOptions): void;
|
|
427
|
-
/**
|
|
428
|
-
* Resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
429
|
-
*
|
|
430
|
-
* @param code - The source code of the entry file
|
|
431
|
-
* @param path - A path to write the entry file to
|
|
432
|
-
* @param options - Optional write file options
|
|
433
|
-
*/
|
|
434
|
-
emitEntry(code: string, path: string, options?: EmitEntryOptions): Promise<void>;
|
|
435
|
-
/**
|
|
436
|
-
* Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
437
|
-
*
|
|
438
|
-
* @param code - The source code of the entry file
|
|
439
|
-
* @param path - A path to write the entry file to
|
|
440
|
-
* @param options - Optional write file options
|
|
441
|
-
*/
|
|
442
|
-
emitEntrySync(code: string, path: string, options?: EmitEntryOptions): void;
|
|
443
|
-
/**
|
|
444
|
-
* Resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
445
|
-
*
|
|
446
|
-
* @param code - The source code of the builtin file
|
|
447
|
-
* @param id - The unique identifier of the builtin file
|
|
448
|
-
* @param options - Optional write file options
|
|
449
|
-
*/
|
|
450
|
-
emitBuiltin(code: string, id: string, options?: EmitOptions): Promise<void>;
|
|
451
|
-
/**
|
|
452
|
-
* Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
453
|
-
*
|
|
454
|
-
* @param code - The source code of the builtin file
|
|
455
|
-
* @param id - The unique identifier of the builtin file
|
|
456
|
-
* @param options - Optional write file options
|
|
457
|
-
*/
|
|
458
|
-
emitBuiltinSync(code: string, id: string, options?: EmitOptions): void;
|
|
459
|
-
/**
|
|
460
|
-
* Resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
461
|
-
*
|
|
462
|
-
* @param code - The source code of the builtin file
|
|
463
|
-
* @param id - The unique identifier of the builtin file
|
|
464
|
-
* @param options - Optional write file options
|
|
465
|
-
*/
|
|
466
|
-
emitInfrastructure(code: string, id: string, options?: EmitOptions): Promise<void>;
|
|
467
|
-
/**
|
|
468
|
-
* Synchronously resolves an infrastructure virtual file and writes it to the VFS if it does not already exist
|
|
469
|
-
*
|
|
470
|
-
* @param code - The source code of the infrastructure file
|
|
471
|
-
* @param id - The unique identifier of the infrastructure file
|
|
472
|
-
* @param options - Optional write file options
|
|
473
|
-
*/
|
|
474
|
-
emitInfrastructureSync(code: string, id: string, options?: EmitOptions): void;
|
|
475
|
-
/**
|
|
476
|
-
* Generates a checksum representing the current context state
|
|
477
|
-
*
|
|
478
|
-
* @param path - The root directory of the project to generate the checksum for
|
|
479
|
-
* @returns A promise that resolves to a string representing the checksum
|
|
480
|
-
*/
|
|
481
|
-
generateChecksum(path?: string): Promise<string>;
|
|
482
|
-
/**
|
|
483
|
-
* A setter function to populate the inline 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 inline configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any inline configuration provided during execution.
|
|
484
|
-
*
|
|
485
|
-
* @param config - The inline configuration values to set.
|
|
486
|
-
* @returns A promise that resolves when the inline configuration values have been set.
|
|
487
|
-
*/
|
|
488
|
-
setInlineConfig(config: TResolvedConfig["inlineConfig"]): Promise<void>;
|
|
489
|
-
/**
|
|
490
|
-
* A setter function to populate the plugin config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the plugin configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any plugin configuration provided during execution.
|
|
491
|
-
*
|
|
492
|
-
* @param config - The plugin configuration values to set.
|
|
493
|
-
* @returns A promise that resolves when the plugin configuration values have been set.
|
|
494
|
-
*/
|
|
495
|
-
setPluginConfig(config: TResolvedConfig["pluginConfig"]): Promise<void>;
|
|
496
|
-
/**
|
|
497
|
-
* 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.
|
|
498
|
-
*
|
|
499
|
-
* @returns The merged configuration object that combines the initial, user, inline, and plugin configurations.
|
|
500
|
-
*/
|
|
501
|
-
protected mergeConfig(): TResolvedConfig;
|
|
502
|
-
/**
|
|
503
|
-
* A setter function to populate the user 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 user configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any inline configuration provided during execution.
|
|
504
|
-
*
|
|
505
|
-
* @param config - The user configuration values to set.
|
|
506
|
-
* @returns A promise that resolves when the user configuration values have been set.
|
|
507
|
-
*/
|
|
508
|
-
protected setUserConfig(config: TResolvedConfig["userConfig"]): Promise<void>;
|
|
509
|
-
/**
|
|
510
|
-
* Initialize the context with the provided configuration options
|
|
511
|
-
*/
|
|
512
|
-
protected init(): Promise<void>;
|
|
513
|
-
/**
|
|
514
|
-
* Resolve the package configurations for the project by loading the `package.json` and `project.json` files, if they exist. This function will look for these files in the project root and parse their contents as JavaScript objects. The parsed contents will be stored in the context for later use by plugins and other parts of the build process.
|
|
515
|
-
*
|
|
516
|
-
* @remarks
|
|
517
|
-
* The `package.json` file is typically used to store metadata about the project, such as its name, version, dependencies, and other information. The `project.json` file is an optional file that can be used to store additional configuration or metadata specific to the project, and is not required for all projects.
|
|
518
|
-
*
|
|
519
|
-
* @param cwd - The current working directory to look for the package configurations. Defaults to the `cwd` specified in the context configuration.
|
|
520
|
-
* @param root - The root directory of the project to look for the package configurations. Defaults to the `root` specified in the context configuration.
|
|
521
|
-
* @returns A promise that resolves when the package configurations have been loaded and stored in the context.
|
|
522
|
-
*/
|
|
523
|
-
protected resolvePackageConfigs(cwd?: string, root?: string): Promise<void>;
|
|
524
|
-
/**
|
|
525
|
-
* Initialize the context with the provided configuration options
|
|
526
|
-
*/
|
|
527
|
-
protected resolveConfig(): Promise<void>;
|
|
528
|
-
private createConfigProxy;
|
|
529
|
-
}
|
|
530
|
-
//#endregion
|
|
531
|
-
//#region src/context/execution-context.d.ts
|
|
532
|
-
declare class PowerlinesExecutionContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PowerlinesContext<TResolvedConfig> implements ExecutionContext<TResolvedConfig> {
|
|
533
|
-
#private;
|
|
534
|
-
/**
|
|
535
|
-
* Create a new Storm context from the workspace root and user config.
|
|
536
|
-
*
|
|
537
|
-
* @param options - The options for resolving the context.
|
|
538
|
-
* @returns A promise that resolves to the new context.
|
|
539
|
-
*/
|
|
540
|
-
static fromInitialConfig<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(options: ExecutionOptions, initialConfig: TResolvedConfig["initialConfig"]): Promise<PowerlinesExecutionContext<TResolvedConfig>>;
|
|
541
|
-
/**
|
|
542
|
-
* Create a new Storm context from the workspace root and user config.
|
|
543
|
-
*
|
|
544
|
-
* @param options - The options for resolving the context.
|
|
545
|
-
* @returns A promise that resolves to the new context.
|
|
546
|
-
*/
|
|
547
|
-
static fromInlineConfig<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(options: ExecutionOptions, initialConfig: TResolvedConfig["initialConfig"], inlineConfig: TResolvedConfig["inlineConfig"]): Promise<PowerlinesExecutionContext<TResolvedConfig>>;
|
|
548
|
-
/**
|
|
549
|
-
* Internal context fields and methods
|
|
550
|
-
*
|
|
551
|
-
* @danger
|
|
552
|
-
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
553
|
-
*
|
|
554
|
-
* @internal
|
|
555
|
-
*/
|
|
556
|
-
get $$internal(): Unstable_ContextInternal<TResolvedConfig>;
|
|
557
|
-
/**
|
|
558
|
-
* Internal context fields and methods
|
|
559
|
-
*
|
|
560
|
-
* @danger
|
|
561
|
-
* This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
|
|
562
|
-
*
|
|
563
|
-
* @internal
|
|
564
|
-
*/
|
|
565
|
-
set $$internal(value: Unstable_ContextInternal<TResolvedConfig>);
|
|
566
|
-
/**
|
|
567
|
-
* The unique identifier of the execution context, which can be used for logging and other purposes to distinguish between different executions in the same process.
|
|
568
|
-
*/
|
|
569
|
-
get id(): string;
|
|
570
|
-
/**
|
|
571
|
-
* A record of all environments by name
|
|
572
|
-
*/
|
|
573
|
-
get environments(): Record<string, Unstable_EnvironmentContext<TResolvedConfig>>;
|
|
574
|
-
get plugins(): Array<Plugin<PluginContext<TResolvedConfig>>>;
|
|
575
|
-
/**
|
|
576
|
-
* Creates a new instance.
|
|
577
|
-
*
|
|
578
|
-
* @param options - The options to use for creating the context, including the resolved configuration and workspace settings.
|
|
579
|
-
* @param initialConfig - The initial configuration options to use for the context, which can be used to provide default values for configuration options that may be overridden by user configuration or inline configuration. This is typically the configuration options provided by the user in a configuration file on disk, and can include any relevant settings such as environment definitions, plugin configurations, and other parameters that may be relevant to the execution of a Powerlines command.
|
|
580
|
-
*/
|
|
581
|
-
protected constructor(options: ExecutionOptions, initialConfig?: TResolvedConfig["initialConfig"]);
|
|
582
|
-
/**
|
|
583
|
-
* A setter function to populate the inline 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 inline configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any inline configuration provided during execution.
|
|
584
|
-
*
|
|
585
|
-
* @param config - The inline configuration values to set.
|
|
586
|
-
* @returns A promise that resolves when the inline configuration values have been set.
|
|
587
|
-
*/
|
|
588
|
-
setInlineConfig(config: TResolvedConfig["inlineConfig"]): Promise<void>;
|
|
589
|
-
/**
|
|
590
|
-
* Create a new logger instance
|
|
591
|
-
*
|
|
592
|
-
* @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.
|
|
593
|
-
* @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.
|
|
594
|
-
* @returns A logger client instance that can be used to generate log messages with consistent formatting and metadata.
|
|
595
|
-
*/
|
|
596
|
-
createLogger(options: LoggerOptions, logFn?: LogFn): Logger;
|
|
597
|
-
/**
|
|
598
|
-
* Extend the base logger with additional configuration options
|
|
599
|
-
*
|
|
600
|
-
* @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.
|
|
601
|
-
* @returns A new logger client instance that extends the base logger with the provided configuration options.
|
|
602
|
-
*/
|
|
603
|
-
extendLogger(options: LoggerOptions): Logger;
|
|
604
|
-
/**
|
|
605
|
-
* A function to copy the context and update the fields for a specific environment
|
|
606
|
-
*
|
|
607
|
-
* @param environment - The environment configuration to use.
|
|
608
|
-
* @returns A new context instance with the updated environment.
|
|
609
|
-
*/
|
|
610
|
-
createEnvironment(environment: EnvironmentResolvedConfig<TResolvedConfig>["environment"]): Promise<Unstable_EnvironmentContext<TResolvedConfig>>;
|
|
611
|
-
/**
|
|
612
|
-
* Update the context using a new inline configuration options
|
|
613
|
-
*/
|
|
614
|
-
resolveConfig(): Promise<void>;
|
|
615
|
-
/**
|
|
616
|
-
* Add a plugin to the API context and all environments
|
|
617
|
-
*
|
|
618
|
-
* @param plugin - The plugin to add.
|
|
619
|
-
*/
|
|
620
|
-
addPlugin(plugin: Plugin<PluginContext<TResolvedConfig>>): Promise<void>;
|
|
621
|
-
/**
|
|
622
|
-
* Get an environment by name, or the default environment if no name is provided
|
|
623
|
-
*
|
|
624
|
-
* @param name - The name of the environment to retrieve.
|
|
625
|
-
* @returns The requested environment context.
|
|
626
|
-
*/
|
|
627
|
-
getEnvironment(name?: string): Promise<EnvironmentContext<TResolvedConfig>>;
|
|
628
|
-
/**
|
|
629
|
-
* A safe version of `getEnvironment` that returns `undefined` if the environment is not found
|
|
630
|
-
*
|
|
631
|
-
* @param name - The name of the environment to retrieve.
|
|
632
|
-
* @returns The requested environment context or `undefined` if not found.
|
|
633
|
-
*/
|
|
634
|
-
getEnvironmentSafe(name?: string): Promise<EnvironmentContext<TResolvedConfig> | undefined>;
|
|
635
|
-
/**
|
|
636
|
-
* A function to merge all configured environments into a single context.
|
|
637
|
-
*
|
|
638
|
-
* @remarks
|
|
639
|
-
* If only one environment is configured, that environment will be returned directly.
|
|
640
|
-
*
|
|
641
|
-
* @returns A promise that resolves to a merged/global environment context.
|
|
642
|
-
*/
|
|
643
|
-
toEnvironment(): Promise<EnvironmentContext<TResolvedConfig>>;
|
|
644
|
-
}
|
|
645
|
-
//#endregion
|
|
646
|
-
export { PowerlinesContext as n, PowerlinesBaseContext as r, PowerlinesExecutionContext as t };
|
|
647
|
-
//# sourceMappingURL=execution-context-YrjFeD9k.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"execution-context-YrjFeD9k.d.mts","names":[],"sources":["../src/context/base-context.ts","../src/context/context.ts","../src/context/execution-context.ts"],"mappings":";;;;;;;;;;;cA6Da,qBAAA,YAAiC,WAAA;EAAA;;;;EAMrC,cAA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