@powerlines/engine 0.9.1 → 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-Bw-RpQgX.d.cts → api-6w4hZL6n.d.cts} +5 -4
- package/dist/api-6w4hZL6n.d.cts.map +1 -0
- package/dist/{api-D9bpSxPB.d.mts → api-CcNgO71y.d.mts} +5 -4
- package/dist/api-CcNgO71y.d.mts.map +1 -0
- 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-C_P-KYJX.d.cts → context-S3XH2DWP.d.mts} +3 -3
- package/dist/{context-C_P-KYJX.d.cts.map → context-S3XH2DWP.d.mts.map} +1 -1
- package/dist/{context-DrNGEC0b.d.mts → context-epL7NPvL.d.cts} +3 -3
- package/dist/{context-DrNGEC0b.d.mts.map → context-epL7NPvL.d.cts.map} +1 -1
- package/dist/{engine-context-BXjBJuHe.d.mts → engine-context-BiDxBwme.d.mts} +3 -3
- package/dist/{engine-context-BXjBJuHe.d.mts.map → engine-context-BiDxBwme.d.mts.map} +1 -1
- package/dist/{engine-context-CPYw-aGB.d.cts → engine-context-Dw8odBCo.d.cts} +3 -3
- package/dist/{engine-context-CPYw-aGB.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.cjs +27 -2
- package/dist/helpers/create-execution-host.d.cts +3 -3
- package/dist/helpers/create-execution-host.d.cts.map +1 -1
- package/dist/helpers/create-execution-host.d.mts +3 -3
- package/dist/helpers/create-execution-host.d.mts.map +1 -1
- package/dist/helpers/create-execution-host.mjs +27 -2
- package/dist/helpers/create-execution-host.mjs.map +1 -1
- 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.cjs +160 -2
- package/dist/worker/execution-host.d.cts +52 -2
- package/dist/worker/execution-host.d.cts.map +1 -1
- package/dist/worker/execution-host.d.mts +52 -2
- package/dist/worker/execution-host.d.mts.map +1 -1
- package/dist/worker/execution-host.mjs +161 -3
- package/dist/worker/execution-host.mjs.map +1 -1
- package/package.json +6 -6
- package/dist/api-Bw-RpQgX.d.cts.map +0 -1
- package/dist/api-D9bpSxPB.d.mts.map +0 -1
|
@@ -1,10 +1,60 @@
|
|
|
1
|
-
import { ExecutionOptions, InlineConfig } from "@powerlines/core";
|
|
1
|
+
import { ExecutionOptions, InlineConfig, LogMeta } from "@powerlines/core";
|
|
2
|
+
import { BirpcOptions } from "birpc";
|
|
3
|
+
import { RpcCacheOptions } from "devframe/rpc";
|
|
4
|
+
import { WsRpcChannelOptions } from "devframe/rpc/transports/ws-client";
|
|
5
|
+
import { ConnectionMeta, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions } from "devframe/types";
|
|
6
|
+
//#region src/types/rpc.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Payload for write log Rpc messages.
|
|
9
|
+
*/
|
|
10
|
+
interface LogPayload {
|
|
11
|
+
/**
|
|
12
|
+
* Metadata associated with the log message, excluding fields that are automatically added by the engine such as executionId, configIndex, environment, and timestamp. This can include custom fields relevant to the log entry, such as category, name, command, hook, plugin, and source.
|
|
13
|
+
*/
|
|
14
|
+
meta: LogMeta;
|
|
15
|
+
/**
|
|
16
|
+
* The log message content, which can be a string or an array of strings representing the log entry. This field is required and should contain the actual message to be logged.
|
|
17
|
+
*/
|
|
18
|
+
message: string;
|
|
19
|
+
}
|
|
20
|
+
interface RpcServerFunctions extends DevToolsRpcServerFunctions {
|
|
21
|
+
"powerlines:log": (payload: LogPayload) => void;
|
|
22
|
+
}
|
|
23
|
+
interface RpcClientFunctions extends DevToolsRpcClientFunctions {}
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/types/config.d.ts
|
|
26
|
+
interface EngineExecutionOptions extends ExecutionOptions {
|
|
27
|
+
/**
|
|
28
|
+
* The base URL for the dev server, which can be used by plugins to construct URLs for assets or API endpoints during development. This value is only relevant in "dev" mode and will be `undefined` in "build" mode.
|
|
29
|
+
*/
|
|
30
|
+
baseURL: string;
|
|
31
|
+
/**
|
|
32
|
+
* Metadata for the connection used by the dev server, including the backend type and websocket configuration.
|
|
33
|
+
*/
|
|
34
|
+
connection: ConnectionMeta;
|
|
35
|
+
/**
|
|
36
|
+
* Options for configuring the WebSocket RPC channel used for communication between the dev server and the client, which can be used by plugins to customize the behavior of the WebSocket connection, such as setting custom timeouts, retry strategies, or other options.
|
|
37
|
+
*/
|
|
38
|
+
wsOptions?: Partial<WsRpcChannelOptions>;
|
|
39
|
+
/**
|
|
40
|
+
* Options for configuring the RPC client used for communication between the dev server and the client, which can be used by plugins to customize the behavior of the RPC client, such as setting custom timeouts, retry strategies, or other options.
|
|
41
|
+
*/
|
|
42
|
+
rpcOptions?: Partial<BirpcOptions<RpcServerFunctions, RpcClientFunctions, boolean>>;
|
|
43
|
+
/**
|
|
44
|
+
* Options for configuring the RPC cache used for caching RPC responses between the dev server and the client, which can be used by plugins to customize the behavior of the RPC cache, such as setting custom cache keys, expiration times, or other options.
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* This option can be set to `true` to enable caching with default options, or it can be set to a configuration object that allows for fine-grained control over the caching behavior.
|
|
48
|
+
*/
|
|
49
|
+
cacheOptions?: boolean | Partial<RpcCacheOptions>;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
2
52
|
//#region src/types/api.d.ts
|
|
3
53
|
interface ExecutionHostParams {
|
|
4
54
|
/**
|
|
5
55
|
* The execution options for the current execution instance
|
|
6
56
|
*/
|
|
7
|
-
options:
|
|
57
|
+
options: EngineExecutionOptions;
|
|
8
58
|
/**
|
|
9
59
|
* The inline configuration for the current execution instance, which is the result of merging the user configuration with any configuration provided by plugins during the "config" hook.
|
|
10
60
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-host.d.cts","names":[],"sources":["../../src/types/api.ts","../../src/execution-host.ts"],"mappings":"
|
|
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,10 +1,60 @@
|
|
|
1
|
-
import { ExecutionOptions, InlineConfig } from "@powerlines/core";
|
|
1
|
+
import { ExecutionOptions, InlineConfig, LogMeta } from "@powerlines/core";
|
|
2
|
+
import { RpcCacheManager, RpcCacheOptions } from "devframe/rpc";
|
|
3
|
+
import { WsRpcChannelOptions } from "devframe/rpc/transports/ws-client";
|
|
4
|
+
import { BirpcOptions } from "birpc";
|
|
5
|
+
import { ConnectionMeta, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions } from "devframe/types";
|
|
6
|
+
//#region src/types/rpc.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Payload for write log Rpc messages.
|
|
9
|
+
*/
|
|
10
|
+
interface LogPayload {
|
|
11
|
+
/**
|
|
12
|
+
* Metadata associated with the log message, excluding fields that are automatically added by the engine such as executionId, configIndex, environment, and timestamp. This can include custom fields relevant to the log entry, such as category, name, command, hook, plugin, and source.
|
|
13
|
+
*/
|
|
14
|
+
meta: LogMeta;
|
|
15
|
+
/**
|
|
16
|
+
* The log message content, which can be a string or an array of strings representing the log entry. This field is required and should contain the actual message to be logged.
|
|
17
|
+
*/
|
|
18
|
+
message: string;
|
|
19
|
+
}
|
|
20
|
+
interface RpcServerFunctions extends DevToolsRpcServerFunctions {
|
|
21
|
+
"powerlines:log": (payload: LogPayload) => void;
|
|
22
|
+
}
|
|
23
|
+
interface RpcClientFunctions extends DevToolsRpcClientFunctions {}
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/types/config.d.ts
|
|
26
|
+
interface EngineExecutionOptions extends ExecutionOptions {
|
|
27
|
+
/**
|
|
28
|
+
* The base URL for the dev server, which can be used by plugins to construct URLs for assets or API endpoints during development. This value is only relevant in "dev" mode and will be `undefined` in "build" mode.
|
|
29
|
+
*/
|
|
30
|
+
baseURL: string;
|
|
31
|
+
/**
|
|
32
|
+
* Metadata for the connection used by the dev server, including the backend type and websocket configuration.
|
|
33
|
+
*/
|
|
34
|
+
connection: ConnectionMeta;
|
|
35
|
+
/**
|
|
36
|
+
* Options for configuring the WebSocket RPC channel used for communication between the dev server and the client, which can be used by plugins to customize the behavior of the WebSocket connection, such as setting custom timeouts, retry strategies, or other options.
|
|
37
|
+
*/
|
|
38
|
+
wsOptions?: Partial<WsRpcChannelOptions>;
|
|
39
|
+
/**
|
|
40
|
+
* Options for configuring the RPC client used for communication between the dev server and the client, which can be used by plugins to customize the behavior of the RPC client, such as setting custom timeouts, retry strategies, or other options.
|
|
41
|
+
*/
|
|
42
|
+
rpcOptions?: Partial<BirpcOptions<RpcServerFunctions, RpcClientFunctions, boolean>>;
|
|
43
|
+
/**
|
|
44
|
+
* Options for configuring the RPC cache used for caching RPC responses between the dev server and the client, which can be used by plugins to customize the behavior of the RPC cache, such as setting custom cache keys, expiration times, or other options.
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* This option can be set to `true` to enable caching with default options, or it can be set to a configuration object that allows for fine-grained control over the caching behavior.
|
|
48
|
+
*/
|
|
49
|
+
cacheOptions?: boolean | Partial<RpcCacheOptions>;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
2
52
|
//#region src/types/api.d.ts
|
|
3
53
|
interface ExecutionHostParams {
|
|
4
54
|
/**
|
|
5
55
|
* The execution options for the current execution instance
|
|
6
56
|
*/
|
|
7
|
-
options:
|
|
57
|
+
options: EngineExecutionOptions;
|
|
8
58
|
/**
|
|
9
59
|
* The inline configuration for the current execution instance, which is the result of merging the user configuration with any configuration provided by plugins during the "config" hook.
|
|
10
60
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-host.d.mts","names":[],"sources":["../../src/types/api.ts","../../src/execution-host.ts"],"mappings":"
|
|
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"}
|
|
@@ -13,7 +13,7 @@ import { installDependencies } from "@powerlines/core/lib/install-dependencies";
|
|
|
13
13
|
import { writeMetaFile } from "@powerlines/core/lib/meta";
|
|
14
14
|
import { initializeTsconfig, resolveTsconfig } from "@powerlines/core/lib/typescript/tsconfig";
|
|
15
15
|
import { format, formatFolder as formatFolder$1 } from "@powerlines/core/lib/utilities/format";
|
|
16
|
-
import { formatConfig } from "@powerlines/core/plugin-utils";
|
|
16
|
+
import { consoleLogger, formatConfig } from "@powerlines/core/plugin-utils";
|
|
17
17
|
import { toArray } from "@stryke/convert/to-array";
|
|
18
18
|
import { createDirectory } from "@stryke/fs/helpers";
|
|
19
19
|
import { isObject } from "@stryke/type-checks/is-object";
|
|
@@ -25,6 +25,19 @@ import { omit } from "@stryke/helpers/omit";
|
|
|
25
25
|
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
26
26
|
import { PowerlinesExecutionContext } from "@powerlines/core/context/execution-context";
|
|
27
27
|
import { resolvePluginConfig } from "@powerlines/core/lib/context-helpers";
|
|
28
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
29
|
+
import { uuid } from "@stryke/unique-id/uuid";
|
|
30
|
+
import { createEventEmitter } from "@powerlines/core/lib/events";
|
|
31
|
+
import { isNumber } from "@stryke/type-checks/is-number";
|
|
32
|
+
import { isSet } from "@stryke/type-checks/is-set";
|
|
33
|
+
import { StormURL } from "@stryke/url";
|
|
34
|
+
import { createRpcStreamingClientHost } from "devframe/client";
|
|
35
|
+
import { RpcCacheManager, RpcFunctionsCollectorBase } from "devframe/rpc";
|
|
36
|
+
import { createRpcClient } from "devframe/rpc/client";
|
|
37
|
+
import { createWsRpcChannel } from "devframe/rpc/transports/ws-client";
|
|
38
|
+
import { promiseWithResolver } from "devframe/utils/promise";
|
|
39
|
+
import { humanId } from "human-id";
|
|
40
|
+
import { EventEmitter } from "node:events";
|
|
28
41
|
|
|
29
42
|
//#region src/api/prepare.ts
|
|
30
43
|
/**
|
|
@@ -337,6 +350,131 @@ async function types$1(context) {
|
|
|
337
350
|
timer();
|
|
338
351
|
}
|
|
339
352
|
|
|
353
|
+
//#endregion
|
|
354
|
+
//#region src/helpers/rpc.ts
|
|
355
|
+
function createWsRpcClientMode(baseURL, connectionMeta, events, clientRpc, authToken = humanId({
|
|
356
|
+
separator: "-",
|
|
357
|
+
capitalize: false
|
|
358
|
+
}), rpcOptions = {}, wsOptions = {}) {
|
|
359
|
+
let isTrusted = false;
|
|
360
|
+
const trustedPromise = promiseWithResolver();
|
|
361
|
+
const url = isNumber(connectionMeta.websocket) || isSet(connectionMeta.websocket) && `${+connectionMeta.websocket}` === `${connectionMeta.websocket}` ? `${baseURL.protocol.replace("http", "ws")}//${baseURL.hostname}:${connectionMeta.websocket}` : connectionMeta.websocket;
|
|
362
|
+
const definitions = /* @__PURE__ */ new Map();
|
|
363
|
+
for (const name of connectionMeta.jsonSerializableMethods ?? []) definitions.set(name, { jsonSerializable: true });
|
|
364
|
+
const serverRpc = createRpcClient(clientRpc.functions, {
|
|
365
|
+
channel: createWsRpcChannel({
|
|
366
|
+
url,
|
|
367
|
+
authToken,
|
|
368
|
+
definitions,
|
|
369
|
+
...wsOptions
|
|
370
|
+
}),
|
|
371
|
+
rpcOptions
|
|
372
|
+
});
|
|
373
|
+
clientRpc.register({
|
|
374
|
+
name: "devframe:auth:revoked",
|
|
375
|
+
type: "event",
|
|
376
|
+
handler: () => {
|
|
377
|
+
isTrusted = false;
|
|
378
|
+
events.emit("rpc:is-trusted:updated", false);
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
let currentAuthToken = authToken;
|
|
382
|
+
async function requestTrustWithToken(token) {
|
|
383
|
+
currentAuthToken = token;
|
|
384
|
+
return true;
|
|
385
|
+
}
|
|
386
|
+
async function requestTrust() {
|
|
387
|
+
if (isTrusted) return true;
|
|
388
|
+
return requestTrustWithToken(currentAuthToken);
|
|
389
|
+
}
|
|
390
|
+
async function ensureTrusted(timeout = 6e4) {
|
|
391
|
+
if (isTrusted) trustedPromise.resolve(true);
|
|
392
|
+
if (timeout <= 0) return trustedPromise.promise;
|
|
393
|
+
let clear = () => {};
|
|
394
|
+
await Promise.race([trustedPromise.promise.then(clear), new Promise((resolve, reject) => {
|
|
395
|
+
const id = setTimeout(() => {
|
|
396
|
+
reject(/* @__PURE__ */ new Error("Timeout waiting for rpc to be trusted"));
|
|
397
|
+
}, timeout);
|
|
398
|
+
clear = () => clearTimeout(id);
|
|
399
|
+
})]);
|
|
400
|
+
return isTrusted;
|
|
401
|
+
}
|
|
402
|
+
return {
|
|
403
|
+
get isTrusted() {
|
|
404
|
+
return isTrusted;
|
|
405
|
+
},
|
|
406
|
+
requestTrust,
|
|
407
|
+
requestTrustWithToken,
|
|
408
|
+
ensureTrusted,
|
|
409
|
+
call: (...args) => {
|
|
410
|
+
return serverRpc.$call(...args);
|
|
411
|
+
},
|
|
412
|
+
callEvent: (...args) => {
|
|
413
|
+
return serverRpc.$callEvent(...args);
|
|
414
|
+
},
|
|
415
|
+
callOptional: (...args) => {
|
|
416
|
+
return serverRpc.$callOptional(...args);
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
const CONNECTION_AUTH_TOKEN_KEY = "__DEVTOOLS_CONNECTION_AUTH_TOKEN__";
|
|
421
|
+
function createRpcClient$1(options) {
|
|
422
|
+
const baseURL = new StormURL(options.baseURL);
|
|
423
|
+
const cacheManager = new RpcCacheManager({
|
|
424
|
+
functions: [],
|
|
425
|
+
...typeof options.cacheOptions === "object" ? options.cacheOptions : {}
|
|
426
|
+
});
|
|
427
|
+
const context = { rpc: void 0 };
|
|
428
|
+
const clientRpc = new RpcFunctionsCollectorBase(context);
|
|
429
|
+
EventEmitter.setMaxListeners(100);
|
|
430
|
+
const events = createEventEmitter();
|
|
431
|
+
const mode = createWsRpcClientMode(baseURL, options.connection, events, clientRpc, void 0, {
|
|
432
|
+
...options.rpcOptions,
|
|
433
|
+
async onRequest(req, next, resolve) {
|
|
434
|
+
await options.rpcOptions?.onRequest?.call(this, req, next, resolve);
|
|
435
|
+
if (options.cacheOptions && cacheManager?.validate(req.m)) {
|
|
436
|
+
const cached = cacheManager.cached(req.m, req.a);
|
|
437
|
+
if (cached) return resolve(cached);
|
|
438
|
+
else {
|
|
439
|
+
const res = await next(req);
|
|
440
|
+
cacheManager?.apply(req, res);
|
|
441
|
+
}
|
|
442
|
+
} else await next(req);
|
|
443
|
+
}
|
|
444
|
+
}, options.wsOptions);
|
|
445
|
+
const rpc = {
|
|
446
|
+
events,
|
|
447
|
+
get isTrusted() {
|
|
448
|
+
return mode.isTrusted;
|
|
449
|
+
},
|
|
450
|
+
connectionMeta: options.connection,
|
|
451
|
+
ensureTrusted: mode.ensureTrusted,
|
|
452
|
+
requestTrust: mode.requestTrust,
|
|
453
|
+
requestTrustWithToken: async (token) => {
|
|
454
|
+
localStorage.setItem(CONNECTION_AUTH_TOKEN_KEY, token);
|
|
455
|
+
globalThis[CONNECTION_AUTH_TOKEN_KEY] = token;
|
|
456
|
+
return mode.requestTrustWithToken(token);
|
|
457
|
+
},
|
|
458
|
+
call: mode.call,
|
|
459
|
+
callEvent: mode.callEvent,
|
|
460
|
+
callOptional: mode.callOptional,
|
|
461
|
+
client: clientRpc,
|
|
462
|
+
sharedState: void 0,
|
|
463
|
+
streaming: void 0,
|
|
464
|
+
cacheManager
|
|
465
|
+
};
|
|
466
|
+
rpc.streaming = createRpcStreamingClientHost(rpc);
|
|
467
|
+
context.rpc = rpc;
|
|
468
|
+
mode.requestTrust();
|
|
469
|
+
try {
|
|
470
|
+
const bc = new BroadcastChannel("vite-devtools-auth");
|
|
471
|
+
bc.onmessage = (event) => {
|
|
472
|
+
if (event.data?.type === "auth-update" && event.data.authToken) rpc.requestTrustWithToken(event.data.authToken);
|
|
473
|
+
};
|
|
474
|
+
} catch {}
|
|
475
|
+
return rpc;
|
|
476
|
+
}
|
|
477
|
+
|
|
340
478
|
//#endregion
|
|
341
479
|
//#region src/helpers/create-execution-host.ts
|
|
342
480
|
/**
|
|
@@ -347,8 +485,28 @@ async function types$1(context) {
|
|
|
347
485
|
*/
|
|
348
486
|
function createExecutionHost(methods) {
|
|
349
487
|
return Object.fromEntries(Object.entries(methods).map(([method, fn]) => [method, async (params) => {
|
|
350
|
-
const
|
|
351
|
-
|
|
488
|
+
const { options, inlineConfig } = params;
|
|
489
|
+
let rpc;
|
|
490
|
+
if (options.baseURL && options.connection) rpc = createRpcClient$1(options);
|
|
491
|
+
else throw new Error(`Execution RPC client could not be created - Missing ${!options.baseURL ? `baseURL${options.connection ? ` and connection information` : ""}` : "connection"} or connection information.`);
|
|
492
|
+
const logFn = (meta, message) => {
|
|
493
|
+
consoleLogger(meta, message);
|
|
494
|
+
if (rpc) rpc.callEvent("powerlines:log", {
|
|
495
|
+
meta: {
|
|
496
|
+
category: "general",
|
|
497
|
+
...options,
|
|
498
|
+
...isSetObject(meta) ? meta : { type: meta },
|
|
499
|
+
logId: uuid(),
|
|
500
|
+
timestamp: Date.now()
|
|
501
|
+
},
|
|
502
|
+
message
|
|
503
|
+
});
|
|
504
|
+
};
|
|
505
|
+
const context = await PowerlinesExecutionContext.from({
|
|
506
|
+
...options,
|
|
507
|
+
logFn
|
|
508
|
+
}, inlineConfig ?? {}, { rpc });
|
|
509
|
+
context.logger.info(`Starting ${titleCase(options.framework?.name) || "Powerlines"} - ${titleCase(method)} execution (${options.executionId})`);
|
|
352
510
|
await resolvePluginConfig(context);
|
|
353
511
|
await fn(context);
|
|
354
512
|
}]));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-host.mjs","names":["prepare","formatFolder","build","prepare","clean","prepare","joinPaths","create","prepare","joinPaths","deploy","prepare","docs","prepare","lint","prepare","test","prepare","types","prepare","executeTypes","executePrepare","executeCreate","executeClean","executeLint","executeTest","executeBuild","executeDocs","executeDeploy"],"sources":["../../src/api/prepare.ts","../../src/api/build.ts","../../src/api/clean.ts","../../src/api/create.ts","../../src/api/deploy.ts","../../src/api/docs.ts","../../src/api/lint.ts","../../src/api/test.ts","../../src/api/types.ts","../../src/helpers/create-execution-host.ts","../../src/execution-host.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 { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { handleTypes } from \"@powerlines/core/lib/generate-types\";\nimport { installDependencies } from \"@powerlines/core/lib/install-dependencies\";\nimport { writeMetaFile } from \"@powerlines/core/lib/meta\";\nimport {\n initializeTsconfig,\n resolveTsconfig\n} from \"@powerlines/core/lib/typescript/tsconfig\";\nimport { formatFolder } from \"@powerlines/core/lib/utilities/format\";\nimport { formatConfig } from \"@powerlines/core/plugin-utils\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { createDirectory } from \"@stryke/fs/helpers\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\n\n/**\n * Prepare the project\n *\n * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\nexport async function prepare<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(\n context: ExecutionContext<TResolvedConfig, TSystemContext>,\n skipTypes = false\n) {\n const timer = context.timer(\"Preparation\");\n\n await executeEnvironments(context, async env => {\n env.debug(\n `Initializing the processing options for the Powerlines project.`\n );\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"pre\"\n });\n\n await initializeTsconfig<TResolvedConfig, TSystemContext>(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.entry.length > 0) {\n env.debug(\n `The configuration provided ${\n isObject(env.config.input)\n ? Object.keys(env.config.input).length\n : toArray(env.config.input).length\n } entry point(s), Powerlines has found ${\n env.entry.length\n } entry files(s) for the ${env.config.title} project${\n env.entry.length > 0 && env.entry.length < 10\n ? `: \\n${env.entry\n .map(\n entry =>\n `- ${entry.file}${\n entry.output ? ` -> ${entry.output}` : \"\"\n }`\n )\n .join(\" \\n\")}`\n : \"\"\n }`\n );\n } else {\n env.warn(\n `No entry files were found for the ${\n env.config.title\n } project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`\n );\n }\n\n await resolveTsconfig<TResolvedConfig, TSystemContext>(env);\n await installDependencies(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"post\"\n });\n\n env.trace({\n meta: {\n category: \"config\"\n },\n message: `Powerlines configuration after configResolved hook: \\n${formatConfig(\n env.config\n )}`\n });\n\n if (!env.fs.existsSync(env.cachePath)) {\n await createDirectory(env.cachePath);\n }\n\n if (!env.fs.existsSync(env.dataPath)) {\n await createDirectory(env.dataPath);\n }\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"pre\"\n });\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"normal\"\n });\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"post\"\n });\n\n if (!skipTypes && env.config.output.types !== false) {\n await handleTypes(context, env);\n }\n\n context.debug(\"Formatting files generated during the prepare step.\");\n\n await Promise.all([\n formatFolder(env, env.builtinsPath),\n formatFolder(env, env.entryPath)\n ]);\n\n await writeMetaFile(env);\n env.persistedMeta = env.meta;\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n EnvironmentContext,\n ExecutionContext,\n formatFolder\n} from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { copyFiles } from \"@stryke/fs/copy-file\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { relativePath } from \"@stryke/path/file-path-fns\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport chalk from \"chalk\";\nimport { existsSync } from \"node:fs\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\nasync function handleBuild<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(\n context: ExecutionContext<TResolvedConfig, TSystemContext>,\n env: EnvironmentContext<TResolvedConfig, TSystemContext>\n) {\n await context.callHook(\"build\", {\n environment: env,\n order: \"pre\"\n });\n\n env.debug(\n \"Formatting the generated entry files before the build process starts.\"\n );\n await formatFolder(env, env.entryPath);\n\n await context.callHook(\"build\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.config.output.copy) {\n env.debug(\"Copying project's files from build output directory.\");\n\n const destinationPath = isParentPath(\n appendPath(env.config.output.path, env.config.cwd),\n appendPath(env.config.root, env.config.cwd)\n )\n ? joinPaths(\n env.config.output.copy.path,\n relativePath(\n appendPath(env.config.root, env.config.cwd),\n appendPath(env.config.output.path, env.config.cwd)\n )\n )\n : joinPaths(env.config.output.copy.path, \"dist\");\n const sourcePath = env.config.output.path;\n\n if (existsSync(sourcePath) && sourcePath !== destinationPath) {\n env.debug(\n `Copying files from project's build output directory (${\n env.config.output.path\n }) to the project's copy/publish directory (${destinationPath}).`\n );\n\n await copyFiles(sourcePath, destinationPath);\n } else {\n env.warn(\n `The source path for the copy operation ${\n !existsSync(sourcePath)\n ? \"does not exist\"\n : \"is the same as the destination path\"\n }. Source: ${sourcePath}, Destination: ${\n destinationPath\n }. Skipping copying of build output files.`\n );\n }\n\n if (\n env.config.output.copy.assets &&\n Array.isArray(env.config.output.copy.assets)\n ) {\n await Promise.all(\n env.config.output.copy.assets.map(async asset => {\n env.trace(\n `Copying asset(s): ${chalk.redBright(\n env.config.cwd === asset.input\n ? asset.glob\n : appendPath(\n asset.glob,\n replacePath(asset.input, env.config.cwd)\n )\n )} -> ${chalk.greenBright(\n appendPath(asset.glob, replacePath(asset.output, env.config.cwd))\n )} ${\n Array.isArray(asset.ignore) && asset.ignore.length > 0\n ? ` (ignoring: ${asset.ignore\n .map(i => chalk.yellowBright(i))\n .join(\", \")})`\n : \"\"\n }`\n );\n\n await env.fs.copy(asset, asset.output);\n })\n );\n }\n } else {\n env.debug(\n \"No copy configuration found for the project output. Skipping the copying of build output files.\"\n );\n }\n\n await context.callHook(\"build\", {\n environment: env,\n order: \"post\"\n });\n}\n\n/**\n * Build the project\n *\n * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\nexport async function build<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Building\");\n\n await context.generateChecksum();\n if (\n context.meta.checksum !== context.persistedMeta?.checksum ||\n context.config.skipCache\n ) {\n context.info(\n !context.persistedMeta?.checksum\n ? \"No previous build cache found. Preparing the project for the initial build.\"\n : context.meta.checksum !== context.persistedMeta.checksum\n ? \"The project has been modified since the last time `prepare` was ran. Re-preparing the project.\"\n : \"The project is configured to skip cache. Re-preparing the project.\"\n );\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n }\n\n if (context.config.singleBuild) {\n await handleBuild<TResolvedConfig, TSystemContext>(\n context,\n await context.toEnvironment()\n );\n } else {\n await executeEnvironments(context, async env => {\n await handleBuild<TResolvedConfig, TSystemContext>(context, env);\n });\n }\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Clean any previously prepared artifacts\n *\n * @param context - The execution context for the clean process, which provides access to the project configuration, environment, and utility functions for performing the clean operation. The context is used to manage the state and behavior of the clean process, allowing for hooks to be called at different stages of the clean and for environment-specific configurations to be applied.\n */\nexport async function clean<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Cleaning\");\n\n await prepare<TResolvedConfig, TSystemContext>(context, true);\n await executeEnvironments(context, async env => {\n env.debug(\"Cleaning the project's dist and artifacts directories.\");\n\n await env.fs.remove(joinPaths(env.config.cwd, env.config.output.path));\n await env.fs.remove(\n joinPaths(\n env.config.cwd,\n env.config.root,\n env.config.output.artifactsPath\n )\n );\n\n await context.callHook(\"clean\", {\n environment: env,\n sequential: false\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { listFiles } from \"@stryke/fs/list-files\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport Handlebars from \"handlebars\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Create a new Powerlines project\n *\n * @param context - The execution context for the create process, which provides access to the project configuration, environment, and utility functions for performing the create operation. The context is used to manage the state and behavior of the create process, allowing for hooks to be called at different stages of the create and for environment-specific configurations to be applied.\n */\nexport async function create<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Create a New Project Generation\");\n\n await prepare<TResolvedConfig, TSystemContext>(context, true);\n await executeEnvironments(context, async env => {\n env.debug(\"Initializing the processing options for the project.\");\n\n await context.callHook(\"create\", {\n environment: env,\n order: \"pre\"\n });\n\n const files = await listFiles(\n joinPaths(env.powerlinesPath, \"files/common/**/*.hbs\")\n );\n for (const file of files) {\n env.trace(`Adding template file to project: ${file}`);\n\n const template = Handlebars.compile(file);\n await env.fs.write(\n joinPaths(env.config.root, file.replace(\".hbs\", \"\")),\n template(env)\n );\n }\n\n await context.callHook(\"create\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.config.projectType === \"application\") {\n const appFiles = await listFiles(\n joinPaths(env.powerlinesPath, \"files/application/**/*.hbs\")\n );\n for (const file of appFiles) {\n env.trace(`Adding application template file: ${file}`);\n\n const template = Handlebars.compile(file);\n await env.fs.write(\n joinPaths(env.config.root, file.replace(\".hbs\", \"\")),\n template(env)\n );\n }\n } else {\n const libFiles = await listFiles(\n joinPaths(env.powerlinesPath, \"files/library/**/*.hbs\")\n );\n for (const file of libFiles) {\n env.trace(`Adding library template file: ${file}`);\n\n const template = Handlebars.compile(file);\n await env.fs.write(\n joinPaths(env.config.root, file.replace(\".hbs\", \"\")),\n template(env)\n );\n }\n }\n\n await context.callHook(\"create\", {\n environment: env,\n order: \"post\"\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Deploy the project's source files to the target environment.\n *\n * @remarks\n * This function serves as the main entry point for the deployment process, orchestrating the execution of deployment hooks across different environments defined in the project configuration. It ensures that all relevant deployment operations are performed in a structured manner, allowing for pre-deployment, main deployment, and post-deployment hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the deployment operation, providing insights into the performance of the deployment process.\n *\n * @param context - The execution context for the deploy process, which provides access to the project configuration, environment, and utility functions for performing the deploy operation. The context is used to manage the state and behavior of the deploy process, allowing for hooks to be called at different stages of the deploy and for environment-specific configurations to be applied.\n */\nexport async function deploy<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Deployment\");\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"deploy\", {\n environment: env\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Generate the project's documentation.\n *\n * @remarks\n * This function serves as the main entry point for the documentation generation process, orchestrating the execution of documentation hooks across different environments defined in the project configuration. It ensures that all relevant documentation operations are performed in a structured manner, allowing for pre-documentation, main documentation, and post-documentation hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the documentation operation, providing insights into the performance of the documentation process.\n *\n * @param context - The execution context for the documentation process, which provides access to the project configuration, environment, and utility functions for performing the documentation operation. The context is used to manage the state and behavior of the documentation process, allowing for hooks to be called at different stages of the documentation and for environment-specific configurations to be applied.\n */\nexport async function docs<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Documentation\");\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"docs\", {\n environment: env\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Lint the project's source files and report any issues found.\n *\n * @remarks\n * This function serves as the main entry point for the linting process, orchestrating the execution of linting hooks across different environments defined in the project configuration. It ensures that all relevant linting operations are performed in a structured manner, allowing for pre-linting, main linting, and post-linting hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the linting operation, providing insights into the performance of the linting process.\n *\n * @param context - The execution context for the lint process, which provides access to the project configuration, environment, and utility functions for performing the lint operation. The context is used to manage the state and behavior of the lint process, allowing for hooks to be called at different stages of the lint and for environment-specific configurations to be applied.\n */\nexport async function lint<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Linting\");\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"lint\", {\n environment: env,\n sequential: false\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Test the project's source files and report any issues found.\n *\n * @remarks\n * This function serves as the main entry point for the testing process, orchestrating the execution of testing hooks across different environments defined in the project configuration. It ensures that all relevant testing operations are performed in a structured manner, allowing for pre-testing, main testing, and post-testing hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the testing operation, providing insights into the performance of the testing process.\n *\n * @param context - The execution context for the test process, which provides access to the project configuration, environment, and utility functions for performing the test operation. The context is used to manage the state and behavior of the test process, allowing for hooks to be called at different stages of the test and for environment-specific configurations to be applied.\n */\nexport async function test<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Testing\");\n\n await prepare(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"test\", {\n environment: env,\n sequential: false\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { handleTypes } from \"@powerlines/core/lib/generate-types\";\nimport { installDependencies } from \"@powerlines/core/lib/install-dependencies\";\nimport { writeMetaFile } from \"@powerlines/core/lib/meta\";\nimport {\n initializeTsconfig,\n resolveTsconfig\n} from \"@powerlines/core/lib/typescript/tsconfig\";\nimport { format } from \"@powerlines/core/lib/utilities/format\";\nimport { ExecutionContext } from \"@powerlines/core/types/context\";\nimport { formatLogMessage } from \"@storm-software/config-tools/logger\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { createDirectory } from \"@stryke/fs/helpers\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Generate runtime types for the Powerlines project.\n *\n * @remarks\n * This function is responsible for generating TypeScript declaration files based on the project's configuration and environment. It executes hooks at various stages of the type generation process, allowing for customization and extension by plugins. The generated types are formatted and written to the appropriate location in the project's file system, ensuring that they are available for use by other parts of the Powerlines system and by end-users of the project.\n *\n * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\nexport async function types<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Type Generation\");\n context.debug(\n \" Aggregating configuration options for the Powerlines project\"\n );\n\n await executeEnvironments(context, async env => {\n env.debug(\n `Initializing the processing options for the Powerlines project.`\n );\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"pre\"\n });\n\n await initializeTsconfig<TResolvedConfig, TSystemContext>(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.entry.length > 0) {\n env.debug(\n `The configuration provided ${\n isObject(env.config.input)\n ? Object.keys(env.config.input).length\n : toArray(env.config.input).length\n } entry point(s), Powerlines has found ${\n env.entry.length\n } entry files(s) for the ${env.config.title} project${\n env.entry.length > 0 && env.entry.length < 10\n ? `: \\n${env.entry\n .map(\n entry =>\n `- ${entry.file}${\n entry.output ? ` -> ${entry.output}` : \"\"\n }`\n )\n .join(\" \\n\")}`\n : \"\"\n }`\n );\n } else {\n env.warn(\n `No entry files were found for the ${\n env.config.title\n } project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`\n );\n }\n\n await resolveTsconfig<TResolvedConfig, TSystemContext>(env);\n await installDependencies(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"post\"\n });\n\n context.trace(\n `Powerlines configuration has been resolved: \\n\\n${formatLogMessage({\n ...env.config,\n userConfig: isSetObject(env.config.userConfig)\n ? omit(env.config.userConfig, [\"plugins\"])\n : undefined,\n inlineConfig: isSetObject(env.config.inlineConfig)\n ? env.config.inlineConfig\n : undefined,\n plugins: env.plugins.map(plugin => plugin.name)\n })}`\n );\n\n if (!env.fs.existsSync(env.cachePath)) {\n await createDirectory(env.cachePath);\n }\n\n if (!env.fs.existsSync(env.dataPath)) {\n await createDirectory(env.dataPath);\n }\n\n if (\n env.config.skipCache === true ||\n env.persistedMeta?.checksum !== env.meta.checksum\n ) {\n env.debug(\n `Using previously prepared files as the meta checksum has not changed.`\n );\n } else {\n env.info(\n `Running \\`prepare\\` command as the meta checksum has changed since the last run.`\n );\n\n await prepare(context, true);\n }\n\n await handleTypes(context, env);\n\n context.debug(\"Formatting files generated during the types step.\");\n\n await format(env, env.typesPath, (await env.fs.read(env.typesPath)) ?? \"\");\n\n await writeMetaFile(env);\n env.persistedMeta = env.meta;\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { PowerlinesExecutionContext } from \"@powerlines/core/context/execution-context\";\nimport { resolvePluginConfig } from \"@powerlines/core/lib/context-helpers\";\nimport { ExecutionHostParams } from \"../types/api\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\n\n/**\n * Creates an execution host with the provided methods. Each method will be wrapped to create an execution context and handle errors appropriately.\n *\n * @param methods - An object where keys are method names and values are functions that take an execution context and return a promise.\n * @returns An object with the same keys as the input methods, but each function is wrapped to create an execution context and handle errors.\n */\nexport function createExecutionHost<\n TContext extends PowerlinesExecutionContext<\n EngineResolvedConfig,\n EngineSystemContext\n > = PowerlinesExecutionContext<EngineResolvedConfig, EngineSystemContext>\n>(methods: Record<string, (context: TContext) => Promise<void>>) {\n return Object.fromEntries(\n Object.entries(methods).map(([method, fn]) => [\n method,\n async (params: ExecutionHostParams) => {\n const context = (await PowerlinesExecutionContext.from(\n params.options,\n params.inlineConfig ?? {}\n )) as TContext;\n context.logger.info(\n `Starting ${method} execution (${params.options.executionId})`\n );\n\n await resolvePluginConfig(context as PowerlinesExecutionContext<any>);\n\n await fn(context);\n }\n ])\n );\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { build as executeBuild } from \"./api/build\";\nimport { clean as executeClean } from \"./api/clean\";\nimport { create as executeCreate } from \"./api/create\";\nimport { deploy as executeDeploy } from \"./api/deploy\";\nimport { docs as executeDocs } from \"./api/docs\";\nimport { lint as executeLint } from \"./api/lint\";\nimport { prepare as executePrepare } from \"./api/prepare\";\nimport { test as executeTest } from \"./api/test\";\nimport { types as executeTypes } from \"./api/types\";\nimport { createExecutionHost } from \"./helpers/create-execution-host\";\n\nconst executionHost = createExecutionHost({\n types: executeTypes,\n prepare: executePrepare,\n create: executeCreate,\n clean: executeClean,\n lint: executeLint,\n test: executeTest,\n build: executeBuild,\n docs: executeDocs,\n deploy: executeDeploy\n});\n\nexport const types = executionHost.types;\nexport const prepare = executionHost.prepare;\nexport const create = executionHost.create;\nexport const clean = executionHost.clean;\nexport const lint = executionHost.lint;\nexport const test = executionHost.test;\nexport const build = executionHost.build;\nexport const docs = executionHost.docs;\nexport const deploy = executionHost.deploy;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,eAAsBA,UAIpB,SACA,YAAY,OACZ;CACA,MAAM,QAAQ,QAAQ,MAAM,cAAc;AAE1C,OAAM,oBAAoB,SAAS,OAAM,QAAO;AAC9C,MAAI,MACF,kEACD;AAED,QAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;GACR,CAAC;AAEF,QAAM,mBAAoD,IAAI;AAE9D,QAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;GACR,CAAC;AAEF,MAAI,IAAI,MAAM,SAAS,EACrB,KAAI,MACF,8BACE,SAAS,IAAI,OAAO,MAAM,GACtB,OAAO,KAAK,IAAI,OAAO,MAAM,CAAC,SAC9B,QAAQ,IAAI,OAAO,MAAM,CAAC,OAC/B,wCACC,IAAI,MAAM,OACX,0BAA0B,IAAI,OAAO,MAAM,UAC1C,IAAI,MAAM,SAAS,KAAK,IAAI,MAAM,SAAS,KACvC,OAAO,IAAI,MACR,KACC,UACE,KAAK,MAAM,OACT,MAAM,SAAS,OAAO,MAAM,WAAW,KAE5C,CACA,KAAK,MAAM,KACd,KAEP;MAED,KAAI,KACF,qCACE,IAAI,OAAO,MACZ,8HACF;AAGH,QAAM,gBAAiD,IAAI;AAC3D,QAAM,oBAAoB,IAAI;AAE9B,QAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;GACR,CAAC;AAEF,MAAI,MAAM;GACR,MAAM,EACJ,UAAU,UACX;GACD,SAAS,yDAAyD,aAChE,IAAI,OACL;GACF,CAAC;AAEF,MAAI,CAAC,IAAI,GAAG,WAAW,IAAI,UAAU,CACnC,OAAM,gBAAgB,IAAI,UAAU;AAGtC,MAAI,CAAC,IAAI,GAAG,WAAW,IAAI,SAAS,CAClC,OAAM,gBAA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a,QAAQ,cAAc;AACnC,MAAa,UAAU,cAAc;AACrC,MAAa,SAAS,cAAc;AACpC,MAAa,QAAQ,cAAc;AACnC,MAAa,OAAO,cAAc;AAClC,MAAa,OAAO,cAAc;AAClC,MAAa,QAAQ,cAAc;AACnC,MAAa,OAAO,cAAc;AAClC,MAAa,SAAS,cAAc"}
|
|
1
|
+
{"version":3,"file":"execution-host.mjs","names":["prepare","formatFolder","build","prepare","clean","prepare","joinPaths","create","prepare","joinPaths","deploy","prepare","docs","prepare","lint","prepare","test","prepare","types","prepare","createDevframeRpcClient","createRpcClient","createRpcClient","executeTypes","executePrepare","executeCreate","executeClean","executeLint","executeTest","executeBuild","executeDocs","executeDeploy"],"sources":["../../src/api/prepare.ts","../../src/api/build.ts","../../src/api/clean.ts","../../src/api/create.ts","../../src/api/deploy.ts","../../src/api/docs.ts","../../src/api/lint.ts","../../src/api/test.ts","../../src/api/types.ts","../../src/helpers/rpc.ts","../../src/helpers/create-execution-host.ts","../../src/execution-host.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 { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { handleTypes } from \"@powerlines/core/lib/generate-types\";\nimport { installDependencies } from \"@powerlines/core/lib/install-dependencies\";\nimport { writeMetaFile } from \"@powerlines/core/lib/meta\";\nimport {\n initializeTsconfig,\n resolveTsconfig\n} from \"@powerlines/core/lib/typescript/tsconfig\";\nimport { formatFolder } from \"@powerlines/core/lib/utilities/format\";\nimport { formatConfig } from \"@powerlines/core/plugin-utils\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { createDirectory } from \"@stryke/fs/helpers\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\n\n/**\n * Prepare the project\n *\n * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\nexport async function prepare<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(\n context: ExecutionContext<TResolvedConfig, TSystemContext>,\n skipTypes = false\n) {\n const timer = context.timer(\"Preparation\");\n\n await executeEnvironments(context, async env => {\n env.debug(\n `Initializing the processing options for the Powerlines project.`\n );\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"pre\"\n });\n\n await initializeTsconfig<TResolvedConfig, TSystemContext>(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.entry.length > 0) {\n env.debug(\n `The configuration provided ${\n isObject(env.config.input)\n ? Object.keys(env.config.input).length\n : toArray(env.config.input).length\n } entry point(s), Powerlines has found ${\n env.entry.length\n } entry files(s) for the ${env.config.title} project${\n env.entry.length > 0 && env.entry.length < 10\n ? `: \\n${env.entry\n .map(\n entry =>\n `- ${entry.file}${\n entry.output ? ` -> ${entry.output}` : \"\"\n }`\n )\n .join(\" \\n\")}`\n : \"\"\n }`\n );\n } else {\n env.warn(\n `No entry files were found for the ${\n env.config.title\n } project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`\n );\n }\n\n await resolveTsconfig<TResolvedConfig, TSystemContext>(env);\n await installDependencies(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"post\"\n });\n\n env.trace({\n meta: {\n category: \"config\"\n },\n message: `Powerlines configuration after configResolved hook: \\n${formatConfig(\n env.config\n )}`\n });\n\n if (!env.fs.existsSync(env.cachePath)) {\n await createDirectory(env.cachePath);\n }\n\n if (!env.fs.existsSync(env.dataPath)) {\n await createDirectory(env.dataPath);\n }\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"pre\"\n });\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"normal\"\n });\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"post\"\n });\n\n if (!skipTypes && env.config.output.types !== false) {\n await handleTypes(context, env);\n }\n\n context.debug(\"Formatting files generated during the prepare step.\");\n\n await Promise.all([\n formatFolder(env, env.builtinsPath),\n formatFolder(env, env.entryPath)\n ]);\n\n await writeMetaFile(env);\n env.persistedMeta = env.meta;\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n EnvironmentContext,\n ExecutionContext,\n formatFolder\n} from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { copyFiles } from \"@stryke/fs/copy-file\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { relativePath } from \"@stryke/path/file-path-fns\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport chalk from \"chalk\";\nimport { existsSync } from \"node:fs\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\nasync function handleBuild<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(\n context: ExecutionContext<TResolvedConfig, TSystemContext>,\n env: EnvironmentContext<TResolvedConfig, TSystemContext>\n) {\n await context.callHook(\"build\", {\n environment: env,\n order: \"pre\"\n });\n\n env.debug(\n \"Formatting the generated entry files before the build process starts.\"\n );\n await formatFolder(env, env.entryPath);\n\n await context.callHook(\"build\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.config.output.copy) {\n env.debug(\"Copying project's files from build output directory.\");\n\n const destinationPath = isParentPath(\n appendPath(env.config.output.path, env.config.cwd),\n appendPath(env.config.root, env.config.cwd)\n )\n ? joinPaths(\n env.config.output.copy.path,\n relativePath(\n appendPath(env.config.root, env.config.cwd),\n appendPath(env.config.output.path, env.config.cwd)\n )\n )\n : joinPaths(env.config.output.copy.path, \"dist\");\n const sourcePath = env.config.output.path;\n\n if (existsSync(sourcePath) && sourcePath !== destinationPath) {\n env.debug(\n `Copying files from project's build output directory (${\n env.config.output.path\n }) to the project's copy/publish directory (${destinationPath}).`\n );\n\n await copyFiles(sourcePath, destinationPath);\n } else {\n env.warn(\n `The source path for the copy operation ${\n !existsSync(sourcePath)\n ? \"does not exist\"\n : \"is the same as the destination path\"\n }. Source: ${sourcePath}, Destination: ${\n destinationPath\n }. Skipping copying of build output files.`\n );\n }\n\n if (\n env.config.output.copy.assets &&\n Array.isArray(env.config.output.copy.assets)\n ) {\n await Promise.all(\n env.config.output.copy.assets.map(async asset => {\n env.trace(\n `Copying asset(s): ${chalk.redBright(\n env.config.cwd === asset.input\n ? asset.glob\n : appendPath(\n asset.glob,\n replacePath(asset.input, env.config.cwd)\n )\n )} -> ${chalk.greenBright(\n appendPath(asset.glob, replacePath(asset.output, env.config.cwd))\n )} ${\n Array.isArray(asset.ignore) && asset.ignore.length > 0\n ? ` (ignoring: ${asset.ignore\n .map(i => chalk.yellowBright(i))\n .join(\", \")})`\n : \"\"\n }`\n );\n\n await env.fs.copy(asset, asset.output);\n })\n );\n }\n } else {\n env.debug(\n \"No copy configuration found for the project output. Skipping the copying of build output files.\"\n );\n }\n\n await context.callHook(\"build\", {\n environment: env,\n order: \"post\"\n });\n}\n\n/**\n * Build the project\n *\n * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\nexport async function build<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Building\");\n\n await context.generateChecksum();\n if (\n context.meta.checksum !== context.persistedMeta?.checksum ||\n context.config.skipCache\n ) {\n context.info(\n !context.persistedMeta?.checksum\n ? \"No previous build cache found. Preparing the project for the initial build.\"\n : context.meta.checksum !== context.persistedMeta.checksum\n ? \"The project has been modified since the last time `prepare` was ran. Re-preparing the project.\"\n : \"The project is configured to skip cache. Re-preparing the project.\"\n );\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n }\n\n if (context.config.singleBuild) {\n await handleBuild<TResolvedConfig, TSystemContext>(\n context,\n await context.toEnvironment()\n );\n } else {\n await executeEnvironments(context, async env => {\n await handleBuild<TResolvedConfig, TSystemContext>(context, env);\n });\n }\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Clean any previously prepared artifacts\n *\n * @param context - The execution context for the clean process, which provides access to the project configuration, environment, and utility functions for performing the clean operation. The context is used to manage the state and behavior of the clean process, allowing for hooks to be called at different stages of the clean and for environment-specific configurations to be applied.\n */\nexport async function clean<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Cleaning\");\n\n await prepare<TResolvedConfig, TSystemContext>(context, true);\n await executeEnvironments(context, async env => {\n env.debug(\"Cleaning the project's dist and artifacts directories.\");\n\n await env.fs.remove(joinPaths(env.config.cwd, env.config.output.path));\n await env.fs.remove(\n joinPaths(\n env.config.cwd,\n env.config.root,\n env.config.output.artifactsPath\n )\n );\n\n await context.callHook(\"clean\", {\n environment: env,\n sequential: false\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { listFiles } from \"@stryke/fs/list-files\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport Handlebars from \"handlebars\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Create a new Powerlines project\n *\n * @param context - The execution context for the create process, which provides access to the project configuration, environment, and utility functions for performing the create operation. The context is used to manage the state and behavior of the create process, allowing for hooks to be called at different stages of the create and for environment-specific configurations to be applied.\n */\nexport async function create<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Create a New Project Generation\");\n\n await prepare<TResolvedConfig, TSystemContext>(context, true);\n await executeEnvironments(context, async env => {\n env.debug(\"Initializing the processing options for the project.\");\n\n await context.callHook(\"create\", {\n environment: env,\n order: \"pre\"\n });\n\n const files = await listFiles(\n joinPaths(env.powerlinesPath, \"files/common/**/*.hbs\")\n );\n for (const file of files) {\n env.trace(`Adding template file to project: ${file}`);\n\n const template = Handlebars.compile(file);\n await env.fs.write(\n joinPaths(env.config.root, file.replace(\".hbs\", \"\")),\n template(env)\n );\n }\n\n await context.callHook(\"create\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.config.projectType === \"application\") {\n const appFiles = await listFiles(\n joinPaths(env.powerlinesPath, \"files/application/**/*.hbs\")\n );\n for (const file of appFiles) {\n env.trace(`Adding application template file: ${file}`);\n\n const template = Handlebars.compile(file);\n await env.fs.write(\n joinPaths(env.config.root, file.replace(\".hbs\", \"\")),\n template(env)\n );\n }\n } else {\n const libFiles = await listFiles(\n joinPaths(env.powerlinesPath, \"files/library/**/*.hbs\")\n );\n for (const file of libFiles) {\n env.trace(`Adding library template file: ${file}`);\n\n const template = Handlebars.compile(file);\n await env.fs.write(\n joinPaths(env.config.root, file.replace(\".hbs\", \"\")),\n template(env)\n );\n }\n }\n\n await context.callHook(\"create\", {\n environment: env,\n order: \"post\"\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Deploy the project's source files to the target environment.\n *\n * @remarks\n * This function serves as the main entry point for the deployment process, orchestrating the execution of deployment hooks across different environments defined in the project configuration. It ensures that all relevant deployment operations are performed in a structured manner, allowing for pre-deployment, main deployment, and post-deployment hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the deployment operation, providing insights into the performance of the deployment process.\n *\n * @param context - The execution context for the deploy process, which provides access to the project configuration, environment, and utility functions for performing the deploy operation. The context is used to manage the state and behavior of the deploy process, allowing for hooks to be called at different stages of the deploy and for environment-specific configurations to be applied.\n */\nexport async function deploy<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Deployment\");\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"deploy\", {\n environment: env\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Generate the project's documentation.\n *\n * @remarks\n * This function serves as the main entry point for the documentation generation process, orchestrating the execution of documentation hooks across different environments defined in the project configuration. It ensures that all relevant documentation operations are performed in a structured manner, allowing for pre-documentation, main documentation, and post-documentation hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the documentation operation, providing insights into the performance of the documentation process.\n *\n * @param context - The execution context for the documentation process, which provides access to the project configuration, environment, and utility functions for performing the documentation operation. The context is used to manage the state and behavior of the documentation process, allowing for hooks to be called at different stages of the documentation and for environment-specific configurations to be applied.\n */\nexport async function docs<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Documentation\");\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"docs\", {\n environment: env\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Lint the project's source files and report any issues found.\n *\n * @remarks\n * This function serves as the main entry point for the linting process, orchestrating the execution of linting hooks across different environments defined in the project configuration. It ensures that all relevant linting operations are performed in a structured manner, allowing for pre-linting, main linting, and post-linting hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the linting operation, providing insights into the performance of the linting process.\n *\n * @param context - The execution context for the lint process, which provides access to the project configuration, environment, and utility functions for performing the lint operation. The context is used to manage the state and behavior of the lint process, allowing for hooks to be called at different stages of the lint and for environment-specific configurations to be applied.\n */\nexport async function lint<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Linting\");\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"lint\", {\n environment: env,\n sequential: false\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Test the project's source files and report any issues found.\n *\n * @remarks\n * This function serves as the main entry point for the testing process, orchestrating the execution of testing hooks across different environments defined in the project configuration. It ensures that all relevant testing operations are performed in a structured manner, allowing for pre-testing, main testing, and post-testing hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the testing operation, providing insights into the performance of the testing process.\n *\n * @param context - The execution context for the test process, which provides access to the project configuration, environment, and utility functions for performing the test operation. The context is used to manage the state and behavior of the test process, allowing for hooks to be called at different stages of the test and for environment-specific configurations to be applied.\n */\nexport async function test<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Testing\");\n\n await prepare(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"test\", {\n environment: env,\n sequential: false\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { handleTypes } from \"@powerlines/core/lib/generate-types\";\nimport { installDependencies } from \"@powerlines/core/lib/install-dependencies\";\nimport { writeMetaFile } from \"@powerlines/core/lib/meta\";\nimport {\n initializeTsconfig,\n resolveTsconfig\n} from \"@powerlines/core/lib/typescript/tsconfig\";\nimport { format } from \"@powerlines/core/lib/utilities/format\";\nimport { ExecutionContext } from \"@powerlines/core/types/context\";\nimport { formatLogMessage } from \"@storm-software/config-tools/logger\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { createDirectory } from \"@stryke/fs/helpers\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Generate runtime types for the Powerlines project.\n *\n * @remarks\n * This function is responsible for generating TypeScript declaration files based on the project's configuration and environment. It executes hooks at various stages of the type generation process, allowing for customization and extension by plugins. The generated types are formatted and written to the appropriate location in the project's file system, ensuring that they are available for use by other parts of the Powerlines system and by end-users of the project.\n *\n * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\nexport async function types<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Type Generation\");\n context.debug(\n \" Aggregating configuration options for the Powerlines project\"\n );\n\n await executeEnvironments(context, async env => {\n env.debug(\n `Initializing the processing options for the Powerlines project.`\n );\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"pre\"\n });\n\n await initializeTsconfig<TResolvedConfig, TSystemContext>(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.entry.length > 0) {\n env.debug(\n `The configuration provided ${\n isObject(env.config.input)\n ? Object.keys(env.config.input).length\n : toArray(env.config.input).length\n } entry point(s), Powerlines has found ${\n env.entry.length\n } entry files(s) for the ${env.config.title} project${\n env.entry.length > 0 && env.entry.length < 10\n ? `: \\n${env.entry\n .map(\n entry =>\n `- ${entry.file}${\n entry.output ? ` -> ${entry.output}` : \"\"\n }`\n )\n .join(\" \\n\")}`\n : \"\"\n }`\n );\n } else {\n env.warn(\n `No entry files were found for the ${\n env.config.title\n } project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`\n );\n }\n\n await resolveTsconfig<TResolvedConfig, TSystemContext>(env);\n await installDependencies(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"post\"\n });\n\n context.trace(\n `Powerlines configuration has been resolved: \\n\\n${formatLogMessage({\n ...env.config,\n userConfig: isSetObject(env.config.userConfig)\n ? omit(env.config.userConfig, [\"plugins\"])\n : undefined,\n inlineConfig: isSetObject(env.config.inlineConfig)\n ? env.config.inlineConfig\n : undefined,\n plugins: env.plugins.map(plugin => plugin.name)\n })}`\n );\n\n if (!env.fs.existsSync(env.cachePath)) {\n await createDirectory(env.cachePath);\n }\n\n if (!env.fs.existsSync(env.dataPath)) {\n await createDirectory(env.dataPath);\n }\n\n if (\n env.config.skipCache === true ||\n env.persistedMeta?.checksum !== env.meta.checksum\n ) {\n env.debug(\n `Using previously prepared files as the meta checksum has not changed.`\n );\n } else {\n env.info(\n `Running \\`prepare\\` command as the meta checksum has changed since the last run.`\n );\n\n await prepare(context, true);\n }\n\n await handleTypes(context, env);\n\n context.debug(\"Formatting files generated during the types step.\");\n\n await format(env, env.typesPath, (await env.fs.read(env.typesPath)) ?? \"\");\n\n await writeMetaFile(env);\n env.persistedMeta = env.meta;\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { createEventEmitter } from \"@powerlines/core/lib/events\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { StormURL } from \"@stryke/url\";\nimport { BirpcOptions } from \"birpc\";\nimport {\n createRpcStreamingClientHost,\n DevToolsClientRpcHost,\n DevToolsRpcClientMode,\n RpcClientEvents\n} from \"devframe/client\";\nimport { RpcCacheManager, RpcFunctionsCollectorBase } from \"devframe/rpc\";\nimport { createRpcClient as createDevframeRpcClient } from \"devframe/rpc/client\";\nimport {\n createWsRpcChannel,\n WsRpcChannelOptions\n} from \"devframe/rpc/transports/ws-client\";\nimport {\n ConnectionMeta,\n EventEmitter as DevFrameEventEmitter\n} from \"devframe/types\";\nimport { promiseWithResolver } from \"devframe/utils/promise\";\nimport { humanId } from \"human-id\";\nimport { EventEmitter } from \"node:events\";\nimport { RpcClientOptions } from \"../types/config\";\nimport {\n RpcClient,\n RpcClientFunctions,\n RpcContext,\n RpcServerFunctions\n} from \"../types/rpc\";\n\nfunction createWsRpcClientMode(\n baseURL: StormURL,\n connectionMeta: ConnectionMeta,\n events: DevFrameEventEmitter<RpcClientEvents>,\n clientRpc: DevToolsClientRpcHost,\n authToken: string = humanId({ separator: \"-\", capitalize: false }),\n rpcOptions: Partial<\n BirpcOptions<RpcServerFunctions, RpcClientFunctions, boolean>\n > = {},\n wsOptions: Partial<WsRpcChannelOptions> = {}\n): DevToolsRpcClientMode {\n let isTrusted = false;\n const trustedPromise = promiseWithResolver<boolean>();\n const url =\n isNumber(connectionMeta.websocket) ||\n (isSet(connectionMeta.websocket) &&\n `${+connectionMeta.websocket}` === `${connectionMeta.websocket}`)\n ? `${baseURL.protocol.replace(\"http\", \"ws\")}//${baseURL.hostname}:${connectionMeta.websocket}`\n : (connectionMeta.websocket as string);\n\n // Build a minimal `defs` map from the connection meta so the per-call\n // wire serializer dispatches outgoing requests with the correct\n // encoding (JSON for `jsonSerializable: true` methods; structured-\n // clone for the rest).\n const definitions = new Map<string, { jsonSerializable: true }>();\n for (const name of connectionMeta.jsonSerializableMethods ?? [])\n definitions.set(name, { jsonSerializable: true });\n\n const serverRpc = createDevframeRpcClient<\n RpcServerFunctions,\n RpcClientFunctions\n >(clientRpc.functions, {\n channel: createWsRpcChannel({\n url,\n authToken,\n definitions,\n ...wsOptions\n }),\n rpcOptions\n });\n\n // Handle server-initiated auth revocation\n clientRpc.register({\n name: \"devframe:auth:revoked\",\n type: \"event\",\n handler: () => {\n isTrusted = false;\n events.emit(\"rpc:is-trusted:updated\", false);\n }\n });\n\n let currentAuthToken = authToken;\n\n async function requestTrustWithToken(token: string) {\n currentAuthToken = token;\n\n // const info = parseUA(navigator.userAgent);\n // const ua = [\n // \"powerlines\",\n // \"1.0\",\n // \"|\",\n // info.os.name,\n // info.os.version,\n // info.device.type\n // ]\n // .filter(i => i)\n // .join(\" \");\n\n // const result = await serverRpc.$call(\"vite:anonymous:auth\", {\n // authToken: token,\n // ua,\n // origin: baseURL.origin\n // });\n\n // isTrusted = result.isTrusted;\n // trustedPromise.resolve(isTrusted);\n // events.emit(\"rpc:is-trusted:updated\", isTrusted);\n // return result.isTrusted;\n\n return true;\n }\n\n async function requestTrust() {\n if (isTrusted) return true;\n return requestTrustWithToken(currentAuthToken);\n }\n\n async function ensureTrusted(timeout = 60_000): Promise<boolean> {\n if (isTrusted) trustedPromise.resolve(true);\n\n if (timeout <= 0) return trustedPromise.promise;\n\n let clear = () => {};\n await Promise.race([\n trustedPromise.promise.then(clear),\n new Promise((resolve, reject) => {\n const id = setTimeout(() => {\n reject(new Error(\"Timeout waiting for rpc to be trusted\"));\n }, timeout);\n clear = () => clearTimeout(id);\n })\n ]);\n\n return isTrusted;\n }\n\n return {\n get isTrusted() {\n return isTrusted;\n },\n requestTrust,\n requestTrustWithToken,\n ensureTrusted,\n call: (...args: any): any => {\n return serverRpc.$call(\n // @ts-expect-error casting\n ...args\n );\n },\n callEvent: (...args: any): any => {\n return serverRpc.$callEvent(\n // @ts-expect-error casting\n ...args\n );\n },\n callOptional: (...args: any): any => {\n return serverRpc.$callOptional(\n // @ts-expect-error casting\n ...args\n );\n }\n };\n}\n\nconst CONNECTION_AUTH_TOKEN_KEY = \"__DEVTOOLS_CONNECTION_AUTH_TOKEN__\";\n\nexport function createRpcClient(options: RpcClientOptions) {\n const baseURL = new StormURL(options.baseURL);\n\n const cacheManager = new RpcCacheManager({\n functions: [],\n ...(typeof options.cacheOptions === \"object\" ? options.cacheOptions : {})\n });\n const context: RpcContext = {\n rpc: undefined!\n };\n\n const clientRpc: DevToolsClientRpcHost = new RpcFunctionsCollectorBase<\n RpcClientFunctions,\n RpcContext\n >(context);\n\n EventEmitter.setMaxListeners(100);\n const events = createEventEmitter<RpcClientEvents>();\n\n const mode = createWsRpcClientMode(\n baseURL,\n options.connection,\n events,\n clientRpc,\n undefined,\n {\n ...options.rpcOptions,\n async onRequest(req, next, resolve) {\n await options.rpcOptions?.onRequest?.call(this, req, next, resolve);\n if (options.cacheOptions && cacheManager?.validate(req.m)) {\n const cached = cacheManager.cached(req.m, req.a);\n if (cached) {\n return resolve(cached);\n } else {\n const res = await next(req);\n cacheManager?.apply(req, res);\n }\n } else {\n await next(req);\n }\n }\n },\n options.wsOptions\n );\n\n const rpc: RpcClient = {\n events,\n get isTrusted() {\n return mode.isTrusted;\n },\n connectionMeta: options.connection,\n ensureTrusted: mode.ensureTrusted,\n requestTrust: mode.requestTrust,\n requestTrustWithToken: async (token: string) => {\n // Update stored token for future reconnections\n localStorage.setItem(CONNECTION_AUTH_TOKEN_KEY, token);\n (globalThis as any)[CONNECTION_AUTH_TOKEN_KEY] = token;\n return mode.requestTrustWithToken(token);\n },\n call: mode.call,\n callEvent: mode.callEvent,\n callOptional: mode.callOptional,\n client: clientRpc,\n sharedState: undefined!,\n streaming: undefined!,\n cacheManager\n };\n\n // rpc.sharedState = createRpcSharedStateClientHost(rpc);\n rpc.streaming = createRpcStreamingClientHost(rpc);\n\n // @ts-expect-error assign to readonly property\n context.rpc = rpc;\n void mode.requestTrust();\n\n // Listen for auth updates from other tabs (e.g., auth URL page)\n try {\n const bc = new BroadcastChannel(\"vite-devtools-auth\");\n bc.onmessage = event => {\n if (event.data?.type === \"auth-update\" && event.data.authToken) {\n void rpc.requestTrustWithToken(event.data.authToken);\n }\n };\n } catch {\n // BroadcastChannel is not supported in all environments, so we can safely ignore errors here\n }\n\n return rpc;\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { LogFnMeta } from \"@powerlines/core\";\nimport { PowerlinesExecutionContext } from \"@powerlines/core/context/execution-context\";\nimport { resolvePluginConfig } from \"@powerlines/core/lib/context-helpers\";\nimport { consoleLogger } from \"@powerlines/core/plugin-utils\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport { RpcClient } from \"../types\";\nimport { ExecutionHostParams } from \"../types/api\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { createRpcClient } from \"./rpc\";\n\n/**\n * Creates an execution host with the provided methods. Each method will be wrapped to create an execution context and handle errors appropriately.\n *\n * @param methods - An object where keys are method names and values are functions that take an execution context and return a promise.\n * @returns An object with the same keys as the input methods, but each function is wrapped to create an execution context and handle errors.\n */\nexport function createExecutionHost<\n TContext extends PowerlinesExecutionContext<\n EngineResolvedConfig,\n EngineSystemContext\n > = PowerlinesExecutionContext<EngineResolvedConfig, EngineSystemContext>\n>(methods: Record<string, (context: TContext) => Promise<void>>) {\n return Object.fromEntries(\n Object.entries(methods).map(([method, fn]) => [\n method,\n async (params: ExecutionHostParams) => {\n const { options, inlineConfig } = params;\n\n let rpc!: RpcClient;\n if (options.baseURL && options.connection) {\n rpc = createRpcClient(options);\n } else {\n throw new Error(\n `Execution RPC client could not be created - Missing ${\n !options.baseURL\n ? `baseURL${options.connection ? ` and connection information` : \"\"}`\n : \"connection\"\n } or connection information.`\n );\n }\n\n const logFn = (meta: LogFnMeta, message: string) => {\n consoleLogger(meta, message);\n if (rpc) {\n void rpc.callEvent(\"powerlines:log\", {\n meta: {\n category: \"general\",\n ...options,\n ...(isSetObject(meta) ? meta : { type: meta }),\n logId: uuid(),\n timestamp: Date.now()\n },\n message\n });\n }\n };\n\n const context = (await PowerlinesExecutionContext.from<\n EngineResolvedConfig,\n EngineSystemContext\n >({ ...options, logFn }, inlineConfig ?? {}, {\n rpc\n })) as TContext;\n\n context.logger.info(\n `Starting ${\n titleCase(options.framework?.name) || \"Powerlines\"\n } - ${titleCase(method)} execution (${options.executionId})`\n );\n\n await resolvePluginConfig(context as PowerlinesExecutionContext<any>);\n\n await fn(context);\n }\n ])\n );\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { build as executeBuild } from \"./api/build\";\nimport { clean as executeClean } from \"./api/clean\";\nimport { create as executeCreate } from \"./api/create\";\nimport { deploy as executeDeploy } from \"./api/deploy\";\nimport { docs as executeDocs } from \"./api/docs\";\nimport { lint as executeLint } from \"./api/lint\";\nimport { prepare as executePrepare } from \"./api/prepare\";\nimport { test as executeTest } from \"./api/test\";\nimport { types as executeTypes } from \"./api/types\";\nimport { createExecutionHost } from \"./helpers/create-execution-host\";\n\nconst executionHost = createExecutionHost({\n types: executeTypes,\n prepare: executePrepare,\n create: executeCreate,\n clean: executeClean,\n lint: executeLint,\n test: executeTest,\n build: executeBuild,\n docs: executeDocs,\n deploy: executeDeploy\n});\n\nexport const types = executionHost.types;\nexport const prepare = executionHost.prepare;\nexport const create = executionHost.create;\nexport const clean = executionHost.clean;\nexport const lint = executionHost.lint;\nexport const test = executionHost.test;\nexport const build = executionHost.build;\nexport const docs = executionHost.docs;\nexport const deploy = executionHost.deploy;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,eAAsBA,UAIpB,SACA,YAAY,OACZ;CACA,MAAM,QAAQ,QAAQ,MAAM,cAAc;AAE1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