@powerlines/engine 0.44.12 → 0.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/worker.cjs +143 -106
- package/dist/_internal/worker.d.cts +16 -8
- package/dist/_internal/worker.d.cts.map +1 -1
- package/dist/_internal/worker.d.mts +16 -8
- package/dist/_internal/worker.d.mts.map +1 -1
- package/dist/_internal/worker.mjs +144 -107
- package/dist/_internal/worker.mjs.map +1 -1
- package/dist/api.cjs +60 -46
- package/dist/api.d.cts +18 -13
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +18 -13
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +60 -46
- package/dist/api.mjs.map +1 -1
- package/dist/{base-context-C6yzgs6K.mjs → base-context-BSAC5sO9.mjs} +21 -15
- package/dist/base-context-BSAC5sO9.mjs.map +1 -0
- package/dist/{base-context-trNQZNsX.cjs → base-context-Byizvf4F.cjs} +20 -14
- package/dist/context/index.cjs +3 -3
- package/dist/context/index.d.cts +13 -8
- package/dist/context/index.d.cts.map +1 -1
- package/dist/context/index.d.mts +13 -8
- package/dist/context/index.d.mts.map +1 -1
- package/dist/context/index.mjs +3 -3
- package/dist/{engine-context-D1_U6xVC.cjs → engine-context-CI_0NWIk.cjs} +5 -3
- package/dist/{engine-context-C-11i43N.mjs → engine-context-_RMFwG4J.mjs} +6 -4
- package/dist/engine-context-_RMFwG4J.mjs.map +1 -0
- package/dist/{execution-context-D9Enw3J5.mjs → execution-context-O6eXdsCn.mjs} +65 -50
- package/dist/execution-context-O6eXdsCn.mjs.map +1 -0
- package/dist/{execution-context-C-M-Mxse.cjs → execution-context-SXtPe9Ae.cjs} +63 -48
- package/dist/index.cjs +30 -20
- package/dist/index.d.cts +9 -8
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +9 -8
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +30 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/base-context-C6yzgs6K.mjs.map +0 -1
- package/dist/engine-context-C-11i43N.mjs.map +0 -1
- package/dist/execution-context-D9Enw3J5.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PowerlinesBaseContext } from "./base-context-
|
|
1
|
+
import { t as PowerlinesBaseContext } from "./base-context-BSAC5sO9.mjs";
|
|
2
2
|
import { a as FileSystem } from "./fs-D1nIP45P.mjs";
|
|
3
3
|
import { n as FileSystemStorageAdapter, t as VirtualStorageAdapter } from "./virtual-CYGZHTDd.mjs";
|
|
4
4
|
import { i as getTsconfigFilePath } from "./tsconfig-CI6bla4E.mjs";
|
|
@@ -18,10 +18,11 @@ import { appendPath } from "@stryke/path/append";
|
|
|
18
18
|
import { isEqual } from "@stryke/path/is-equal";
|
|
19
19
|
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
|
20
20
|
import chalk from "chalk";
|
|
21
|
-
import defu, {
|
|
21
|
+
import defu, { defu as defu$1 } from "defu";
|
|
22
22
|
import { joinPaths as joinPaths$1 } from "@stryke/path/join-paths";
|
|
23
23
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
24
24
|
import { format } from "@powerlines/core/lib/utilities/format";
|
|
25
|
+
import { formatLogMessage } from "@storm-software/config-tools/logger/console";
|
|
25
26
|
import { existsSync } from "@stryke/fs/exists";
|
|
26
27
|
import { getUnique, getUniqueBy } from "@stryke/helpers/get-unique";
|
|
27
28
|
import { omit } from "@stryke/helpers/omit";
|
|
@@ -1302,9 +1303,9 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
1302
1303
|
* @param options - The options for resolving the context.
|
|
1303
1304
|
* @returns A promise that resolves to the new context.
|
|
1304
1305
|
*/
|
|
1305
|
-
static async
|
|
1306
|
+
static async init(options, initialConfig) {
|
|
1306
1307
|
const context = new PowerlinesContext(options);
|
|
1307
|
-
await context.init(options);
|
|
1308
|
+
await context.init(options, initialConfig);
|
|
1308
1309
|
const powerlinesPath = await resolvePackage("powerlines");
|
|
1309
1310
|
if (!powerlinesPath) throw new Error("Could not resolve `powerlines` package location.");
|
|
1310
1311
|
context.powerlinesPath = powerlinesPath;
|
|
@@ -1607,7 +1608,7 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
1607
1608
|
* @returns A promise that resolves to the cloned context.
|
|
1608
1609
|
*/
|
|
1609
1610
|
async clone() {
|
|
1610
|
-
const clone = await PowerlinesContext.
|
|
1611
|
+
const clone = await PowerlinesContext.init(this.options, this.initialConfig);
|
|
1611
1612
|
return this.copyTo(clone);
|
|
1612
1613
|
}
|
|
1613
1614
|
/**
|
|
@@ -1961,8 +1962,9 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
1961
1962
|
cwd: this.options.cwd,
|
|
1962
1963
|
inlineConfig: this.config.inlineConfig ?? {},
|
|
1963
1964
|
userConfig: this.config.userConfig ?? {},
|
|
1965
|
+
initialConfig: this.config.initialConfig ?? {},
|
|
1964
1966
|
pluginConfig: this.config.pluginConfig ?? {}
|
|
1965
|
-
}, getConfigProps(this.config.inlineConfig), getConfigProps(this.config.userConfig), getConfigProps(this.config.pluginConfig), this.options, {
|
|
1967
|
+
}, getConfigProps(this.config.inlineConfig), getConfigProps(this.config.userConfig), getConfigProps(this.config.initialConfig), getConfigProps(this.config.pluginConfig), this.options, {
|
|
1966
1968
|
name: this.projectJson?.name || this.packageJson?.name,
|
|
1967
1969
|
version: this.packageJson?.version,
|
|
1968
1970
|
description: this.packageJson?.description
|
|
@@ -1987,7 +1989,8 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
1987
1989
|
copyTo(context) {
|
|
1988
1990
|
for (const [key, value] of Object.entries(this)) if (!SKIP_CLONING_PROPS.includes(key)) if (isObject(value) || Array.isArray(value)) context[key] = deepClone(value);
|
|
1989
1991
|
else context[key] = value;
|
|
1990
|
-
context.
|
|
1992
|
+
context.initialConfig = deepClone(this.initialConfig);
|
|
1993
|
+
context.initialOptions = deepClone(this.initialOptions);
|
|
1991
1994
|
context.options = deepClone(this.options);
|
|
1992
1995
|
context.dependencies = deepClone(this.dependencies);
|
|
1993
1996
|
context.devDependencies = deepClone(this.devDependencies);
|
|
@@ -2008,8 +2011,8 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
2008
2011
|
*
|
|
2009
2012
|
* @param options - The configuration options to initialize the context with
|
|
2010
2013
|
*/
|
|
2011
|
-
async init(options) {
|
|
2012
|
-
await super.init(options);
|
|
2014
|
+
async init(options, initialConfig) {
|
|
2015
|
+
await super.init(options, initialConfig ?? {});
|
|
2013
2016
|
this.options.executionId = options.executionId ?? this.options.executionId;
|
|
2014
2017
|
this.options.executionIndex = options.executionIndex ?? this.options.executionIndex ?? 0;
|
|
2015
2018
|
const projectJsonPath = joinPaths(this.options.cwd, this.options.root, "project.json");
|
|
@@ -2022,8 +2025,14 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
2022
2025
|
this.#checksum = await this.generateChecksum(joinPaths(this.options.cwd, this.options.root));
|
|
2023
2026
|
const userConfig = this.configFile.config ? Array.isArray(this.configFile.config) && this.configFile.config.length > this.options.executionIndex ? this.configFile.config[this.options.executionIndex] : this.configFile.config : {};
|
|
2024
2027
|
this.resolvedConfig = {
|
|
2025
|
-
|
|
2028
|
+
cwd: this.options.cwd,
|
|
2029
|
+
root: this.options.root,
|
|
2030
|
+
...this.initialOptions,
|
|
2031
|
+
...initialConfig,
|
|
2026
2032
|
...userConfig,
|
|
2033
|
+
inlineConfig: {},
|
|
2034
|
+
pluginConfig: {},
|
|
2035
|
+
initialConfig,
|
|
2027
2036
|
userConfig
|
|
2028
2037
|
};
|
|
2029
2038
|
}
|
|
@@ -2046,28 +2055,33 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
2046
2055
|
] },
|
|
2047
2056
|
dts: true
|
|
2048
2057
|
});
|
|
2049
|
-
logger.trace(`Pre-setup Powerlines configuration object: \n${
|
|
2050
|
-
...omit(this.config, [
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2058
|
+
logger.trace(`Pre-setup Powerlines configuration object: \n${formatLogMessage({
|
|
2059
|
+
...omit(this.config, [
|
|
2060
|
+
"inlineConfig",
|
|
2061
|
+
"userConfig",
|
|
2062
|
+
"initialConfig",
|
|
2063
|
+
"pluginConfig",
|
|
2064
|
+
"plugins"
|
|
2065
|
+
]),
|
|
2066
|
+
inlineConfig: isSetObject(this.config.inlineConfig) ? omit(this.config.inlineConfig, ["plugins"]) : void 0,
|
|
2067
|
+
userConfig: isSetObject(this.config.userConfig) ? omit(this.config.userConfig, ["plugins"]) : void 0,
|
|
2068
|
+
initialConfig: isSetObject(this.config.initialConfig) ? omit(this.config.initialConfig, ["plugins"]) : void 0,
|
|
2069
|
+
pluginConfig: isSetObject(this.config.pluginConfig) ? omit(this.config.pluginConfig, ["plugins"]) : void 0
|
|
2070
|
+
})}`);
|
|
2071
|
+
if (!this.initialOptions.mode && !this.config.userConfig?.mode && !this.config.inlineConfig?.mode && !this.config.initialConfig?.mode && !this.config.pluginConfig?.mode) {
|
|
2056
2072
|
this.options.mode = "production";
|
|
2057
2073
|
this.config.mode = "production";
|
|
2058
2074
|
}
|
|
2059
|
-
if (!this.
|
|
2075
|
+
if (!this.initialOptions.framework && !this.config.userConfig?.framework && !this.config.inlineConfig?.framework && !this.config.initialConfig?.framework && !this.config.pluginConfig?.framework) {
|
|
2060
2076
|
this.options.framework = "powerlines";
|
|
2061
2077
|
this.config.framework = "powerlines";
|
|
2062
2078
|
}
|
|
2063
|
-
if (!this.config.userConfig?.projectType && !this.config.inlineConfig?.projectType && !this.config.pluginConfig?.projectType) this.config.projectType = "application";
|
|
2064
|
-
if (!this.config.userConfig?.platform && !this.config.inlineConfig?.platform && !this.config.pluginConfig?.platform) this.config.platform = "neutral";
|
|
2065
|
-
this.
|
|
2079
|
+
if (!this.config.userConfig?.projectType && !this.config.inlineConfig?.projectType && !this.config.initialConfig?.projectType && !this.config.pluginConfig?.projectType) this.config.projectType = "application";
|
|
2080
|
+
if (!this.config.userConfig?.platform && !this.config.inlineConfig?.platform && !this.config.initialConfig?.platform && !this.config.pluginConfig?.platform) this.config.platform = "neutral";
|
|
2081
|
+
this.config.compatibilityDate = resolveCompatibilityDates(this.config.inlineConfig.compatibilityDate ?? this.config.userConfig.compatibilityDate ?? this.config.initialConfig.compatibilityDate ?? this.config.pluginConfig.compatibilityDate, "latest");
|
|
2066
2082
|
this.config.input = getUniqueInputs(this.config.input);
|
|
2067
2083
|
if (this.config.name?.startsWith("@") && this.config.name.split("/").filter(Boolean).length > 1) this.config.name = this.config.name.split("/").filter(Boolean)[1];
|
|
2068
2084
|
this.config.title ??= titleCase(this.config.name);
|
|
2069
|
-
if (this.config.userConfig.resolve?.external) this.config.userConfig.resolve.external = getUnique(this.config.userConfig.resolve.external);
|
|
2070
|
-
if (this.config.userConfig.resolve?.noExternal) this.config.userConfig.resolve.noExternal = getUnique(this.config.userConfig.resolve.noExternal);
|
|
2071
2085
|
if (this.config.resolve.external) this.config.resolve.external = getUnique(this.config.resolve.external);
|
|
2072
2086
|
if (this.config.resolve.noExternal) this.config.resolve.noExternal = getUnique(this.config.resolve.noExternal);
|
|
2073
2087
|
this.config.plugins = (this.config.plugins ?? []).flatMap((plugin) => toArray(plugin)).filter(Boolean).reduce((ret, plugin) => {
|
|
@@ -2075,10 +2089,10 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
2075
2089
|
ret.push(plugin);
|
|
2076
2090
|
return ret;
|
|
2077
2091
|
}, []);
|
|
2078
|
-
if (!this.config.userConfig?.logLevel && !this.config.inlineConfig?.logLevel) if (this.config.mode === "development") this.config.logLevel = DEFAULT_DEVELOPMENT_LOG_LEVEL;
|
|
2092
|
+
if (!this.config.userConfig?.logLevel && !this.config.initialConfig?.logLevel && !this.config.pluginConfig?.logLevel && !this.config.inlineConfig?.logLevel) if (this.config.mode === "development") this.config.logLevel = DEFAULT_DEVELOPMENT_LOG_LEVEL;
|
|
2079
2093
|
else if (this.config.mode === "test") this.config.logLevel = DEFAULT_TEST_LOG_LEVEL;
|
|
2080
2094
|
else this.config.logLevel = DEFAULT_PRODUCTION_LOG_LEVEL;
|
|
2081
|
-
if (!this.config.userConfig?.tsconfig && !this.config.inlineConfig?.tsconfig) this.config.tsconfig = getTsconfigFilePath(this.config.cwd, this.config.root);
|
|
2095
|
+
if (!this.config.userConfig?.tsconfig && !this.config.initialConfig?.tsconfig && !this.config.pluginConfig?.tsconfig && !this.config.inlineConfig?.tsconfig) this.config.tsconfig = getTsconfigFilePath(this.config.cwd, this.config.root);
|
|
2082
2096
|
else if (this.config.tsconfig) this.config.tsconfig = replacePath(replacePathTokens(this, this.config.tsconfig), this.config.cwd);
|
|
2083
2097
|
this.config.output.format = getUnique(toArray(this.config.output?.format ?? (this.config.projectType === "library" ? ["cjs", "esm"] : ["esm"])));
|
|
2084
2098
|
if (this.config.output.path) this.config.output.path = appendPath(replacePathTokens(this, this.config.output.path), this.config.cwd);
|
|
@@ -2088,7 +2102,7 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
2088
2102
|
if (!this.config.root.replace(/^\.\/?/, "")) this.config.output.copy.path = this.config.output.copy.path ? appendPath(replacePathTokens(this, this.config.output.copy.path), this.config.cwd) : this.config.output.path;
|
|
2089
2103
|
else this.config.output.copy.path = appendPath(replacePathTokens(this, this.config.output.copy.path || joinPaths("dist", this.config.root)), this.config.cwd);
|
|
2090
2104
|
}
|
|
2091
|
-
if (this.config.output.types !== false) this.config.output.types = appendPath(replacePathTokens(this, this.config.userConfig?.output?.types || this.config.inlineConfig?.output?.types || this.config.pluginConfig?.output?.types || joinPaths(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`)), this.config.cwd);
|
|
2105
|
+
if (this.config.output.types !== false) this.config.output.types = appendPath(replacePathTokens(this, this.config.userConfig?.output?.types || this.config.inlineConfig?.output?.types || this.config.initialConfig?.output?.types || this.config.pluginConfig?.output?.types || joinPaths(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`)), this.config.cwd);
|
|
2092
2106
|
if (this.config.output.copy && this.config.output.copy.path && this.config.output.copy.assets && Array.isArray(this.config.output.copy.assets)) this.config.output.copy.assets = getUniqueBy(this.config.output.copy.assets.map((asset) => {
|
|
2093
2107
|
return {
|
|
2094
2108
|
glob: isSetObject(asset) ? asset.glob : asset,
|
|
@@ -2097,11 +2111,11 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
2097
2111
|
ignore: isSetObject(asset) && asset.ignore ? toArray(asset.ignore) : void 0
|
|
2098
2112
|
};
|
|
2099
2113
|
}), (a) => `${a.input}-${a.glob}-${a.output}`);
|
|
2100
|
-
if (!this.config.userConfig?.output?.sourceMap && !this.config.inlineConfig?.output?.sourceMap) if (this.config.mode === "development") this.config.output.sourceMap = true;
|
|
2114
|
+
if (!this.config.userConfig?.output?.sourceMap && !this.config.initialConfig?.output?.sourceMap && !this.config.inlineConfig?.output?.sourceMap && !this.config.pluginConfig?.output?.sourceMap) if (this.config.mode === "development") this.config.output.sourceMap = true;
|
|
2101
2115
|
else this.config.output.sourceMap = false;
|
|
2102
|
-
if (!this.config.userConfig?.output?.minify && !this.config.inlineConfig?.output?.minify) if (this.config.mode === "production") this.config.output.minify = true;
|
|
2116
|
+
if (!this.config.userConfig?.output?.minify && !this.config.initialConfig?.output?.minify && !this.config.inlineConfig?.output?.minify && !this.config.pluginConfig?.output?.minify) if (this.config.mode === "production") this.config.output.minify = true;
|
|
2103
2117
|
else this.config.output.minify = false;
|
|
2104
|
-
if (!this.config.userConfig?.output?.artifactsPath && !this.config.inlineConfig?.output?.artifactsPath && !this.config.pluginConfig?.output?.artifactsPath) this.config.output.artifactsPath = `.${this.config.framework || "powerlines"}`;
|
|
2118
|
+
if (!this.config.userConfig?.output?.artifactsPath && !this.config.initialConfig?.output?.artifactsPath && !this.config.inlineConfig?.output?.artifactsPath && !this.config.pluginConfig?.output?.artifactsPath) this.config.output.artifactsPath = `.${this.config.framework || "powerlines"}`;
|
|
2105
2119
|
if (this.config.output.copy && this.config.output.copy.assets) this.config.output.copy.assets = this.config.output.copy.assets.map((asset) => ({
|
|
2106
2120
|
...asset,
|
|
2107
2121
|
glob: replacePathTokens(this, asset.glob),
|
|
@@ -2111,24 +2125,24 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
|
|
|
2111
2125
|
}));
|
|
2112
2126
|
if (isSetString(this.config.output?.storage) && this.config.output.storage === "virtual" || isSetObject(this.config.output?.storage) && Object.values(this.config.output.storage).every((adapter) => adapter.preset === "virtual")) this.config.output.overwrite = true;
|
|
2113
2127
|
this.#fs ??= await VirtualFileSystem.create(this);
|
|
2114
|
-
if (isSetObject(this.config.userConfig) && isSetObject(this.config.
|
|
2115
|
-
...omit(this.config, [
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2128
|
+
if (isSetObject(this.config.inlineConfig) && isSetObject(this.config.userConfig) && isSetObject(this.config.initialConfig) && isSetObject(this.config.pluginConfig)) logger.debug(`Resolved Powerlines configuration object: \n${formatLogMessage({
|
|
2129
|
+
...omit(this.config, [
|
|
2130
|
+
"inlineConfig",
|
|
2131
|
+
"userConfig",
|
|
2132
|
+
"initialConfig",
|
|
2133
|
+
"pluginConfig",
|
|
2134
|
+
"plugins"
|
|
2135
|
+
]),
|
|
2136
|
+
inlineConfig: isSetObject(this.config.inlineConfig) ? omit(this.config.inlineConfig, ["plugins"]) : void 0,
|
|
2137
|
+
userConfig: isSetObject(this.config.userConfig) ? omit(this.config.userConfig, ["plugins"]) : void 0,
|
|
2138
|
+
initialConfig: isSetObject(this.config.initialConfig) ? omit(this.config.initialConfig, ["plugins"]) : void 0,
|
|
2139
|
+
pluginConfig: isSetObject(this.config.pluginConfig) ? omit(this.config.pluginConfig, ["plugins"]) : void 0
|
|
2140
|
+
})}`);
|
|
2120
2141
|
}
|
|
2121
2142
|
};
|
|
2122
2143
|
|
|
2123
2144
|
//#endregion
|
|
2124
2145
|
//#region src/_internal/helpers/hooks.ts
|
|
2125
|
-
const mergeResultObjects = createDefu((obj, key, value) => {
|
|
2126
|
-
if (isString(obj[key]) && isString(value)) {
|
|
2127
|
-
obj[key] = `${obj[key] || ""}\n${value || ""}`.trim();
|
|
2128
|
-
return true;
|
|
2129
|
-
}
|
|
2130
|
-
return false;
|
|
2131
|
-
});
|
|
2132
2146
|
/**
|
|
2133
2147
|
* Merges the current hook result with the previous results based on their types.
|
|
2134
2148
|
*
|
|
@@ -2139,7 +2153,7 @@ const mergeResultObjects = createDefu((obj, key, value) => {
|
|
|
2139
2153
|
function mergeResults(currentResult, previousResults) {
|
|
2140
2154
|
if (!previousResults || previousResults.length === 0) return [currentResult];
|
|
2141
2155
|
if (isSetString(currentResult)) previousResults = [`${isSetString(previousResults[0]) ? previousResults[0] || "" : ""}\n${isSetString(previousResults[0]) ? currentResult.replace(previousResults[0], "") : currentResult}`.trim()];
|
|
2142
|
-
else if (isObject(currentResult)) previousResults = [
|
|
2156
|
+
else if (isObject(currentResult)) previousResults = previousResults.length > 0 ? [defu$1(currentResult, previousResults[0])] : [currentResult];
|
|
2143
2157
|
return previousResults;
|
|
2144
2158
|
}
|
|
2145
2159
|
/**
|
|
@@ -2517,9 +2531,9 @@ var PowerlinesExecutionContext = class PowerlinesExecutionContext extends Powerl
|
|
|
2517
2531
|
* @param options - The options for resolving the context.
|
|
2518
2532
|
* @returns A promise that resolves to the new context.
|
|
2519
2533
|
*/
|
|
2520
|
-
static async
|
|
2534
|
+
static async init(options, initialConfig) {
|
|
2521
2535
|
const context = new PowerlinesExecutionContext(options);
|
|
2522
|
-
await context.init(options);
|
|
2536
|
+
await context.init(options, initialConfig);
|
|
2523
2537
|
const powerlinesPath = await resolvePackage("powerlines");
|
|
2524
2538
|
if (!powerlinesPath) throw new Error("Could not resolve `powerlines` package location.");
|
|
2525
2539
|
context.powerlinesPath = powerlinesPath;
|
|
@@ -2531,10 +2545,10 @@ var PowerlinesExecutionContext = class PowerlinesExecutionContext extends Powerl
|
|
|
2531
2545
|
* @param options - The options for resolving the context.
|
|
2532
2546
|
* @returns A promise that resolves to the new context.
|
|
2533
2547
|
*/
|
|
2534
|
-
static async
|
|
2548
|
+
static async inline(options, initialConfig, inlineConfig) {
|
|
2535
2549
|
const context = new PowerlinesExecutionContext(options);
|
|
2536
|
-
await context.init(options);
|
|
2537
|
-
context.config.inlineConfig =
|
|
2550
|
+
await context.init(options, initialConfig);
|
|
2551
|
+
context.config.inlineConfig = inlineConfig;
|
|
2538
2552
|
if (context.config.inlineConfig.command === "new") {
|
|
2539
2553
|
const workspacePackageJsonPath = joinPaths(context.config.cwd, "package.json");
|
|
2540
2554
|
if (!existsSync(workspacePackageJsonPath)) throw new Error(`The workspace package.json file could not be found at ${workspacePackageJsonPath}`);
|
|
@@ -2628,8 +2642,9 @@ var PowerlinesExecutionContext = class PowerlinesExecutionContext extends Powerl
|
|
|
2628
2642
|
* @returns A promise that resolves to the cloned context.
|
|
2629
2643
|
*/
|
|
2630
2644
|
async clone() {
|
|
2631
|
-
const clone = await PowerlinesExecutionContext.
|
|
2645
|
+
const clone = await PowerlinesExecutionContext.init(this.options, this.initialConfig);
|
|
2632
2646
|
clone.config.userConfig = deepClone(this.config.userConfig);
|
|
2647
|
+
clone.config.initialConfig = deepClone(this.config.initialConfig);
|
|
2633
2648
|
clone.config.inlineConfig = deepClone(this.config.inlineConfig);
|
|
2634
2649
|
clone.config.pluginConfig = deepClone(this.config.pluginConfig);
|
|
2635
2650
|
await clone.setup();
|
|
@@ -2721,4 +2736,4 @@ var PowerlinesExecutionContext = class PowerlinesExecutionContext extends Powerl
|
|
|
2721
2736
|
|
|
2722
2737
|
//#endregion
|
|
2723
2738
|
export { mergeConfigs as a, callHook as i, PowerlinesEnvironmentContext as n, PowerlinesContext as o, createPluginContext as r, writeMetaFile as s, PowerlinesExecutionContext as t };
|
|
2724
|
-
//# sourceMappingURL=execution-context-
|
|
2739
|
+
//# sourceMappingURL=execution-context-O6eXdsCn.mjs.map
|