@powerlines/engine 0.0.15 → 0.0.16
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 +155 -161
- package/dist/_internal/worker.mjs +155 -161
- package/dist/_internal/worker.mjs.map +1 -1
- package/dist/api.cjs +20 -11
- 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 +20 -11
- package/dist/api.mjs.map +1 -1
- package/dist/context/index.cjs +1 -1
- package/dist/context/index.d.cts +13 -15
- package/dist/context/index.d.cts.map +1 -1
- package/dist/context/index.d.mts +13 -15
- package/dist/context/index.d.mts.map +1 -1
- package/dist/context/index.mjs +1 -1
- package/dist/{execution-context-BfQt0NWO.cjs → execution-context-BuypgQoS.cjs} +146 -157
- package/dist/{execution-context-DaplwLr4.mjs → execution-context-ePeyduze.mjs} +147 -158
- package/dist/execution-context-ePeyduze.mjs.map +1 -0
- package/package.json +3 -3
- package/dist/execution-context-DaplwLr4.mjs.map +0 -1
package/dist/api.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_chunk = require('./chunk-C0xms8kb.cjs');
|
|
3
|
-
const require_execution_context = require('./execution-context-
|
|
3
|
+
const require_execution_context = require('./execution-context-BuypgQoS.cjs');
|
|
4
4
|
const require_tsconfig = require('./tsconfig-DeyWQC2N.cjs');
|
|
5
5
|
const require_ts_morph = require('./ts-morph-BaLPVAdB.cjs');
|
|
6
6
|
let _stryke_fs_resolve = require("@stryke/fs/resolve");
|
|
@@ -13,7 +13,9 @@ chalk = require_chunk.__toESM(chalk, 1);
|
|
|
13
13
|
let defu = require("defu");
|
|
14
14
|
defu = require_chunk.__toESM(defu, 1);
|
|
15
15
|
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
16
|
+
let _stryke_env_environment_checks = require("@stryke/env/environment-checks");
|
|
16
17
|
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
18
|
+
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
17
19
|
let _powerlines_core_lib_utilities_file_header = require("@powerlines/core/lib/utilities/file-header");
|
|
18
20
|
let _powerlines_core_lib_utilities_format = require("@powerlines/core/lib/utilities/format");
|
|
19
21
|
let _powerlines_core_plugin_utils = require("@powerlines/core/plugin-utils");
|
|
@@ -36,7 +38,6 @@ let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function")
|
|
|
36
38
|
let _stryke_type_checks_is_number = require("@stryke/type-checks/is-number");
|
|
37
39
|
let _stryke_type_checks_is_object = require("@stryke/type-checks/is-object");
|
|
38
40
|
let _stryke_type_checks_is_promise = require("@stryke/type-checks/is-promise");
|
|
39
|
-
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
40
41
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
41
42
|
let handlebars = require("handlebars");
|
|
42
43
|
handlebars = require_chunk.__toESM(handlebars, 1);
|
|
@@ -704,7 +705,7 @@ ${formatTypes(code)}
|
|
|
704
705
|
static async fromConfig(options, config) {
|
|
705
706
|
const api = new PowerlinesExecution(await require_execution_context.PowerlinesExecutionContext.fromOptions(options));
|
|
706
707
|
api.#context.config.inlineConfig = config;
|
|
707
|
-
await api.#context.setup(
|
|
708
|
+
await api.#context.setup();
|
|
708
709
|
api.#context.$$internal = {
|
|
709
710
|
api,
|
|
710
711
|
addPlugin: api.addPlugin.bind(api)
|
|
@@ -721,7 +722,7 @@ ${formatTypes(code)}
|
|
|
721
722
|
});
|
|
722
723
|
if (pluginConfig) {
|
|
723
724
|
api.#context.config.pluginConfig = pluginConfig;
|
|
724
|
-
await api.#context.setup(
|
|
725
|
+
await api.#context.setup();
|
|
725
726
|
}
|
|
726
727
|
timer();
|
|
727
728
|
return api;
|
|
@@ -737,7 +738,8 @@ ${formatTypes(code)}
|
|
|
737
738
|
async types(inlineConfig = { command: "types" }) {
|
|
738
739
|
this.context.debug(" Aggregating configuration options for the Powerlines project");
|
|
739
740
|
inlineConfig.command ??= "types";
|
|
740
|
-
|
|
741
|
+
this.context.config.inlineConfig = inlineConfig;
|
|
742
|
+
await this.context.setup();
|
|
741
743
|
await this.#executeEnvironments(async (context) => {
|
|
742
744
|
context.debug(`Initializing the processing options for the Powerlines project.`);
|
|
743
745
|
await this.callHook("configResolved", {
|
|
@@ -787,7 +789,8 @@ ${formatTypes(code)}
|
|
|
787
789
|
*/
|
|
788
790
|
async prepare(inlineConfig = { command: "prepare" }) {
|
|
789
791
|
inlineConfig.command ??= "prepare";
|
|
790
|
-
|
|
792
|
+
this.context.config.inlineConfig = inlineConfig;
|
|
793
|
+
await this.context.setup();
|
|
791
794
|
await this.#executeEnvironments(async (context) => {
|
|
792
795
|
context.debug(`Initializing the processing options for the Powerlines project.`);
|
|
793
796
|
await this.callHook("configResolved", {
|
|
@@ -947,11 +950,14 @@ ${formatTypes(code)}
|
|
|
947
950
|
* @returns A promise that resolves when the build command has completed
|
|
948
951
|
*/
|
|
949
952
|
async build(inlineConfig = { command: "build" }) {
|
|
953
|
+
inlineConfig.command ??= "build";
|
|
950
954
|
await this.context.generateChecksum();
|
|
951
955
|
if (this.context.meta.checksum !== this.context.persistedMeta?.checksum || this.context.config.skipCache) {
|
|
952
956
|
this.context.info(!this.context.persistedMeta?.checksum ? "No previous build cache found. Preparing the project for the initial build." : this.context.meta.checksum !== this.context.persistedMeta.checksum ? "The project has been modified since the last time `prepare` was ran. Re-preparing the project." : "The project is configured to skip cache. Re-preparing the project.");
|
|
953
|
-
inlineConfig.command ??= "build";
|
|
954
957
|
await this.prepare(inlineConfig);
|
|
958
|
+
} else {
|
|
959
|
+
this.context.config.inlineConfig = inlineConfig;
|
|
960
|
+
await this.context.setup();
|
|
955
961
|
}
|
|
956
962
|
if (this.context.config.singleBuild) await this.#handleBuild(await this.#context.toEnvironment());
|
|
957
963
|
else await this.#executeEnvironments(async (context) => {
|
|
@@ -1072,12 +1078,15 @@ var PowerlinesAPI = class PowerlinesAPI extends PowerlinesExecution {
|
|
|
1072
1078
|
static async fromOptions(options, override) {
|
|
1073
1079
|
const api = new PowerlinesAPI(await require_execution_context.PowerlinesExecutionContext.fromOptions({
|
|
1074
1080
|
cwd: process.cwd(),
|
|
1075
|
-
mode: "production",
|
|
1081
|
+
mode: _stryke_env_environment_checks.isDevelopment ? "development" : _stryke_env_environment_checks.isTest ? "test" : "production",
|
|
1076
1082
|
framework: "powerlines",
|
|
1077
1083
|
...options,
|
|
1078
1084
|
configIndex: 0
|
|
1079
1085
|
}));
|
|
1080
|
-
if (override)
|
|
1086
|
+
if (override) {
|
|
1087
|
+
api.context.config.inlineConfig = override;
|
|
1088
|
+
await api.context.setup();
|
|
1089
|
+
}
|
|
1081
1090
|
api.context.$$internal = {
|
|
1082
1091
|
api,
|
|
1083
1092
|
addPlugin: api.addPlugin.bind(api)
|
|
@@ -1092,9 +1101,9 @@ var PowerlinesAPI = class PowerlinesAPI extends PowerlinesExecution {
|
|
|
1092
1101
|
result: "merge",
|
|
1093
1102
|
merge: require_execution_context.mergeConfigs
|
|
1094
1103
|
});
|
|
1095
|
-
if (pluginConfig) {
|
|
1104
|
+
if ((0, _stryke_type_checks_is_set_object.isSetObject)(pluginConfig)) {
|
|
1096
1105
|
api.context.config.pluginConfig = pluginConfig;
|
|
1097
|
-
await api.context.setup(
|
|
1106
|
+
await api.context.setup();
|
|
1098
1107
|
}
|
|
1099
1108
|
timer();
|
|
1100
1109
|
return api;
|
package/dist/api.d.cts
CHANGED
|
@@ -161,7 +161,7 @@ declare class PowerlinesAPI<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
161
161
|
* @param options - The options to initialize the API with
|
|
162
162
|
* @returns A new instance of the Powerlines API
|
|
163
163
|
*/
|
|
164
|
-
static fromOptions<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(options: EngineOptions, override?:
|
|
164
|
+
static fromOptions<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(options: EngineOptions, override?: InlineConfig): Promise<PowerlinesAPI<TResolvedConfig>>;
|
|
165
165
|
/**
|
|
166
166
|
* Generate the Powerlines typescript declaration file
|
|
167
167
|
*
|
package/dist/api.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.cts","names":[],"sources":["../src/_internal/execution.ts","../src/api.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"api.d.cts","names":[],"sources":["../src/_internal/execution.ts","../src/api.ts"],"mappings":";;;;;;;;AAyGA;;;;;cAAa,mBAAA,yBACa,cAAA,GAAiB,cAAA,aAC9B,SAAA;EAAA;EA0qBe;;;EAAA,IAXf,OAAA,CAAA,GAAW,gBAAA,CAAiB,eAAA;EAeR;;;;;;EAAA,OALX,UAAA,yBACM,cAAA,GAAiB,cAAA,CAAA,CAEzC,OAAA,EAAS,wBAAA,EACT,MAAA,EAAQ,YAAA,GACP,OAAA,CAAQ,mBAAA,CAAoB,eAAA;EAoMzB;;;;;;;;EA1IO,KAAA,CACX,YAAA,GAAc,WAAA,CAAY,iBAAA,eAEzB,OAAA;EA4Ie;;;;;;;;EAPL,OAAA,CACX,YAAA,GACI,WAAA,CAAY,mBAAA,eACZ,WAAA,CAAY,iBAAA,eACZ,WAAA,CAAY,eAAA,eACZ,WAAA,CAAY,iBAAA,eACZ,WAAA,CAAY,iBAAA,eACZ,WAAA,CAAY,gBAAA,eACZ,WAAA,CAAY,gBAAA,eACZ,WAAA,CAAY,gBAAA,eACZ,WAAA,CAAY,kBAAA,eAAuD,OAAA;EAyH9B;;;;;;;;;EAA9B,GAAA,CAAI,YAAA,EAAc,WAAA,CAAY,eAAA,eAA2B,OAAA;EAoHpD;;;;;;;;;EAxCL,KAAA,CACX,YAAA,GACI,WAAA,CAAY,iBAAA,eACZ,WAAA,CAAY,mBAAA,eAEf,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ResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
161
161
|
* @param options - The options to initialize the API with
|
|
162
162
|
* @returns A new instance of the Powerlines API
|
|
163
163
|
*/
|
|
164
|
-
static fromOptions<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(options: EngineOptions, override?:
|
|
164
|
+
static fromOptions<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(options: EngineOptions, override?: InlineConfig): Promise<PowerlinesAPI<TResolvedConfig>>;
|
|
165
165
|
/**
|
|
166
166
|
* Generate the Powerlines typescript declaration file
|
|
167
167
|
*
|
package/dist/api.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.mts","names":[],"sources":["../src/_internal/execution.ts","../src/api.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"api.d.mts","names":[],"sources":["../src/_internal/execution.ts","../src/api.ts"],"mappings":";;;;;;;;AAyGA;;;;;cAAa,mBAAA,yBACa,cAAA,GAAiB,cAAA,aAC9B,SAAA;EAAA;EA0qBe;;;EAAA,IAXf,OAAA,CAAA,GAAW,gBAAA,CAAiB,eAAA;EAeR;;;;;;EAAA,OALX,UAAA,yBACM,cAAA,GAAiB,cAAA,CAAA,CAEzC,OAAA,EAAS,wBAAA,EACT,MAAA,EAAQ,YAAA,GACP,OAAA,CAAQ,mBAAA,CAAoB,eAAA;EAoMzB;;;;;;;;EA1IO,KAAA,CACX,YAAA,GAAc,WAAA,CAAY,iBAAA,eAEzB,OAAA;EA4Ie;;;;;;;;EAPL,OAAA,CACX,YAAA,GACI,WAAA,CAAY,mBAAA,eACZ,WAAA,CAAY,iBAAA,eACZ,WAAA,CAAY,eAAA,eACZ,WAAA,CAAY,iBAAA,eACZ,WAAA,CAAY,iBAAA,eACZ,WAAA,CAAY,gBAAA,eACZ,WAAA,CAAY,gBAAA,eACZ,WAAA,CAAY,gBAAA,eACZ,WAAA,CAAY,kBAAA,eAAuD,OAAA;EAyH9B;;;;;;;;;EA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,QAAA,CAAA,GAAQ,OAAA;EDqnBjB;;;;;;EAAA,CCrmBC,MAAA,CAAO,YAAA,KAAa,OAAA;AAAA"}
|
package/dist/api.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as mergeConfigs, i as callHook, s as writeMetaFile, t as PowerlinesExecutionContext } from "./execution-context-
|
|
1
|
+
import { a as mergeConfigs, i as callHook, s as writeMetaFile, t as PowerlinesExecutionContext } from "./execution-context-ePeyduze.mjs";
|
|
2
2
|
import { a as isIncludeMatchFound, i as getTsconfigFilePath, r as getParsedTypeScriptConfig } from "./tsconfig-Cstsoprg.mjs";
|
|
3
3
|
import { n as createProgram } from "./ts-morph-D0CaA37w.mjs";
|
|
4
4
|
import { resolvePackage } from "@stryke/fs/resolve";
|
|
@@ -9,7 +9,9 @@ import { StormJSON } from "@stryke/json/storm-json";
|
|
|
9
9
|
import chalk from "chalk";
|
|
10
10
|
import defu from "defu";
|
|
11
11
|
import { joinPaths } from "@stryke/path/join-paths";
|
|
12
|
+
import { isDevelopment, isTest } from "@stryke/env/environment-checks";
|
|
12
13
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
14
|
+
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
13
15
|
import { getTypescriptFileHeader } from "@powerlines/core/lib/utilities/file-header";
|
|
14
16
|
import { format, formatFolder } from "@powerlines/core/lib/utilities/format";
|
|
15
17
|
import { findInvalidPluginConfig, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple } from "@powerlines/core/plugin-utils";
|
|
@@ -32,7 +34,6 @@ import { isFunction } from "@stryke/type-checks/is-function";
|
|
|
32
34
|
import { isNumber } from "@stryke/type-checks/is-number";
|
|
33
35
|
import { isObject } from "@stryke/type-checks/is-object";
|
|
34
36
|
import { isPromiseLike } from "@stryke/type-checks/is-promise";
|
|
35
|
-
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
36
37
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
37
38
|
import Handlebars from "handlebars";
|
|
38
39
|
import { readJsonFile } from "@stryke/fs/json";
|
|
@@ -699,7 +700,7 @@ ${formatTypes(code)}
|
|
|
699
700
|
static async fromConfig(options, config) {
|
|
700
701
|
const api = new PowerlinesExecution(await PowerlinesExecutionContext.fromOptions(options));
|
|
701
702
|
api.#context.config.inlineConfig = config;
|
|
702
|
-
await api.#context.setup(
|
|
703
|
+
await api.#context.setup();
|
|
703
704
|
api.#context.$$internal = {
|
|
704
705
|
api,
|
|
705
706
|
addPlugin: api.addPlugin.bind(api)
|
|
@@ -716,7 +717,7 @@ ${formatTypes(code)}
|
|
|
716
717
|
});
|
|
717
718
|
if (pluginConfig) {
|
|
718
719
|
api.#context.config.pluginConfig = pluginConfig;
|
|
719
|
-
await api.#context.setup(
|
|
720
|
+
await api.#context.setup();
|
|
720
721
|
}
|
|
721
722
|
timer();
|
|
722
723
|
return api;
|
|
@@ -732,7 +733,8 @@ ${formatTypes(code)}
|
|
|
732
733
|
async types(inlineConfig = { command: "types" }) {
|
|
733
734
|
this.context.debug(" Aggregating configuration options for the Powerlines project");
|
|
734
735
|
inlineConfig.command ??= "types";
|
|
735
|
-
|
|
736
|
+
this.context.config.inlineConfig = inlineConfig;
|
|
737
|
+
await this.context.setup();
|
|
736
738
|
await this.#executeEnvironments(async (context) => {
|
|
737
739
|
context.debug(`Initializing the processing options for the Powerlines project.`);
|
|
738
740
|
await this.callHook("configResolved", {
|
|
@@ -782,7 +784,8 @@ ${formatTypes(code)}
|
|
|
782
784
|
*/
|
|
783
785
|
async prepare(inlineConfig = { command: "prepare" }) {
|
|
784
786
|
inlineConfig.command ??= "prepare";
|
|
785
|
-
|
|
787
|
+
this.context.config.inlineConfig = inlineConfig;
|
|
788
|
+
await this.context.setup();
|
|
786
789
|
await this.#executeEnvironments(async (context) => {
|
|
787
790
|
context.debug(`Initializing the processing options for the Powerlines project.`);
|
|
788
791
|
await this.callHook("configResolved", {
|
|
@@ -942,11 +945,14 @@ ${formatTypes(code)}
|
|
|
942
945
|
* @returns A promise that resolves when the build command has completed
|
|
943
946
|
*/
|
|
944
947
|
async build(inlineConfig = { command: "build" }) {
|
|
948
|
+
inlineConfig.command ??= "build";
|
|
945
949
|
await this.context.generateChecksum();
|
|
946
950
|
if (this.context.meta.checksum !== this.context.persistedMeta?.checksum || this.context.config.skipCache) {
|
|
947
951
|
this.context.info(!this.context.persistedMeta?.checksum ? "No previous build cache found. Preparing the project for the initial build." : this.context.meta.checksum !== this.context.persistedMeta.checksum ? "The project has been modified since the last time `prepare` was ran. Re-preparing the project." : "The project is configured to skip cache. Re-preparing the project.");
|
|
948
|
-
inlineConfig.command ??= "build";
|
|
949
952
|
await this.prepare(inlineConfig);
|
|
953
|
+
} else {
|
|
954
|
+
this.context.config.inlineConfig = inlineConfig;
|
|
955
|
+
await this.context.setup();
|
|
950
956
|
}
|
|
951
957
|
if (this.context.config.singleBuild) await this.#handleBuild(await this.#context.toEnvironment());
|
|
952
958
|
else await this.#executeEnvironments(async (context) => {
|
|
@@ -1067,12 +1073,15 @@ var PowerlinesAPI = class PowerlinesAPI extends PowerlinesExecution {
|
|
|
1067
1073
|
static async fromOptions(options, override) {
|
|
1068
1074
|
const api = new PowerlinesAPI(await PowerlinesExecutionContext.fromOptions({
|
|
1069
1075
|
cwd: process.cwd(),
|
|
1070
|
-
mode: "production",
|
|
1076
|
+
mode: isDevelopment ? "development" : isTest ? "test" : "production",
|
|
1071
1077
|
framework: "powerlines",
|
|
1072
1078
|
...options,
|
|
1073
1079
|
configIndex: 0
|
|
1074
1080
|
}));
|
|
1075
|
-
if (override)
|
|
1081
|
+
if (override) {
|
|
1082
|
+
api.context.config.inlineConfig = override;
|
|
1083
|
+
await api.context.setup();
|
|
1084
|
+
}
|
|
1076
1085
|
api.context.$$internal = {
|
|
1077
1086
|
api,
|
|
1078
1087
|
addPlugin: api.addPlugin.bind(api)
|
|
@@ -1087,9 +1096,9 @@ var PowerlinesAPI = class PowerlinesAPI extends PowerlinesExecution {
|
|
|
1087
1096
|
result: "merge",
|
|
1088
1097
|
merge: mergeConfigs
|
|
1089
1098
|
});
|
|
1090
|
-
if (pluginConfig) {
|
|
1099
|
+
if (isSetObject(pluginConfig)) {
|
|
1091
1100
|
api.context.config.pluginConfig = pluginConfig;
|
|
1092
|
-
await api.context.setup(
|
|
1101
|
+
await api.context.setup();
|
|
1093
1102
|
}
|
|
1094
1103
|
timer();
|
|
1095
1104
|
return api;
|