@powerlines/engine 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/build.cjs +1 -1
- package/dist/api/build.d.cts +2 -2
- package/dist/api/build.d.mts +2 -2
- package/dist/api/build.mjs +1 -1
- package/dist/api/clean.d.cts +2 -2
- package/dist/api/clean.d.mts +2 -2
- package/dist/api/create.d.cts +2 -2
- package/dist/api/create.d.mts +2 -2
- package/dist/api/deploy.d.cts +2 -2
- package/dist/api/deploy.d.mts +2 -2
- package/dist/api/docs.d.cts +2 -2
- package/dist/api/docs.d.mts +2 -2
- package/dist/api/lint.d.cts +2 -2
- package/dist/api/lint.d.mts +2 -2
- package/dist/api/prepare.d.cts +2 -2
- package/dist/api/prepare.d.mts +2 -2
- package/dist/api/test.d.cts +2 -2
- package/dist/api/test.d.mts +2 -2
- package/dist/api/types.d.cts +2 -2
- package/dist/api/types.d.mts +2 -2
- package/dist/{api-Bi_h4LMX.d.cts → api-6w4hZL6n.d.cts} +3 -3
- package/dist/{api-Bi_h4LMX.d.cts.map → api-6w4hZL6n.d.cts.map} +1 -1
- package/dist/{api-oIs2Wp3t.d.mts → api-CcNgO71y.d.mts} +3 -3
- package/dist/{api-oIs2Wp3t.d.mts.map → api-CcNgO71y.d.mts.map} +1 -1
- package/dist/{config-B_E_HMcT.d.cts → config-C9AD-erz.d.mts} +8 -4
- package/dist/{config-B_E_HMcT.d.cts.map → config-C9AD-erz.d.mts.map} +1 -1
- package/dist/{config-FB8Zqjjz.d.mts → config-D6xUniHh.d.cts} +8 -4
- package/dist/{config-FB8Zqjjz.d.mts.map → config-D6xUniHh.d.cts.map} +1 -1
- package/dist/context/index.d.cts +1 -1
- package/dist/context/index.d.mts +1 -1
- package/dist/{context-DrNQXXRC.d.mts → context-S3XH2DWP.d.mts} +2 -2
- package/dist/{context-DrNQXXRC.d.mts.map → context-S3XH2DWP.d.mts.map} +1 -1
- package/dist/{context-LQBeYY23.d.cts → context-epL7NPvL.d.cts} +2 -2
- package/dist/{context-LQBeYY23.d.cts.map → context-epL7NPvL.d.cts.map} +1 -1
- package/dist/{engine-context-BBSMtv0b.d.mts → engine-context-BiDxBwme.d.mts} +3 -3
- package/dist/{engine-context-BBSMtv0b.d.mts.map → engine-context-BiDxBwme.d.mts.map} +1 -1
- package/dist/{engine-context-C6bNxumd.d.cts → engine-context-Dw8odBCo.d.cts} +3 -3
- package/dist/{engine-context-C6bNxumd.d.cts.map → engine-context-Dw8odBCo.d.cts.map} +1 -1
- package/dist/engine.cjs +1 -0
- package/dist/engine.d.cts +4 -4
- package/dist/engine.d.mts +4 -4
- package/dist/engine.mjs +1 -0
- package/dist/engine.mjs.map +1 -1
- package/dist/helpers/create-execution-host.d.cts +3 -3
- package/dist/helpers/create-execution-host.d.mts +3 -3
- package/dist/helpers/execution-host-worker.cjs +2 -1
- package/dist/helpers/execution-host-worker.d.cts +6 -2
- package/dist/helpers/execution-host-worker.d.cts.map +1 -1
- package/dist/helpers/execution-host-worker.d.mts +6 -2
- package/dist/helpers/execution-host-worker.d.mts.map +1 -1
- package/dist/helpers/execution-host-worker.mjs +2 -1
- package/dist/helpers/execution-host-worker.mjs.map +1 -1
- package/dist/helpers/rpc.d.cts +1 -1
- package/dist/helpers/rpc.d.mts +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/worker/execution-host.d.cts.map +1 -1
- package/dist/worker/execution-host.d.mts.map +1 -1
- package/package.json +3 -3
package/dist/api/build.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_chunk = require('../chunk-C0xms8kb.cjs');
|
|
3
3
|
const require_api_prepare = require('./prepare.cjs');
|
|
4
|
+
let _stryke_path_append = require("@stryke/path/append");
|
|
4
5
|
let _powerlines_core = require("@powerlines/core");
|
|
5
6
|
let _powerlines_core_lib_environment = require("@powerlines/core/lib/environment");
|
|
6
7
|
let _stryke_fs_copy_file = require("@stryke/fs/copy-file");
|
|
7
|
-
let _stryke_path_append = require("@stryke/path/append");
|
|
8
8
|
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
9
9
|
let _stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
|
|
10
10
|
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
package/dist/api/build.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-D6xUniHh.cjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-epL7NPvL.cjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/build.d.ts
|
package/dist/api/build.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-C9AD-erz.mjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-S3XH2DWP.mjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/build.d.ts
|
package/dist/api/build.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { prepare } from "./prepare.mjs";
|
|
2
|
+
import { appendPath } from "@stryke/path/append";
|
|
2
3
|
import { formatFolder } from "@powerlines/core";
|
|
3
4
|
import { executeEnvironments } from "@powerlines/core/lib/environment";
|
|
4
5
|
import { copyFiles } from "@stryke/fs/copy-file";
|
|
5
|
-
import { appendPath } from "@stryke/path/append";
|
|
6
6
|
import { relativePath } from "@stryke/path/file-path-fns";
|
|
7
7
|
import { isParentPath } from "@stryke/path/is-parent-path";
|
|
8
8
|
import { joinPaths } from "@stryke/path/join-paths";
|
package/dist/api/clean.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-D6xUniHh.cjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-epL7NPvL.cjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/clean.d.ts
|
package/dist/api/clean.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-C9AD-erz.mjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-S3XH2DWP.mjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/clean.d.ts
|
package/dist/api/create.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-D6xUniHh.cjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-epL7NPvL.cjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/create.d.ts
|
package/dist/api/create.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-C9AD-erz.mjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-S3XH2DWP.mjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/create.d.ts
|
package/dist/api/deploy.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-D6xUniHh.cjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-epL7NPvL.cjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/deploy.d.ts
|
package/dist/api/deploy.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-C9AD-erz.mjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-S3XH2DWP.mjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/deploy.d.ts
|
package/dist/api/docs.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-D6xUniHh.cjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-epL7NPvL.cjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/docs.d.ts
|
package/dist/api/docs.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-C9AD-erz.mjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-S3XH2DWP.mjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/docs.d.ts
|
package/dist/api/lint.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-D6xUniHh.cjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-epL7NPvL.cjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/lint.d.ts
|
package/dist/api/lint.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-C9AD-erz.mjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-S3XH2DWP.mjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/lint.d.ts
|
package/dist/api/prepare.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-D6xUniHh.cjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-epL7NPvL.cjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/prepare.d.ts
|
package/dist/api/prepare.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-C9AD-erz.mjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-S3XH2DWP.mjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/prepare.d.ts
|
package/dist/api/test.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-D6xUniHh.cjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-epL7NPvL.cjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/test.d.ts
|
package/dist/api/test.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-C9AD-erz.mjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-S3XH2DWP.mjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core";
|
|
4
4
|
|
|
5
5
|
//#region src/api/test.d.ts
|
package/dist/api/types.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-D6xUniHh.cjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-epL7NPvL.cjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core/types/context";
|
|
4
4
|
|
|
5
5
|
//#region src/api/types.d.ts
|
package/dist/api/types.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-C9AD-erz.mjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-S3XH2DWP.mjs";
|
|
3
3
|
import { ExecutionContext } from "@powerlines/core/types/context";
|
|
4
4
|
|
|
5
5
|
//#region src/api/types.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as EngineExecutionOptions } from "./config-
|
|
2
|
-
import { t as EngineContext } from "./context-
|
|
1
|
+
import { t as EngineExecutionOptions } from "./config-D6xUniHh.cjs";
|
|
2
|
+
import { t as EngineContext } from "./context-epL7NPvL.cjs";
|
|
3
3
|
import { BuildInlineConfig, CleanInlineConfig, CreateInlineConfig, DeployInlineConfig, DocsInlineConfig, InlineConfig, LintInlineConfig, PrepareInlineConfig, TestInlineConfig, TypesInlineConfig } from "@powerlines/core";
|
|
4
4
|
import { EXECUTION_API_METHODS } from "@powerlines/core/constants/api";
|
|
5
5
|
|
|
@@ -132,4 +132,4 @@ interface Engine<TExecutionAPI extends ReadonlyArray<string>> extends ExecutionI
|
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
134
|
export { PowerlinesExecutionHost as a, ExecutionInterface as i, ExecutionHost as n, Worker as o, ExecutionHostParams as r, Engine as t };
|
|
135
|
-
//# sourceMappingURL=api-
|
|
135
|
+
//# sourceMappingURL=api-6w4hZL6n.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-
|
|
1
|
+
{"version":3,"file":"api-6w4hZL6n.d.cts","names":[],"sources":["../src/types/utils.ts","../src/types/api.ts"],"mappings":";;;;;;KAkBY,MAAA,kCAAwC,aAAA,oBAC5C,eAAA,YAA2B,MAAA,EAAQ,OAAA,KAAY,OAAA;EAErD,KAAA;EACA,GAAA,QAAW,OAAA;AAAA;;;;AAJb;;;;;UCuBiB,kBAAA;EDtBsC;;;;;;;;EC+BrD,OAAA,GAAU,YAAA,EAAc,mBAAA,KAAwB,OAAA;ED/BP;;;;;;;;ECyCzC,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;;;AAnB9C;;;;;;;EA8BE,MAAA,GAAS,YAAA,EAAc,kBAAA,KAAuB,OAAA;EAAA;;;;;;;;;EAW9C,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;EAmCF;;;;;;EA3B1C,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EAxClB;;;;;;EAgDxB,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EA3B1C;;;;;;;;;EAsCA,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;EAnBrC;;;;;;EA2BP,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EARpB;;;;;;;;EAkBtB,MAAA,GAAS,YAAA,EAAc,kBAAA,KAAuB,OAAA;EAArC;;;;;;AAaX;;EAHE,QAAA,QAAgB,OAAA;AAAA;AAAA,UAGD,mBAAA;EAIN;;;EAAT,OAAA,EAAS,sBAAA;EAKiB;AAG5B;;EAHE,YAAA,EAAc,YAAA;AAAA;AAAA,KAGJ,aAAA,uBAAoC,aAAA,YAAyB,MAAA,CACvE,mBAAA,EACA,aAAA;AAAA,KAGU,uBAAA,GAA0B,aAAA,QAC7B,qBAAA;;;;UAMQ,MAAA,uBACO,aAAA,kBACd,kBAAA;EAdsC;;;EAkB9C,OAAA,EAAS,aAAA;EAhBI;;AAGf;EAkBE,IAAA,EAAM,aAAA,CAAc,aAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as EngineExecutionOptions } from "./config-
|
|
2
|
-
import { t as EngineContext } from "./context-
|
|
1
|
+
import { t as EngineExecutionOptions } from "./config-C9AD-erz.mjs";
|
|
2
|
+
import { t as EngineContext } from "./context-S3XH2DWP.mjs";
|
|
3
3
|
import { BuildInlineConfig, CleanInlineConfig, CreateInlineConfig, DeployInlineConfig, DocsInlineConfig, InlineConfig, LintInlineConfig, PrepareInlineConfig, TestInlineConfig, TypesInlineConfig } from "@powerlines/core";
|
|
4
4
|
import { EXECUTION_API_METHODS } from "@powerlines/core/constants/api";
|
|
5
5
|
|
|
@@ -132,4 +132,4 @@ interface Engine<TExecutionAPI extends ReadonlyArray<string>> extends ExecutionI
|
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
134
|
export { PowerlinesExecutionHost as a, ExecutionInterface as i, ExecutionHost as n, Worker as o, ExecutionHostParams as r, Engine as t };
|
|
135
|
-
//# sourceMappingURL=api-
|
|
135
|
+
//# sourceMappingURL=api-CcNgO71y.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-
|
|
1
|
+
{"version":3,"file":"api-CcNgO71y.d.mts","names":[],"sources":["../src/types/utils.ts","../src/types/api.ts"],"mappings":";;;;;;KAkBY,MAAA,kCAAwC,aAAA,oBAC5C,eAAA,YAA2B,MAAA,EAAQ,OAAA,KAAY,OAAA;EAErD,KAAA;EACA,GAAA,QAAW,OAAA;AAAA;;;;AAJb;;;;;UCuBiB,kBAAA;EDtBsC;;;;;;;;EC+BrD,OAAA,GAAU,YAAA,EAAc,mBAAA,KAAwB,OAAA;ED/BP;;;;;;;;ECyCzC,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;;;AAnB9C;;;;;;;EA8BE,MAAA,GAAS,YAAA,EAAc,kBAAA,KAAuB,OAAA;EAAA;;;;;;;;;EAW9C,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;EAmCF;;;;;;EA3B1C,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EAxClB;;;;;;EAgDxB,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EA3B1C;;;;;;;;;EAsCA,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;EAnBrC;;;;;;EA2BP,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EARpB;;;;;;;;EAkBtB,MAAA,GAAS,YAAA,EAAc,kBAAA,KAAuB,OAAA;EAArC;;;;;;AAaX;;EAHE,QAAA,QAAgB,OAAA;AAAA;AAAA,UAGD,mBAAA;EAIN;;;EAAT,OAAA,EAAS,sBAAA;EAKiB;AAG5B;;EAHE,YAAA,EAAc,YAAA;AAAA;AAAA,KAGJ,aAAA,uBAAoC,aAAA,YAAyB,MAAA,CACvE,mBAAA,EACA,aAAA;AAAA,KAGU,uBAAA,GAA0B,aAAA,QAC7B,qBAAA;;;;UAMQ,MAAA,uBACO,aAAA,kBACd,kBAAA;EAdsC;;;EAkB9C,OAAA,EAAS,aAAA;EAhBI;;AAGf;EAkBE,IAAA,EAAM,aAAA,CAAc,aAAA;AAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CustomLogger, ExecutionOptions, FrameworkOptions, LogMeta, Options, ResolvedConfig, UserConfig } from "@powerlines/core";
|
|
2
|
-
import {
|
|
3
|
-
import { BirpcOptions, BirpcReturn, ProxifiedRemoteFunctions } from "birpc";
|
|
2
|
+
import { RpcStreamingClientHost } from "devframe/client";
|
|
4
3
|
import { RpcCacheManager, RpcCacheOptions, RpcFunctionsCollector } from "devframe/rpc";
|
|
5
4
|
import { WsRpcChannelOptions } from "devframe/rpc/transports/ws-client";
|
|
5
|
+
import { MaybePromise, PartialKeys, RequiredKeys } from "@stryke/types/base";
|
|
6
|
+
import { BirpcOptions, BirpcReturn, ProxifiedRemoteFunctions } from "birpc";
|
|
6
7
|
import { ConnectionMeta, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevframeDefinition, EventEmitter, RpcSharedStateHost } from "devframe/types";
|
|
7
8
|
import { Asyncify } from "@stryke/types/async";
|
|
8
|
-
import { RpcStreamingClientHost } from "devframe/client";
|
|
9
9
|
|
|
10
10
|
//#region src/types/rpc.d.ts
|
|
11
11
|
interface RpcPayloadMetadata {
|
|
@@ -156,6 +156,10 @@ type EngineOptions = Omit<PartialKeys<DevframeDefinition, "name" | "setup">, "id
|
|
|
156
156
|
* The port number to use for the websocket connection between the engine and the various hosts.
|
|
157
157
|
*/
|
|
158
158
|
port?: number;
|
|
159
|
+
/**
|
|
160
|
+
* An optional root directory for the engine to use when resolving paths and loading configuration files. This value can be used to specify a custom root directory for the engine, which can be useful in cases where the default behavior of using the current working directory is not desirable. If this option is not provided, the engine will use the current working directory as the root directory by default.
|
|
161
|
+
*/
|
|
162
|
+
root?: string;
|
|
159
163
|
/**
|
|
160
164
|
* A custom logger instance that implements the {@link CustomLogger} interface, which can be used for logging messages during the build process instead of the default Powerlines logger.
|
|
161
165
|
*
|
|
@@ -197,4 +201,4 @@ type RpcClientOptions = RequiredKeys<EngineExecutionOptions, "baseURL" | "connec
|
|
|
197
201
|
type EngineResolvedConfig<TUserConfig extends UserConfig = UserConfig> = ResolvedConfig<TUserConfig, EngineExecutionOptions>;
|
|
198
202
|
//#endregion
|
|
199
203
|
export { RpcServerFunctions as C, WrappedRpcFunctions as D, WrappedRpcFunction as E, RpcPayloadMetadata as S, WrapRpcFunctions as T, RpcClientRemoteFunctions as _, ExtractRpcFunction as a, RpcFunctions as b, InputRpcFunctions as c, RpcClientCall as d, RpcClientCallEvent as f, RpcClientHost as g, RpcClientFunctions as h, RpcClientOptions as i, LogPayload as l, RpcClientEvents as m, EngineOptions as n, ExtractRpcFunctions as o, RpcClientCallOptional as p, EngineResolvedConfig as r, InputRpcFunction as s, EngineExecutionOptions as t, RpcClient as u, RpcContext as v, WrapRpcFunction as w, RpcPayloadEnvelop as x, RpcFunction as y };
|
|
200
|
-
//# sourceMappingURL=config-
|
|
204
|
+
//# sourceMappingURL=config-C9AD-erz.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-
|
|
1
|
+
{"version":3,"file":"config-C9AD-erz.d.mts","names":[],"sources":["../src/types/rpc.ts","../src/types/config.ts"],"mappings":";;;;;;;;;;UAkCiB,kBAAA;;AAAjB;;EAIE,SAAA;EAJiC;;;EAQjC,IAAA;EAQA;;;EAJA,SAAA;EAYW;AAGb;;EAXE,WAAA;EAWqE;;;EAPrE,WAAA;EAWS;;;EAPT,WAAA;AAAA;AAAA,UAGe,iBAAA,mBAAoC,kBAAA;EAO1B;;AAC3B;EAJE,OAAA,EAAS,QAAA;AAAA;AAAA,KAGC,WAAA,IAAe,OAAA,UAA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AChE,cAAA,CAAe,WAAA,EAAa,sBAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CustomLogger, ExecutionOptions, FrameworkOptions, LogMeta, Options, ResolvedConfig, UserConfig } from "@powerlines/core";
|
|
2
|
-
import { RpcStreamingClientHost } from "devframe/client";
|
|
3
|
-
import { RpcCacheManager, RpcCacheOptions, RpcFunctionsCollector } from "devframe/rpc";
|
|
4
|
-
import { WsRpcChannelOptions } from "devframe/rpc/transports/ws-client";
|
|
5
2
|
import { MaybePromise, PartialKeys, RequiredKeys } from "@stryke/types/base";
|
|
6
3
|
import { BirpcOptions, BirpcReturn, ProxifiedRemoteFunctions } from "birpc";
|
|
4
|
+
import { RpcCacheManager, RpcCacheOptions, RpcFunctionsCollector } from "devframe/rpc";
|
|
5
|
+
import { WsRpcChannelOptions } from "devframe/rpc/transports/ws-client";
|
|
7
6
|
import { ConnectionMeta, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevframeDefinition, EventEmitter, RpcSharedStateHost } from "devframe/types";
|
|
8
7
|
import { Asyncify } from "@stryke/types/async";
|
|
8
|
+
import { RpcStreamingClientHost } from "devframe/client";
|
|
9
9
|
|
|
10
10
|
//#region src/types/rpc.d.ts
|
|
11
11
|
interface RpcPayloadMetadata {
|
|
@@ -156,6 +156,10 @@ type EngineOptions = Omit<PartialKeys<DevframeDefinition, "name" | "setup">, "id
|
|
|
156
156
|
* The port number to use for the websocket connection between the engine and the various hosts.
|
|
157
157
|
*/
|
|
158
158
|
port?: number;
|
|
159
|
+
/**
|
|
160
|
+
* An optional root directory for the engine to use when resolving paths and loading configuration files. This value can be used to specify a custom root directory for the engine, which can be useful in cases where the default behavior of using the current working directory is not desirable. If this option is not provided, the engine will use the current working directory as the root directory by default.
|
|
161
|
+
*/
|
|
162
|
+
root?: string;
|
|
159
163
|
/**
|
|
160
164
|
* A custom logger instance that implements the {@link CustomLogger} interface, which can be used for logging messages during the build process instead of the default Powerlines logger.
|
|
161
165
|
*
|
|
@@ -197,4 +201,4 @@ type RpcClientOptions = RequiredKeys<EngineExecutionOptions, "baseURL" | "connec
|
|
|
197
201
|
type EngineResolvedConfig<TUserConfig extends UserConfig = UserConfig> = ResolvedConfig<TUserConfig, EngineExecutionOptions>;
|
|
198
202
|
//#endregion
|
|
199
203
|
export { RpcServerFunctions as C, WrappedRpcFunctions as D, WrappedRpcFunction as E, RpcPayloadMetadata as S, WrapRpcFunctions as T, RpcClientRemoteFunctions as _, ExtractRpcFunction as a, RpcFunctions as b, InputRpcFunctions as c, RpcClientCall as d, RpcClientCallEvent as f, RpcClientHost as g, RpcClientFunctions as h, RpcClientOptions as i, LogPayload as l, RpcClientEvents as m, EngineOptions as n, ExtractRpcFunctions as o, RpcClientCallOptional as p, EngineResolvedConfig as r, InputRpcFunction as s, EngineExecutionOptions as t, RpcClient as u, RpcContext as v, WrapRpcFunction as w, RpcPayloadEnvelop as x, RpcFunction as y };
|
|
200
|
-
//# sourceMappingURL=config-
|
|
204
|
+
//# sourceMappingURL=config-D6xUniHh.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-
|
|
1
|
+
{"version":3,"file":"config-D6xUniHh.d.cts","names":[],"sources":["../src/types/rpc.ts","../src/types/config.ts"],"mappings":";;;;;;;;;;UAkCiB,kBAAA;;AAAjB;;EAIE,SAAA;EAJiC;;;EAQjC,IAAA;EAQA;;;EAJA,SAAA;EAYW;AAGb;;EAXE,WAAA;EAWqE;;;EAPrE,WAAA;EAWS;;;EAPT,WAAA;AAAA;AAAA,UAGe,iBAAA,mBAAoC,kBAAA;EAO1B;;AAC3B;EAJE,OAAA,EAAS,QAAA;AAAA;AAAA,KAGC,WAAA,IAAe,OAAA,UAAiB,YAAA;AAAA,KAChC,YAAA,GAAe,MAAA,SAAe,WAAA;AAAA,KAE9B,gBAAA,IAAoB,OAAA,EAAS,iBAAA;AAAA,KAC7B,iBAAA,GAAoB,MAAA,SAAe,gBAAA;AAAA,KAEnC,kB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} from "../engine-context-Dw8odBCo.cjs";
|
|
2
2
|
export { PowerlinesEngineContext };
|
package/dist/context/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as PowerlinesEngineContext } from "../engine-context-
|
|
1
|
+
import { t as PowerlinesEngineContext } from "../engine-context-BiDxBwme.mjs";
|
|
2
2
|
export { PowerlinesEngineContext };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as EngineOptions, t as EngineExecutionOptions, u as RpcClient } from "./config-
|
|
1
|
+
import { n as EngineOptions, t as EngineExecutionOptions, u as RpcClient } from "./config-C9AD-erz.mjs";
|
|
2
2
|
import { BaseContext, InlineConfig, ParsedUserConfig } from "@powerlines/core";
|
|
3
3
|
import { ConnectionMeta, DevToolsNodeContext } from "devframe/types";
|
|
4
4
|
|
|
@@ -146,4 +146,4 @@ interface EngineSystemContext {
|
|
|
146
146
|
}
|
|
147
147
|
//#endregion
|
|
148
148
|
export { ExecutionHookScopeState as a, ExecutionScopeType as c, ExecutionCommandScopeState as i, ExecutionState as l, EngineExecutionItem as n, ExecutionPluginScopeState as o, EngineSystemContext as r, ExecutionScopeState as s, EngineContext as t };
|
|
149
|
-
//# sourceMappingURL=context-
|
|
149
|
+
//# sourceMappingURL=context-S3XH2DWP.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-
|
|
1
|
+
{"version":3,"file":"context-S3XH2DWP.d.mts","names":[],"sources":["../src/types/context.ts"],"mappings":";;;;;;AA0BA;;KAAY,kBAAA;;;AAKZ;UAAiB,mBAAA;;;;EAIf,SAAA;EAUA;;;EALA,IAAA;EAWe;;;EANf,IAAA,EAAM,kBAAA;AAAA;AAgBR;;;AAAA,UAViB,0BAAA,SAAmC,mBAAA;EAUH;;;EAN/C,IAAA;AAAA;AAqBF;;;AAAA,UAfiB,uBAAA,SAAgC,mBAAA;EAmB3C;AAMN;;EArBE,KAAA;EAyBS;;;EApBT,IAAA;AAAA;;;;UAMe,yBAAA,SAAkC,mBAAA;EAwBjD;;;EApBA,IAAA;AAAA;;;;UAMe,cAAA;EA4CR;;;EAxCP,OAAA,EAAS,0BAAA;EAyBT;;;EApBA,IAAA,EAAM,uBAAA;EA8BM;;;EAzBZ,MAAA,EAAQ,yBAAA;AAAA;AAuCV;;;AAAA,UAjCiB,mBAAA;EAoCC;;;EAhChB,YAAA;EAiDU;;;EA5CV,MAAA;EA4DK;;;EAvDL,OAAA,EAAS,sBAAA;EAsBH;;;EAjBN,UAAA,EAAY,gBAAA;EAiBV;;;EAZF,KAAA,EAAO,cAAA;AAAA;;;;;;;UASQ,aAAA,mCAEb,WAAA,CAAY,cAAA,GACZ,IAAA,CAAK,QAAA,CAAS,aAAA;EA+Bd;;;EA3BF,OAAA,EAAS,aAAA;EA6BI;;;EAxBb,UAAA,EAAY,cAAA;EAgCiD;;AAG/D;;;;EA3BE,QAAA,EAAU,mBAAA;;;;EAKV,UAAA,EAAY,mBAAA;;;;;;;EAQZ,cAAA,GACE,MAAA,UACA,YAAA,EAAc,YAAA,KACX,OAAA,CAAQ,mBAAA;;;;;;;EAQb,iBAAA,GAAoB,YAAA,UAAsB,WAAA;AAAA;AAAA,UAG3B,mBAAA;;;;EAIf,GAAA,EAAK,SAAA;AAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as EngineOptions, t as EngineExecutionOptions, u as RpcClient } from "./config-
|
|
1
|
+
import { n as EngineOptions, t as EngineExecutionOptions, u as RpcClient } from "./config-D6xUniHh.cjs";
|
|
2
2
|
import { BaseContext, InlineConfig, ParsedUserConfig } from "@powerlines/core";
|
|
3
3
|
import { ConnectionMeta, DevToolsNodeContext } from "devframe/types";
|
|
4
4
|
|
|
@@ -146,4 +146,4 @@ interface EngineSystemContext {
|
|
|
146
146
|
}
|
|
147
147
|
//#endregion
|
|
148
148
|
export { ExecutionHookScopeState as a, ExecutionScopeType as c, ExecutionCommandScopeState as i, ExecutionState as l, EngineExecutionItem as n, ExecutionPluginScopeState as o, EngineSystemContext as r, ExecutionScopeState as s, EngineContext as t };
|
|
149
|
-
//# sourceMappingURL=context-
|
|
149
|
+
//# sourceMappingURL=context-epL7NPvL.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-
|
|
1
|
+
{"version":3,"file":"context-epL7NPvL.d.cts","names":[],"sources":["../src/types/context.ts"],"mappings":";;;;;;AA0BA;;KAAY,kBAAA;;;AAKZ;UAAiB,mBAAA;;;;EAIf,SAAA;EAUA;;;EALA,IAAA;EAWe;;;EANf,IAAA,EAAM,kBAAA;AAAA;AAgBR;;;AAAA,UAViB,0BAAA,SAAmC,mBAAA;EAUH;;;EAN/C,IAAA;AAAA;AAqBF;;;AAAA,UAfiB,uBAAA,SAAgC,mBAAA;EAmB3C;AAMN;;EArBE,KAAA;EAyBS;;;EApBT,IAAA;AAAA;;;;UAMe,yBAAA,SAAkC,mBAAA;EAwBjD;;;EApBA,IAAA;AAAA;;;;UAMe,cAAA;EA4CR;;;EAxCP,OAAA,EAAS,0BAAA;EAyBT;;;EApBA,IAAA,EAAM,uBAAA;EA8BM;;;EAzBZ,MAAA,EAAQ,yBAAA;AAAA;AAuCV;;;AAAA,UAjCiB,mBAAA;EAoCC;;;EAhChB,YAAA;EAiDU;;;EA5CV,MAAA;EA4DK;;;EAvDL,OAAA,EAAS,sBAAA;EAsBH;;;EAjBN,UAAA,EAAY,gBAAA;EAiBV;;;EAZF,KAAA,EAAO,cAAA;AAAA;;;;;;;UASQ,aAAA,mCAEb,WAAA,CAAY,cAAA,GACZ,IAAA,CAAK,QAAA,CAAS,aAAA;EA+Bd;;;EA3BF,OAAA,EAAS,aAAA;EA6BI;;;EAxBb,UAAA,EAAY,cAAA;EAgCiD;;AAG/D;;;;EA3BE,QAAA,EAAU,mBAAA;;;;EAKV,UAAA,EAAY,mBAAA;;;;;;;EAQZ,cAAA,GACE,MAAA,UACA,YAAA,EAAc,YAAA,KACX,OAAA,CAAQ,mBAAA;;;;;;;EAQb,iBAAA,GAAoB,YAAA,UAAsB,WAAA;AAAA;AAAA,UAG3B,mBAAA;;;;EAIf,GAAA,EAAK,SAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as EngineOptions } from "./config-
|
|
2
|
-
import { n as EngineExecutionItem, t as EngineContext } from "./context-
|
|
1
|
+
import { n as EngineOptions } from "./config-C9AD-erz.mjs";
|
|
2
|
+
import { n as EngineExecutionItem, t as EngineContext } from "./context-S3XH2DWP.mjs";
|
|
3
3
|
import { PowerlinesBaseContext } from "@powerlines/core/context/base-context";
|
|
4
4
|
import { EnvPaths } from "@stryke/env/get-env-paths";
|
|
5
5
|
import * as _$_powerlines_core0 from "@powerlines/core";
|
|
@@ -51,4 +51,4 @@ declare class PowerlinesEngineContext<TSystemContext = unknown> extends Powerlin
|
|
|
51
51
|
}
|
|
52
52
|
//#endregion
|
|
53
53
|
export { PowerlinesEngineContext as t };
|
|
54
|
-
//# sourceMappingURL=engine-context-
|
|
54
|
+
//# sourceMappingURL=engine-context-BiDxBwme.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-context-
|
|
1
|
+
{"version":3,"file":"engine-context-BiDxBwme.d.mts","names":[],"sources":["../src/context/engine-context.ts"],"mappings":";;;;;;;;;cAmDa,uBAAA,mCACH,qBAAA,CAAsB,cAAA,aACnB,aAAA,CAAc,cAAA;EAAA;EAkIP,OAAA,EAAS,aAAA;EAClB,UAAA,EAAY,cAAA;EArIa;;;;;;EAAA,OAgBd,IAAA,0BAAA,CAClB,OAAA,EAAS,aAAA,EACT,IAAA,EAAM,YAAA,EACN,UAAA,EAAY,cAAA,GACX,OAAA,CAAQ,uBAAA,CAAwB,cAAA;EA8DnB,YAAA,CAAa,OAAA,GAAS,aAAA,EAAoB,KAAA,GAAQ,KAAA,GAAK,mBAAA,CAAA,MAAA;EAAA,IAe5D,UAAA,CAAA,GAAc,mBAAA;EAAA,IAId,QAAA,CAAA,GAAY,mBAAA;EAAA,IAIZ,QAAA,CAAA,GAAY,QAAA;EAAA,IAQZ,SAAA,CAAA,GAAa,gBAAA;EAAA,IAQb,KAAA,CAAA;EAvCuD;;;;;;EAAA,UAiDzD,WAAA,CACS,OAAA,EAAS,aAAA,EAClB,UAAA,EAAY,cAAA;EAAA;;;;;;;;;EAcR,cAAA,CACX,MAAA,UACA,YAAA,EAAc,YAAA,GACb,OAAA,CAAQ,mBAAA;EArJmB;;;;;;EAyNvB,iBAAA,CAAkB,YAAA,UAAsB,WAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as EngineOptions } from "./config-
|
|
2
|
-
import { n as EngineExecutionItem, t as EngineContext } from "./context-
|
|
1
|
+
import { n as EngineOptions } from "./config-D6xUniHh.cjs";
|
|
2
|
+
import { n as EngineExecutionItem, t as EngineContext } from "./context-epL7NPvL.cjs";
|
|
3
3
|
import * as _$_powerlines_core0 from "@powerlines/core";
|
|
4
4
|
import { FrameworkOptions, InlineConfig, LogFn, LoggerOptions } from "@powerlines/core";
|
|
5
5
|
import { ConnectionMeta, DevToolsHost, DevToolsNodeContext } from "devframe/types";
|
|
@@ -51,4 +51,4 @@ declare class PowerlinesEngineContext<TSystemContext = unknown> extends Powerlin
|
|
|
51
51
|
}
|
|
52
52
|
//#endregion
|
|
53
53
|
export { PowerlinesEngineContext as t };
|
|
54
|
-
//# sourceMappingURL=engine-context-
|
|
54
|
+
//# sourceMappingURL=engine-context-Dw8odBCo.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-context-
|
|
1
|
+
{"version":3,"file":"engine-context-Dw8odBCo.d.cts","names":[],"sources":["../src/context/engine-context.ts"],"mappings":";;;;;;;;;cAmDa,uBAAA,mCACH,qBAAA,CAAsB,cAAA,aACnB,aAAA,CAAc,cAAA;EAAA;EAkIP,OAAA,EAAS,aAAA;EAClB,UAAA,EAAY,cAAA;EArIa;;;;;;EAAA,OAgBd,IAAA,0BAAA,CAClB,OAAA,EAAS,aAAA,EACT,IAAA,EAAM,YAAA,EACN,UAAA,EAAY,cAAA,GACX,OAAA,CAAQ,uBAAA,CAAwB,cAAA;EA8DnB,YAAA,CAAa,OAAA,GAAS,aAAA,EAAoB,KAAA,GAAQ,KAAA,GAAK,mBAAA,CAAA,MAAA;EAAA,IAe5D,UAAA,CAAA,GAAc,mBAAA;EAAA,IAId,QAAA,CAAA,GAAY,mBAAA;EAAA,IAIZ,QAAA,CAAA,GAAY,QAAA;EAAA,IAQZ,SAAA,CAAA,GAAa,gBAAA;EAAA,IAQb,KAAA,CAAA;EAvCuD;;;;;;EAAA,UAiDzD,WAAA,CACS,OAAA,EAAS,aAAA,EAClB,UAAA,EAAY,cAAA;EAAA;;;;;;;;;EAcR,cAAA,CACX,MAAA,UACA,YAAA,EAAc,YAAA,GACb,OAAA,CAAQ,mBAAA;EArJmB;;;;;;EAyNvB,iBAAA,CAAkB,YAAA,UAAsB,WAAA;AAAA"}
|
package/dist/engine.cjs
CHANGED
|
@@ -256,6 +256,7 @@ async function createEngine(options, executionHostPath = "@powerlines/engine/exe
|
|
|
256
256
|
node_events.EventEmitter.setMaxListeners(100);
|
|
257
257
|
const context = await createContext(options);
|
|
258
258
|
return new PowerlinesEngine(context, await require_helpers_execution_host_worker.ExecutionHostWorker.from(executionHostPath, {
|
|
259
|
+
root: options.root,
|
|
259
260
|
context,
|
|
260
261
|
executionMethods
|
|
261
262
|
}));
|
package/dist/engine.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as EngineOptions } from "./config-
|
|
2
|
-
import { t as EngineContext } from "./context-
|
|
3
|
-
import { t as PowerlinesEngineContext } from "./engine-context-
|
|
4
|
-
import { n as ExecutionHost, t as Engine } from "./api-
|
|
1
|
+
import { n as EngineOptions } from "./config-D6xUniHh.cjs";
|
|
2
|
+
import { t as EngineContext } from "./context-epL7NPvL.cjs";
|
|
3
|
+
import { t as PowerlinesEngineContext } from "./engine-context-Dw8odBCo.cjs";
|
|
4
|
+
import { n as ExecutionHost, t as Engine } from "./api-6w4hZL6n.cjs";
|
|
5
5
|
import { BuildInlineConfig, CleanInlineConfig, CreateInlineConfig, DeployInlineConfig, DocsInlineConfig, InlineConfig, LintInlineConfig, PrepareInlineConfig, TestInlineConfig, TypesInlineConfig } from "@powerlines/core";
|
|
6
6
|
import { EXECUTION_API_METHODS } from "@powerlines/core/constants";
|
|
7
7
|
|
package/dist/engine.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as EngineOptions } from "./config-
|
|
2
|
-
import { t as EngineContext } from "./context-
|
|
3
|
-
import { t as PowerlinesEngineContext } from "./engine-context-
|
|
4
|
-
import { n as ExecutionHost, t as Engine } from "./api-
|
|
1
|
+
import { n as EngineOptions } from "./config-C9AD-erz.mjs";
|
|
2
|
+
import { t as EngineContext } from "./context-S3XH2DWP.mjs";
|
|
3
|
+
import { t as PowerlinesEngineContext } from "./engine-context-BiDxBwme.mjs";
|
|
4
|
+
import { n as ExecutionHost, t as Engine } from "./api-CcNgO71y.mjs";
|
|
5
5
|
import { EXECUTION_API_METHODS } from "@powerlines/core/constants";
|
|
6
6
|
import { BuildInlineConfig, CleanInlineConfig, CreateInlineConfig, DeployInlineConfig, DocsInlineConfig, InlineConfig, LintInlineConfig, PrepareInlineConfig, TestInlineConfig, TypesInlineConfig } from "@powerlines/core";
|
|
7
7
|
|
package/dist/engine.mjs
CHANGED
|
@@ -253,6 +253,7 @@ async function createEngine(options, executionHostPath = "@powerlines/engine/exe
|
|
|
253
253
|
EventEmitter.setMaxListeners(100);
|
|
254
254
|
const context = await createContext(options);
|
|
255
255
|
return new PowerlinesEngine(context, await ExecutionHostWorker.from(executionHostPath, {
|
|
256
|
+
root: options.root,
|
|
256
257
|
context,
|
|
257
258
|
executionMethods
|
|
258
259
|
}));
|
package/dist/engine.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.mjs","names":["#context","#host"],"sources":["../src/engine.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 {\n BuildInlineConfig,\n CleanInlineConfig,\n CreateInlineConfig,\n DeployInlineConfig,\n DocsInlineConfig,\n InlineConfig,\n LintInlineConfig,\n PrepareInlineConfig,\n TestInlineConfig,\n TypesInlineConfig\n} from \"@powerlines/core\";\nimport { EXECUTION_API_METHODS } from \"@powerlines/core/constants\";\nimport { createH3DevToolsHost } from \"devframe/node\";\nimport { getPort } from \"get-port-please\";\nimport { createApp, fromNodeMiddleware } from \"h3\";\nimport { EventEmitter } from \"node:events\";\nimport sirv from \"sirv\";\nimport { PowerlinesEngineContext } from \"./context/engine-context\";\nimport { ExecutionHostWorker } from \"./helpers/execution-host-worker\";\nimport { Engine, ExecutionHost } from \"./types/api\";\nimport { EngineOptions } from \"./types/config\";\nimport { EngineContext } from \"./types/context\";\n\n/**\n * The Powerlines process' orchestration and coordination API.\n *\n * @public\n */\nexport class PowerlinesEngine<\n TExecutionAPI extends ReadonlyArray<string> = typeof EXECUTION_API_METHODS\n>\n implements Engine<TExecutionAPI>, AsyncDisposable\n{\n /**\n * The Powerlines context\n */\n #context: EngineContext;\n\n /**\n * The execution host, which provides methods to call the execution API functions from the engine context. This allows the engine to invoke commands and other API functions during the execution of Powerlines commands, enabling communication between the engine and the execution contexts.\n */\n #host: ExecutionHost<TExecutionAPI>;\n\n /**\n * The Powerlines context\n */\n public get context(): EngineContext {\n return this.#context;\n }\n\n /**\n * The execution host, which provides methods to call the execution API functions from the engine context. This allows the engine to invoke commands and other API functions during the execution of Powerlines commands, enabling communication between the engine and the execution contexts.\n */\n public get host(): ExecutionHost<TExecutionAPI> {\n return this.#host;\n }\n\n /**\n * Create a new Powerlines Engine instance\n *\n * @param context - The Powerlines context\n * @param host - The API host for the execution workers\n * @returns A new instance of the Powerlines Engine\n */\n public constructor(\n context: EngineContext,\n host: ExecutionHost<TExecutionAPI>\n ) {\n this.#context = context;\n this.#host = host;\n }\n\n /**\n * Create a new Powerlines project\n *\n * @remarks\n * This method will create a new Powerlines project in the current directory.\n *\n * @param inlineConfig - The inline configuration for the create command\n * @returns A promise that resolves when the project has been created\n */\n public async create(inlineConfig: CreateInlineConfig) {\n const timer = this.context.timer(\"Create\");\n this.context.info(\"🆕 Creating a new project\");\n\n await this.execute(\"create\", inlineConfig);\n\n this.context.debug(\"✔ Create command completed successfully\");\n timer();\n }\n\n /**\n * Generate the Powerlines typescript declaration file\n *\n * @remarks\n * This method will only generate the typescript declaration file for the Powerlines project. It is generally recommended to run the full `prepare` command, which will run this method as part of its process.\n *\n * @param inlineConfig - The inline configuration for the types command\n */\n public async types(inlineConfig: TypesInlineConfig) {\n const timer = this.context.timer(\"Types\");\n this.context.info(\"🏗️ Generating typescript declarations for the project\");\n\n await this.execute(\"types\", inlineConfig);\n\n this.context.debug(\"✔ Types generation has completed successfully\");\n timer();\n }\n\n /**\n * Prepare the Powerlines API\n *\n * @remarks\n * This method will prepare the Powerlines API for use, initializing any necessary resources.\n *\n * @param inlineConfig - The inline configuration for the prepare command\n */\n public async prepare(inlineConfig: PrepareInlineConfig) {\n const timer = this.context.timer(\"Prepare\");\n this.context.info(\"🏗️ Preparing the project\");\n\n await this.execute(\"prepare\", inlineConfig);\n\n this.context.debug(\"✔ Preparation has completed successfully\");\n timer();\n }\n\n /**\n * Clean any previously prepared artifacts\n *\n * @remarks\n * This method will remove the previous Powerlines artifacts from the project.\n *\n * @param inlineConfig - The inline configuration for the clean command\n * @returns A promise that resolves when the clean command has completed\n */\n public async clean(inlineConfig: CleanInlineConfig) {\n const timer = this.context.timer(\"Clean\");\n this.context.info(\"🧹 Cleaning the previous artifacts\");\n\n await this.execute(\"clean\", inlineConfig);\n\n this.context.debug(\"✔ Cleaning completed successfully\");\n timer();\n }\n\n /**\n * Lint the project\n *\n * @param inlineConfig - The inline configuration for the lint command\n * @returns A promise that resolves when the lint command has completed\n */\n public async lint(inlineConfig: LintInlineConfig) {\n const timer = this.context.timer(\"Lint\");\n this.context.info(\"📝 Linting the project\");\n\n await this.execute(\"lint\", inlineConfig);\n\n this.context.debug(\"✔ Linting completed successfully\");\n timer();\n }\n\n /**\n * Test the project\n *\n * @remarks\n * This method will run the tests for the Powerlines project.\n *\n * @param inlineConfig - The inline configuration for the test command\n * @returns A promise that resolves when the test command has completed\n */\n public async test(inlineConfig: TestInlineConfig) {\n const timer = this.context.timer(\"Test\");\n this.context.info(\"🧪 Running tests for the project\");\n\n await this.execute(\"test\", inlineConfig);\n\n this.context.debug(\"✔ Testing completed successfully\");\n timer();\n }\n\n /**\n * Build the project\n *\n * @remarks\n * This method will build the Powerlines project, generating the necessary artifacts.\n *\n * @param inlineConfig - The inline configuration for the build command\n * @returns A promise that resolves when the build command has completed\n */\n public async build(inlineConfig: BuildInlineConfig) {\n const timer = this.context.timer(\"Build\");\n this.context.info(\"📦 Building the project\");\n\n await this.execute(\"build\", inlineConfig);\n\n this.context.debug(\"✔ Build completed successfully\");\n timer();\n }\n\n /**\n * Prepare the documentation for the project\n *\n * @param inlineConfig - The inline configuration for the docs command\n * @returns A promise that resolves when the documentation generation has completed\n */\n public async docs(inlineConfig: DocsInlineConfig) {\n const timer = this.context.timer(\"Docs\");\n this.context.info(\"📓 Generating documentation for the project\");\n\n await this.execute(\"docs\", inlineConfig);\n\n this.context.debug(\"✔ Documentation generation completed successfully\");\n timer();\n }\n\n /**\n * Deploy the project source code\n *\n * @remarks\n * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.\n *\n * @param inlineConfig - The inline configuration for the deploy command\n * @returns A promise that resolves when the deploy command has completed\n */\n public async deploy(inlineConfig: DeployInlineConfig) {\n const timer = this.context.timer(\"Deploy\");\n this.context.info(\"🚀 Deploying the project\");\n\n await this.execute(\"deploy\", inlineConfig);\n\n this.context.debug(\"✔ Deployment completed successfully\");\n timer();\n }\n\n /**\n * Finalization/cleanup processing for the Powerlines API\n *\n * @remarks\n * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.\n *\n * @returns A promise that resolves when the finalization process has completed\n */\n public async finalize() {\n const timer = this.context.timer(\"Finalize\");\n this.context.info(\"🏁 Finalization processes started\");\n\n await this.host.end();\n\n this.context.debug(\"✔ Finalization completed successfully\");\n timer();\n }\n\n /**\n * Asynchronous disposal method for the Powerlines Engine, which will call the finalize method to perform any necessary cleanup when the engine is disposed of.\n */\n public async [Symbol.asyncDispose]() {\n return this.finalize();\n }\n\n /**\n * Execute a Powerlines command based on the provided execution path and inline configuration, loading the necessary executions from the context and managing their lifecycle.\n *\n * @remarks\n * This method will load the executions for the specified command and inline configuration, then execute each one while managing their lifecycle, including handling their completion and any errors that may occur during execution.\n *\n * @param method - The path to the execution configuration to load and run, which can be used to specify different execution configurations for different commands or scenarios.\n * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.\n * @returns A promise that resolves when all executions for the specified command have completed\n */\n protected async execute(\n method: TExecutionAPI[number],\n inlineConfig: InlineConfig\n ) {\n await Promise.all(\n (await this.context.loadExecutions(method, inlineConfig)).map(\n async execution => {\n try {\n await this.host[method]({\n options: execution.options,\n inlineConfig\n });\n } catch (error) {\n this.context.error(\n `Execution of method \"${method}\" failed for execution with invocation ID \"${\n execution.invocationId\n }\" and execution ID \"${execution.options.executionId}\": \\n\\n${\n error instanceof Error\n ? error.stack || error.message\n : String(error)\n }`\n );\n\n throw error;\n } finally {\n this.context.completeExecution(\n execution.invocationId,\n execution.options.executionId\n );\n }\n }\n )\n );\n }\n}\n\nexport async function createContext(options: EngineOptions) {\n const port =\n options.port ??\n (await getPort({\n host: options.host || \"localhost\",\n random: true\n }));\n\n const app = createApp();\n const host = createH3DevToolsHost({\n appName: options.framework?.name || \"powerlines\",\n origin: `http://${options.host || \"localhost\"}:${port}`,\n mount: (base, dir) => {\n app.use(base, fromNodeMiddleware(sirv(dir, { dev: true, single: true })));\n }\n });\n\n return PowerlinesEngineContext.from(options, host, {\n backend: \"websocket\",\n websocket: port\n });\n}\n\nexport async function createEngine<TExecutionAPI extends ReadonlyArray<string>>(\n options: EngineOptions,\n executionHostPath = \"@powerlines/engine/execution-host\",\n executionMethods: TExecutionAPI = EXECUTION_API_METHODS as unknown as TExecutionAPI\n) {\n EventEmitter.setMaxListeners(100);\n\n const context = await createContext(options);\n const host = await ExecutionHostWorker.from<TExecutionAPI>(\n executionHostPath,\n {\n context,\n executionMethods\n }\n );\n\n return new PowerlinesEngine<TExecutionAPI>(context, host);\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+CA,IAAa,mBAAb,MAIA;;;;CAIE;;;;CAKA;;;;CAKA,IAAW,UAAyB;AAClC,SAAO,MAAKA;;;;;CAMd,IAAW,OAAqC;AAC9C,SAAO,MAAKC;;;;;;;;;CAUd,AAAO,YACL,SACA,MACA;AACA,QAAKD,UAAW;AAChB,QAAKC,OAAQ;;;;;;;;;;;CAYf,MAAa,OAAO,cAAkC;EACpD,MAAM,QAAQ,KAAK,QAAQ,MAAM,SAAS;AAC1C,OAAK,QAAQ,KAAK,4BAA4B;AAE9C,QAAM,KAAK,QAAQ,UAAU,aAAa;AAE1C,OAAK,QAAQ,MAAM,0CAA0C;AAC7D,SAAO;;;;;;;;;;CAWT,MAAa,MAAM,cAAiC;EAClD,MAAM,QAAQ,KAAK,QAAQ,MAAM,QAAQ;AACzC,OAAK,QAAQ,KAAK,0DAA0D;AAE5E,QAAM,KAAK,QAAQ,SAAS,aAAa;AAEzC,OAAK,QAAQ,MAAM,gDAAgD;AACnE,SAAO;;;;;;;;;;CAW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F,QAAO,wBAAwB,KAAK,SAAS,MAAM;EACjD,SAAS;EACT,WAAW;EACZ,CAAC;;AAGJ,eAAsB,aACpB,SACA,oBAAoB,qCACpB,mBAAkC,uBAClC;AACA,cAAa,gBAAgB,IAAI;CAEjC,MAAM,UAAU,MAAM,cAAc,QAAQ;AAS5C,QAAO,IAAI,iBAAgC,SAAS,MARjC,oBAAoB,KACrC,mBACA;EACE;EACA;EACD,CACF,CAEwD"}
|
|
1
|
+
{"version":3,"file":"engine.mjs","names":["#context","#host"],"sources":["../src/engine.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 {\n BuildInlineConfig,\n CleanInlineConfig,\n CreateInlineConfig,\n DeployInlineConfig,\n DocsInlineConfig,\n InlineConfig,\n LintInlineConfig,\n PrepareInlineConfig,\n TestInlineConfig,\n TypesInlineConfig\n} from \"@powerlines/core\";\nimport { EXECUTION_API_METHODS } from \"@powerlines/core/constants\";\nimport { createH3DevToolsHost } from \"devframe/node\";\nimport { getPort } from \"get-port-please\";\nimport { createApp, fromNodeMiddleware } from \"h3\";\nimport { EventEmitter } from \"node:events\";\nimport sirv from \"sirv\";\nimport { PowerlinesEngineContext } from \"./context/engine-context\";\nimport { ExecutionHostWorker } from \"./helpers/execution-host-worker\";\nimport { Engine, ExecutionHost } from \"./types/api\";\nimport { EngineOptions } from \"./types/config\";\nimport { EngineContext } from \"./types/context\";\n\n/**\n * The Powerlines process' orchestration and coordination API.\n *\n * @public\n */\nexport class PowerlinesEngine<\n TExecutionAPI extends ReadonlyArray<string> = typeof EXECUTION_API_METHODS\n>\n implements Engine<TExecutionAPI>, AsyncDisposable\n{\n /**\n * The Powerlines context\n */\n #context: EngineContext;\n\n /**\n * The execution host, which provides methods to call the execution API functions from the engine context. This allows the engine to invoke commands and other API functions during the execution of Powerlines commands, enabling communication between the engine and the execution contexts.\n */\n #host: ExecutionHost<TExecutionAPI>;\n\n /**\n * The Powerlines context\n */\n public get context(): EngineContext {\n return this.#context;\n }\n\n /**\n * The execution host, which provides methods to call the execution API functions from the engine context. This allows the engine to invoke commands and other API functions during the execution of Powerlines commands, enabling communication between the engine and the execution contexts.\n */\n public get host(): ExecutionHost<TExecutionAPI> {\n return this.#host;\n }\n\n /**\n * Create a new Powerlines Engine instance\n *\n * @param context - The Powerlines context\n * @param host - The API host for the execution workers\n * @returns A new instance of the Powerlines Engine\n */\n public constructor(\n context: EngineContext,\n host: ExecutionHost<TExecutionAPI>\n ) {\n this.#context = context;\n this.#host = host;\n }\n\n /**\n * Create a new Powerlines project\n *\n * @remarks\n * This method will create a new Powerlines project in the current directory.\n *\n * @param inlineConfig - The inline configuration for the create command\n * @returns A promise that resolves when the project has been created\n */\n public async create(inlineConfig: CreateInlineConfig) {\n const timer = this.context.timer(\"Create\");\n this.context.info(\"🆕 Creating a new project\");\n\n await this.execute(\"create\", inlineConfig);\n\n this.context.debug(\"✔ Create command completed successfully\");\n timer();\n }\n\n /**\n * Generate the Powerlines typescript declaration file\n *\n * @remarks\n * This method will only generate the typescript declaration file for the Powerlines project. It is generally recommended to run the full `prepare` command, which will run this method as part of its process.\n *\n * @param inlineConfig - The inline configuration for the types command\n */\n public async types(inlineConfig: TypesInlineConfig) {\n const timer = this.context.timer(\"Types\");\n this.context.info(\"🏗️ Generating typescript declarations for the project\");\n\n await this.execute(\"types\", inlineConfig);\n\n this.context.debug(\"✔ Types generation has completed successfully\");\n timer();\n }\n\n /**\n * Prepare the Powerlines API\n *\n * @remarks\n * This method will prepare the Powerlines API for use, initializing any necessary resources.\n *\n * @param inlineConfig - The inline configuration for the prepare command\n */\n public async prepare(inlineConfig: PrepareInlineConfig) {\n const timer = this.context.timer(\"Prepare\");\n this.context.info(\"🏗️ Preparing the project\");\n\n await this.execute(\"prepare\", inlineConfig);\n\n this.context.debug(\"✔ Preparation has completed successfully\");\n timer();\n }\n\n /**\n * Clean any previously prepared artifacts\n *\n * @remarks\n * This method will remove the previous Powerlines artifacts from the project.\n *\n * @param inlineConfig - The inline configuration for the clean command\n * @returns A promise that resolves when the clean command has completed\n */\n public async clean(inlineConfig: CleanInlineConfig) {\n const timer = this.context.timer(\"Clean\");\n this.context.info(\"🧹 Cleaning the previous artifacts\");\n\n await this.execute(\"clean\", inlineConfig);\n\n this.context.debug(\"✔ Cleaning completed successfully\");\n timer();\n }\n\n /**\n * Lint the project\n *\n * @param inlineConfig - The inline configuration for the lint command\n * @returns A promise that resolves when the lint command has completed\n */\n public async lint(inlineConfig: LintInlineConfig) {\n const timer = this.context.timer(\"Lint\");\n this.context.info(\"📝 Linting the project\");\n\n await this.execute(\"lint\", inlineConfig);\n\n this.context.debug(\"✔ Linting completed successfully\");\n timer();\n }\n\n /**\n * Test the project\n *\n * @remarks\n * This method will run the tests for the Powerlines project.\n *\n * @param inlineConfig - The inline configuration for the test command\n * @returns A promise that resolves when the test command has completed\n */\n public async test(inlineConfig: TestInlineConfig) {\n const timer = this.context.timer(\"Test\");\n this.context.info(\"🧪 Running tests for the project\");\n\n await this.execute(\"test\", inlineConfig);\n\n this.context.debug(\"✔ Testing completed successfully\");\n timer();\n }\n\n /**\n * Build the project\n *\n * @remarks\n * This method will build the Powerlines project, generating the necessary artifacts.\n *\n * @param inlineConfig - The inline configuration for the build command\n * @returns A promise that resolves when the build command has completed\n */\n public async build(inlineConfig: BuildInlineConfig) {\n const timer = this.context.timer(\"Build\");\n this.context.info(\"📦 Building the project\");\n\n await this.execute(\"build\", inlineConfig);\n\n this.context.debug(\"✔ Build completed successfully\");\n timer();\n }\n\n /**\n * Prepare the documentation for the project\n *\n * @param inlineConfig - The inline configuration for the docs command\n * @returns A promise that resolves when the documentation generation has completed\n */\n public async docs(inlineConfig: DocsInlineConfig) {\n const timer = this.context.timer(\"Docs\");\n this.context.info(\"📓 Generating documentation for the project\");\n\n await this.execute(\"docs\", inlineConfig);\n\n this.context.debug(\"✔ Documentation generation completed successfully\");\n timer();\n }\n\n /**\n * Deploy the project source code\n *\n * @remarks\n * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.\n *\n * @param inlineConfig - The inline configuration for the deploy command\n * @returns A promise that resolves when the deploy command has completed\n */\n public async deploy(inlineConfig: DeployInlineConfig) {\n const timer = this.context.timer(\"Deploy\");\n this.context.info(\"🚀 Deploying the project\");\n\n await this.execute(\"deploy\", inlineConfig);\n\n this.context.debug(\"✔ Deployment completed successfully\");\n timer();\n }\n\n /**\n * Finalization/cleanup processing for the Powerlines API\n *\n * @remarks\n * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.\n *\n * @returns A promise that resolves when the finalization process has completed\n */\n public async finalize() {\n const timer = this.context.timer(\"Finalize\");\n this.context.info(\"🏁 Finalization processes started\");\n\n await this.host.end();\n\n this.context.debug(\"✔ Finalization completed successfully\");\n timer();\n }\n\n /**\n * Asynchronous disposal method for the Powerlines Engine, which will call the finalize method to perform any necessary cleanup when the engine is disposed of.\n */\n public async [Symbol.asyncDispose]() {\n return this.finalize();\n }\n\n /**\n * Execute a Powerlines command based on the provided execution path and inline configuration, loading the necessary executions from the context and managing their lifecycle.\n *\n * @remarks\n * This method will load the executions for the specified command and inline configuration, then execute each one while managing their lifecycle, including handling their completion and any errors that may occur during execution.\n *\n * @param method - The path to the execution configuration to load and run, which can be used to specify different execution configurations for different commands or scenarios.\n * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.\n * @returns A promise that resolves when all executions for the specified command have completed\n */\n protected async execute(\n method: TExecutionAPI[number],\n inlineConfig: InlineConfig\n ) {\n await Promise.all(\n (await this.context.loadExecutions(method, inlineConfig)).map(\n async execution => {\n try {\n await this.host[method]({\n options: execution.options,\n inlineConfig\n });\n } catch (error) {\n this.context.error(\n `Execution of method \"${method}\" failed for execution with invocation ID \"${\n execution.invocationId\n }\" and execution ID \"${execution.options.executionId}\": \\n\\n${\n error instanceof Error\n ? error.stack || error.message\n : String(error)\n }`\n );\n\n throw error;\n } finally {\n this.context.completeExecution(\n execution.invocationId,\n execution.options.executionId\n );\n }\n }\n )\n );\n }\n}\n\nexport async function createContext(options: EngineOptions) {\n const port =\n options.port ??\n (await getPort({\n host: options.host || \"localhost\",\n random: true\n }));\n\n const app = createApp();\n const host = createH3DevToolsHost({\n appName: options.framework?.name || \"powerlines\",\n origin: `http://${options.host || \"localhost\"}:${port}`,\n mount: (base, dir) => {\n app.use(base, fromNodeMiddleware(sirv(dir, { dev: true, single: true })));\n }\n });\n\n return PowerlinesEngineContext.from(options, host, {\n backend: \"websocket\",\n websocket: port\n });\n}\n\nexport async function createEngine<TExecutionAPI extends ReadonlyArray<string>>(\n options: EngineOptions,\n executionHostPath = \"@powerlines/engine/execution-host\",\n executionMethods: TExecutionAPI = EXECUTION_API_METHODS as unknown as TExecutionAPI\n) {\n EventEmitter.setMaxListeners(100);\n\n const context = await createContext(options);\n const host = await ExecutionHostWorker.from<TExecutionAPI>(\n executionHostPath,\n {\n root: options.root,\n context,\n executionMethods\n }\n );\n\n return new PowerlinesEngine<TExecutionAPI>(context, host);\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+CA,IAAa,mBAAb,MAIA;;;;CAIE;;;;CAKA;;;;CAKA,IAAW,UAAyB;AAClC,SAAO,MAAKA;;;;;CAMd,IAAW,OAAqC;AAC9C,SAAO,MAAKC;;;;;;;;;CAUd,AAAO,YACL,SACA,MACA;AACA,QAAKD,UAAW;AAChB,QAAKC,OAAQ;;;;;;;;;;;CAYf,MAAa,OAAO,cAAkC;EACpD,MAAM,QAAQ,KAAK,QAAQ,MAAM,SAAS;AAC1C,OAAK,QAA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;EACb,MAAM,QAAQ,QAAQ;EACtB,QAAQ;EACT,CAAC;CAEJ,MAAM,MAAM,WAAW;CACvB,MAAM,OAAO,qBAAqB;EAChC,SAAS,QAAQ,WAAW,QAAQ;EACpC,QAAQ,UAAU,QAAQ,QAAQ,YAAY,GAAG;EACjD,QAAQ,MAAM,QAAQ;AACpB,OAAI,IAAI,MAAM,mBAAmB,KAAK,KAAK;IAAE,KAAK;IAAM,QAAQ;IAAM,CAAC,CAAC,CAAC;;EAE5E,CAAC;AAEF,QAAO,wBAAwB,KAAK,SAAS,MAAM;EACjD,SAAS;EACT,WAAW;EACZ,CAAC;;AAGJ,eAAsB,aACpB,SACA,oBAAoB,qCACpB,mBAAkC,uBAClC;AACA,cAAa,gBAAgB,IAAI;CAEjC,MAAM,UAAU,MAAM,cAAc,QAAQ;AAU5C,QAAO,IAAI,iBAAgC,SAAS,MATjC,oBAAoB,KACrC,mBACA;EACE,MAAM,QAAQ;EACd;EACA;EACD,CACF,CAEwD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
3
|
-
import { r as ExecutionHostParams } from "../api-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-D6xUniHh.cjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-epL7NPvL.cjs";
|
|
3
|
+
import { r as ExecutionHostParams } from "../api-6w4hZL6n.cjs";
|
|
4
4
|
import { PowerlinesExecutionContext } from "@powerlines/core/context/execution-context";
|
|
5
5
|
|
|
6
6
|
//#region src/helpers/create-execution-host.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as EngineResolvedConfig } from "../config-
|
|
2
|
-
import { r as EngineSystemContext } from "../context-
|
|
3
|
-
import { r as ExecutionHostParams } from "../api-
|
|
1
|
+
import { r as EngineResolvedConfig } from "../config-C9AD-erz.mjs";
|
|
2
|
+
import { r as EngineSystemContext } from "../context-S3XH2DWP.mjs";
|
|
3
|
+
import { r as ExecutionHostParams } from "../api-CcNgO71y.mjs";
|
|
4
4
|
import { PowerlinesExecutionContext } from "@powerlines/core/context/execution-context";
|
|
5
5
|
|
|
6
6
|
//#region src/helpers/create-execution-host.d.ts
|
|
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
const require_chunk = require('../chunk-C0xms8kb.cjs');
|
|
3
3
|
let _powerlines_core_lib_config = require("@powerlines/core/lib/config");
|
|
4
4
|
let _stryke_fs_resolve = require("@stryke/fs/resolve");
|
|
5
|
+
let _stryke_path_append = require("@stryke/path/append");
|
|
5
6
|
let _stryke_type_checks_is_number = require("@stryke/type-checks/is-number");
|
|
6
7
|
let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
|
|
7
8
|
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
@@ -65,7 +66,7 @@ var ExecutionHostWorker = class ExecutionHostWorker {
|
|
|
65
66
|
*/
|
|
66
67
|
static async from(executionHostPath, options) {
|
|
67
68
|
const mode = await (0, _powerlines_core_lib_config.getDefaultMode)(options.context.cwd);
|
|
68
|
-
const resolvedPath = await (0, _stryke_fs_resolve.resolve)(executionHostPath, { paths: [options.context.cwd] });
|
|
69
|
+
const resolvedPath = await (0, _stryke_fs_resolve.resolve)(executionHostPath, { paths: [options.context.cwd, options.root ? (0, _stryke_path_append.appendPath)(options.root, options.context.cwd) : void 0].filter(Boolean) });
|
|
69
70
|
if (!resolvedPath) throw new Error(`Could not resolve the provided Execution Host path: \`${executionHostPath}\`.`);
|
|
70
71
|
return new ExecutionHostWorker(resolvedPath, {
|
|
71
72
|
mode,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as EngineContext } from "../context-
|
|
2
|
-
import { n as ExecutionHost } from "../api-
|
|
1
|
+
import { t as EngineContext } from "../context-epL7NPvL.cjs";
|
|
2
|
+
import { n as ExecutionHost } from "../api-6w4hZL6n.cjs";
|
|
3
3
|
import { Mode } from "@powerlines/core";
|
|
4
4
|
import { Worker } from "jest-worker";
|
|
5
5
|
|
|
@@ -20,6 +20,10 @@ interface ExecutionHostWorkerOptions<TExecutionAPI extends ReadonlyArray<string>
|
|
|
20
20
|
* The mode to run the worker in, which can affect how the worker is initialized and how it behaves. This is determined based on the resolved configuration of the engine, and can be used to optimize the worker for different environments (e.g., development, production, etc.).
|
|
21
21
|
*/
|
|
22
22
|
mode?: Mode;
|
|
23
|
+
/**
|
|
24
|
+
* An optional root to resolve the execution host path from, which can be used to specify a custom root directory for the worker to use when resolving paths and loading configuration files. If this option is not provided, the worker will use the current working directory as the root directory by default.
|
|
25
|
+
*/
|
|
26
|
+
root?: string;
|
|
23
27
|
/**
|
|
24
28
|
* The context of the {@link @powerlines/engine#Engine | Engine instance}, which can be used to access the engine's state and services within the worker.
|
|
25
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-host-worker.d.cts","names":[],"sources":["../../src/helpers/execution-host-worker.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"execution-host-worker.d.cts","names":[],"sources":["../../src/helpers/execution-host-worker.ts"],"mappings":";;;;;;KAmDY,WAAA,GAAc,MAAA;AAAA,UAqDT,0BAAA,uBACO,aAAA;EAtDZ;;;;;EAuEV,OAAA;EAlByC;;;EAuBzC,cAAA;EAeS;;;EAVT,IAAA,GAAO,IAAA;EA3BP;;;EAgCA,IAAA;EALA;;;EAUA,OAAA,EAAS,aAAA;EAAA;;;EAKT,gBAAA,EAAkB,aAAA;AAAA;AAAA,cAGP,mBAAA,uBAA0C,aAAA;EAAA;YAyCzC,iBAAA;EAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EAAA;;;;;;;EAAA,OAhC5B,IAAA,uBAA2B,aAAA,SAAA,CAC7C,iBAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA,IAAc,OAAA,CAAA,aAAA,CAAA,aAAA;EA8BJ;;;;;;cADpC,iBAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EA1CK;;;;;EAkbxC,GAAA,CAAA,GAAO,UAAA,CAAW,MAAA;EAxaX;;;EAsbb,KAAA,CAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as EngineContext } from "../context-
|
|
2
|
-
import { n as ExecutionHost } from "../api-
|
|
1
|
+
import { t as EngineContext } from "../context-S3XH2DWP.mjs";
|
|
2
|
+
import { n as ExecutionHost } from "../api-CcNgO71y.mjs";
|
|
3
3
|
import { Worker } from "jest-worker";
|
|
4
4
|
import { Mode } from "@powerlines/core";
|
|
5
5
|
|
|
@@ -20,6 +20,10 @@ interface ExecutionHostWorkerOptions<TExecutionAPI extends ReadonlyArray<string>
|
|
|
20
20
|
* The mode to run the worker in, which can affect how the worker is initialized and how it behaves. This is determined based on the resolved configuration of the engine, and can be used to optimize the worker for different environments (e.g., development, production, etc.).
|
|
21
21
|
*/
|
|
22
22
|
mode?: Mode;
|
|
23
|
+
/**
|
|
24
|
+
* An optional root to resolve the execution host path from, which can be used to specify a custom root directory for the worker to use when resolving paths and loading configuration files. If this option is not provided, the worker will use the current working directory as the root directory by default.
|
|
25
|
+
*/
|
|
26
|
+
root?: string;
|
|
23
27
|
/**
|
|
24
28
|
* The context of the {@link @powerlines/engine#Engine | Engine instance}, which can be used to access the engine's state and services within the worker.
|
|
25
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-host-worker.d.mts","names":[],"sources":["../../src/helpers/execution-host-worker.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"execution-host-worker.d.mts","names":[],"sources":["../../src/helpers/execution-host-worker.ts"],"mappings":";;;;;;KAmDY,WAAA,GAAc,MAAA;AAAA,UAqDT,0BAAA,uBACO,aAAA;EAtDZ;;;;;EAuEV,OAAA;EAlByC;;;EAuBzC,cAAA;EAeS;;;EAVT,IAAA,GAAO,IAAA;EA3BP;;;EAgCA,IAAA;EALA;;;EAUA,OAAA,EAAS,aAAA;EAAA;;;EAKT,gBAAA,EAAkB,aAAA;AAAA;AAAA,cAGP,mBAAA,uBAA0C,aAAA;EAAA;YAyCzC,iBAAA;EAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EAAA;;;;;;;EAAA,OAhC5B,IAAA,uBAA2B,aAAA,SAAA,CAC7C,iBAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA,IAAc,OAAA,CAAA,aAAA,CAAA,aAAA;EA8BJ;;;;;;cADpC,iBAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EA1CK;;;;;EAkbxC,GAAA,CAAA,GAAO,UAAA,CAAW,MAAA;EAxaX;;;EAsbb,KAAA,CAAA;AAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getDefaultMode } from "@powerlines/core/lib/config";
|
|
2
2
|
import { resolve } from "@stryke/fs/resolve";
|
|
3
|
+
import { appendPath } from "@stryke/path/append";
|
|
3
4
|
import { isNumber } from "@stryke/type-checks/is-number";
|
|
4
5
|
import { isSet } from "@stryke/type-checks/is-set";
|
|
5
6
|
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
@@ -63,7 +64,7 @@ var ExecutionHostWorker = class ExecutionHostWorker {
|
|
|
63
64
|
*/
|
|
64
65
|
static async from(executionHostPath, options) {
|
|
65
66
|
const mode = await getDefaultMode(options.context.cwd);
|
|
66
|
-
const resolvedPath = await resolve(executionHostPath, { paths: [options.context.cwd] });
|
|
67
|
+
const resolvedPath = await resolve(executionHostPath, { paths: [options.context.cwd, options.root ? appendPath(options.root, options.context.cwd) : void 0].filter(Boolean) });
|
|
67
68
|
if (!resolvedPath) throw new Error(`Could not resolve the provided Execution Host path: \`${executionHostPath}\`.`);
|
|
68
69
|
return new ExecutionHostWorker(resolvedPath, {
|
|
69
70
|
mode,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-host-worker.mjs","names":["#worker","JestWorker"],"sources":["../../src/helpers/execution-host-worker.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 { Mode } from \"@powerlines/core\";\nimport { getDefaultMode } from \"@powerlines/core/lib/config\";\nimport { resolve } from \"@stryke/fs/resolve\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { formatDuration } from \"date-fns/formatDuration\";\nimport { Worker as JestWorker } from \"jest-worker\";\nimport type { ChildProcess } from \"node:child_process\";\nimport { Transform } from \"node:stream\";\nimport { parseArgs } from \"node:util\";\nimport { ExecutionHost, ExecutionHostParams } from \"../types/api\";\nimport { EngineContext } from \"../types/context\";\n\nconst RESTARTED = Symbol(\"powerlines-worker:restarted\");\n\n/**\n * The debug address is in the form of `[host:]port`. The host is optional.\n */\ninterface DebugAddress {\n host?: string;\n port: number;\n}\n\n/**\n * Formats the debug address into a string.\n */\nconst formatDebugAddress = ({ host, port }: DebugAddress): string => {\n return host ? `${host}:${port}` : `${port}`;\n};\n\nexport type NodeOptions = Record<string, string | boolean | undefined>;\n\n/**\n * Get's the debug address from the `NODE_OPTIONS` environment variable. If the\n * address is not found, it returns the default host (`undefined`) and port\n * (`9229`).\n *\n * @returns An object with the host and port of the debug address.\n */\nconst getParsedDebugAddress = (\n address: string | boolean | undefined\n): DebugAddress => {\n if (!address || !isString(address)) {\n return { host: undefined, port: 9229 };\n }\n\n // The address is in the form of `[host:]port`. Let's parse the address.\n if (address.includes(\":\")) {\n const [host, port] = address.split(\":\");\n if (!host || !port) {\n throw new Error(`Invalid debug address: ${address}`);\n }\n\n return { host, port: Number.parseInt(port, 10) };\n }\n\n return { host: undefined, port: Number.parseInt(address, 10) };\n};\n\ntype NodeInspectType = \"inspect\" | \"inspect-brk\" | undefined;\n\n/**\n * Get the debug type from the `NODE_OPTIONS` environment variable.\n */\nfunction getNodeDebugType(nodeOptions: NodeOptions): NodeInspectType {\n if (nodeOptions.inspect) {\n return \"inspect\";\n }\n if (nodeOptions[\"inspect-brk\"] || nodeOptions.inspect_brk) {\n return \"inspect-brk\";\n }\n\n return undefined;\n}\n\nconst cleanupWorkers = (worker: JestWorker) => {\n for (const curWorker of ((worker as any)._workerPool?._workers || []) as {\n _child?: ChildProcess;\n }[]) {\n curWorker._child?.kill(\"SIGINT\");\n }\n};\n\nexport interface ExecutionHostWorkerOptions<\n TExecutionAPI extends ReadonlyArray<string>\n> {\n // /**\n // * `-1` if not inspectable\n // */\n // debuggerPortOffset?: number;\n\n // /**\n // * Whether to enable source maps support in the worker, which can improve the quality of stack traces at the cost of increased memory usage and slower performance. Defaults to `false`.\n // */\n // enableSourceMaps?: boolean;\n\n /**\n * The maximum time in milliseconds a worker can run before being terminated.\n *\n * @defaultValue 900000 (15 minutes)\n */\n timeout?: number;\n\n /**\n * True if `--max-old-space-size` should not be forwarded to the worker.\n */\n isolatedMemory?: boolean;\n\n /**\n * The mode to run the worker in, which can affect how the worker is initialized and how it behaves. This is determined based on the resolved configuration of the engine, and can be used to optimize the worker for different environments (e.g., development, production, etc.).\n */\n mode?: Mode;\n\n /**\n * The context of the {@link @powerlines/engine#Engine | Engine instance}, which can be used to access the engine's state and services within the worker.\n */\n context: EngineContext;\n\n /**\n * An array of method names that the worker exposes. These methods will be available on the Worker instance and can be called to execute tasks in the worker process.\n */\n executionMethods: TExecutionAPI;\n}\n\nexport class ExecutionHostWorker<TExecutionAPI extends ReadonlyArray<string>> {\n #worker: JestWorker | undefined;\n\n /**\n * Creates a new instance of the ExecutionHostWorker class, which manages a worker process for executing tasks related to the Powerlines Engine. The worker is initialized with the specified options and can be used to run tasks in an isolated environment, with support for automatic restarts and activity monitoring.\n *\n * @param executionHostPath - The path to the Execution Host file.\n * @param options - The options for configuring the worker, including the execution context, exposed methods, timeout, and mode.\n * @returns A promise that resolves to an instance of the ExecutionHostWorker class.\n */\n public static async from<TExecutionAPI extends ReadonlyArray<string>>(\n executionHostPath: string,\n options: ExecutionHostWorkerOptions<TExecutionAPI>\n ) {\n const mode = await getDefaultMode(options.context.cwd);\n\n const resolvedPath = await resolve(executionHostPath, {\n paths: [options.context.cwd]\n });\n if (!resolvedPath) {\n throw new Error(\n `Could not resolve the provided Execution Host path: \\`${executionHostPath}\\`.`\n );\n }\n\n return new ExecutionHostWorker<TExecutionAPI>(resolvedPath, {\n mode,\n ...options\n }) as unknown as ExecutionHost<TExecutionAPI>;\n }\n\n /**\n * Create a new worker instance.\n *\n * @param executionHostPath - The path to the worker file.\n * @param options - The options for the worker, including exposed methods, timeout, and hooks for activity and restart.\n */\n public constructor(\n protected executionHostPath: string,\n protected options: ExecutionHostWorkerOptions<TExecutionAPI>\n ) {\n const {\n timeout = 900_000,\n isolatedMemory = false,\n mode = \"production\",\n context,\n executionMethods\n } = this.options;\n\n const logger = context.extendLogger({ category: \"communication\" });\n\n let restartPromise: Promise<typeof RESTARTED>;\n let resolveRestartPromise: (arg: typeof RESTARTED) => void;\n let activeTasks = 0;\n\n this.#worker = undefined;\n\n // ensure we end workers if they weren't before exit\n process.on(\"exit\", () => {\n this.close();\n });\n\n let nodeOptions = {} as {\n [longOption: string]: string | boolean | undefined;\n };\n\n const args: string[] = [...process.execArgv];\n if (process.env.NODE_OPTIONS) {\n let isInString = false;\n let willStartNewArg = true;\n for (let i = 0; i < process.env.NODE_OPTIONS.length; i++) {\n let char = process.env.NODE_OPTIONS[i];\n if (char) {\n // Skip any escaped characters in strings.\n if (char === \"\\\\\" && isInString) {\n // Ensure we don't have an escape character at the end.\n if (process.env.NODE_OPTIONS.length === i + 1) {\n throw new Error(\"Invalid escape character at the end.\");\n }\n\n // Skip the next character.\n char = process.env.NODE_OPTIONS[++i];\n if (!char) {\n continue;\n }\n }\n // If we find a space outside of a string, we should start a new argument.\n else if (char === \" \" && !isInString) {\n willStartNewArg = true;\n continue;\n }\n\n // If we find a quote, we should toggle the string flag.\n else if (char === '\"') {\n isInString = !isInString;\n continue;\n }\n\n // If we're starting a new argument, we should add it to the array.\n if (willStartNewArg) {\n args.push(char);\n willStartNewArg = false;\n }\n // Otherwise, add it to the last argument.\n else {\n args[args.length - 1] += char;\n }\n }\n }\n\n if (isInString) {\n throw new Error(\"Unterminated string\");\n }\n }\n\n if (args.length > 0) {\n const { values, tokens } = parseArgs({\n args,\n strict: false,\n tokens: true\n });\n nodeOptions = values;\n\n // For the `NODE_OPTIONS`, we support arguments with values without the `=`\n // sign. We need to parse them manually.\n let orphan = null;\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n if (!token) continue;\n\n if (token.kind === \"option-terminator\") {\n break;\n }\n\n // When we encounter an option, if it's value is undefined, we should check\n // to see if the following tokens are positional parameters. If they are,\n // then the option is orphaned, and we can assign it.\n if (token.kind === \"option\") {\n orphan = !isSet(token.value) ? token : null;\n continue;\n }\n\n // If the token isn't a positional one, then we can't assign it to the found\n // orphaned option.\n if (token.kind !== \"positional\") {\n orphan = null;\n continue;\n }\n\n // If we don't have an orphan, then we can skip this token.\n if (!orphan) {\n continue;\n }\n\n // If the token is a positional one, and it has a value, so add it to the\n // values object. If it already exists, append it with a space.\n if (orphan.name in nodeOptions && isString(nodeOptions[orphan.name])) {\n nodeOptions[orphan.name] += ` ${token.value}`;\n } else {\n nodeOptions[orphan.name] = token.value;\n }\n }\n }\n\n const originalOptions = { ...nodeOptions };\n\n delete nodeOptions.inspect;\n delete nodeOptions[\"inspect-brk\"];\n delete nodeOptions.inspect_brk;\n\n if (mode === \"development\") {\n const nodeDebugType = getNodeDebugType(originalOptions);\n if (nodeDebugType) {\n const debuggerAddress = getParsedDebugAddress(\n originalOptions[nodeDebugType]\n );\n const address: DebugAddress = {\n host: debuggerAddress.host,\n // current process runs on `address.port`\n port: debuggerAddress.port === 0 ? 0 : debuggerAddress.port + 1 + 1\n };\n nodeOptions[nodeDebugType] = formatDebugAddress(address);\n }\n\n nodeOptions[\"enable-source-maps\"] = true;\n }\n\n if (isolatedMemory) {\n delete nodeOptions[\"max-old-space-size\"];\n delete nodeOptions.max_old_space_size;\n }\n\n const execArgv: string[] = [];\n const nodeOptionsParts: string[] = [];\n for (const [key, value] of Object.entries(nodeOptions)) {\n let formatted: string | null = null;\n if (value === true) {\n formatted = `--${key}`;\n } else if (value) {\n formatted = `--${key}=${\n // Values with spaces need to be quoted. We use JSON.stringify to\n // also escape any nested quotes.\n value.includes(\" \") && !value.startsWith('\"')\n ? JSON.stringify(value)\n : value\n }`;\n }\n\n if (formatted === null) {\n continue;\n }\n\n if (\n [\n \"experimental-network-inspection\",\n \"experimental-storage-inspection\",\n \"experimental-worker-inspection\",\n \"experimental-inspector-network-resource\"\n ].includes(key)\n ) {\n execArgv.push(formatted);\n } else {\n nodeOptionsParts.push(formatted);\n }\n }\n\n const onHanging = () => {\n const worker = this.#worker;\n if (!worker) {\n return;\n }\n\n const resolve = resolveRestartPromise;\n // eslint-disable-next-line ts/no-use-before-define\n createWorker();\n\n logger.warn(\n `Sending SIGTERM signal to worker due to timeout${\n timeout ? ` of ${formatDuration({ seconds: timeout / 1000 })}` : \"\"\n }. Subsequent errors may be a result of the worker exiting.`\n );\n\n void worker.end().then(() => {\n resolve(RESTARTED);\n });\n };\n\n let hangingTimer: NodeJS.Timeout | false = false;\n\n const onActivity = () => {\n if (hangingTimer) {\n clearTimeout(hangingTimer);\n }\n\n hangingTimer = activeTasks > 0 && setTimeout(onHanging, timeout);\n };\n\n const createWorker = () => {\n const env: NodeJS.ProcessEnv = {\n ...process.env,\n NODE_ENV: mode,\n NODE_OPTIONS: nodeOptionsParts.join(\" \"),\n POWERLINES_EXECUTION_HOST_WORKER: \"true\"\n };\n\n if (env.FORCE_COLOR === undefined) {\n // Mirror the enablement heuristic from picocolors (see https://github.com/vercel/next.js/blob/6a40da0345939fe4f7b1ae519b296a86dd103432/packages/next/src/lib/picocolors.ts#L21-L24).\n // Picocolors snapshots `process.env`/`stdout.isTTY` at module load time, so when the worker\n // process bootstraps with piped stdio its own check would disable colors. Re-evaluating the\n // same conditions here lets us opt the worker into color output only when the parent would\n // have seen colors, while still respecting explicit opt-outs like NO_COLOR.\n const supportsColors =\n !env.NO_COLOR &&\n !env.CI &&\n env.TERM !== \"dumb\" &&\n (process.stdout.isTTY || process.stderr?.isTTY);\n\n if (supportsColors) {\n env.FORCE_COLOR = \"1\";\n }\n }\n\n this.#worker = new JestWorker(executionHostPath, {\n maxRetries: 0,\n computeWorkerKey: (_, ...args: Array<unknown>) => {\n let executionId = \"default\";\n let configIndex = 0;\n if (args.length > 0 && isSetObject(args[0])) {\n const arg = args[0] as ExecutionHostParams;\n if (isSetObject(arg.options)) {\n configIndex = arg.options.configIndex ?? 0;\n executionId = arg.options.executionId || \"default\";\n }\n }\n\n return `${executionId}-${configIndex}`;\n },\n forkOptions: {\n execArgv,\n env\n }\n });\n restartPromise = new Promise(resolve => {\n resolveRestartPromise = resolve;\n });\n\n for (const worker of ((this.#worker as any)._workerPool?._workers ||\n []) as {\n _child?: ChildProcess;\n }[]) {\n worker._child?.on(\"exit\", (code, signal) => {\n logger.debug(\n `Worker process exited with code ${code} and signal ${signal}`\n );\n\n if ((code || (signal && signal !== \"SIGINT\")) && this.#worker) {\n const error = new Error(\n `Execution Host Worker exited unexpectedly with code ${\n code\n } and signal ${signal}`\n );\n logger.error(error);\n\n throw error;\n }\n });\n\n worker._child?.on(\"error\", error => {\n logger.error({\n meta: { category: \"communication\" },\n message: `Worker process emitted an error: ${error.message}`,\n error\n });\n });\n\n // if a child process emits a particular message, we track that as activity\n // so the parent process can keep track of progress\n worker._child?.on(\"message\", data => {\n onActivity();\n\n if (Array.isArray(data) && data.length > 1 && isNumber(data[0])) {\n if (data[0] === 0) {\n logger.trace(\n `Received message from worker: ${JSON.stringify(data.slice(1), null, 2)}`\n );\n } else {\n logger.debug(\n `Received error message from worker: ${JSON.stringify(\n data.slice(1),\n null,\n 2\n )}`\n );\n }\n }\n\n logger.trace(\n `Received message from worker: ${JSON.stringify(data, null, 2)}`\n );\n });\n }\n\n let aborted = false;\n const onActivityAbort = () => {\n if (!aborted) {\n aborted = true;\n }\n };\n\n // Listen to the worker's stdout and stderr, if there's any thing logged, abort the activity first\n const abortActivityStreamOnLog = new Transform({\n transform(_chunk, _encoding, callback) {\n onActivityAbort();\n callback();\n }\n });\n // Stop the activity if there's any output from the worker\n this.#worker.getStdout().pipe(abortActivityStreamOnLog);\n this.#worker.getStderr().pipe(abortActivityStreamOnLog);\n\n // Pipe the worker's stdout and stderr to the parent process\n this.#worker.getStdout().pipe(process.stdout);\n this.#worker.getStderr().pipe(process.stderr);\n };\n createWorker();\n\n for (const method of executionMethods) {\n if (method.startsWith(\"_\")) {\n continue;\n }\n\n (this as any)[method] = timeout\n ? async (...args: any[]) => {\n activeTasks++;\n try {\n let attempts = 0;\n for (;;) {\n onActivity();\n\n const result = await Promise.race([\n // eslint-disable-next-line ts/no-unsafe-call\n (this.#worker as any)[method](\n args.length > 0 && args[0] ? args[0] : {}\n ),\n restartPromise\n ]);\n if (result !== RESTARTED) {\n return result;\n }\n\n logger.warn(\n `Execution Host Worker was restarted while calling method \"${\n method\n }\" (attempt ${attempts++}). Retrying the call...`\n );\n }\n } finally {\n activeTasks--;\n onActivity();\n }\n }\n : // eslint-disable-next-line ts/no-unsafe-call\n (this.#worker as any)[method].bind(this.#worker);\n }\n }\n\n /**\n * Ends the worker process and cleans up any resources associated with it. This method should be called when the worker is no longer needed, to ensure that it is properly terminated and does not continue to consume system resources. If the worker is already terminated or was never initialized, this method will throw an error.\n *\n * @returns A promise that resolves when the worker has been successfully terminated.\n */\n public async end(): ReturnType<JestWorker[\"end\"]> {\n const worker = this.#worker;\n if (!worker) {\n throw new Error(\"Execution Host Worker is not initialized\");\n }\n\n cleanupWorkers(worker);\n this.#worker = undefined;\n return worker.end();\n }\n\n /**\n * Quietly end the worker if it exists\n */\n public close(): void {\n if (this.#worker) {\n cleanupWorkers(this.#worker);\n void this.#worker.end();\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;AAiCA,MAAM,YAAY,OAAO,8BAA8B;;;;AAavD,MAAM,sBAAsB,EAAE,MAAM,WAAiC;AACnE,QAAO,OAAO,GAAG,KAAK,GAAG,SAAS,GAAG;;;;;;;;;AAYvC,MAAM,yBACJ,YACiB;AACjB,KAAI,CAAC,WAAW,CAAC,SAAS,QAAQ,CAChC,QAAO;EAAE,MAAM;EAAW,MAAM;EAAM;AAIxC,KAAI,QAAQ,SAAS,IAAI,EAAE;EACzB,MAAM,CAAC,MAAM,QAAQ,QAAQ,MAAM,IAAI;AACvC,MAAI,CAAC,QAAQ,CAAC,KACZ,OAAM,IAAI,MAAM,0BAA0B,UAAU;AAGtD,SAAO;GAAE;GAAM,MAAM,OAAO,SAAS,MAAM,GAAG;GAAE;;AAGlD,QAAO;EAAE,MAAM;EAAW,MAAM,OAAO,SAAS,SAAS,GAAG;EAAE;;;;;AAQhE,SAAS,iBAAiB,aAA2C;AACnE,KAAI,YAAY,QACd,QAAO;AAET,KAAI,YAAY,kBAAkB,YAAY,YAC5C,QAAO;;AAMX,MAAM,kBAAkB,WAAuB;AAC7C,MAAK,MAAM,aAAe,OAAe,aAAa,YAAY,EAAE,CAGlE,WAAU,QAAQ,KAAK,SAAS;;AA6CpC,IAAa,sBAAb,MAAa,oBAAiE;CAC5E;;;;;;;;CASA,aAAoB,KAClB,mBACA,SACA;EACA,MAAM,OAAO,MAAM,eAAe,QAAQ,QAAQ,IAAI;EAEtD,MAAM,eAAe,MAAM,QAAQ,m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pB,OAAO,GAAG,SAAgB;AACxB;AACA,QAAI;KACF,IAAI,WAAW;AACf,cAAS;AACP,kBAAY;MAEZ,MAAM,SAAS,MAAM,QAAQ,KAAK,CAE/B,MAAKA,OAAgB,QACpB,KAAK,SAAS,KAAK,KAAK,KAAK,KAAK,KAAK,EAAE,CAC1C,EACD,eACD,CAAC;AACF,UAAI,WAAW,UACb,QAAO;AAGT,aAAO,KACL,6DACE,OACD,aAAa,WAAW,yBAC1B;;cAEK;AACR;AACA,iBAAY;;OAIf,MAAKA,OAAgB,QAAQ,KAAK,MAAKA,OAAQ;;;;;;;;CASxD,MAAa,MAAqC;EAChD,MAAM,SAAS,MAAKA;AACpB,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,2CAA2C;AAG7D,iBAAe,OAAO;AACtB,QAAKA,SAAU;AACf,SAAO,OAAO,KAAK;;;;;CAMrB,AAAO,QAAc;AACnB,MAAI,MAAKA,QAAS;AAChB,kBAAe,MAAKA,OAAQ;AAC5B,GAAK,MAAKA,OAAQ,KAAK"}
|
|
1
|
+
{"version":3,"file":"execution-host-worker.mjs","names":["#worker","JestWorker"],"sources":["../../src/helpers/execution-host-worker.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 { Mode } from \"@powerlines/core\";\nimport { getDefaultMode } from \"@powerlines/core/lib/config\";\nimport { resolve } from \"@stryke/fs/resolve\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { formatDuration } from \"date-fns/formatDuration\";\nimport { Worker as JestWorker } from \"jest-worker\";\nimport type { ChildProcess } from \"node:child_process\";\nimport { Transform } from \"node:stream\";\nimport { parseArgs } from \"node:util\";\nimport { ExecutionHost, ExecutionHostParams } from \"../types/api\";\nimport { EngineContext } from \"../types/context\";\n\nconst RESTARTED = Symbol(\"powerlines-worker:restarted\");\n\n/**\n * The debug address is in the form of `[host:]port`. The host is optional.\n */\ninterface DebugAddress {\n host?: string;\n port: number;\n}\n\n/**\n * Formats the debug address into a string.\n */\nconst formatDebugAddress = ({ host, port }: DebugAddress): string => {\n return host ? `${host}:${port}` : `${port}`;\n};\n\nexport type NodeOptions = Record<string, string | boolean | undefined>;\n\n/**\n * Get's the debug address from the `NODE_OPTIONS` environment variable. If the\n * address is not found, it returns the default host (`undefined`) and port\n * (`9229`).\n *\n * @returns An object with the host and port of the debug address.\n */\nconst getParsedDebugAddress = (\n address: string | boolean | undefined\n): DebugAddress => {\n if (!address || !isString(address)) {\n return { host: undefined, port: 9229 };\n }\n\n // The address is in the form of `[host:]port`. Let's parse the address.\n if (address.includes(\":\")) {\n const [host, port] = address.split(\":\");\n if (!host || !port) {\n throw new Error(`Invalid debug address: ${address}`);\n }\n\n return { host, port: Number.parseInt(port, 10) };\n }\n\n return { host: undefined, port: Number.parseInt(address, 10) };\n};\n\ntype NodeInspectType = \"inspect\" | \"inspect-brk\" | undefined;\n\n/**\n * Get the debug type from the `NODE_OPTIONS` environment variable.\n */\nfunction getNodeDebugType(nodeOptions: NodeOptions): NodeInspectType {\n if (nodeOptions.inspect) {\n return \"inspect\";\n }\n if (nodeOptions[\"inspect-brk\"] || nodeOptions.inspect_brk) {\n return \"inspect-brk\";\n }\n\n return undefined;\n}\n\nconst cleanupWorkers = (worker: JestWorker) => {\n for (const curWorker of ((worker as any)._workerPool?._workers || []) as {\n _child?: ChildProcess;\n }[]) {\n curWorker._child?.kill(\"SIGINT\");\n }\n};\n\nexport interface ExecutionHostWorkerOptions<\n TExecutionAPI extends ReadonlyArray<string>\n> {\n // /**\n // * `-1` if not inspectable\n // */\n // debuggerPortOffset?: number;\n\n // /**\n // * Whether to enable source maps support in the worker, which can improve the quality of stack traces at the cost of increased memory usage and slower performance. Defaults to `false`.\n // */\n // enableSourceMaps?: boolean;\n\n /**\n * The maximum time in milliseconds a worker can run before being terminated.\n *\n * @defaultValue 900000 (15 minutes)\n */\n timeout?: number;\n\n /**\n * True if `--max-old-space-size` should not be forwarded to the worker.\n */\n isolatedMemory?: boolean;\n\n /**\n * The mode to run the worker in, which can affect how the worker is initialized and how it behaves. This is determined based on the resolved configuration of the engine, and can be used to optimize the worker for different environments (e.g., development, production, etc.).\n */\n mode?: Mode;\n\n /**\n * An optional root to resolve the execution host path from, which can be used to specify a custom root directory for the worker to use when resolving paths and loading configuration files. If this option is not provided, the worker will use the current working directory as the root directory by default.\n */\n root?: string;\n\n /**\n * The context of the {@link @powerlines/engine#Engine | Engine instance}, which can be used to access the engine's state and services within the worker.\n */\n context: EngineContext;\n\n /**\n * An array of method names that the worker exposes. These methods will be available on the Worker instance and can be called to execute tasks in the worker process.\n */\n executionMethods: TExecutionAPI;\n}\n\nexport class ExecutionHostWorker<TExecutionAPI extends ReadonlyArray<string>> {\n #worker: JestWorker | undefined;\n\n /**\n * Creates a new instance of the ExecutionHostWorker class, which manages a worker process for executing tasks related to the Powerlines Engine. The worker is initialized with the specified options and can be used to run tasks in an isolated environment, with support for automatic restarts and activity monitoring.\n *\n * @param executionHostPath - The path to the Execution Host file.\n * @param options - The options for configuring the worker, including the execution context, exposed methods, timeout, and mode.\n * @returns A promise that resolves to an instance of the ExecutionHostWorker class.\n */\n public static async from<TExecutionAPI extends ReadonlyArray<string>>(\n executionHostPath: string,\n options: ExecutionHostWorkerOptions<TExecutionAPI>\n ) {\n const mode = await getDefaultMode(options.context.cwd);\n\n const resolvedPath = await resolve(executionHostPath, {\n paths: [\n options.context.cwd,\n options.root ? appendPath(options.root, options.context.cwd) : undefined\n ].filter(Boolean) as string[]\n });\n if (!resolvedPath) {\n throw new Error(\n `Could not resolve the provided Execution Host path: \\`${executionHostPath}\\`.`\n );\n }\n\n return new ExecutionHostWorker<TExecutionAPI>(resolvedPath, {\n mode,\n ...options\n }) as unknown as ExecutionHost<TExecutionAPI>;\n }\n\n /**\n * Create a new worker instance.\n *\n * @param executionHostPath - The path to the worker file.\n * @param options - The options for the worker, including exposed methods, timeout, and hooks for activity and restart.\n */\n public constructor(\n protected executionHostPath: string,\n protected options: ExecutionHostWorkerOptions<TExecutionAPI>\n ) {\n const {\n timeout = 900_000,\n isolatedMemory = false,\n mode = \"production\",\n context,\n executionMethods\n } = this.options;\n\n const logger = context.extendLogger({ category: \"communication\" });\n\n let restartPromise: Promise<typeof RESTARTED>;\n let resolveRestartPromise: (arg: typeof RESTARTED) => void;\n let activeTasks = 0;\n\n this.#worker = undefined;\n\n // ensure we end workers if they weren't before exit\n process.on(\"exit\", () => {\n this.close();\n });\n\n let nodeOptions = {} as {\n [longOption: string]: string | boolean | undefined;\n };\n\n const args: string[] = [...process.execArgv];\n if (process.env.NODE_OPTIONS) {\n let isInString = false;\n let willStartNewArg = true;\n for (let i = 0; i < process.env.NODE_OPTIONS.length; i++) {\n let char = process.env.NODE_OPTIONS[i];\n if (char) {\n // Skip any escaped characters in strings.\n if (char === \"\\\\\" && isInString) {\n // Ensure we don't have an escape character at the end.\n if (process.env.NODE_OPTIONS.length === i + 1) {\n throw new Error(\"Invalid escape character at the end.\");\n }\n\n // Skip the next character.\n char = process.env.NODE_OPTIONS[++i];\n if (!char) {\n continue;\n }\n }\n // If we find a space outside of a string, we should start a new argument.\n else if (char === \" \" && !isInString) {\n willStartNewArg = true;\n continue;\n }\n\n // If we find a quote, we should toggle the string flag.\n else if (char === '\"') {\n isInString = !isInString;\n continue;\n }\n\n // If we're starting a new argument, we should add it to the array.\n if (willStartNewArg) {\n args.push(char);\n willStartNewArg = false;\n }\n // Otherwise, add it to the last argument.\n else {\n args[args.length - 1] += char;\n }\n }\n }\n\n if (isInString) {\n throw new Error(\"Unterminated string\");\n }\n }\n\n if (args.length > 0) {\n const { values, tokens } = parseArgs({\n args,\n strict: false,\n tokens: true\n });\n nodeOptions = values;\n\n // For the `NODE_OPTIONS`, we support arguments with values without the `=`\n // sign. We need to parse them manually.\n let orphan = null;\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n if (!token) continue;\n\n if (token.kind === \"option-terminator\") {\n break;\n }\n\n // When we encounter an option, if it's value is undefined, we should check\n // to see if the following tokens are positional parameters. If they are,\n // then the option is orphaned, and we can assign it.\n if (token.kind === \"option\") {\n orphan = !isSet(token.value) ? token : null;\n continue;\n }\n\n // If the token isn't a positional one, then we can't assign it to the found\n // orphaned option.\n if (token.kind !== \"positional\") {\n orphan = null;\n continue;\n }\n\n // If we don't have an orphan, then we can skip this token.\n if (!orphan) {\n continue;\n }\n\n // If the token is a positional one, and it has a value, so add it to the\n // values object. If it already exists, append it with a space.\n if (orphan.name in nodeOptions && isString(nodeOptions[orphan.name])) {\n nodeOptions[orphan.name] += ` ${token.value}`;\n } else {\n nodeOptions[orphan.name] = token.value;\n }\n }\n }\n\n const originalOptions = { ...nodeOptions };\n\n delete nodeOptions.inspect;\n delete nodeOptions[\"inspect-brk\"];\n delete nodeOptions.inspect_brk;\n\n if (mode === \"development\") {\n const nodeDebugType = getNodeDebugType(originalOptions);\n if (nodeDebugType) {\n const debuggerAddress = getParsedDebugAddress(\n originalOptions[nodeDebugType]\n );\n const address: DebugAddress = {\n host: debuggerAddress.host,\n // current process runs on `address.port`\n port: debuggerAddress.port === 0 ? 0 : debuggerAddress.port + 1 + 1\n };\n nodeOptions[nodeDebugType] = formatDebugAddress(address);\n }\n\n nodeOptions[\"enable-source-maps\"] = true;\n }\n\n if (isolatedMemory) {\n delete nodeOptions[\"max-old-space-size\"];\n delete nodeOptions.max_old_space_size;\n }\n\n const execArgv: string[] = [];\n const nodeOptionsParts: string[] = [];\n for (const [key, value] of Object.entries(nodeOptions)) {\n let formatted: string | null = null;\n if (value === true) {\n formatted = `--${key}`;\n } else if (value) {\n formatted = `--${key}=${\n // Values with spaces need to be quoted. We use JSON.stringify to\n // also escape any nested quotes.\n value.includes(\" \") && !value.startsWith('\"')\n ? JSON.stringify(value)\n : value\n }`;\n }\n\n if (formatted === null) {\n continue;\n }\n\n if (\n [\n \"experimental-network-inspection\",\n \"experimental-storage-inspection\",\n \"experimental-worker-inspection\",\n \"experimental-inspector-network-resource\"\n ].includes(key)\n ) {\n execArgv.push(formatted);\n } else {\n nodeOptionsParts.push(formatted);\n }\n }\n\n const onHanging = () => {\n const worker = this.#worker;\n if (!worker) {\n return;\n }\n\n const resolve = resolveRestartPromise;\n // eslint-disable-next-line ts/no-use-before-define\n createWorker();\n\n logger.warn(\n `Sending SIGTERM signal to worker due to timeout${\n timeout ? ` of ${formatDuration({ seconds: timeout / 1000 })}` : \"\"\n }. Subsequent errors may be a result of the worker exiting.`\n );\n\n void worker.end().then(() => {\n resolve(RESTARTED);\n });\n };\n\n let hangingTimer: NodeJS.Timeout | false = false;\n\n const onActivity = () => {\n if (hangingTimer) {\n clearTimeout(hangingTimer);\n }\n\n hangingTimer = activeTasks > 0 && setTimeout(onHanging, timeout);\n };\n\n const createWorker = () => {\n const env: NodeJS.ProcessEnv = {\n ...process.env,\n NODE_ENV: mode,\n NODE_OPTIONS: nodeOptionsParts.join(\" \"),\n POWERLINES_EXECUTION_HOST_WORKER: \"true\"\n };\n\n if (env.FORCE_COLOR === undefined) {\n // Mirror the enablement heuristic from picocolors (see https://github.com/vercel/next.js/blob/6a40da0345939fe4f7b1ae519b296a86dd103432/packages/next/src/lib/picocolors.ts#L21-L24).\n // Picocolors snapshots `process.env`/`stdout.isTTY` at module load time, so when the worker\n // process bootstraps with piped stdio its own check would disable colors. Re-evaluating the\n // same conditions here lets us opt the worker into color output only when the parent would\n // have seen colors, while still respecting explicit opt-outs like NO_COLOR.\n const supportsColors =\n !env.NO_COLOR &&\n !env.CI &&\n env.TERM !== \"dumb\" &&\n (process.stdout.isTTY || process.stderr?.isTTY);\n\n if (supportsColors) {\n env.FORCE_COLOR = \"1\";\n }\n }\n\n this.#worker = new JestWorker(executionHostPath, {\n maxRetries: 0,\n computeWorkerKey: (_, ...args: Array<unknown>) => {\n let executionId = \"default\";\n let configIndex = 0;\n if (args.length > 0 && isSetObject(args[0])) {\n const arg = args[0] as ExecutionHostParams;\n if (isSetObject(arg.options)) {\n configIndex = arg.options.configIndex ?? 0;\n executionId = arg.options.executionId || \"default\";\n }\n }\n\n return `${executionId}-${configIndex}`;\n },\n forkOptions: {\n execArgv,\n env\n }\n });\n restartPromise = new Promise(resolve => {\n resolveRestartPromise = resolve;\n });\n\n for (const worker of ((this.#worker as any)._workerPool?._workers ||\n []) as {\n _child?: ChildProcess;\n }[]) {\n worker._child?.on(\"exit\", (code, signal) => {\n logger.debug(\n `Worker process exited with code ${code} and signal ${signal}`\n );\n\n if ((code || (signal && signal !== \"SIGINT\")) && this.#worker) {\n const error = new Error(\n `Execution Host Worker exited unexpectedly with code ${\n code\n } and signal ${signal}`\n );\n logger.error(error);\n\n throw error;\n }\n });\n\n worker._child?.on(\"error\", error => {\n logger.error({\n meta: { category: \"communication\" },\n message: `Worker process emitted an error: ${error.message}`,\n error\n });\n });\n\n // if a child process emits a particular message, we track that as activity\n // so the parent process can keep track of progress\n worker._child?.on(\"message\", data => {\n onActivity();\n\n if (Array.isArray(data) && data.length > 1 && isNumber(data[0])) {\n if (data[0] === 0) {\n logger.trace(\n `Received message from worker: ${JSON.stringify(data.slice(1), null, 2)}`\n );\n } else {\n logger.debug(\n `Received error message from worker: ${JSON.stringify(\n data.slice(1),\n null,\n 2\n )}`\n );\n }\n }\n\n logger.trace(\n `Received message from worker: ${JSON.stringify(data, null, 2)}`\n );\n });\n }\n\n let aborted = false;\n const onActivityAbort = () => {\n if (!aborted) {\n aborted = true;\n }\n };\n\n // Listen to the worker's stdout and stderr, if there's any thing logged, abort the activity first\n const abortActivityStreamOnLog = new Transform({\n transform(_chunk, _encoding, callback) {\n onActivityAbort();\n callback();\n }\n });\n // Stop the activity if there's any output from the worker\n this.#worker.getStdout().pipe(abortActivityStreamOnLog);\n this.#worker.getStderr().pipe(abortActivityStreamOnLog);\n\n // Pipe the worker's stdout and stderr to the parent process\n this.#worker.getStdout().pipe(process.stdout);\n this.#worker.getStderr().pipe(process.stderr);\n };\n createWorker();\n\n for (const method of executionMethods) {\n if (method.startsWith(\"_\")) {\n continue;\n }\n\n (this as any)[method] = timeout\n ? async (...args: any[]) => {\n activeTasks++;\n try {\n let attempts = 0;\n for (;;) {\n onActivity();\n\n const result = await Promise.race([\n // eslint-disable-next-line ts/no-unsafe-call\n (this.#worker as any)[method](\n args.length > 0 && args[0] ? args[0] : {}\n ),\n restartPromise\n ]);\n if (result !== RESTARTED) {\n return result;\n }\n\n logger.warn(\n `Execution Host Worker was restarted while calling method \"${\n method\n }\" (attempt ${attempts++}). Retrying the call...`\n );\n }\n } finally {\n activeTasks--;\n onActivity();\n }\n }\n : // eslint-disable-next-line ts/no-unsafe-call\n (this.#worker as any)[method].bind(this.#worker);\n }\n }\n\n /**\n * Ends the worker process and cleans up any resources associated with it. This method should be called when the worker is no longer needed, to ensure that it is properly terminated and does not continue to consume system resources. If the worker is already terminated or was never initialized, this method will throw an error.\n *\n * @returns A promise that resolves when the worker has been successfully terminated.\n */\n public async end(): ReturnType<JestWorker[\"end\"]> {\n const worker = this.#worker;\n if (!worker) {\n throw new Error(\"Execution Host Worker is not initialized\");\n }\n\n cleanupWorkers(worker);\n this.#worker = undefined;\n return worker.end();\n }\n\n /**\n * Quietly end the worker if it exists\n */\n public close(): void {\n if (this.#worker) {\n cleanupWorkers(this.#worker);\n void this.#worker.end();\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAkCA,MAAM,YAAY,OAAO,8BAA8B;;;;AAavD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Aa,WAAW,yBAC1B;;cAEK;AACR;AACA,iBAAY;;OAIf,MAAKA,OAAgB,QAAQ,KAAK,MAAKA,OAAQ;;;;;;;;CASxD,MAAa,MAAqC;EAChD,MAAM,SAAS,MAAKA;AACpB,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,2CAA2C;AAG7D,iBAAe,OAAO;AACtB,QAAKA,SAAU;AACf,SAAO,OAAO,KAAK;;;;;CAMrB,AAAO,QAAc;AACnB,MAAI,MAAKA,QAAS;AAChB,kBAAe,MAAKA,OAAQ;AAC5B,GAAK,MAAKA,OAAQ,KAAK"}
|
package/dist/helpers/rpc.d.cts
CHANGED
package/dist/helpers/rpc.d.mts
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as RpcServerFunctions, D as WrappedRpcFunctions, E as WrappedRpcFunction, S as RpcPayloadMetadata, T as WrapRpcFunctions, _ as RpcClientRemoteFunctions, a as ExtractRpcFunction, b as RpcFunctions, c as InputRpcFunctions, d as RpcClientCall, f as RpcClientCallEvent, g as RpcClientHost, h as RpcClientFunctions, i as RpcClientOptions, l as LogPayload, m as RpcClientEvents, n as EngineOptions, o as ExtractRpcFunctions, p as RpcClientCallOptional, r as EngineResolvedConfig, s as InputRpcFunction, t as EngineExecutionOptions, u as RpcClient, v as RpcContext, w as WrapRpcFunction, x as RpcPayloadEnvelop, y as RpcFunction } from "./config-
|
|
2
|
-
import { a as ExecutionHookScopeState, c as ExecutionScopeType, i as ExecutionCommandScopeState, l as ExecutionState, n as EngineExecutionItem, o as ExecutionPluginScopeState, r as EngineSystemContext, s as ExecutionScopeState, t as EngineContext } from "./context-
|
|
3
|
-
import { a as PowerlinesExecutionHost, i as ExecutionInterface, n as ExecutionHost, o as Worker, r as ExecutionHostParams, t as Engine } from "./api-
|
|
1
|
+
import { C as RpcServerFunctions, D as WrappedRpcFunctions, E as WrappedRpcFunction, S as RpcPayloadMetadata, T as WrapRpcFunctions, _ as RpcClientRemoteFunctions, a as ExtractRpcFunction, b as RpcFunctions, c as InputRpcFunctions, d as RpcClientCall, f as RpcClientCallEvent, g as RpcClientHost, h as RpcClientFunctions, i as RpcClientOptions, l as LogPayload, m as RpcClientEvents, n as EngineOptions, o as ExtractRpcFunctions, p as RpcClientCallOptional, r as EngineResolvedConfig, s as InputRpcFunction, t as EngineExecutionOptions, u as RpcClient, v as RpcContext, w as WrapRpcFunction, x as RpcPayloadEnvelop, y as RpcFunction } from "./config-D6xUniHh.cjs";
|
|
2
|
+
import { a as ExecutionHookScopeState, c as ExecutionScopeType, i as ExecutionCommandScopeState, l as ExecutionState, n as EngineExecutionItem, o as ExecutionPluginScopeState, r as EngineSystemContext, s as ExecutionScopeState, t as EngineContext } from "./context-epL7NPvL.cjs";
|
|
3
|
+
import { a as PowerlinesExecutionHost, i as ExecutionInterface, n as ExecutionHost, o as Worker, r as ExecutionHostParams, t as Engine } from "./api-6w4hZL6n.cjs";
|
|
4
4
|
import { PowerlinesEngine, createContext, createEngine } from "./engine.cjs";
|
|
5
5
|
export { Engine, EngineContext, EngineExecutionItem, EngineExecutionOptions, EngineOptions, EngineResolvedConfig, EngineSystemContext, ExecutionCommandScopeState, ExecutionHookScopeState, ExecutionHost, ExecutionHostParams, ExecutionInterface, ExecutionPluginScopeState, ExecutionScopeState, ExecutionScopeType, ExecutionState, ExtractRpcFunction, ExtractRpcFunctions, InputRpcFunction, InputRpcFunctions, LogPayload, type PowerlinesEngine, PowerlinesExecutionHost, RpcClient, RpcClientCall, RpcClientCallEvent, RpcClientCallOptional, RpcClientEvents, RpcClientFunctions, RpcClientHost, RpcClientOptions, RpcClientRemoteFunctions, RpcContext, RpcFunction, RpcFunctions, RpcPayloadEnvelop, RpcPayloadMetadata, RpcServerFunctions, Worker, WrapRpcFunction, WrapRpcFunctions, WrappedRpcFunction, WrappedRpcFunctions, createContext, createEngine };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as RpcServerFunctions, D as WrappedRpcFunctions, E as WrappedRpcFunction, S as RpcPayloadMetadata, T as WrapRpcFunctions, _ as RpcClientRemoteFunctions, a as ExtractRpcFunction, b as RpcFunctions, c as InputRpcFunctions, d as RpcClientCall, f as RpcClientCallEvent, g as RpcClientHost, h as RpcClientFunctions, i as RpcClientOptions, l as LogPayload, m as RpcClientEvents, n as EngineOptions, o as ExtractRpcFunctions, p as RpcClientCallOptional, r as EngineResolvedConfig, s as InputRpcFunction, t as EngineExecutionOptions, u as RpcClient, v as RpcContext, w as WrapRpcFunction, x as RpcPayloadEnvelop, y as RpcFunction } from "./config-
|
|
2
|
-
import { a as ExecutionHookScopeState, c as ExecutionScopeType, i as ExecutionCommandScopeState, l as ExecutionState, n as EngineExecutionItem, o as ExecutionPluginScopeState, r as EngineSystemContext, s as ExecutionScopeState, t as EngineContext } from "./context-
|
|
3
|
-
import { a as PowerlinesExecutionHost, i as ExecutionInterface, n as ExecutionHost, o as Worker, r as ExecutionHostParams, t as Engine } from "./api-
|
|
1
|
+
import { C as RpcServerFunctions, D as WrappedRpcFunctions, E as WrappedRpcFunction, S as RpcPayloadMetadata, T as WrapRpcFunctions, _ as RpcClientRemoteFunctions, a as ExtractRpcFunction, b as RpcFunctions, c as InputRpcFunctions, d as RpcClientCall, f as RpcClientCallEvent, g as RpcClientHost, h as RpcClientFunctions, i as RpcClientOptions, l as LogPayload, m as RpcClientEvents, n as EngineOptions, o as ExtractRpcFunctions, p as RpcClientCallOptional, r as EngineResolvedConfig, s as InputRpcFunction, t as EngineExecutionOptions, u as RpcClient, v as RpcContext, w as WrapRpcFunction, x as RpcPayloadEnvelop, y as RpcFunction } from "./config-C9AD-erz.mjs";
|
|
2
|
+
import { a as ExecutionHookScopeState, c as ExecutionScopeType, i as ExecutionCommandScopeState, l as ExecutionState, n as EngineExecutionItem, o as ExecutionPluginScopeState, r as EngineSystemContext, s as ExecutionScopeState, t as EngineContext } from "./context-S3XH2DWP.mjs";
|
|
3
|
+
import { a as PowerlinesExecutionHost, i as ExecutionInterface, n as ExecutionHost, o as Worker, r as ExecutionHostParams, t as Engine } from "./api-CcNgO71y.mjs";
|
|
4
4
|
import { PowerlinesEngine, createContext, createEngine } from "./engine.mjs";
|
|
5
5
|
export { Engine, EngineContext, EngineExecutionItem, EngineExecutionOptions, EngineOptions, EngineResolvedConfig, EngineSystemContext, ExecutionCommandScopeState, ExecutionHookScopeState, ExecutionHost, ExecutionHostParams, ExecutionInterface, ExecutionPluginScopeState, ExecutionScopeState, ExecutionScopeType, ExecutionState, ExtractRpcFunction, ExtractRpcFunctions, InputRpcFunction, InputRpcFunctions, LogPayload, type PowerlinesEngine, PowerlinesExecutionHost, RpcClient, RpcClientCall, RpcClientCallEvent, RpcClientCallOptional, RpcClientEvents, RpcClientFunctions, RpcClientHost, RpcClientOptions, RpcClientRemoteFunctions, RpcContext, RpcFunction, RpcFunctions, RpcPayloadEnvelop, RpcPayloadMetadata, RpcServerFunctions, Worker, WrapRpcFunction, WrapRpcFunctions, WrappedRpcFunction, WrappedRpcFunctions, createContext, createEngine };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-host.d.cts","names":[],"sources":["../../src/types/rpc.ts","../../src/types/config.ts","../../src/types/api.ts","../../src/execution-host.ts"],"mappings":";;;;;;;;;UAqGiB,UAAA;
|
|
1
|
+
{"version":3,"file":"execution-host.d.cts","names":[],"sources":["../../src/types/rpc.ts","../../src/types/config.ts","../../src/types/api.ts","../../src/execution-host.ts"],"mappings":";;;;;;;;;UAqGiB,UAAA;ECjBK;;;EDqBpB,IAAA,EAAM,OAAA;ECfS;;;EDoBf,OAAA;AAAA;AAAA,UAGe,kBAAA,SAA2B,0BAAA;EAE1C,gBAAA,GAAmB,OAAA,EAAS,UAAA;AAAA;AAAA,UAGb,kBAAA,SAA2B,0BAAA;;;UChD3B,sBAAA,SAA+B,gBAAA;;;AAAhD;EAIE,OAAA;;;;EAKA,UAAA,EAAY,cAAA;EAWG;;;EANf,SAAA,GAAY,OAAA,CAAQ,mBAAA;EAea;;;EAVjC,UAAA,GAAa,OAAA,CACX,YAAA,CAAa,kBAAA,EAAoB,kBAAA;EApB2B;;;;;;EA6B9D,YAAA,aAAyB,OAAA,CAAQ,eAAA;AAAA;;;UCyClB,mBAAA;EClGG;;;EDsGlB,OAAA,EAAS,sBAAA;ECrG+B;;;ED0GxC,YAAA,EAAc,YAAA;AAAA;;;cC5GH,KAAA,IAAK,MAAA,EAAsB,mBAAA,KAAtB,OAAA;AAAA,cACL,OAAA,IAAO,MAAA,EAAwB,mBAAA,KAAxB,OAAA;AAAA,cACP,MAAA,IAAM,MAAA,EAAuB,mBAAA,KAAvB,OAAA;AAAA,cACN,KAAA,IAAK,MAAA,EAAsB,mBAAA,KAAtB,OAAA;AAAA,cACL,IAAA,IAAI,MAAA,EAAqB,mBAAA,KAArB,OAAA;AAAA,cACJ,IAAA,IAAI,MAAA,EAAqB,mBAAA,KAArB,OAAA;AAAA,cACJ,KAAA,IAAK,MAAA,EAAsB,mBAAA,KAAtB,OAAA;AAAA,cACL,IAAA,IAAI,MAAA,EAAqB,mBAAA,KAArB,OAAA;AAAA,cACJ,MAAA,IAAM,MAAA,EAAuB,mBAAA,KAAvB,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-host.d.mts","names":[],"sources":["../../src/types/rpc.ts","../../src/types/config.ts","../../src/types/api.ts","../../src/execution-host.ts"],"mappings":";;;;;;;;;UAqGiB,UAAA;
|
|
1
|
+
{"version":3,"file":"execution-host.d.mts","names":[],"sources":["../../src/types/rpc.ts","../../src/types/config.ts","../../src/types/api.ts","../../src/execution-host.ts"],"mappings":";;;;;;;;;UAqGiB,UAAA;ECjBK;;;EDqBpB,IAAA,EAAM,OAAA;ECfS;;;EDoBf,OAAA;AAAA;AAAA,UAGe,kBAAA,SAA2B,0BAAA;EAE1C,gBAAA,GAAmB,OAAA,EAAS,UAAA;AAAA;AAAA,UAGb,kBAAA,SAA2B,0BAAA;;;UChD3B,sBAAA,SAA+B,gBAAA;;;AAAhD;EAIE,OAAA;;;;EAKA,UAAA,EAAY,cAAA;EAWG;;;EANf,SAAA,GAAY,OAAA,CAAQ,mBAAA;EAea;;;EAVjC,UAAA,GAAa,OAAA,CACX,YAAA,CAAa,kBAAA,EAAoB,kBAAA;EApB2B;;;;;;EA6B9D,YAAA,aAAyB,OAAA,CAAQ,eAAA;AAAA;;;UCyClB,mBAAA;EClGG;;;EDsGlB,OAAA,EAAS,sBAAA;ECrG+B;;;ED0GxC,YAAA,EAAc,YAAA;AAAA;;;cC5GH,KAAA,IAAK,MAAA,EAAsB,mBAAA,KAAtB,OAAA;AAAA,cACL,OAAA,IAAO,MAAA,EAAwB,mBAAA,KAAxB,OAAA;AAAA,cACP,MAAA,IAAM,MAAA,EAAuB,mBAAA,KAAvB,OAAA;AAAA,cACN,KAAA,IAAK,MAAA,EAAsB,mBAAA,KAAtB,OAAA;AAAA,cACL,IAAA,IAAI,MAAA,EAAqB,mBAAA,KAArB,OAAA;AAAA,cACJ,IAAA,IAAI,MAAA,EAAqB,mBAAA,KAArB,OAAA;AAAA,cACJ,KAAA,IAAK,MAAA,EAAsB,mBAAA,KAAtB,OAAA;AAAA,cACL,IAAA,IAAI,MAAA,EAAqB,mBAAA,KAArB,OAAA;AAAA,cACJ,MAAA,IAAM,MAAA,EAAuB,mBAAA,KAAvB,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/engine",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "An internal package containing the core engine modules for Powerlines.",
|
|
6
6
|
"homepage": "https://stormsoftware.com",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"types": "./dist/index.d.cts",
|
|
108
108
|
"files": ["dist"],
|
|
109
109
|
"dependencies": {
|
|
110
|
-
"@powerlines/core": "^0.9.
|
|
110
|
+
"@powerlines/core": "^0.9.3",
|
|
111
111
|
"@storm-software/config": "^1.137.35",
|
|
112
112
|
"@storm-software/config-tools": "^1.190.2",
|
|
113
113
|
"@stryke/async": "^0.1.4",
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
"@types/node": "^25.7.0",
|
|
144
144
|
"typescript": "^6.0.3"
|
|
145
145
|
},
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "e5d8383bd361a99563985879776392fb679cbbe4"
|
|
147
147
|
}
|