@powerlines/engine 0.49.13 → 0.49.14
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-DcHfCjQK.d.cts → api-D1r7WAQA.d.cts} +13 -13
- package/dist/api-D1r7WAQA.d.cts.map +1 -0
- package/dist/{api-BgyEi2hF.d.mts → api-DRcC7Ry-.d.mts} +13 -13
- package/dist/api-DRcC7Ry-.d.mts.map +1 -0
- package/dist/api.cjs +3 -21
- package/dist/api.d.cts +5 -12
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +5 -11
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +21 -30
- package/dist/api.mjs.map +1 -1
- package/dist/engine-BLp7JcAB.d.mts +199 -0
- package/dist/engine-BLp7JcAB.d.mts.map +1 -0
- package/dist/{engine-BWwXttY1.mjs → engine-CDFOkhKj.mjs} +113 -121
- package/dist/engine-CDFOkhKj.mjs.map +1 -0
- package/dist/engine-DFKgU8-G.d.cts +199 -0
- package/dist/engine-DFKgU8-G.d.cts.map +1 -0
- package/dist/{engine-CYesECu-.cjs → engine-DlOFwFgt.cjs} +112 -120
- package/dist/engine.cjs +1 -1
- package/dist/engine.d.cts +2 -143
- package/dist/engine.d.mts +2 -143
- package/dist/engine.mjs +1 -1
- package/dist/helpers/{create-execution-host.cjs → create-api.cjs} +14 -13
- package/dist/helpers/create-api.d.cts +18 -0
- package/dist/helpers/create-api.d.cts.map +1 -0
- package/dist/helpers/create-api.d.mts +18 -0
- package/dist/helpers/create-api.d.mts.map +1 -0
- package/dist/helpers/{create-execution-host.mjs → create-api.mjs} +15 -14
- package/dist/helpers/create-api.mjs.map +1 -0
- package/dist/helpers/index.cjs +2 -2
- package/dist/helpers/index.d.cts +2 -2
- package/dist/helpers/index.d.mts +2 -2
- package/dist/helpers/index.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/package.json +23 -23
- package/dist/api-BgyEi2hF.d.mts.map +0 -1
- package/dist/api-DcHfCjQK.d.cts.map +0 -1
- package/dist/engine-BWwXttY1.mjs.map +0 -1
- package/dist/engine.d.cts.map +0 -1
- package/dist/engine.d.mts.map +0 -1
- package/dist/helpers/create-execution-host.d.cts +0 -20
- package/dist/helpers/create-execution-host.d.cts.map +0 -1
- package/dist/helpers/create-execution-host.d.mts +0 -20
- package/dist/helpers/create-execution-host.d.mts.map +0 -1
- package/dist/helpers/create-execution-host.mjs.map +0 -1
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { t as EngineExecutionOptions } from "./config-DKEmqMrh.cjs";
|
|
2
2
|
import { t as EngineContext } from "./context-D0_a0kRO.cjs";
|
|
3
3
|
import { BuildInlineConfig, CleanInlineConfig, CreateInlineConfig, DeployInlineConfig, DocsInlineConfig, InlineConfig, LintInlineConfig, PrepareInlineConfig, TestInlineConfig, TypesInlineConfig } from "@powerlines/core";
|
|
4
|
-
import { EXECUTION_API_METHODS } from "@powerlines/core/constants/api";
|
|
5
4
|
|
|
6
|
-
//#region src/types/utils.d.ts
|
|
7
|
-
type Worker<TParams extends any[], TExposedMethods extends ReadonlyArray<string>> = { [K in TExposedMethods[number]]: (...params: TParams) => Promise<void> } & {
|
|
8
|
-
finalize: () => Promise<void>;
|
|
9
|
-
};
|
|
10
|
-
//#endregion
|
|
11
5
|
//#region src/types/api.d.ts
|
|
12
6
|
/**
|
|
13
7
|
* The Powerlines Base API Interface
|
|
@@ -104,7 +98,11 @@ interface ExecutionInterface {
|
|
|
104
98
|
*/
|
|
105
99
|
finalize: () => Promise<void>;
|
|
106
100
|
}
|
|
107
|
-
interface
|
|
101
|
+
interface ExecutionApiParams {
|
|
102
|
+
/**
|
|
103
|
+
* The command being executed, which corresponds to the method name in the execution API. This value is used to identify which command is being invoked and can be used for logging, error handling, and other purposes within the execution host.
|
|
104
|
+
*/
|
|
105
|
+
command: string;
|
|
108
106
|
/**
|
|
109
107
|
* The {@link MessagePort} used for communication between the execution host and the engine. This port will be used to send and receive messages, allowing the execution host to invoke API methods and return results to the engine.
|
|
110
108
|
*/
|
|
@@ -118,12 +116,14 @@ interface ExecutionHostParams {
|
|
|
118
116
|
*/
|
|
119
117
|
inlineConfig: InlineConfig;
|
|
120
118
|
}
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
interface ExecutionApiWorkerInterface {
|
|
120
|
+
execute: (command: string, options: EngineExecutionOptions, inlineConfig: InlineConfig) => Promise<void>;
|
|
121
|
+
finalize: () => Promise<void>;
|
|
122
|
+
}
|
|
123
123
|
/**
|
|
124
124
|
* The Engine interface represents the Powerlines process' orchestration and coordination API.
|
|
125
125
|
*/
|
|
126
|
-
interface Engine
|
|
126
|
+
interface Engine extends ExecutionInterface {
|
|
127
127
|
/**
|
|
128
128
|
* The Powerlines shared context
|
|
129
129
|
*/
|
|
@@ -131,8 +131,8 @@ interface Engine<TExecutionAPI extends ReadonlyArray<string>> extends ExecutionI
|
|
|
131
131
|
/**
|
|
132
132
|
* The execution host, which provides methods to call the execution API functions from the engine context. This allows the engine to invoke commands and other API functions during the execution of Powerlines commands, enabling communication between the engine and the execution contexts.
|
|
133
133
|
*/
|
|
134
|
-
|
|
134
|
+
api: ExecutionApiWorkerInterface;
|
|
135
135
|
}
|
|
136
136
|
//#endregion
|
|
137
|
-
export {
|
|
138
|
-
//# sourceMappingURL=api-
|
|
137
|
+
export { ExecutionInterface as i, ExecutionApiParams as n, ExecutionApiWorkerInterface as r, Engine as t };
|
|
138
|
+
//# sourceMappingURL=api-D1r7WAQA.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-D1r7WAQA.d.cts","names":[],"sources":["../src/types/api.ts"],"mappings":";;;;;;;AAuCA;;;;UAAiB,kBAAA;EAmBO;;;;;;;;EAVtB,OAAA,GAAU,YAAA,EAAc,mBAAA,KAAwB,OAAA;EAgDN;;;;;;;;EAtC1C,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;EA6ErB;;;;;;;;;EAlEvB,MAAA,GAAS,YAAA,EAAc,kBAAA,KAAuB,OAAA;EAAvB;;;;;;;;;EAWvB,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;EAQF;;;;;;EAA1C,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EAmBlC;;;;;;EAXR,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EA6BnB;;;;;;AAUA;AAGzB;;EA/BE,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;EAwCtC;;;;;;EAhCN,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EAgCpC;;;;;;AAUoB;AAG5B;EAnCE,MAAA,GAAS,YAAA,EAAc,kBAAA,KAAuB,OAAA;;;;;;;;;EAU9C,QAAA,QAAgB,OAAA;AAAA;AAAA,UAGD,kBAAA;EA0BC;;;EAtBhB,OAAA;EAwBgB;;AAAO;EAnBvB,IAAA,EAAM,WAAA;EAyBgB;;;EApBtB,OAAA,EAAS,sBAAA;EAoBqB;;;EAf9B,YAAA,EAAc,YAAA;AAAA;AAAA,UAGC,2BAAA;EACf,OAAA,GACE,OAAA,UACA,OAAA,EAAS,sBAAA,EACT,YAAA,EAAc,YAAA,KACX,OAAA;EACL,QAAA,QAAgB,OAAA;AAAA;AAegB;;;AAAA,UATjB,MAAA,SAAe,kBAAA;;;;EAI9B,OAAA,EAAS,aAAA;;;;EAKT,GAAA,EAAK,2BAAA;AAAA"}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { t as EngineExecutionOptions } from "./config-ByLyzMI0.mjs";
|
|
2
2
|
import { t as EngineContext } from "./context-DcXV6_GL.mjs";
|
|
3
3
|
import { BuildInlineConfig, CleanInlineConfig, CreateInlineConfig, DeployInlineConfig, DocsInlineConfig, InlineConfig, LintInlineConfig, PrepareInlineConfig, TestInlineConfig, TypesInlineConfig } from "@powerlines/core";
|
|
4
|
-
import { EXECUTION_API_METHODS } from "@powerlines/core/constants/api";
|
|
5
4
|
|
|
6
|
-
//#region src/types/utils.d.ts
|
|
7
|
-
type Worker<TParams extends any[], TExposedMethods extends ReadonlyArray<string>> = { [K in TExposedMethods[number]]: (...params: TParams) => Promise<void> } & {
|
|
8
|
-
finalize: () => Promise<void>;
|
|
9
|
-
};
|
|
10
|
-
//#endregion
|
|
11
5
|
//#region src/types/api.d.ts
|
|
12
6
|
/**
|
|
13
7
|
* The Powerlines Base API Interface
|
|
@@ -104,7 +98,11 @@ interface ExecutionInterface {
|
|
|
104
98
|
*/
|
|
105
99
|
finalize: () => Promise<void>;
|
|
106
100
|
}
|
|
107
|
-
interface
|
|
101
|
+
interface ExecutionApiParams {
|
|
102
|
+
/**
|
|
103
|
+
* The command being executed, which corresponds to the method name in the execution API. This value is used to identify which command is being invoked and can be used for logging, error handling, and other purposes within the execution host.
|
|
104
|
+
*/
|
|
105
|
+
command: string;
|
|
108
106
|
/**
|
|
109
107
|
* The {@link MessagePort} used for communication between the execution host and the engine. This port will be used to send and receive messages, allowing the execution host to invoke API methods and return results to the engine.
|
|
110
108
|
*/
|
|
@@ -118,12 +116,14 @@ interface ExecutionHostParams {
|
|
|
118
116
|
*/
|
|
119
117
|
inlineConfig: InlineConfig;
|
|
120
118
|
}
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
interface ExecutionApiWorkerInterface {
|
|
120
|
+
execute: (command: string, options: EngineExecutionOptions, inlineConfig: InlineConfig) => Promise<void>;
|
|
121
|
+
finalize: () => Promise<void>;
|
|
122
|
+
}
|
|
123
123
|
/**
|
|
124
124
|
* The Engine interface represents the Powerlines process' orchestration and coordination API.
|
|
125
125
|
*/
|
|
126
|
-
interface Engine
|
|
126
|
+
interface Engine extends ExecutionInterface {
|
|
127
127
|
/**
|
|
128
128
|
* The Powerlines shared context
|
|
129
129
|
*/
|
|
@@ -131,8 +131,8 @@ interface Engine<TExecutionAPI extends ReadonlyArray<string>> extends ExecutionI
|
|
|
131
131
|
/**
|
|
132
132
|
* The execution host, which provides methods to call the execution API functions from the engine context. This allows the engine to invoke commands and other API functions during the execution of Powerlines commands, enabling communication between the engine and the execution contexts.
|
|
133
133
|
*/
|
|
134
|
-
|
|
134
|
+
api: ExecutionApiWorkerInterface;
|
|
135
135
|
}
|
|
136
136
|
//#endregion
|
|
137
|
-
export {
|
|
138
|
-
//# sourceMappingURL=api-
|
|
137
|
+
export { ExecutionInterface as i, ExecutionApiParams as n, ExecutionApiWorkerInterface as r, Engine as t };
|
|
138
|
+
//# sourceMappingURL=api-DRcC7Ry-.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-DRcC7Ry-.d.mts","names":[],"sources":["../src/types/api.ts"],"mappings":";;;;;;;AAuCA;;;;UAAiB,kBAAA;EAmBO;;;;;;;;EAVtB,OAAA,GAAU,YAAA,EAAc,mBAAA,KAAwB,OAAA;EAgDN;;;;;;;;EAtC1C,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;EA6ErB;;;;;;;;;EAlEvB,MAAA,GAAS,YAAA,EAAc,kBAAA,KAAuB,OAAA;EAAvB;;;;;;;;;EAWvB,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;EAQF;;;;;;EAA1C,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EAmBlC;;;;;;EAXR,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EA6BnB;;;;;;AAUA;AAGzB;;EA/BE,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;EAwCtC;;;;;;EAhCN,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EAgCpC;;;;;;AAUoB;AAG5B;EAnCE,MAAA,GAAS,YAAA,EAAc,kBAAA,KAAuB,OAAA;;;;;;;;;EAU9C,QAAA,QAAgB,OAAA;AAAA;AAAA,UAGD,kBAAA;EA0BC;;;EAtBhB,OAAA;EAwBgB;;AAAO;EAnBvB,IAAA,EAAM,WAAA;EAyBgB;;;EApBtB,OAAA,EAAS,sBAAA;EAoBqB;;;EAf9B,YAAA,EAAc,YAAA;AAAA;AAAA,UAGC,2BAAA;EACf,OAAA,GACE,OAAA,UACA,OAAA,EAAS,sBAAA,EACT,YAAA,EAAc,YAAA,KACX,OAAA;EACL,QAAA,QAAgB,OAAA;AAAA;AAegB;;;AAAA,UATjB,MAAA,SAAe,kBAAA;;;;EAI9B,OAAA,EAAS,aAAA;;;;EAKT,GAAA,EAAK,2BAAA;AAAA"}
|
package/dist/api.cjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
1
|
const require_api_prepare = require('./api/prepare.cjs');
|
|
3
2
|
const require_api_build = require('./api/build.cjs');
|
|
4
3
|
const require_api_clean = require('./api/clean.cjs');
|
|
@@ -8,10 +7,10 @@ const require_api_docs = require('./api/docs.cjs');
|
|
|
8
7
|
const require_api_lint = require('./api/lint.cjs');
|
|
9
8
|
const require_api_test = require('./api/test.cjs');
|
|
10
9
|
const require_api_types = require('./api/types.cjs');
|
|
11
|
-
const
|
|
10
|
+
const require_helpers_create_api = require('./helpers/create-api.cjs');
|
|
12
11
|
|
|
13
12
|
//#region src/api.ts
|
|
14
|
-
|
|
13
|
+
var api_default = require_helpers_create_api.createApi({
|
|
15
14
|
types: require_api_types.types,
|
|
16
15
|
prepare: require_api_prepare.prepare,
|
|
17
16
|
create: require_api_create.create,
|
|
@@ -22,23 +21,6 @@ const executionHost = require_helpers_create_execution_host.createExecutionHost(
|
|
|
22
21
|
docs: require_api_docs.docs,
|
|
23
22
|
deploy: require_api_deploy.deploy
|
|
24
23
|
});
|
|
25
|
-
const types = executionHost.types;
|
|
26
|
-
const prepare = executionHost.prepare;
|
|
27
|
-
const create = executionHost.create;
|
|
28
|
-
const clean = executionHost.clean;
|
|
29
|
-
const lint = executionHost.lint;
|
|
30
|
-
const test = executionHost.test;
|
|
31
|
-
const build = executionHost.build;
|
|
32
|
-
const docs = executionHost.docs;
|
|
33
|
-
const deploy = executionHost.deploy;
|
|
34
24
|
|
|
35
25
|
//#endregion
|
|
36
|
-
exports
|
|
37
|
-
exports.clean = clean;
|
|
38
|
-
exports.create = create;
|
|
39
|
-
exports.deploy = deploy;
|
|
40
|
-
exports.docs = docs;
|
|
41
|
-
exports.lint = lint;
|
|
42
|
-
exports.prepare = prepare;
|
|
43
|
-
exports.test = test;
|
|
44
|
-
exports.types = types;
|
|
26
|
+
module.exports = api_default;
|
package/dist/api.d.cts
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import { r as
|
|
1
|
+
import { r as EngineResolvedConfig } from "./config-DKEmqMrh.cjs";
|
|
2
|
+
import { r as EngineSystemContext } from "./context-D0_a0kRO.cjs";
|
|
3
|
+
import { n as ExecutionApiParams } from "./api-D1r7WAQA.cjs";
|
|
2
4
|
//#region src/api.d.ts
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
declare const create: ((params: ExecutionHostParams) => Promise<void>) | undefined;
|
|
6
|
-
declare const clean: ((params: ExecutionHostParams) => Promise<void>) | undefined;
|
|
7
|
-
declare const lint: ((params: ExecutionHostParams) => Promise<void>) | undefined;
|
|
8
|
-
declare const test: ((params: ExecutionHostParams) => Promise<void>) | undefined;
|
|
9
|
-
declare const build: ((params: ExecutionHostParams) => Promise<void>) | undefined;
|
|
10
|
-
declare const docs: ((params: ExecutionHostParams) => Promise<void>) | undefined;
|
|
11
|
-
declare const deploy: ((params: ExecutionHostParams) => Promise<void>) | undefined;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { build, clean, create, deploy, docs, lint, prepare, test, types };
|
|
5
|
+
declare const _default: <TResolvedConfig extends EngineResolvedConfig, TSystemContext extends EngineSystemContext>(params: ExecutionApiParams) => Promise<void>;
|
|
6
|
+
export = _default;
|
|
14
7
|
//# sourceMappingURL=api.d.cts.map
|
package/dist/api.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.cts","names":[],"sources":["../src/api.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.cts","names":[],"sources":["../src/api.ts"],"mappings":""}
|
package/dist/api.d.mts
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { r as
|
|
1
|
+
import { r as EngineResolvedConfig } from "./config-ByLyzMI0.mjs";
|
|
2
|
+
import { r as EngineSystemContext } from "./context-DcXV6_GL.mjs";
|
|
3
|
+
import { n as ExecutionApiParams } from "./api-DRcC7Ry-.mjs";
|
|
2
4
|
//#region src/api.d.ts
|
|
3
|
-
declare const
|
|
4
|
-
declare const prepare: ((params: ExecutionHostParams) => Promise<void>) | undefined;
|
|
5
|
-
declare const create: ((params: ExecutionHostParams) => Promise<void>) | undefined;
|
|
6
|
-
declare const clean: ((params: ExecutionHostParams) => Promise<void>) | undefined;
|
|
7
|
-
declare const lint: ((params: ExecutionHostParams) => Promise<void>) | undefined;
|
|
8
|
-
declare const test: ((params: ExecutionHostParams) => Promise<void>) | undefined;
|
|
9
|
-
declare const build: ((params: ExecutionHostParams) => Promise<void>) | undefined;
|
|
10
|
-
declare const docs: ((params: ExecutionHostParams) => Promise<void>) | undefined;
|
|
11
|
-
declare const deploy: ((params: ExecutionHostParams) => Promise<void>) | undefined;
|
|
5
|
+
declare const _default: <TResolvedConfig extends EngineResolvedConfig, TSystemContext extends EngineSystemContext>(params: ExecutionApiParams) => Promise<void>;
|
|
12
6
|
//#endregion
|
|
13
|
-
export {
|
|
7
|
+
export { _default as default };
|
|
14
8
|
//# sourceMappingURL=api.d.mts.map
|
package/dist/api.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.mts","names":[],"sources":["../src/api.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.mts","names":[],"sources":["../src/api.ts"],"mappings":""}
|
package/dist/api.mjs
CHANGED
|
@@ -1,36 +1,27 @@
|
|
|
1
|
-
import { prepare
|
|
2
|
-
import { build
|
|
3
|
-
import { clean
|
|
4
|
-
import { create
|
|
5
|
-
import { deploy
|
|
6
|
-
import { docs
|
|
7
|
-
import { lint
|
|
8
|
-
import { test
|
|
9
|
-
import { types
|
|
10
|
-
import {
|
|
1
|
+
import { prepare } from "./api/prepare.mjs";
|
|
2
|
+
import { build } from "./api/build.mjs";
|
|
3
|
+
import { clean } from "./api/clean.mjs";
|
|
4
|
+
import { create } from "./api/create.mjs";
|
|
5
|
+
import { deploy } from "./api/deploy.mjs";
|
|
6
|
+
import { docs } from "./api/docs.mjs";
|
|
7
|
+
import { lint } from "./api/lint.mjs";
|
|
8
|
+
import { test } from "./api/test.mjs";
|
|
9
|
+
import { types } from "./api/types.mjs";
|
|
10
|
+
import { createApi } from "./helpers/create-api.mjs";
|
|
11
11
|
|
|
12
12
|
//#region src/api.ts
|
|
13
|
-
|
|
14
|
-
types
|
|
15
|
-
prepare
|
|
16
|
-
create
|
|
17
|
-
clean
|
|
18
|
-
lint
|
|
19
|
-
test
|
|
20
|
-
build
|
|
21
|
-
docs
|
|
22
|
-
deploy
|
|
13
|
+
var api_default = createApi({
|
|
14
|
+
types,
|
|
15
|
+
prepare,
|
|
16
|
+
create,
|
|
17
|
+
clean,
|
|
18
|
+
lint,
|
|
19
|
+
test,
|
|
20
|
+
build,
|
|
21
|
+
docs,
|
|
22
|
+
deploy
|
|
23
23
|
});
|
|
24
|
-
const types = executionHost.types;
|
|
25
|
-
const prepare = executionHost.prepare;
|
|
26
|
-
const create = executionHost.create;
|
|
27
|
-
const clean = executionHost.clean;
|
|
28
|
-
const lint = executionHost.lint;
|
|
29
|
-
const test = executionHost.test;
|
|
30
|
-
const build = executionHost.build;
|
|
31
|
-
const docs = executionHost.docs;
|
|
32
|
-
const deploy = executionHost.deploy;
|
|
33
24
|
|
|
34
25
|
//#endregion
|
|
35
|
-
export {
|
|
26
|
+
export { api_default as default };
|
|
36
27
|
//# sourceMappingURL=api.mjs.map
|
package/dist/api.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.mjs","names":[
|
|
1
|
+
{"version":3,"file":"api.mjs","names":[],"sources":["../src/api.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 { build } from \"./api/build\";\nimport { clean } from \"./api/clean\";\nimport { create } from \"./api/create\";\nimport { deploy } from \"./api/deploy\";\nimport { docs } from \"./api/docs\";\nimport { lint } from \"./api/lint\";\nimport { prepare } from \"./api/prepare\";\nimport { test } from \"./api/test\";\nimport { types } from \"./api/types\";\nimport { createApi } from \"./helpers/create-api\";\n\nexport default createApi({\n types,\n prepare,\n create,\n clean,\n lint,\n test,\n build,\n docs,\n deploy\n});\n"],"mappings":";;;;;;;;;;;;AA6BA,kBAAe,UAAU;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { n as EngineOptions, t as EngineExecutionOptions } from "./config-ByLyzMI0.mjs";
|
|
2
|
+
import { t as EngineContext } from "./context-DcXV6_GL.mjs";
|
|
3
|
+
import { r as ExecutionApiWorkerInterface, t as Engine } from "./api-DRcC7Ry-.mjs";
|
|
4
|
+
import { t as PowerlinesEngineContext } from "./engine-context-DKlA5Pgu.mjs";
|
|
5
|
+
import { BuildInlineConfig, CleanInlineConfig, CreateInlineConfig, DeployInlineConfig, DocsInlineConfig, InlineConfig, LintInlineConfig, Mode, PrepareInlineConfig, TestInlineConfig, TypesInlineConfig } from "@powerlines/core";
|
|
6
|
+
|
|
7
|
+
//#region src/_internal/execution-api-worker.d.ts
|
|
8
|
+
declare const RESTARTED: unique symbol;
|
|
9
|
+
interface ExecutionApiWorkerOptions {
|
|
10
|
+
/**
|
|
11
|
+
* The maximum time in milliseconds a worker can run before being terminated.
|
|
12
|
+
*
|
|
13
|
+
* @defaultValue 900000 (15 minutes)
|
|
14
|
+
*/
|
|
15
|
+
timeout?: number;
|
|
16
|
+
/**
|
|
17
|
+
* True if `--max-old-space-size` should not be forwarded to the worker.
|
|
18
|
+
*/
|
|
19
|
+
isolatedMemory?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The mode to run the worker in, which can affect how the worker is initialized and how it behaves. This is determined based on the resolved configuration of the engine, and can be used to optimize the worker for different environments (e.g., development, production, etc.).
|
|
22
|
+
*/
|
|
23
|
+
mode?: Mode;
|
|
24
|
+
/**
|
|
25
|
+
* An optional root to resolve the execution host path from, which can be used to specify a custom root directory for the worker to use when resolving paths and loading configuration files. If this option is not provided, the worker will use the current working directory as the root directory by default.
|
|
26
|
+
*/
|
|
27
|
+
root?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The context of the {@link @powerlines/engine#Engine | Engine instance}, which can be used to access the engine's state and services within the worker.
|
|
30
|
+
*/
|
|
31
|
+
context: EngineContext;
|
|
32
|
+
}
|
|
33
|
+
declare class ExecutionApiWorker implements ExecutionApiWorkerInterface {
|
|
34
|
+
#private;
|
|
35
|
+
protected executionApiPath: string;
|
|
36
|
+
protected options: ExecutionApiWorkerOptions;
|
|
37
|
+
protected get restartPromise(): Promise<typeof RESTARTED>;
|
|
38
|
+
protected resolveRestartPromise(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new instance of the Execution API Worker class, which manages a worker process for executing tasks related to the Powerlines Engine. The worker is initialized with the specified options and can be used to run tasks in an isolated environment, with support for automatic restarts and activity monitoring.
|
|
41
|
+
*
|
|
42
|
+
* @param apiPath - The path to the Execution API file.
|
|
43
|
+
* @param options - The options for configuring the worker, including the execution context, exposed methods, timeout, and mode.
|
|
44
|
+
* @returns A promise that resolves to an instance of the ExecutionApiWorker class.
|
|
45
|
+
*/
|
|
46
|
+
static from(apiPath: string, options: ExecutionApiWorkerOptions): Promise<ExecutionApiWorker>;
|
|
47
|
+
/**
|
|
48
|
+
* Create a new API worker instance.
|
|
49
|
+
*
|
|
50
|
+
* @param executionApiPath - The path to the worker file.
|
|
51
|
+
* @param options - The options for the worker, including exposed commands, timeout, and hooks for activity and restart.
|
|
52
|
+
*/
|
|
53
|
+
protected constructor(executionApiPath: string, options: ExecutionApiWorkerOptions);
|
|
54
|
+
execute(command: string, options: EngineExecutionOptions, inlineConfig: InlineConfig): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Closes the worker process, terminating it if it's still running. This method should be called when the worker is no longer needed, to free up system resources and ensure a clean shutdown. If the worker has already been terminated, this method will have no effect.
|
|
57
|
+
*/
|
|
58
|
+
finalize(): Promise<void>;
|
|
59
|
+
protected onHanging(): void;
|
|
60
|
+
protected onActivity(): void;
|
|
61
|
+
protected innerExecute(command: string, options: EngineExecutionOptions, inlineConfig: InlineConfig): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/engine.d.ts
|
|
65
|
+
/**
|
|
66
|
+
* The Powerlines process' orchestration and coordination API.
|
|
67
|
+
*
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
declare class PowerlinesEngine implements Engine, AsyncDisposable {
|
|
71
|
+
#private;
|
|
72
|
+
/**
|
|
73
|
+
* The Powerlines context
|
|
74
|
+
*/
|
|
75
|
+
get context(): EngineContext;
|
|
76
|
+
/**
|
|
77
|
+
* The execution host, which provides methods to call the execution API functions from the engine context. This allows the engine to invoke commands and other API functions during the execution of Powerlines commands, enabling communication between the engine and the execution contexts.
|
|
78
|
+
*/
|
|
79
|
+
get api(): ExecutionApiWorker;
|
|
80
|
+
/**
|
|
81
|
+
* Create a new Powerlines Engine instance
|
|
82
|
+
*
|
|
83
|
+
* @param context - The Powerlines context
|
|
84
|
+
* @param api - The API host for the execution workers
|
|
85
|
+
* @returns A new instance of the Powerlines Engine
|
|
86
|
+
*/
|
|
87
|
+
constructor(context: EngineContext, api: ExecutionApiWorker);
|
|
88
|
+
/**
|
|
89
|
+
* Create a new Powerlines project
|
|
90
|
+
*
|
|
91
|
+
* @remarks
|
|
92
|
+
* This method will create a new Powerlines project in the current directory.
|
|
93
|
+
*
|
|
94
|
+
* @param inlineConfig - The inline configuration for the create command
|
|
95
|
+
* @returns A promise that resolves when the project has been created
|
|
96
|
+
*/
|
|
97
|
+
create(inlineConfig: CreateInlineConfig): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Generate the Powerlines typescript declaration file
|
|
100
|
+
*
|
|
101
|
+
* @remarks
|
|
102
|
+
* This method will only generate the typescript declaration file for the Powerlines project. It is generally recommended to run the full `prepare` command, which will run this method as part of its process.
|
|
103
|
+
*
|
|
104
|
+
* @param inlineConfig - The inline configuration for the types command
|
|
105
|
+
*/
|
|
106
|
+
types(inlineConfig: TypesInlineConfig): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Prepare the Powerlines API
|
|
109
|
+
*
|
|
110
|
+
* @remarks
|
|
111
|
+
* This method will prepare the Powerlines API for use, initializing any necessary resources.
|
|
112
|
+
*
|
|
113
|
+
* @param inlineConfig - The inline configuration for the prepare command
|
|
114
|
+
*/
|
|
115
|
+
prepare(inlineConfig: PrepareInlineConfig): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Clean any previously prepared artifacts
|
|
118
|
+
*
|
|
119
|
+
* @remarks
|
|
120
|
+
* This method will remove the previous Powerlines artifacts from the project.
|
|
121
|
+
*
|
|
122
|
+
* @param inlineConfig - The inline configuration for the clean command
|
|
123
|
+
* @returns A promise that resolves when the clean command has completed
|
|
124
|
+
*/
|
|
125
|
+
clean(inlineConfig: CleanInlineConfig): Promise<void>;
|
|
126
|
+
/**
|
|
127
|
+
* Lint the project
|
|
128
|
+
*
|
|
129
|
+
* @param inlineConfig - The inline configuration for the lint command
|
|
130
|
+
* @returns A promise that resolves when the lint command has completed
|
|
131
|
+
*/
|
|
132
|
+
lint(inlineConfig: LintInlineConfig): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Test the project
|
|
135
|
+
*
|
|
136
|
+
* @remarks
|
|
137
|
+
* This method will run the tests for the Powerlines project.
|
|
138
|
+
*
|
|
139
|
+
* @param inlineConfig - The inline configuration for the test command
|
|
140
|
+
* @returns A promise that resolves when the test command has completed
|
|
141
|
+
*/
|
|
142
|
+
test(inlineConfig: TestInlineConfig): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* Build the project
|
|
145
|
+
*
|
|
146
|
+
* @remarks
|
|
147
|
+
* This method will build the Powerlines project, generating the necessary artifacts.
|
|
148
|
+
*
|
|
149
|
+
* @param inlineConfig - The inline configuration for the build command
|
|
150
|
+
* @returns A promise that resolves when the build command has completed
|
|
151
|
+
*/
|
|
152
|
+
build(inlineConfig: BuildInlineConfig): Promise<void>;
|
|
153
|
+
/**
|
|
154
|
+
* Prepare the documentation for the project
|
|
155
|
+
*
|
|
156
|
+
* @param inlineConfig - The inline configuration for the docs command
|
|
157
|
+
* @returns A promise that resolves when the documentation generation has completed
|
|
158
|
+
*/
|
|
159
|
+
docs(inlineConfig: DocsInlineConfig): Promise<void>;
|
|
160
|
+
/**
|
|
161
|
+
* Deploy the project source code
|
|
162
|
+
*
|
|
163
|
+
* @remarks
|
|
164
|
+
* This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.
|
|
165
|
+
*
|
|
166
|
+
* @param inlineConfig - The inline configuration for the deploy command
|
|
167
|
+
* @returns A promise that resolves when the deploy command has completed
|
|
168
|
+
*/
|
|
169
|
+
deploy(inlineConfig: DeployInlineConfig): Promise<void>;
|
|
170
|
+
/**
|
|
171
|
+
* Finalization/cleanup processing for the Powerlines API
|
|
172
|
+
*
|
|
173
|
+
* @remarks
|
|
174
|
+
* This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.
|
|
175
|
+
*
|
|
176
|
+
* @returns A promise that resolves when the finalization process has completed
|
|
177
|
+
*/
|
|
178
|
+
finalize(): Promise<void>;
|
|
179
|
+
/**
|
|
180
|
+
* Asynchronous disposal method for the Powerlines Engine, which will call the finalize method to perform any necessary cleanup when the engine is disposed of.
|
|
181
|
+
*/
|
|
182
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
183
|
+
/**
|
|
184
|
+
* Execute a Powerlines command based on the provided execution path and inline configuration, loading the necessary executions from the context and managing their lifecycle.
|
|
185
|
+
*
|
|
186
|
+
* @remarks
|
|
187
|
+
* This method will load the executions for the specified command and inline configuration, then execute each one while managing their lifecycle, including handling their completion and any errors that may occur during execution.
|
|
188
|
+
*
|
|
189
|
+
* @param command - The path to the execution configuration to load and run, which can be used to specify different execution configurations for different commands or scenarios.
|
|
190
|
+
* @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.
|
|
191
|
+
* @returns A promise that resolves when all executions for the specified command have completed
|
|
192
|
+
*/
|
|
193
|
+
protected execute(command: string, inlineConfig: InlineConfig): Promise<void>;
|
|
194
|
+
}
|
|
195
|
+
declare function createContext(options: EngineOptions): Promise<PowerlinesEngineContext<unknown>>;
|
|
196
|
+
declare function createEngine(options: EngineOptions, apiPath?: string): Promise<PowerlinesEngine>;
|
|
197
|
+
//#endregion
|
|
198
|
+
export { createContext as n, createEngine as r, PowerlinesEngine as t };
|
|
199
|
+
//# sourceMappingURL=engine-BLp7JcAB.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-BLp7JcAB.d.mts","names":[],"sources":["../src/_internal/execution-api-worker.ts","../src/engine.ts"],"mappings":";;;;;;;cAuCM,SAAA;AAAA,UA8DW,yBAAA;;AAhEgC;;;;EAgF/C,OAAA;EAhBe;;;EAqBf,cAAA;EALA;;;EAUA,IAAA,GAAO,IAAA;EAKP;;;EAAA,IAAA;EAKsB;AAGxB;;EAHE,OAAA,EAAS,aAAa;AAAA;AAAA,cAGX,kBAAA,YAA8B,2BAAA;EAAA;YAsF7B,gBAAA;EAAA,UACA,OAAA,EAAS,yBAAA;EAAA,cAxEP,cAAA,CAAA,GAAc,OAAA,QAAA,SAAA;EAAA,UASlB,qBAAA,CAAA;EA6WC;;;;;;;EAAA,OA9VS,IAAA,CAClB,OAAA,UACA,OAAA,EAAS,yBAAA,GAAyB,OAAA,CAAA,kBAAA;EAzCgC;;;;;;EAAA,UAqF3D,WAAA,CACG,gBAAA,UACA,OAAA,EAAS,yBAAA;EA4SR,OAAA,CACX,OAAA,UACA,OAAA,EAAS,sBAAA,EACT,YAAA,EAAc,YAAA,GAAY,OAAA;EAvXA;;;EA0Zf,QAAA,CAAA,GAAY,OAAA;EAAA,UAYf,SAAA,CAAA;EAAA,UAoBA,UAAA,CAAA;EAAA,UAUM,YAAA,CACd,OAAA,UACA,OAAA,EAAS,sBAAA,EACT,YAAA,EAAc,YAAA,GAAY,OAAA;AAAA;;;;;AA7jBmB;;;cCSpC,gBAAA,YAA4B,MAAA,EAAQ,eAAA;EAAA;EDuDhC;;;EAAA,ICzCJ,OAAA,CAAA,GAAW,aAAA;EDyDtB;;;EAAA,IClDW,GAAA,CAAA,GAAO,kBAAA;EDiElB;;;;AAKsB;AAGxB;;cC9DqB,OAAA,EAAS,aAAA,EAAe,GAAA,EAAK,kBAAA;EDqJ3B;;;;;;;;;ECvIR,MAAA,CAAO,YAAA,EAAc,kBAAA,GAAkB,OAAA;EDyd3B;;;;;;;;ECvcZ,KAAA,CAAM,YAAA,EAAc,iBAAA,GAAiB,OAAA;EDoHtC;;;;;;;;EClGC,OAAA,CAAQ,YAAA,EAAc,mBAAA,GAAmB,OAAA;EDqD3C;;;;;;;;;EClCE,KAAA,CAAM,YAAA,EAAc,iBAAA,GAAiB,OAAA;ED8XvC;;;;;;EC9WE,IAAA,CAAK,YAAA,EAAc,gBAAA,GAAgB,OAAA;ED8ZtC;;;;;;;;;EC3YG,IAAA,CAAK,YAAA,EAAc,gBAAA,GAAgB,OAAA;ED4apB;;;;ACpjB9B;;;;;EA2Je,KAAA,CAAM,YAAA,EAAc,iBAAA,GAAiB,OAAA;EA3HF;;;;;;EA2InC,IAAA,CAAK,YAAA,EAAc,gBAAA,GAAgB,OAAA;EAtEf;;;;;;;;;EAyFpB,MAAA,CAAO,YAAA,EAAc,kBAAA,GAAkB,OAAA;EAAlB;;;;;;;;EAkBrB,QAAA,CAAA,GAAQ,OAAA;EAhNyC;;;EAAA,CA6NhD,MAAA,CAAO,YAAA,KAAa,OAAA;;;;;;;;;;;YAclB,OAAA,CAAQ,OAAA,UAAiB,YAAA,EAAc,YAAA,GAAY,OAAA;AAAA;AAAA,iBA8B/C,aAAA,CAAc,OAAA,EAAS,aAAA,GAAa,OAAA,CAAA,uBAAA;AAAA,iBAuBpC,YAAA,CACpB,OAAA,EAAS,aAAA,EACT,OAAA,YAAkC,OAAA,CAAA,gBAAA"}
|