@powerlines/engine 0.43.30 → 0.43.31
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/_internal/worker.cjs +112 -42
- package/dist/_internal/worker.mjs +112 -42
- package/dist/_internal/worker.mjs.map +1 -1
- package/dist/api.cjs +9 -7
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +9 -7
- package/dist/api.mjs.map +1 -1
- package/dist/{base-context-B9AROf66.cjs → base-context-CPoqO4io.cjs} +9 -8
- package/dist/{base-context-D8a2XGIK.mjs → base-context-SmQ6OfXm.mjs} +10 -9
- package/dist/base-context-SmQ6OfXm.mjs.map +1 -0
- package/dist/context/index.cjs +3 -3
- package/dist/context/index.d.cts +37 -20
- package/dist/context/index.d.cts.map +1 -1
- package/dist/context/index.d.mts +37 -20
- package/dist/context/index.d.mts.map +1 -1
- package/dist/context/index.mjs +3 -3
- package/dist/{engine-context-qCVw66U_.cjs → engine-context-CEu21ZZf.cjs} +36 -10
- package/dist/{engine-context-DsA9XGVb.mjs → engine-context-D7CWyTsr.mjs} +36 -11
- package/dist/engine-context-D7CWyTsr.mjs.map +1 -0
- package/dist/{execution-context-CBJxP2B2.mjs → execution-context-C_7IC8er.mjs} +110 -40
- package/dist/execution-context-C_7IC8er.mjs.map +1 -0
- package/dist/{execution-context-CprxWvYn.cjs → execution-context-DsT6s1du.cjs} +108 -38
- package/dist/index.cjs +135 -54
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +135 -54
- package/dist/index.mjs.map +1 -1
- package/dist/storage/index.cjs +1 -1
- package/dist/storage/index.d.mts +1 -1
- package/dist/storage/index.mjs +1 -1
- package/dist/typescript/index.d.mts +1 -1
- package/dist/{virtual-BNdKVkRw.cjs → virtual-1hYa9zCy.cjs} +1 -1
- package/dist/{virtual-gIlTc3Lj.mjs → virtual-CUgOdyIa.mjs} +2 -2
- package/dist/{virtual-gIlTc3Lj.mjs.map → virtual-CUgOdyIa.mjs.map} +1 -1
- package/package.json +3 -3
- package/dist/base-context-D8a2XGIK.mjs.map +0 -1
- package/dist/engine-context-DsA9XGVb.mjs.map +0 -1
- package/dist/execution-context-CBJxP2B2.mjs.map +0 -1
|
@@ -7,6 +7,7 @@ let _powerlines_core_lib_logger = require("@powerlines/core/lib/logger");
|
|
|
7
7
|
let _stryke_env_get_env_paths = require("@stryke/env/get-env-paths");
|
|
8
8
|
let _stryke_json_storm_json = require("@stryke/json/storm-json");
|
|
9
9
|
let _stryke_path_is_equal = require("@stryke/path/is-equal");
|
|
10
|
+
let _stryke_path_replace = require("@stryke/path/replace");
|
|
10
11
|
let _stryke_type_checks_is_null = require("@stryke/type-checks/is-null");
|
|
11
12
|
let chalk = require("chalk");
|
|
12
13
|
chalk = require_chunk.__toESM(chalk, 1);
|
|
@@ -185,23 +186,23 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
185
186
|
/**
|
|
186
187
|
* Create a new logger instance
|
|
187
188
|
*
|
|
188
|
-
* @param
|
|
189
|
+
* @param source - The source name to use for the logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.
|
|
189
190
|
* @returns A logger function
|
|
190
191
|
*/
|
|
191
|
-
createLog(
|
|
192
|
-
return (0, _powerlines_core_lib_logger.createLog)(
|
|
192
|
+
createLog(source = null) {
|
|
193
|
+
return (0, _powerlines_core_lib_logger.createLog)(source, {
|
|
193
194
|
...this.options,
|
|
194
195
|
logLevel: (0, _stryke_type_checks_is_null.isNull)(this.logLevel) ? "silent" : this.logLevel
|
|
195
196
|
});
|
|
196
197
|
}
|
|
197
198
|
/**
|
|
198
|
-
* Extend the current logger instance with a new
|
|
199
|
+
* Extend the current logger instance with a new source
|
|
199
200
|
*
|
|
200
|
-
* @param
|
|
201
|
+
* @param source - The source name to use for the extended logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.
|
|
201
202
|
* @returns A logger function
|
|
202
203
|
*/
|
|
203
|
-
extendLog(
|
|
204
|
-
return (0, _powerlines_core_lib_logger.extendLog)(this.log,
|
|
204
|
+
extendLog(source) {
|
|
205
|
+
return (0, _powerlines_core_lib_logger.extendLog)(this.log, source);
|
|
205
206
|
}
|
|
206
207
|
/**
|
|
207
208
|
* A logger function specific to this context
|
|
@@ -223,7 +224,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
223
224
|
this.powerlinesPath = powerlinesPath;
|
|
224
225
|
}
|
|
225
226
|
const cwd = options.cwd || this.options?.cwd || process.cwd();
|
|
226
|
-
const root = (options.root || this.options?.root) && (options.root || this.options.root).replace(/^\.\/?/, "") && !(0, _stryke_path_is_equal.isEqual)(options.root || this.options.root, cwd) ? options.root || this.options.root : ".";
|
|
227
|
+
const root = (0, _stryke_path_replace.replacePath)((options.root || this.options?.root) && (options.root || this.options.root).replace(/^\.\/?/, "") && !(0, _stryke_path_is_equal.isEqual)(options.root || this.options.root, cwd) ? options.root || this.options.root : ".", cwd);
|
|
227
228
|
this.options = (0, defu.default)({
|
|
228
229
|
root,
|
|
229
230
|
cwd,
|
|
@@ -6,6 +6,7 @@ import { createLog, extendLog } from "@powerlines/core/lib/logger";
|
|
|
6
6
|
import { getEnvPaths } from "@stryke/env/get-env-paths";
|
|
7
7
|
import { StormJSON } from "@stryke/json/storm-json";
|
|
8
8
|
import { isEqual } from "@stryke/path/is-equal";
|
|
9
|
+
import { replacePath } from "@stryke/path/replace";
|
|
9
10
|
import { isNull } from "@stryke/type-checks/is-null";
|
|
10
11
|
import chalk from "chalk";
|
|
11
12
|
import { formatDistanceToNowStrict } from "date-fns/formatDistanceToNowStrict";
|
|
@@ -182,23 +183,23 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
182
183
|
/**
|
|
183
184
|
* Create a new logger instance
|
|
184
185
|
*
|
|
185
|
-
* @param
|
|
186
|
+
* @param source - The source name to use for the logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.
|
|
186
187
|
* @returns A logger function
|
|
187
188
|
*/
|
|
188
|
-
createLog(
|
|
189
|
-
return createLog(
|
|
189
|
+
createLog(source = null) {
|
|
190
|
+
return createLog(source, {
|
|
190
191
|
...this.options,
|
|
191
192
|
logLevel: isNull(this.logLevel) ? "silent" : this.logLevel
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
195
|
/**
|
|
195
|
-
* Extend the current logger instance with a new
|
|
196
|
+
* Extend the current logger instance with a new source
|
|
196
197
|
*
|
|
197
|
-
* @param
|
|
198
|
+
* @param source - The source name to use for the extended logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.
|
|
198
199
|
* @returns A logger function
|
|
199
200
|
*/
|
|
200
|
-
extendLog(
|
|
201
|
-
return extendLog(this.log,
|
|
201
|
+
extendLog(source) {
|
|
202
|
+
return extendLog(this.log, source);
|
|
202
203
|
}
|
|
203
204
|
/**
|
|
204
205
|
* A logger function specific to this context
|
|
@@ -220,7 +221,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
220
221
|
this.powerlinesPath = powerlinesPath;
|
|
221
222
|
}
|
|
222
223
|
const cwd = options.cwd || this.options?.cwd || process.cwd();
|
|
223
|
-
const root = (options.root || this.options?.root) && (options.root || this.options.root).replace(/^\.\/?/, "") && !isEqual(options.root || this.options.root, cwd) ? options.root || this.options.root : ".";
|
|
224
|
+
const root = replacePath((options.root || this.options?.root) && (options.root || this.options.root).replace(/^\.\/?/, "") && !isEqual(options.root || this.options.root, cwd) ? options.root || this.options.root : ".", cwd);
|
|
224
225
|
this.options = defu({
|
|
225
226
|
root,
|
|
226
227
|
cwd,
|
|
@@ -245,4 +246,4 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
245
246
|
|
|
246
247
|
//#endregion
|
|
247
248
|
export { PowerlinesBaseContext as t };
|
|
248
|
-
//# sourceMappingURL=base-context-
|
|
249
|
+
//# sourceMappingURL=base-context-SmQ6OfXm.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-context-SmQ6OfXm.mjs","names":["#timestamp","#logLevel"],"sources":["../src/_internal/helpers/resolver.ts","../src/context/base-context.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ResolvedConfig, Resolver } from \"@powerlines/core\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { JitiOptions, createJiti } from \"jiti\";\n\nexport type CreateResolverOptions = Omit<\n JitiOptions,\n \"fsCache\" | \"moduleCache\" | \"interopDefault\"\n> &\n Pick<ResolvedConfig, \"mode\" | \"logLevel\" | \"skipCache\"> & {\n workspaceRoot: string;\n root: string;\n cacheDir: string;\n };\n\n/**\n * Create a Jiti resolver for the given workspace and project root.\n *\n * @param options - The options for creating the resolver.\n * @returns A Jiti instance configured for the specified workspace and project root.\n */\nfunction resolveOptions(options: CreateResolverOptions): JitiOptions {\n return defu(options, {\n interopDefault: true,\n fsCache:\n options.mode !== \"development\"\n ? joinPaths(options.cacheDir, \"jiti\")\n : false,\n moduleCache: options.mode !== \"development\"\n });\n}\n\n/**\n * Create a Jiti resolver for the given workspace and project root.\n *\n * @param options - The options for creating the resolver.\n * @returns A Jiti instance configured for the specified workspace and project root.\n */\nexport function createResolver(options: CreateResolverOptions): Resolver {\n const baseResolver = createJiti(\n joinPaths(options.workspaceRoot, options.root),\n resolveOptions(options)\n ) as Resolver;\n baseResolver.plugin = createJiti(\n joinPaths(options.workspaceRoot, options.root),\n resolveOptions(options)\n );\n\n return baseResolver;\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type {\n BaseContext,\n EngineOptions,\n LogFn,\n Logger,\n LogLevel,\n ParsedUserConfig,\n ResolvedEngineOptions,\n Resolver\n} from \"@powerlines/core\";\nimport { loadUserConfigFile } from \"@powerlines/core/lib/config\";\nimport { createLog, extendLog } from \"@powerlines/core/lib/logger\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { EnvPaths, getEnvPaths } from \"@stryke/env/get-env-paths\";\nimport { resolvePackage } from \"@stryke/fs/resolve\";\nimport { StormJSON } from \"@stryke/json/storm-json\";\nimport { isEqual } from \"@stryke/path/is-equal\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { isNull } from \"@stryke/type-checks/is-null\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport chalk from \"chalk\";\nimport { formatDistanceToNowStrict } from \"date-fns/formatDistanceToNowStrict\";\nimport defu from \"defu\";\nimport { UnpluginMessage } from \"unplugin\";\nimport { createResolver } from \"../_internal/helpers/resolver\";\n\nexport class PowerlinesBaseContext implements BaseContext {\n #timestamp: number = Date.now();\n\n #logLevel: LogLevel | null = \"info\";\n\n /**\n * The path to the Powerlines package\n */\n public powerlinesPath!: string;\n\n /**\n * The module resolver for the project\n */\n public resolver!: Resolver;\n\n /**\n * The options provided to the Powerlines process\n */\n public options!: ResolvedEngineOptions;\n\n /**\n * 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\n */\n public inputOptions: Partial<EngineOptions> = {};\n\n /**\n * The parsed configuration file for the project\n */\n public configFile!: ParsedUserConfig;\n\n /**\n * A timestamp representing when the context was initialized\n */\n public get timestamp(): Date {\n return new Date(this.#timestamp);\n }\n\n public get logLevel(): LogLevel | null {\n return this.#logLevel || \"info\";\n }\n\n public set logLevel(level: LogLevel | null) {\n this.#logLevel = level;\n }\n\n /**\n * The logger function\n */\n public get log(): LogFn {\n const level = this.logLevel || \"info\";\n if (!this.logger || this.logger.level !== level) {\n this.logger = {\n log: this.createLog(),\n level\n };\n }\n\n return this.logger.log;\n }\n\n /**\n * The environment paths for the project\n */\n public get envPaths(): EnvPaths {\n return getEnvPaths({\n orgId: this.options.organization,\n appId: this.options.framework || \"powerlines\",\n workspaceRoot: this.options.cwd\n });\n }\n\n /**\n * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.\n *\n * @remarks\n * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.\n *\n * @returns A promise that resolves to the cloned context.\n */\n public async clone(): Promise<BaseContext> {\n const clone = new PowerlinesBaseContext();\n await clone.init(this.options);\n\n return clone;\n }\n\n /**\n * A logging function for fatal messages\n *\n * @param message - The message to log.\n */\n public fatal(message: string | UnpluginMessage) {\n this.log(\n LogLevelLabel.FATAL,\n isString(message) ? message : StormJSON.stringify(message)\n );\n }\n\n /**\n * A logging function for error messages\n *\n * @param message - The message to log.\n */\n public error(message: string | UnpluginMessage) {\n this.log(\n LogLevelLabel.ERROR,\n isString(message) ? message : StormJSON.stringify(message)\n );\n }\n\n /**\n * A logging function for warning messages\n *\n * @param message - The message to log.\n */\n public warn(message: string | UnpluginMessage) {\n this.log(\n LogLevelLabel.WARN,\n isString(message) ? message : StormJSON.stringify(message)\n );\n }\n\n /**\n * A logging function for informational messages\n *\n * @param message - The message to log.\n */\n public info(message: string | UnpluginMessage) {\n this.log(\n LogLevelLabel.INFO,\n isString(message) ? message : StormJSON.stringify(message)\n );\n }\n\n /**\n * A logging function for debug messages\n *\n * @param message - The message to log.\n */\n public debug(message: string | UnpluginMessage) {\n this.log(\n LogLevelLabel.DEBUG,\n isString(message) ? message : StormJSON.stringify(message)\n );\n }\n\n /**\n * A logging function for trace messages\n *\n * @param message - The message to log.\n */\n public trace(message: string | UnpluginMessage) {\n this.log(\n LogLevelLabel.TRACE,\n isString(message) ? message : StormJSON.stringify(message)\n );\n }\n\n /**\n * A function to create a timer for measuring the duration of asynchronous operations\n *\n * @example\n * ```ts\n * const stopTimer = context.timer(\"Your Async Operation\");\n * await performAsyncOperation();\n * stopTimer(); // \"Your Async Operation completed in 123.45 milliseconds\"\n * ```\n *\n * @param name - The name of the timer.\n * @returns A function that, when called, stops the timer and logs the duration.\n */\n public timer(name: string): () => void {\n const startDate = Date.now();\n const startDuration = performance.now();\n\n return () => {\n const duration = performance.now() - startDuration;\n this.log(\n LogLevelLabel.PERFORMANCE,\n `${chalk.bold.cyanBright(name)} completed in ${chalk.bold.cyanBright(\n duration < 1000\n ? `${duration.toFixed(2)} milliseconds`\n : formatDistanceToNowStrict(startDate)\n )}`\n );\n };\n }\n\n /**\n * Create a new logger instance\n *\n * @param source - The source name to use for the logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.\n * @returns A logger function\n */\n public createLog(source: string | null = null): LogFn {\n return createLog(source, {\n ...this.options,\n logLevel: isNull(this.logLevel) ? \"silent\" : this.logLevel\n });\n }\n\n /**\n * Extend the current logger instance with a new source\n *\n * @param source - The source name to use for the extended logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.\n * @returns A logger function\n */\n public extendLog(source: string): LogFn {\n return extendLog(this.log, source);\n }\n\n /**\n * A logger function specific to this context\n */\n protected logger!: Logger;\n\n /**\n * Initialize the context with the provided configuration options\n *\n * @remarks\n * 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.\n *\n * @param options - The configuration options to initialize the context with\n */\n protected async init(options: Partial<EngineOptions> = {}) {\n this.inputOptions = options;\n\n if (!this.powerlinesPath) {\n const powerlinesPath = await resolvePackage(\"powerlines\");\n if (!powerlinesPath) {\n throw new Error(\"Could not resolve `powerlines` package location.\");\n }\n this.powerlinesPath = powerlinesPath;\n }\n\n const cwd = options.cwd || this.options?.cwd || process.cwd();\n const root = replacePath(\n (options.root || this.options?.root) &&\n (options.root || this.options.root).replace(/^\\.\\/?/, \"\") &&\n !isEqual(options.root || this.options.root, cwd)\n ? options.root || this.options.root\n : \".\",\n cwd\n );\n\n this.options = defu(\n {\n root,\n cwd,\n mode: options.mode,\n framework: options.framework,\n organization: options.organization,\n configFile: options.configFile\n },\n this.options ?? {},\n {\n mode: \"production\",\n framework: \"powerlines\"\n }\n ) as ResolvedEngineOptions;\n\n this.resolver = createResolver({\n workspaceRoot: cwd,\n root,\n cacheDir: this.envPaths.cache,\n mode: this.options.mode,\n logLevel: this.logLevel\n });\n\n this.configFile = await loadUserConfigFile(this.options, this.resolver);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuCA,SAAS,eAAe,SAA6C;AACnE,QAAO,KAAK,SAAS;EACnB,gBAAgB;EAChB,SACE,QAAQ,SAAS,gBACb,UAAU,QAAQ,UAAU,OAAO,GACnC;EACN,aAAa,QAAQ,SAAS;EAC/B,CAAC;;;;;;;;AASJ,SAAgB,eAAe,SAA0C;CACvE,MAAM,eAAe,WACnB,UAAU,QAAQ,eAAe,QAAQ,KAAK,EAC9C,eAAe,QAAQ,CACxB;AACD,cAAa,SAAS,WACpB,UAAU,QAAQ,eAAe,QAAQ,KAAK,EAC9C,eAAe,QAAQ,CACxB;AAED,QAAO;;;;;ACtBT,IAAa,wBAAb,MAAa,sB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AAK,UAAU,KACb;GACE;GACA;GACA,MAAM,QAAQ;GACd,WAAW,QAAQ;GACnB,cAAc,QAAQ;GACtB,YAAY,QAAQ;GACrB,EACD,KAAK,WAAW,EAAE,EAClB;GACE,MAAM;GACN,WAAW;GACZ,CACF;AAED,OAAK,WAAW,eAAe;GAC7B,eAAe;GACf;GACA,UAAU,KAAK,SAAS;GACxB,MAAM,KAAK,QAAQ;GACnB,UAAU,KAAK;GAChB,CAAC;AAEF,OAAK,aAAa,MAAM,mBAAmB,KAAK,SAAS,KAAK,SAAS"}
|
package/dist/context/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_base_context = require('../base-context-
|
|
3
|
-
const require_engine_context = require('../engine-context-
|
|
4
|
-
const require_execution_context = require('../execution-context-
|
|
2
|
+
const require_base_context = require('../base-context-CPoqO4io.cjs');
|
|
3
|
+
const require_engine_context = require('../engine-context-CEu21ZZf.cjs');
|
|
4
|
+
const require_execution_context = require('../execution-context-DsT6s1du.cjs');
|
|
5
5
|
|
|
6
6
|
exports.PowerlinesBaseContext = require_base_context.PowerlinesBaseContext;
|
|
7
7
|
exports.PowerlinesContext = require_execution_context.PowerlinesContext;
|
package/dist/context/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseContext, Context, EmitEntryOptions, EmitOptions, EngineContext, EngineOptions, EnvironmentContext, EnvironmentContextPlugin, EnvironmentResolvedConfig, ExecutionContext, ExecutionOptions, FetchOptions, HooksList, InlineConfig, LogFn, LogLevel, Logger, MetaInfo, ParseOptions, ParsedTypeScriptConfig, ParsedUserConfig, Plugin, PluginContext, ResolveOptions, ResolveResult, ResolvedConfig, ResolvedEngineOptions, ResolvedEntryTypeDefinition, ResolvedExecutionOptions, Resolver, SelectHookResult, SelectHooksOptions, TransformResult, VirtualFile, VirtualFileSystemInterface } from "@powerlines/core";
|
|
1
|
+
import { BaseContext, Context, EmitEntryOptions, EmitOptions, EngineContext, EngineOptions, EnvironmentContext, EnvironmentContextPlugin, EnvironmentResolvedConfig, ExecutionContext, ExecutionOptions, ExecutionState, FetchOptions, HooksList, InlineConfig, LogFn, LogLevel, Logger, MetaInfo, ParseOptions, ParsedTypeScriptConfig, ParsedUserConfig, Plugin, PluginContext, ResolveOptions, ResolveResult, ResolvedConfig, ResolvedEngineOptions, ResolvedEntryTypeDefinition, ResolvedExecutionOptions, Resolver, SelectHookResult, SelectHooksOptions, TransformResult, VirtualFile, VirtualFileSystemInterface } from "@powerlines/core";
|
|
2
2
|
import { EnvPaths } from "@stryke/env/get-env-paths";
|
|
3
3
|
import { UnpluginMessage } from "unplugin";
|
|
4
4
|
import { Unstable_ContextInternal, Unstable_EnvironmentContext, Unstable_PluginContext } from "@powerlines/core/types/_internal";
|
|
@@ -107,17 +107,17 @@ declare class PowerlinesBaseContext implements BaseContext {
|
|
|
107
107
|
/**
|
|
108
108
|
* Create a new logger instance
|
|
109
109
|
*
|
|
110
|
-
* @param
|
|
110
|
+
* @param source - The source name to use for the logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.
|
|
111
111
|
* @returns A logger function
|
|
112
112
|
*/
|
|
113
|
-
createLog(
|
|
113
|
+
createLog(source?: string | null): LogFn;
|
|
114
114
|
/**
|
|
115
|
-
* Extend the current logger instance with a new
|
|
115
|
+
* Extend the current logger instance with a new source
|
|
116
116
|
*
|
|
117
|
-
* @param
|
|
117
|
+
* @param source - The source name to use for the extended logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.
|
|
118
118
|
* @returns A logger function
|
|
119
119
|
*/
|
|
120
|
-
extendLog(
|
|
120
|
+
extendLog(source: string): LogFn;
|
|
121
121
|
/**
|
|
122
122
|
* A logger function specific to this context
|
|
123
123
|
*/
|
|
@@ -291,13 +291,6 @@ declare class PowerlinesContext<TResolvedConfig extends ResolvedConfig = Resolve
|
|
|
291
291
|
* @returns A promise that resolves to the cloned context.
|
|
292
292
|
*/
|
|
293
293
|
clone(): Promise<Context<TResolvedConfig>>;
|
|
294
|
-
/**
|
|
295
|
-
* Create a new logger instance
|
|
296
|
-
*
|
|
297
|
-
* @param name - The name to use for the logger instance
|
|
298
|
-
* @returns A logger function
|
|
299
|
-
*/
|
|
300
|
-
createLog(name?: string | null): LogFn;
|
|
301
294
|
/**
|
|
302
295
|
* A function to perform HTTP fetch requests
|
|
303
296
|
*
|
|
@@ -488,9 +481,9 @@ declare class PowerlinesEngineContext extends PowerlinesBaseContext implements E
|
|
|
488
481
|
/**
|
|
489
482
|
* A list of all command executions that will be run during the lifecycle of the engine
|
|
490
483
|
*
|
|
491
|
-
* @returns An array of
|
|
484
|
+
* @returns An array of {@link ExecutionState} representing each execution context for the engine.
|
|
492
485
|
*/
|
|
493
|
-
get executions():
|
|
486
|
+
get executions(): ExecutionState[];
|
|
494
487
|
}
|
|
495
488
|
//#endregion
|
|
496
489
|
//#region src/context/environment-context.d.ts
|
|
@@ -512,17 +505,29 @@ declare class PowerlinesEnvironmentContext<TResolvedConfig extends ResolvedConfi
|
|
|
512
505
|
* The list of plugins applied to this environment
|
|
513
506
|
*/
|
|
514
507
|
plugins: EnvironmentContextPlugin<TResolvedConfig>[];
|
|
508
|
+
/**
|
|
509
|
+
* 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.
|
|
510
|
+
*/
|
|
511
|
+
get id(): string;
|
|
512
|
+
/**
|
|
513
|
+
* The hooks registered by plugins in this environment
|
|
514
|
+
*/
|
|
515
|
+
get hooks(): Record<string, HooksList<PluginContext<TResolvedConfig>>>;
|
|
515
516
|
/**
|
|
516
517
|
* Create a new logger instance
|
|
517
518
|
*
|
|
518
|
-
* @param
|
|
519
|
+
* @param source - The source name to use for the logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.
|
|
519
520
|
* @returns A logger function
|
|
520
521
|
*/
|
|
521
|
-
createLog(
|
|
522
|
+
createLog(source?: string | null): LogFn;
|
|
522
523
|
/**
|
|
523
|
-
*
|
|
524
|
+
* Extend the current logger instance with a new name
|
|
525
|
+
*
|
|
526
|
+
* @param source - The name of the source to use for the extended logger instance
|
|
527
|
+
* @param plugin - An optional plugin name to use for the extended logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.
|
|
528
|
+
* @returns A logger function
|
|
524
529
|
*/
|
|
525
|
-
|
|
530
|
+
extendLog(source: string, plugin?: string): LogFn;
|
|
526
531
|
/**
|
|
527
532
|
* Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
|
|
528
533
|
*
|
|
@@ -588,6 +593,10 @@ declare class PowerlinesExecutionContext<TResolvedConfig extends ResolvedConfig
|
|
|
588
593
|
* @internal
|
|
589
594
|
*/
|
|
590
595
|
set $$internal(value: Unstable_ContextInternal<TResolvedConfig>);
|
|
596
|
+
/**
|
|
597
|
+
* 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.
|
|
598
|
+
*/
|
|
599
|
+
get id(): string;
|
|
591
600
|
/**
|
|
592
601
|
* A record of all environments by name
|
|
593
602
|
*/
|
|
@@ -599,6 +608,13 @@ declare class PowerlinesExecutionContext<TResolvedConfig extends ResolvedConfig
|
|
|
599
608
|
* @param options - The options to use for creating the context, including the resolved configuration and workspace settings.
|
|
600
609
|
*/
|
|
601
610
|
protected constructor(options: ResolvedExecutionOptions);
|
|
611
|
+
/**
|
|
612
|
+
* Create a new logger instance
|
|
613
|
+
*
|
|
614
|
+
* @param source - The source name to use for the logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.
|
|
615
|
+
* @returns A logger function
|
|
616
|
+
*/
|
|
617
|
+
createLog(source?: string | null): LogFn;
|
|
602
618
|
/**
|
|
603
619
|
* Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
|
|
604
620
|
*
|
|
@@ -654,11 +670,12 @@ declare class PowerlinesExecutionContext<TResolvedConfig extends ResolvedConfig
|
|
|
654
670
|
/**
|
|
655
671
|
* Create a Proxy-based PluginContext
|
|
656
672
|
*
|
|
673
|
+
* @param pluginId - The unique identifier of the plugin
|
|
657
674
|
* @param plugin - The plugin instance
|
|
658
675
|
* @param environment - The environment context
|
|
659
676
|
* @returns The proxied plugin context
|
|
660
677
|
*/
|
|
661
|
-
declare function createPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(plugin: Plugin<PluginContext<TResolvedConfig>>, environment: Unstable_EnvironmentContext<TResolvedConfig>): Unstable_PluginContext<TResolvedConfig>;
|
|
678
|
+
declare function createPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(pluginId: string, plugin: Plugin<PluginContext<TResolvedConfig>>, environment: Unstable_EnvironmentContext<TResolvedConfig>): Unstable_PluginContext<TResolvedConfig>;
|
|
662
679
|
//#endregion
|
|
663
680
|
export { PowerlinesBaseContext, PowerlinesContext, PowerlinesEngineContext, PowerlinesEnvironmentContext, PowerlinesExecutionContext, createPluginContext };
|
|
664
681
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/context/base-context.ts","../../src/context/context.ts","../../src/context/engine-context.ts","../../src/context/environment-context.ts","../../src/context/execution-context.ts","../../src/context/plugin-context.ts"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/context/base-context.ts","../../src/context/context.ts","../../src/context/engine-context.ts","../../src/context/environment-context.ts","../../src/context/execution-context.ts","../../src/context/plugin-context.ts"],"mappings":";;;;;;;;;;;cA4Ca,qBAAA,YAAiC,WAAA;EAAA;;;;EAQrC,cAAA;;;AART;EAaS,QAAA,EAAW,QAAA;;;;EAKX,O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I8HE,WAAA,CAAa,OAAA,EAAS,wBAAA;EJpHX;;;;;;EI8HJ,SAAA,CAAU,MAAA,mBAA+B,KAAA;EJjHrC;;;;;;;;EIiJE,KAAA,CAAA,GAAS,OAAA,CAAQ,gBAAA,CAAiB,eAAA;EJ/FzB;;;;;;EIyHlB,EAAA,CACX,WAAA,EAAa,yBAAA,GACZ,OAAA,CAAQ,2BAAA,CAA4B,eAAA;EJnG3B;;;EI8HU,KAAA,CAAA,GAAK,OAAA;EJtGpB;;;;;EI4HM,SAAA,CAAU,MAAA,EAAQ,MAAA,CAAO,aAAA,CAAc,eAAA,KAAiB,OAAA;EJ5F9D;;;;;;EI4GM,cAAA,CAAe,IAAA,YAAa,OAAA,CAAA,kBAAA,CAAA,eAAA;EJxEP;;;;;;EI+GrB,kBAAA,CACX,IAAA,YACC,OAAA,CAAQ,kBAAA,CAAmB,eAAA;EJhG2B;;;;;;ACtI3D;;EGsPe,aAAA,CAAA,GAAiB,OAAA,CAAQ,kBAAA,CAAmB,eAAA;AAAA;;;;;;;;;;;iBChV3C,mBAAA,yBACU,cAAA,GAAiB,cAAA,CAAA,CAEzC,QAAA,UACA,MAAA,EAAQ,MAAA,CAAO,aAAA,CAAc,eAAA,IAC7B,WAAA,EAAa,2BAAA,CAA4B,eAAA,IACxC,sBAAA,CAAuB,eAAA"}
|
package/dist/context/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EnvPaths } from "@stryke/env/get-env-paths";
|
|
2
|
+
import { BaseContext, Context, EmitEntryOptions, EmitOptions, EngineContext, EngineOptions, EnvironmentContext, EnvironmentContextPlugin, EnvironmentResolvedConfig, ExecutionContext, ExecutionOptions, ExecutionState, FetchOptions, HooksList, InlineConfig, LogFn, LogLevel, Logger, MetaInfo, ParseOptions, ParsedTypeScriptConfig, ParsedUserConfig, Plugin, PluginContext, ResolveOptions, ResolveResult, ResolvedConfig, ResolvedEngineOptions, ResolvedEntryTypeDefinition, ResolvedExecutionOptions, Resolver, SelectHookResult, SelectHooksOptions, TransformResult, VirtualFile, VirtualFileSystemInterface } from "@powerlines/core";
|
|
2
3
|
import { FlatCache } from "flat-cache";
|
|
3
4
|
import { ParseResult } from "oxc-parser";
|
|
4
5
|
import { RequestInfo, Response } from "undici";
|
|
5
|
-
import { BaseContext, Context, EmitEntryOptions, EmitOptions, EngineContext, EngineOptions, EnvironmentContext, EnvironmentContextPlugin, EnvironmentResolvedConfig, ExecutionContext, ExecutionOptions, FetchOptions, HooksList, InlineConfig, LogFn, LogLevel, Logger, MetaInfo, ParseOptions, ParsedTypeScriptConfig, ParsedUserConfig, Plugin, PluginContext, ResolveOptions, ResolveResult, ResolvedConfig, ResolvedEngineOptions, ResolvedEntryTypeDefinition, ResolvedExecutionOptions, Resolver, SelectHookResult, SelectHooksOptions, TransformResult, VirtualFile, VirtualFileSystemInterface } from "@powerlines/core";
|
|
6
6
|
import { UnpluginMessage } from "unplugin";
|
|
7
7
|
import { Unstable_ContextInternal, Unstable_EnvironmentContext, Unstable_PluginContext } from "@powerlines/core/types/_internal";
|
|
8
8
|
import { PackageJson } from "@stryke/types/package-json";
|
|
@@ -107,17 +107,17 @@ declare class PowerlinesBaseContext implements BaseContext {
|
|
|
107
107
|
/**
|
|
108
108
|
* Create a new logger instance
|
|
109
109
|
*
|
|
110
|
-
* @param
|
|
110
|
+
* @param source - The source name to use for the logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.
|
|
111
111
|
* @returns A logger function
|
|
112
112
|
*/
|
|
113
|
-
createLog(
|
|
113
|
+
createLog(source?: string | null): LogFn;
|
|
114
114
|
/**
|
|
115
|
-
* Extend the current logger instance with a new
|
|
115
|
+
* Extend the current logger instance with a new source
|
|
116
116
|
*
|
|
117
|
-
* @param
|
|
117
|
+
* @param source - The source name to use for the extended logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.
|
|
118
118
|
* @returns A logger function
|
|
119
119
|
*/
|
|
120
|
-
extendLog(
|
|
120
|
+
extendLog(source: string): LogFn;
|
|
121
121
|
/**
|
|
122
122
|
* A logger function specific to this context
|
|
123
123
|
*/
|
|
@@ -291,13 +291,6 @@ declare class PowerlinesContext<TResolvedConfig extends ResolvedConfig = Resolve
|
|
|
291
291
|
* @returns A promise that resolves to the cloned context.
|
|
292
292
|
*/
|
|
293
293
|
clone(): Promise<Context<TResolvedConfig>>;
|
|
294
|
-
/**
|
|
295
|
-
* Create a new logger instance
|
|
296
|
-
*
|
|
297
|
-
* @param name - The name to use for the logger instance
|
|
298
|
-
* @returns A logger function
|
|
299
|
-
*/
|
|
300
|
-
createLog(name?: string | null): LogFn;
|
|
301
294
|
/**
|
|
302
295
|
* A function to perform HTTP fetch requests
|
|
303
296
|
*
|
|
@@ -488,9 +481,9 @@ declare class PowerlinesEngineContext extends PowerlinesBaseContext implements E
|
|
|
488
481
|
/**
|
|
489
482
|
* A list of all command executions that will be run during the lifecycle of the engine
|
|
490
483
|
*
|
|
491
|
-
* @returns An array of
|
|
484
|
+
* @returns An array of {@link ExecutionState} representing each execution context for the engine.
|
|
492
485
|
*/
|
|
493
|
-
get executions():
|
|
486
|
+
get executions(): ExecutionState[];
|
|
494
487
|
}
|
|
495
488
|
//#endregion
|
|
496
489
|
//#region src/context/environment-context.d.ts
|
|
@@ -512,17 +505,29 @@ declare class PowerlinesEnvironmentContext<TResolvedConfig extends ResolvedConfi
|
|
|
512
505
|
* The list of plugins applied to this environment
|
|
513
506
|
*/
|
|
514
507
|
plugins: EnvironmentContextPlugin<TResolvedConfig>[];
|
|
508
|
+
/**
|
|
509
|
+
* 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.
|
|
510
|
+
*/
|
|
511
|
+
get id(): string;
|
|
512
|
+
/**
|
|
513
|
+
* The hooks registered by plugins in this environment
|
|
514
|
+
*/
|
|
515
|
+
get hooks(): Record<string, HooksList<PluginContext<TResolvedConfig>>>;
|
|
515
516
|
/**
|
|
516
517
|
* Create a new logger instance
|
|
517
518
|
*
|
|
518
|
-
* @param
|
|
519
|
+
* @param source - The source name to use for the logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.
|
|
519
520
|
* @returns A logger function
|
|
520
521
|
*/
|
|
521
|
-
createLog(
|
|
522
|
+
createLog(source?: string | null): LogFn;
|
|
522
523
|
/**
|
|
523
|
-
*
|
|
524
|
+
* Extend the current logger instance with a new name
|
|
525
|
+
*
|
|
526
|
+
* @param source - The name of the source to use for the extended logger instance
|
|
527
|
+
* @param plugin - An optional plugin name to use for the extended logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.
|
|
528
|
+
* @returns A logger function
|
|
524
529
|
*/
|
|
525
|
-
|
|
530
|
+
extendLog(source: string, plugin?: string): LogFn;
|
|
526
531
|
/**
|
|
527
532
|
* Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
|
|
528
533
|
*
|
|
@@ -588,6 +593,10 @@ declare class PowerlinesExecutionContext<TResolvedConfig extends ResolvedConfig
|
|
|
588
593
|
* @internal
|
|
589
594
|
*/
|
|
590
595
|
set $$internal(value: Unstable_ContextInternal<TResolvedConfig>);
|
|
596
|
+
/**
|
|
597
|
+
* 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.
|
|
598
|
+
*/
|
|
599
|
+
get id(): string;
|
|
591
600
|
/**
|
|
592
601
|
* A record of all environments by name
|
|
593
602
|
*/
|
|
@@ -599,6 +608,13 @@ declare class PowerlinesExecutionContext<TResolvedConfig extends ResolvedConfig
|
|
|
599
608
|
* @param options - The options to use for creating the context, including the resolved configuration and workspace settings.
|
|
600
609
|
*/
|
|
601
610
|
protected constructor(options: ResolvedExecutionOptions);
|
|
611
|
+
/**
|
|
612
|
+
* Create a new logger instance
|
|
613
|
+
*
|
|
614
|
+
* @param source - The source name to use for the logger instance, which can be used to identify the origin of log messages in the logs for better traceability. This is typically the name of the plugin or module that is creating the logger instance.
|
|
615
|
+
* @returns A logger function
|
|
616
|
+
*/
|
|
617
|
+
createLog(source?: string | null): LogFn;
|
|
602
618
|
/**
|
|
603
619
|
* Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
|
|
604
620
|
*
|
|
@@ -654,11 +670,12 @@ declare class PowerlinesExecutionContext<TResolvedConfig extends ResolvedConfig
|
|
|
654
670
|
/**
|
|
655
671
|
* Create a Proxy-based PluginContext
|
|
656
672
|
*
|
|
673
|
+
* @param pluginId - The unique identifier of the plugin
|
|
657
674
|
* @param plugin - The plugin instance
|
|
658
675
|
* @param environment - The environment context
|
|
659
676
|
* @returns The proxied plugin context
|
|
660
677
|
*/
|
|
661
|
-
declare function createPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(plugin: Plugin<PluginContext<TResolvedConfig>>, environment: Unstable_EnvironmentContext<TResolvedConfig>): Unstable_PluginContext<TResolvedConfig>;
|
|
678
|
+
declare function createPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(pluginId: string, plugin: Plugin<PluginContext<TResolvedConfig>>, environment: Unstable_EnvironmentContext<TResolvedConfig>): Unstable_PluginContext<TResolvedConfig>;
|
|
662
679
|
//#endregion
|
|
663
680
|
export { PowerlinesBaseContext, PowerlinesContext, PowerlinesEngineContext, PowerlinesEnvironmentContext, PowerlinesExecutionContext, createPluginContext };
|
|
664
681
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/context/base-context.ts","../../src/context/context.ts","../../src/context/engine-context.ts","../../src/context/environment-context.ts","../../src/context/execution-context.ts","../../src/context/plugin-context.ts"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/context/base-context.ts","../../src/context/context.ts","../../src/context/eng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;EJzHiC;;;EAAA,IIgIjC,YAAA,CAAA,GAAgB,MAAA,SAEzB,2BAAA,CAA4B,eAAA;EAAA,IAKnB,OAAA,CAAA,GAAW,KAAA,CAAM,MAAA,CAAO,aAAA,CAAc,eAAA;EJrH1C;;;;;EAAA,UI8HE,WAAA,CAAa,OAAA,EAAS,wBAAA;EJpHX;;;;;;EI8HJ,SAAA,CAAU,MAAA,mBAA+B,KAAA;EJjHrC;;;;;;;;EIiJE,KAAA,CAAA,GAAS,OAAA,CAAQ,gBAAA,CAAiB,eAAA;EJ/FzB;;;;;;EIyHlB,EAAA,CACX,WAAA,EAAa,yBAAA,GACZ,OAAA,CAAQ,2BAAA,CAA4B,eAAA;EJnG3B;;;EI8HU,KAAA,CAAA,GAAK,OAAA;EJtGpB;;;;;EI4HM,SAAA,CAAU,MAAA,EAAQ,MAAA,CAAO,aAAA,CAAc,eAAA,KAAiB,OAAA;EJ5F9D;;;;;;EI4GM,cAAA,CAAe,IAAA,YAAa,OAAA,CAAA,kBAAA,CAAA,eAAA;EJxEP;;;;;;EI+GrB,kBAAA,CACX,IAAA,YACC,OAAA,CAAQ,kBAAA,CAAmB,eAAA;EJhG2B;;;;;;ACtI3D;;EGsPe,aAAA,CAAA,GAAiB,OAAA,CAAQ,kBAAA,CAAmB,eAAA;AAAA;;;;;;;;;;;iBChV3C,mBAAA,yBACU,cAAA,GAAiB,cAAA,CAAA,CAEzC,QAAA,UACA,MAAA,EAAQ,MAAA,CAAO,aAAA,CAAc,eAAA,IAC7B,WAAA,EAAa,2BAAA,CAA4B,eAAA,IACxC,sBAAA,CAAuB,eAAA"}
|
package/dist/context/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as PowerlinesBaseContext } from "../base-context-
|
|
2
|
-
import { t as PowerlinesEngineContext } from "../engine-context-
|
|
3
|
-
import { n as PowerlinesEnvironmentContext, o as PowerlinesContext, r as createPluginContext, t as PowerlinesExecutionContext } from "../execution-context-
|
|
1
|
+
import { t as PowerlinesBaseContext } from "../base-context-SmQ6OfXm.mjs";
|
|
2
|
+
import { t as PowerlinesEngineContext } from "../engine-context-D7CWyTsr.mjs";
|
|
3
|
+
import { n as PowerlinesEnvironmentContext, o as PowerlinesContext, r as createPluginContext, t as PowerlinesExecutionContext } from "../execution-context-C_7IC8er.mjs";
|
|
4
4
|
|
|
5
5
|
export { PowerlinesBaseContext, PowerlinesContext, PowerlinesEngineContext, PowerlinesEnvironmentContext, PowerlinesExecutionContext, createPluginContext };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_chunk = require('./chunk-C0xms8kb.cjs');
|
|
2
|
+
const require_base_context = require('./base-context-CPoqO4io.cjs');
|
|
3
|
+
let _stryke_unique_id_uuid = require("@stryke/unique-id/uuid");
|
|
2
4
|
|
|
3
5
|
//#region src/context/engine-context.ts
|
|
4
6
|
var PowerlinesEngineContext = class PowerlinesEngineContext extends require_base_context.PowerlinesBaseContext {
|
|
@@ -16,20 +18,44 @@ var PowerlinesEngineContext = class PowerlinesEngineContext extends require_base
|
|
|
16
18
|
context.fatal("No configuration file found. Please ensure you have a valid configuration file in your project.");
|
|
17
19
|
throw new Error("No configuration file found");
|
|
18
20
|
}
|
|
19
|
-
if (Array.isArray(context.configFile.config)) context.#executions = await Promise.all(context.configFile.config.map(async (_,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
if (Array.isArray(context.configFile.config)) context.#executions = await Promise.all(context.configFile.config.map(async (_, executionIndex) => {
|
|
22
|
+
const executionId = (0, _stryke_unique_id_uuid.uuid)();
|
|
23
|
+
return {
|
|
24
|
+
executionId,
|
|
25
|
+
options: {
|
|
26
|
+
...context.options,
|
|
27
|
+
executionId,
|
|
28
|
+
executionIndex
|
|
29
|
+
},
|
|
30
|
+
active: {
|
|
31
|
+
command: null,
|
|
32
|
+
hook: null,
|
|
33
|
+
plugin: null
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}));
|
|
37
|
+
else {
|
|
38
|
+
const executionId = (0, _stryke_unique_id_uuid.uuid)();
|
|
39
|
+
context.#executions = [{
|
|
40
|
+
executionId,
|
|
41
|
+
options: {
|
|
42
|
+
...context.options,
|
|
43
|
+
executionId,
|
|
44
|
+
executionIndex: 0
|
|
45
|
+
},
|
|
46
|
+
active: {
|
|
47
|
+
command: null,
|
|
48
|
+
hook: null,
|
|
49
|
+
plugin: null
|
|
50
|
+
}
|
|
51
|
+
}];
|
|
52
|
+
}
|
|
27
53
|
return context;
|
|
28
54
|
}
|
|
29
55
|
/**
|
|
30
56
|
* A list of all command executions that will be run during the lifecycle of the engine
|
|
31
57
|
*
|
|
32
|
-
* @returns An array of
|
|
58
|
+
* @returns An array of {@link ExecutionState} representing each execution context for the engine.
|
|
33
59
|
*/
|
|
34
60
|
get executions() {
|
|
35
61
|
return this.#executions;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { t as PowerlinesBaseContext } from "./base-context-
|
|
1
|
+
import { t as PowerlinesBaseContext } from "./base-context-SmQ6OfXm.mjs";
|
|
2
|
+
import { uuid } from "@stryke/unique-id/uuid";
|
|
2
3
|
|
|
3
4
|
//#region src/context/engine-context.ts
|
|
4
5
|
var PowerlinesEngineContext = class PowerlinesEngineContext extends PowerlinesBaseContext {
|
|
@@ -16,20 +17,44 @@ var PowerlinesEngineContext = class PowerlinesEngineContext extends PowerlinesBa
|
|
|
16
17
|
context.fatal("No configuration file found. Please ensure you have a valid configuration file in your project.");
|
|
17
18
|
throw new Error("No configuration file found");
|
|
18
19
|
}
|
|
19
|
-
if (Array.isArray(context.configFile.config)) context.#executions = await Promise.all(context.configFile.config.map(async (_,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
if (Array.isArray(context.configFile.config)) context.#executions = await Promise.all(context.configFile.config.map(async (_, executionIndex) => {
|
|
21
|
+
const executionId = uuid();
|
|
22
|
+
return {
|
|
23
|
+
executionId,
|
|
24
|
+
options: {
|
|
25
|
+
...context.options,
|
|
26
|
+
executionId,
|
|
27
|
+
executionIndex
|
|
28
|
+
},
|
|
29
|
+
active: {
|
|
30
|
+
command: null,
|
|
31
|
+
hook: null,
|
|
32
|
+
plugin: null
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}));
|
|
36
|
+
else {
|
|
37
|
+
const executionId = uuid();
|
|
38
|
+
context.#executions = [{
|
|
39
|
+
executionId,
|
|
40
|
+
options: {
|
|
41
|
+
...context.options,
|
|
42
|
+
executionId,
|
|
43
|
+
executionIndex: 0
|
|
44
|
+
},
|
|
45
|
+
active: {
|
|
46
|
+
command: null,
|
|
47
|
+
hook: null,
|
|
48
|
+
plugin: null
|
|
49
|
+
}
|
|
50
|
+
}];
|
|
51
|
+
}
|
|
27
52
|
return context;
|
|
28
53
|
}
|
|
29
54
|
/**
|
|
30
55
|
* A list of all command executions that will be run during the lifecycle of the engine
|
|
31
56
|
*
|
|
32
|
-
* @returns An array of
|
|
57
|
+
* @returns An array of {@link ExecutionState} representing each execution context for the engine.
|
|
33
58
|
*/
|
|
34
59
|
get executions() {
|
|
35
60
|
return this.#executions;
|
|
@@ -38,4 +63,4 @@ var PowerlinesEngineContext = class PowerlinesEngineContext extends PowerlinesBa
|
|
|
38
63
|
|
|
39
64
|
//#endregion
|
|
40
65
|
export { PowerlinesEngineContext as t };
|
|
41
|
-
//# sourceMappingURL=engine-context-
|
|
66
|
+
//# sourceMappingURL=engine-context-D7CWyTsr.mjs.map
|