@powerlines/engine 0.46.3 → 0.46.4
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 +38 -22
- package/dist/_internal/worker.mjs +39 -23
- package/dist/_internal/worker.mjs.map +1 -1
- package/dist/api.cjs +5 -1
- package/dist/api.d.cts +1 -1
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +1 -1
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +5 -1
- package/dist/api.mjs.map +1 -1
- package/dist/context/index.cjs +1 -1
- package/dist/context/index.d.cts +3 -3
- package/dist/context/index.d.cts.map +1 -1
- package/dist/context/index.d.mts +3 -3
- package/dist/context/index.d.mts.map +1 -1
- package/dist/context/index.mjs +1 -1
- package/dist/{execution-context-Cu_xPYxI.mjs → execution-context-Bb5pfsyN.mjs} +35 -25
- package/dist/execution-context-Bb5pfsyN.mjs.map +1 -0
- package/dist/{execution-context-BpRfsnkE.d.mts → execution-context-CghMd-eP.d.cts} +9 -5
- package/dist/execution-context-CghMd-eP.d.cts.map +1 -0
- package/dist/{execution-context-xj0KA802.cjs → execution-context-Dxa103Qg.cjs} +34 -24
- package/dist/{execution-context-CodQucFX.d.cts → execution-context-rKd-zSZy.d.mts} +9 -5
- package/dist/execution-context-rKd-zSZy.d.mts.map +1 -0
- package/dist/storage/index.d.mts +1 -1
- package/dist/typescript/index.d.mts +1 -1
- package/package.json +3 -3
- package/dist/execution-context-BpRfsnkE.d.mts.map +0 -1
- package/dist/execution-context-CodQucFX.d.cts.map +0 -1
- package/dist/execution-context-Cu_xPYxI.mjs.map +0 -1
|
@@ -82,7 +82,6 @@ let oxc_parser = require("oxc-parser");
|
|
|
82
82
|
let undici = require("undici");
|
|
83
83
|
require("@stryke/fs/remove-file");
|
|
84
84
|
let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
85
|
-
let _powerlines_core = require("@powerlines/core");
|
|
86
85
|
let jest_worker = require("jest-worker");
|
|
87
86
|
let _stryke_capnp = require("@stryke/capnp");
|
|
88
87
|
_stryke_capnp = __toESM(_stryke_capnp, 1);
|
|
@@ -217,7 +216,7 @@ function formatWriteLogMessage(context, meta, message) {
|
|
|
217
216
|
payload: {
|
|
218
217
|
meta: {
|
|
219
218
|
type: combinedMeta.type,
|
|
220
|
-
category: combinedMeta.category ||
|
|
219
|
+
category: combinedMeta.category || _powerlines_core_constants.LogCategories.GENERAL,
|
|
221
220
|
logId: combinedMeta.logId || (0, _stryke_unique_id_uuid.uuid)(),
|
|
222
221
|
timestamp: combinedMeta.timestamp ?? Date.now(),
|
|
223
222
|
name: combinedMeta.name || context.config.name,
|
|
@@ -2477,7 +2476,8 @@ const UNRESOLVED_CONFIG_NAMES = [
|
|
|
2477
2476
|
"initialConfig",
|
|
2478
2477
|
"userConfig",
|
|
2479
2478
|
"inlineConfig",
|
|
2480
|
-
"pluginConfig"
|
|
2479
|
+
"pluginConfig",
|
|
2480
|
+
"environmentConfig"
|
|
2481
2481
|
];
|
|
2482
2482
|
var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
2483
2483
|
#checksum = null;
|
|
@@ -2544,6 +2544,10 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
2544
2544
|
*/
|
|
2545
2545
|
pluginConfig = {};
|
|
2546
2546
|
/**
|
|
2547
|
+
* The configuration options provided by the environment
|
|
2548
|
+
*/
|
|
2549
|
+
environmentConfig = {};
|
|
2550
|
+
/**
|
|
2547
2551
|
* The resolved entry type definitions for the project
|
|
2548
2552
|
*/
|
|
2549
2553
|
get entry() {
|
|
@@ -3125,7 +3129,7 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
3125
3129
|
* @returns A promise that resolves when the inline configuration values have been set.
|
|
3126
3130
|
*/
|
|
3127
3131
|
async setInlineConfig(config) {
|
|
3128
|
-
this.logger.
|
|
3132
|
+
this.logger.debug({
|
|
3129
3133
|
meta: { category: "config" },
|
|
3130
3134
|
message: `Updating inline configuration object: \n${this.logConfig(config)}`
|
|
3131
3135
|
});
|
|
@@ -3139,7 +3143,7 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
3139
3143
|
* @returns A promise that resolves when the plugin configuration values have been set.
|
|
3140
3144
|
*/
|
|
3141
3145
|
async setPluginConfig(config) {
|
|
3142
|
-
this.logger.
|
|
3146
|
+
this.logger.debug({
|
|
3143
3147
|
meta: { category: "config" },
|
|
3144
3148
|
message: `Updating plugin configuration object: \n${this.logConfig(config)}`
|
|
3145
3149
|
});
|
|
@@ -3155,21 +3159,21 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
3155
3159
|
return (0, _powerlines_core_plugin_utils.mergeConfig)({
|
|
3156
3160
|
mode: this.initialOptions.mode,
|
|
3157
3161
|
framework: this.initialOptions.framework,
|
|
3158
|
-
initialOptions: this.initialOptions,
|
|
3159
3162
|
logLevel: this.initialOptions.logLevel,
|
|
3160
|
-
options: this.options,
|
|
3161
3163
|
inlineConfig: this.inlineConfig,
|
|
3162
3164
|
userConfig: this.userConfig,
|
|
3163
3165
|
initialConfig: this.initialConfig,
|
|
3164
|
-
pluginConfig: this.pluginConfig
|
|
3166
|
+
pluginConfig: this.pluginConfig,
|
|
3167
|
+
environmentConfig: this.environmentConfig
|
|
3165
3168
|
}, getConfigProps(this.overriddenConfig), (0, _stryke_helpers_omit.omit)(this.options, [
|
|
3169
|
+
"name",
|
|
3166
3170
|
"mode",
|
|
3167
3171
|
"framework",
|
|
3168
3172
|
"logLevel"
|
|
3169
3173
|
]), getConfigProps(this.inlineConfig), getConfigProps(this.userConfig), getConfigProps(this.initialConfig), getConfigProps(this.pluginConfig), {
|
|
3174
|
+
name: this.initialOptions.name,
|
|
3170
3175
|
version: this.packageJson?.version,
|
|
3171
|
-
description: this.packageJson?.description
|
|
3172
|
-
}, {
|
|
3176
|
+
description: this.packageJson?.description,
|
|
3173
3177
|
environments: {},
|
|
3174
3178
|
resolve: {}
|
|
3175
3179
|
});
|
|
@@ -3181,7 +3185,7 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
3181
3185
|
* @returns A promise that resolves when the user configuration values have been set.
|
|
3182
3186
|
*/
|
|
3183
3187
|
async setUserConfig(config) {
|
|
3184
|
-
this.logger.
|
|
3188
|
+
this.logger.debug({
|
|
3185
3189
|
meta: { category: "config" },
|
|
3186
3190
|
message: `Updating user configuration object: \n${this.logConfig(config)}`
|
|
3187
3191
|
});
|
|
@@ -3220,7 +3224,7 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
3220
3224
|
const mergedConfig = this.mergeConfig();
|
|
3221
3225
|
this.logger.trace({
|
|
3222
3226
|
meta: { category: "config" },
|
|
3223
|
-
message: `Pre-setup Powerlines configuration object: \n ---
|
|
3227
|
+
message: `Pre-setup Powerlines configuration object: \n --- Merged Config --- \n\n${this.logConfig(mergedConfig)} \n\n --- Initial Options --- \n\n${this.logConfig(this.initialOptions)} \n\n --- Initial Config --- \n\n${this.logConfig(this.initialConfig)} \n\n --- User Config --- \n\n${this.logConfig(this.userConfig)} \n\n --- Inline Config --- \n\n${this.logConfig(this.inlineConfig)} \n\n --- Plugin Config --- \n\n${this.logConfig(this.pluginConfig)} \n\n --- Environment Config --- \n\n${this.logConfig(this.environmentConfig)} \n\n --- Overridden Config --- \n\n${this.logConfig(this.overriddenConfig)}`
|
|
3224
3228
|
});
|
|
3225
3229
|
mergedConfig.output = (0, defu.default)(mergedConfig.output ?? {}, {
|
|
3226
3230
|
copy: { assets: [
|
|
@@ -3292,15 +3296,22 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
3292
3296
|
this.#configProxy = this.createConfigProxy();
|
|
3293
3297
|
this.logger.debug({
|
|
3294
3298
|
meta: { category: "config" },
|
|
3295
|
-
message: `Resolved Powerlines configuration object: \n
|
|
3299
|
+
message: `Resolved Powerlines configuration object: \n${this.logConfig(this.resolvedConfig)}`
|
|
3296
3300
|
});
|
|
3297
3301
|
this.#fs ??= await VirtualFileSystem.create(this);
|
|
3298
3302
|
}
|
|
3299
3303
|
logConfig(config) {
|
|
3300
|
-
return
|
|
3301
|
-
...(0, _stryke_helpers_omit.omit)(config, [
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
+
return JSON.stringify({
|
|
3305
|
+
...(0, _stryke_helpers_omit.omit)(config, [
|
|
3306
|
+
"plugins",
|
|
3307
|
+
"initialConfig",
|
|
3308
|
+
"userConfig",
|
|
3309
|
+
"inlineConfig",
|
|
3310
|
+
"pluginConfig",
|
|
3311
|
+
"environmentConfig"
|
|
3312
|
+
]),
|
|
3313
|
+
plugins: config.plugins ? config.plugins.flatMap((plugin) => (0, _stryke_convert_to_array.toArray)(plugin)).map((plugin) => String((0, _stryke_type_checks_is_set_string.isSetString)(plugin) ? plugin : (0, _stryke_type_checks_is_set_object.isSetObject)(plugin) && (0, _stryke_type_checks_is_set_string.isSetString)(plugin.name) ? plugin.name : Array.isArray(plugin) && (0, _stryke_type_checks_is_set_string.isSetString)(plugin[0]) ? plugin[0] : "<function-plugin>")) : []
|
|
3314
|
+
}, null, 2).replace(/"([^"]+)":/g, "$1:").replace(/: "([^"]+)"/g, ": $1");
|
|
3304
3315
|
}
|
|
3305
3316
|
createConfigProxy() {
|
|
3306
3317
|
return new Proxy(this.resolvedConfig, {
|
|
@@ -3327,6 +3338,7 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
3327
3338
|
if (key === "userConfig") return this.userConfig;
|
|
3328
3339
|
if (key === "inlineConfig") return this.inlineConfig;
|
|
3329
3340
|
if (key === "pluginConfig") return this.pluginConfig;
|
|
3341
|
+
if (key === "environmentConfig") return this.environmentConfig;
|
|
3330
3342
|
}
|
|
3331
3343
|
return Reflect.get(target, key, receiver);
|
|
3332
3344
|
},
|
|
@@ -3596,14 +3608,14 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
|
|
|
3596
3608
|
/**
|
|
3597
3609
|
* Create a new context from the config.
|
|
3598
3610
|
*
|
|
3599
|
-
* @param
|
|
3611
|
+
* @param initialOptions - The resolved execution options.
|
|
3600
3612
|
* @param config - The user configuration options.
|
|
3601
3613
|
* @param overriddenConfig - The configuration options that should override all other configuration sources, such as CLI flags or environment variables. This is used to ensure that certain configuration values take precedence over any other settings defined in the user configuration or environment configuration, allowing for dynamic overrides based on the execution context.
|
|
3602
3614
|
* @param environment - The resolved environment configuration, which may include additional properties or modifications made during the configuration loading process. This is used to provide context about the environment in which the command is being executed, allowing for environment-specific behavior and configuration resolution.
|
|
3603
3615
|
* @returns A promise that resolves to an instance of the PowerlinesEnvironmentContext class, initialized with the provided configuration and environment data.
|
|
3604
3616
|
*/
|
|
3605
|
-
static async createEnvironment(
|
|
3606
|
-
const context = new PowerlinesEnvironmentContext(
|
|
3617
|
+
static async createEnvironment(initialOptions, config, overriddenConfig, environment) {
|
|
3618
|
+
const context = new PowerlinesEnvironmentContext(initialOptions, config, overriddenConfig);
|
|
3607
3619
|
await context.setEnvironmentConfig(environment);
|
|
3608
3620
|
return context;
|
|
3609
3621
|
}
|
|
@@ -3656,7 +3668,7 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
|
|
|
3656
3668
|
* @returns A promise that resolves when the environment configuration values have been set.
|
|
3657
3669
|
*/
|
|
3658
3670
|
async setEnvironmentConfig(config) {
|
|
3659
|
-
this.logger.
|
|
3671
|
+
this.logger.debug({
|
|
3660
3672
|
meta: { category: "config" },
|
|
3661
3673
|
message: `Updating environment configuration object: \n${this.logConfig(config)}`
|
|
3662
3674
|
});
|
|
@@ -3909,7 +3921,7 @@ var PowerlinesExecutionContext = class PowerlinesExecutionContext extends Powerl
|
|
|
3909
3921
|
* @returns A new context instance with the updated environment.
|
|
3910
3922
|
*/
|
|
3911
3923
|
async createEnvironment(environment) {
|
|
3912
|
-
const context = await PowerlinesEnvironmentContext.createEnvironment((0, _stryke_helpers_deep_clone.deepClone)(this.
|
|
3924
|
+
const context = await PowerlinesEnvironmentContext.createEnvironment((0, _stryke_helpers_deep_clone.deepClone)(this.initialOptions), (0, _stryke_helpers_deep_clone.deepClone)(this.config), (0, _stryke_helpers_deep_clone.deepClone)(this.overriddenConfig), (0, _stryke_helpers_deep_clone.deepClone)(environment));
|
|
3913
3925
|
context.$$internal = this.$$internal;
|
|
3914
3926
|
context.dependencies = (0, _stryke_helpers_deep_clone.deepClone)(this.dependencies);
|
|
3915
3927
|
context.devDependencies = (0, _stryke_helpers_deep_clone.deepClone)(this.devDependencies);
|
|
@@ -4891,6 +4903,10 @@ var PowerlinesExecution = class PowerlinesExecution {
|
|
|
4891
4903
|
merge: mergeConfigs
|
|
4892
4904
|
});
|
|
4893
4905
|
if (pluginConfig) await this.context.setPluginConfig(pluginConfig);
|
|
4906
|
+
else this.context.debug({
|
|
4907
|
+
meta: { category: "config" },
|
|
4908
|
+
message: "No plugin configuration was returned from the config hook."
|
|
4909
|
+
});
|
|
4894
4910
|
timer();
|
|
4895
4911
|
}
|
|
4896
4912
|
/**
|
|
@@ -24,7 +24,7 @@ import { isError } from "@stryke/type-checks/is-error";
|
|
|
24
24
|
import { isFunction } from "@stryke/type-checks/is-function";
|
|
25
25
|
import { isNumber } from "@stryke/type-checks/is-number";
|
|
26
26
|
import { isObject } from "@stryke/type-checks/is-object";
|
|
27
|
-
import {
|
|
27
|
+
import { isPromiseLike } from "@stryke/type-checks/is-promise";
|
|
28
28
|
import { isSet } from "@stryke/type-checks/is-set";
|
|
29
29
|
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
30
30
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
@@ -32,7 +32,7 @@ import { isString } from "@stryke/type-checks/is-string";
|
|
|
32
32
|
import chalk from "chalk";
|
|
33
33
|
import defu, { defu as defu$1 } from "defu";
|
|
34
34
|
import Handlebars from "handlebars";
|
|
35
|
-
import { CACHE_HASH_LENGTH, DEFAULT_DEVELOPMENT_LOG_LEVEL, DEFAULT_ENVIRONMENT, DEFAULT_PRODUCTION_LOG_LEVEL, DEFAULT_TEST_LOG_LEVEL, GLOBAL_ENVIRONMENT, PLUGIN_NON_HOOK_FIELDS, ROOT_HASH_LENGTH } from "@powerlines/core/constants";
|
|
35
|
+
import { CACHE_HASH_LENGTH, DEFAULT_DEVELOPMENT_LOG_LEVEL, DEFAULT_ENVIRONMENT, DEFAULT_PRODUCTION_LOG_LEVEL, DEFAULT_TEST_LOG_LEVEL, GLOBAL_ENVIRONMENT, LogCategories, PLUGIN_NON_HOOK_FIELDS, ROOT_HASH_LENGTH } from "@powerlines/core/constants";
|
|
36
36
|
import { readJsonFile, readJsonFileSync } from "@stryke/fs/json";
|
|
37
37
|
import { deepClone } from "@stryke/helpers/deep-clone";
|
|
38
38
|
import { joinPaths as joinPaths$1 } from "@stryke/path/join";
|
|
@@ -51,7 +51,6 @@ import { parse } from "oxc-parser";
|
|
|
51
51
|
import { Agent, Response, interceptors, setGlobalDispatcher } from "undici";
|
|
52
52
|
import "@stryke/fs/remove-file";
|
|
53
53
|
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
54
|
-
import { LogCategories } from "@powerlines/core";
|
|
55
54
|
import { messageParent } from "jest-worker";
|
|
56
55
|
import * as $ from "@stryke/capnp";
|
|
57
56
|
import { readFileBuffer, readFileBufferSync, writeFileBuffer } from "@stryke/fs/buffer";
|
|
@@ -2444,7 +2443,8 @@ const UNRESOLVED_CONFIG_NAMES = [
|
|
|
2444
2443
|
"initialConfig",
|
|
2445
2444
|
"userConfig",
|
|
2446
2445
|
"inlineConfig",
|
|
2447
|
-
"pluginConfig"
|
|
2446
|
+
"pluginConfig",
|
|
2447
|
+
"environmentConfig"
|
|
2448
2448
|
];
|
|
2449
2449
|
var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
2450
2450
|
#checksum = null;
|
|
@@ -2511,6 +2511,10 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
2511
2511
|
*/
|
|
2512
2512
|
pluginConfig = {};
|
|
2513
2513
|
/**
|
|
2514
|
+
* The configuration options provided by the environment
|
|
2515
|
+
*/
|
|
2516
|
+
environmentConfig = {};
|
|
2517
|
+
/**
|
|
2514
2518
|
* The resolved entry type definitions for the project
|
|
2515
2519
|
*/
|
|
2516
2520
|
get entry() {
|
|
@@ -3092,7 +3096,7 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
3092
3096
|
* @returns A promise that resolves when the inline configuration values have been set.
|
|
3093
3097
|
*/
|
|
3094
3098
|
async setInlineConfig(config) {
|
|
3095
|
-
this.logger.
|
|
3099
|
+
this.logger.debug({
|
|
3096
3100
|
meta: { category: "config" },
|
|
3097
3101
|
message: `Updating inline configuration object: \n${this.logConfig(config)}`
|
|
3098
3102
|
});
|
|
@@ -3106,7 +3110,7 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
3106
3110
|
* @returns A promise that resolves when the plugin configuration values have been set.
|
|
3107
3111
|
*/
|
|
3108
3112
|
async setPluginConfig(config) {
|
|
3109
|
-
this.logger.
|
|
3113
|
+
this.logger.debug({
|
|
3110
3114
|
meta: { category: "config" },
|
|
3111
3115
|
message: `Updating plugin configuration object: \n${this.logConfig(config)}`
|
|
3112
3116
|
});
|
|
@@ -3122,21 +3126,21 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
3122
3126
|
return mergeConfig({
|
|
3123
3127
|
mode: this.initialOptions.mode,
|
|
3124
3128
|
framework: this.initialOptions.framework,
|
|
3125
|
-
initialOptions: this.initialOptions,
|
|
3126
3129
|
logLevel: this.initialOptions.logLevel,
|
|
3127
|
-
options: this.options,
|
|
3128
3130
|
inlineConfig: this.inlineConfig,
|
|
3129
3131
|
userConfig: this.userConfig,
|
|
3130
3132
|
initialConfig: this.initialConfig,
|
|
3131
|
-
pluginConfig: this.pluginConfig
|
|
3133
|
+
pluginConfig: this.pluginConfig,
|
|
3134
|
+
environmentConfig: this.environmentConfig
|
|
3132
3135
|
}, getConfigProps(this.overriddenConfig), omit(this.options, [
|
|
3136
|
+
"name",
|
|
3133
3137
|
"mode",
|
|
3134
3138
|
"framework",
|
|
3135
3139
|
"logLevel"
|
|
3136
3140
|
]), getConfigProps(this.inlineConfig), getConfigProps(this.userConfig), getConfigProps(this.initialConfig), getConfigProps(this.pluginConfig), {
|
|
3141
|
+
name: this.initialOptions.name,
|
|
3137
3142
|
version: this.packageJson?.version,
|
|
3138
|
-
description: this.packageJson?.description
|
|
3139
|
-
}, {
|
|
3143
|
+
description: this.packageJson?.description,
|
|
3140
3144
|
environments: {},
|
|
3141
3145
|
resolve: {}
|
|
3142
3146
|
});
|
|
@@ -3148,7 +3152,7 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
3148
3152
|
* @returns A promise that resolves when the user configuration values have been set.
|
|
3149
3153
|
*/
|
|
3150
3154
|
async setUserConfig(config) {
|
|
3151
|
-
this.logger.
|
|
3155
|
+
this.logger.debug({
|
|
3152
3156
|
meta: { category: "config" },
|
|
3153
3157
|
message: `Updating user configuration object: \n${this.logConfig(config)}`
|
|
3154
3158
|
});
|
|
@@ -3187,7 +3191,7 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
3187
3191
|
const mergedConfig = this.mergeConfig();
|
|
3188
3192
|
this.logger.trace({
|
|
3189
3193
|
meta: { category: "config" },
|
|
3190
|
-
message: `Pre-setup Powerlines configuration object: \n ---
|
|
3194
|
+
message: `Pre-setup Powerlines configuration object: \n --- Merged Config --- \n\n${this.logConfig(mergedConfig)} \n\n --- Initial Options --- \n\n${this.logConfig(this.initialOptions)} \n\n --- Initial Config --- \n\n${this.logConfig(this.initialConfig)} \n\n --- User Config --- \n\n${this.logConfig(this.userConfig)} \n\n --- Inline Config --- \n\n${this.logConfig(this.inlineConfig)} \n\n --- Plugin Config --- \n\n${this.logConfig(this.pluginConfig)} \n\n --- Environment Config --- \n\n${this.logConfig(this.environmentConfig)} \n\n --- Overridden Config --- \n\n${this.logConfig(this.overriddenConfig)}`
|
|
3191
3195
|
});
|
|
3192
3196
|
mergedConfig.output = defu(mergedConfig.output ?? {}, {
|
|
3193
3197
|
copy: { assets: [
|
|
@@ -3259,15 +3263,22 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
3259
3263
|
this.#configProxy = this.createConfigProxy();
|
|
3260
3264
|
this.logger.debug({
|
|
3261
3265
|
meta: { category: "config" },
|
|
3262
|
-
message: `Resolved Powerlines configuration object: \n
|
|
3266
|
+
message: `Resolved Powerlines configuration object: \n${this.logConfig(this.resolvedConfig)}`
|
|
3263
3267
|
});
|
|
3264
3268
|
this.#fs ??= await VirtualFileSystem.create(this);
|
|
3265
3269
|
}
|
|
3266
3270
|
logConfig(config) {
|
|
3267
|
-
return
|
|
3268
|
-
...omit(config, [
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
+
return JSON.stringify({
|
|
3272
|
+
...omit(config, [
|
|
3273
|
+
"plugins",
|
|
3274
|
+
"initialConfig",
|
|
3275
|
+
"userConfig",
|
|
3276
|
+
"inlineConfig",
|
|
3277
|
+
"pluginConfig",
|
|
3278
|
+
"environmentConfig"
|
|
3279
|
+
]),
|
|
3280
|
+
plugins: config.plugins ? config.plugins.flatMap((plugin) => toArray(plugin)).map((plugin) => String(isSetString(plugin) ? plugin : isSetObject(plugin) && isSetString(plugin.name) ? plugin.name : Array.isArray(plugin) && isSetString(plugin[0]) ? plugin[0] : "<function-plugin>")) : []
|
|
3281
|
+
}, null, 2).replace(/"([^"]+)":/g, "$1:").replace(/: "([^"]+)"/g, ": $1");
|
|
3271
3282
|
}
|
|
3272
3283
|
createConfigProxy() {
|
|
3273
3284
|
return new Proxy(this.resolvedConfig, {
|
|
@@ -3294,6 +3305,7 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
3294
3305
|
if (key === "userConfig") return this.userConfig;
|
|
3295
3306
|
if (key === "inlineConfig") return this.inlineConfig;
|
|
3296
3307
|
if (key === "pluginConfig") return this.pluginConfig;
|
|
3308
|
+
if (key === "environmentConfig") return this.environmentConfig;
|
|
3297
3309
|
}
|
|
3298
3310
|
return Reflect.get(target, key, receiver);
|
|
3299
3311
|
},
|
|
@@ -3563,14 +3575,14 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
|
|
|
3563
3575
|
/**
|
|
3564
3576
|
* Create a new context from the config.
|
|
3565
3577
|
*
|
|
3566
|
-
* @param
|
|
3578
|
+
* @param initialOptions - The resolved execution options.
|
|
3567
3579
|
* @param config - The user configuration options.
|
|
3568
3580
|
* @param overriddenConfig - The configuration options that should override all other configuration sources, such as CLI flags or environment variables. This is used to ensure that certain configuration values take precedence over any other settings defined in the user configuration or environment configuration, allowing for dynamic overrides based on the execution context.
|
|
3569
3581
|
* @param environment - The resolved environment configuration, which may include additional properties or modifications made during the configuration loading process. This is used to provide context about the environment in which the command is being executed, allowing for environment-specific behavior and configuration resolution.
|
|
3570
3582
|
* @returns A promise that resolves to an instance of the PowerlinesEnvironmentContext class, initialized with the provided configuration and environment data.
|
|
3571
3583
|
*/
|
|
3572
|
-
static async createEnvironment(
|
|
3573
|
-
const context = new PowerlinesEnvironmentContext(
|
|
3584
|
+
static async createEnvironment(initialOptions, config, overriddenConfig, environment) {
|
|
3585
|
+
const context = new PowerlinesEnvironmentContext(initialOptions, config, overriddenConfig);
|
|
3574
3586
|
await context.setEnvironmentConfig(environment);
|
|
3575
3587
|
return context;
|
|
3576
3588
|
}
|
|
@@ -3623,7 +3635,7 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
|
|
|
3623
3635
|
* @returns A promise that resolves when the environment configuration values have been set.
|
|
3624
3636
|
*/
|
|
3625
3637
|
async setEnvironmentConfig(config) {
|
|
3626
|
-
this.logger.
|
|
3638
|
+
this.logger.debug({
|
|
3627
3639
|
meta: { category: "config" },
|
|
3628
3640
|
message: `Updating environment configuration object: \n${this.logConfig(config)}`
|
|
3629
3641
|
});
|
|
@@ -3876,7 +3888,7 @@ var PowerlinesExecutionContext = class PowerlinesExecutionContext extends Powerl
|
|
|
3876
3888
|
* @returns A new context instance with the updated environment.
|
|
3877
3889
|
*/
|
|
3878
3890
|
async createEnvironment(environment) {
|
|
3879
|
-
const context = await PowerlinesEnvironmentContext.createEnvironment(deepClone(this.
|
|
3891
|
+
const context = await PowerlinesEnvironmentContext.createEnvironment(deepClone(this.initialOptions), deepClone(this.config), deepClone(this.overriddenConfig), deepClone(environment));
|
|
3880
3892
|
context.$$internal = this.$$internal;
|
|
3881
3893
|
context.dependencies = deepClone(this.dependencies);
|
|
3882
3894
|
context.devDependencies = deepClone(this.devDependencies);
|
|
@@ -4858,6 +4870,10 @@ var PowerlinesExecution = class PowerlinesExecution {
|
|
|
4858
4870
|
merge: mergeConfigs
|
|
4859
4871
|
});
|
|
4860
4872
|
if (pluginConfig) await this.context.setPluginConfig(pluginConfig);
|
|
4873
|
+
else this.context.debug({
|
|
4874
|
+
meta: { category: "config" },
|
|
4875
|
+
message: "No plugin configuration was returned from the config hook."
|
|
4876
|
+
});
|
|
4861
4877
|
timer();
|
|
4862
4878
|
}
|
|
4863
4879
|
/**
|