@powerlines/engine 0.44.11 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/worker.cjs +141 -106
- package/dist/_internal/worker.d.cts +16 -8
- package/dist/_internal/worker.d.cts.map +1 -1
- package/dist/_internal/worker.d.mts +16 -8
- package/dist/_internal/worker.d.mts.map +1 -1
- package/dist/_internal/worker.mjs +142 -107
- package/dist/_internal/worker.mjs.map +1 -1
- package/dist/api.cjs +60 -46
- package/dist/api.d.cts +18 -13
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +18 -13
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +60 -46
- package/dist/api.mjs.map +1 -1
- package/dist/{base-context-C6yzgs6K.mjs → base-context-BSAC5sO9.mjs} +21 -15
- package/dist/base-context-BSAC5sO9.mjs.map +1 -0
- package/dist/{base-context-trNQZNsX.cjs → base-context-Byizvf4F.cjs} +20 -14
- package/dist/context/index.cjs +3 -3
- package/dist/context/index.d.cts +13 -8
- package/dist/context/index.d.cts.map +1 -1
- package/dist/context/index.d.mts +13 -8
- package/dist/context/index.d.mts.map +1 -1
- package/dist/context/index.mjs +3 -3
- package/dist/{engine-context-D1_U6xVC.cjs → engine-context-CI_0NWIk.cjs} +5 -3
- package/dist/{engine-context-C-11i43N.mjs → engine-context-_RMFwG4J.mjs} +6 -4
- package/dist/engine-context-_RMFwG4J.mjs.map +1 -0
- package/dist/{execution-context-C-M-Mxse.cjs → execution-context-BFCOc0mH.cjs} +61 -48
- package/dist/{execution-context-D9Enw3J5.mjs → execution-context-Cr_VUBrP.mjs} +63 -50
- package/dist/execution-context-Cr_VUBrP.mjs.map +1 -0
- package/dist/index.cjs +30 -20
- package/dist/index.d.cts +9 -8
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +9 -8
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +30 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/base-context-C6yzgs6K.mjs.map +0 -1
- package/dist/engine-context-C-11i43N.mjs.map +0 -1
- package/dist/execution-context-D9Enw3J5.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_chunk = require('./chunk-C0xms8kb.cjs');
|
|
3
|
-
const require_engine_context = require('./engine-context-
|
|
3
|
+
const require_engine_context = require('./engine-context-CI_0NWIk.cjs');
|
|
4
4
|
let _powerlines_core_constants = require("@powerlines/core/constants");
|
|
5
5
|
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
6
6
|
let _stryke_fs_resolve = require("@stryke/fs/resolve");
|
|
@@ -410,10 +410,11 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
410
410
|
* Create a new Powerlines Engine instance
|
|
411
411
|
*
|
|
412
412
|
* @param options - The options to initialize the context with
|
|
413
|
+
* @param initialConfig - The initial configuration for the context, which can be used to provide additional context or override certain configuration values during initialization. This is particularly useful when initializing the context from a CLI command, where the CLI flags can be passed as part of the initial configuration to ensure they are properly merged with the configuration file and made available to plugins during their setup and execution.
|
|
413
414
|
* @returns A new instance of the Powerlines Engine
|
|
414
415
|
*/
|
|
415
|
-
static async
|
|
416
|
-
const api = new PowerlinesEngine(await require_engine_context.PowerlinesEngineContext.
|
|
416
|
+
static async init(options, initialConfig = {}) {
|
|
417
|
+
const api = new PowerlinesEngine(await require_engine_context.PowerlinesEngineContext.init(options, initialConfig));
|
|
417
418
|
const packagePath = await (0, _stryke_fs_resolve.resolvePackage)("@powerlines/engine");
|
|
418
419
|
if (!packagePath) throw new Error("Could not resolve `@powerlines/engine` package location.");
|
|
419
420
|
api.#worker = new Worker((0, _stryke_path_join.joinPaths)(packagePath, "./_internal/worker.mjs"), {
|
|
@@ -431,14 +432,6 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
431
432
|
return this.#context;
|
|
432
433
|
}
|
|
433
434
|
/**
|
|
434
|
-
* Create a new Powerlines Engine instance
|
|
435
|
-
*
|
|
436
|
-
* @param context - The Powerlines context
|
|
437
|
-
*/
|
|
438
|
-
constructor(context) {
|
|
439
|
-
this.#context = context;
|
|
440
|
-
}
|
|
441
|
-
/**
|
|
442
435
|
* Generate the Powerlines typescript declaration file
|
|
443
436
|
*
|
|
444
437
|
* @remarks
|
|
@@ -453,7 +446,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
453
446
|
inlineConfig.command ??= "types";
|
|
454
447
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.types({
|
|
455
448
|
options: execution.options,
|
|
456
|
-
|
|
449
|
+
initialConfig: this.#context.initialConfig,
|
|
450
|
+
inlineConfig
|
|
457
451
|
})));
|
|
458
452
|
this.context.debug("✔ Powerlines types generation has completed successfully");
|
|
459
453
|
timer();
|
|
@@ -473,7 +467,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
473
467
|
inlineConfig.command ??= "prepare";
|
|
474
468
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.prepare({
|
|
475
469
|
options: execution.options,
|
|
476
|
-
|
|
470
|
+
initialConfig: this.#context.initialConfig,
|
|
471
|
+
inlineConfig
|
|
477
472
|
})));
|
|
478
473
|
this.context.debug("✔ Powerlines preparation has completed successfully");
|
|
479
474
|
timer();
|
|
@@ -493,7 +488,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
493
488
|
inlineConfig.command ??= "new";
|
|
494
489
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.new({
|
|
495
490
|
options: execution.options,
|
|
496
|
-
|
|
491
|
+
initialConfig: this.#context.initialConfig,
|
|
492
|
+
inlineConfig
|
|
497
493
|
})));
|
|
498
494
|
this.context.debug("✔ Powerlines new command completed successfully");
|
|
499
495
|
timer();
|
|
@@ -513,7 +509,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
513
509
|
inlineConfig.command ??= "clean";
|
|
514
510
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.clean({
|
|
515
511
|
options: execution.options,
|
|
516
|
-
|
|
512
|
+
initialConfig: this.#context.initialConfig,
|
|
513
|
+
inlineConfig
|
|
517
514
|
})));
|
|
518
515
|
this.context.debug("✔ Powerlines cleaning completed successfully");
|
|
519
516
|
timer();
|
|
@@ -530,7 +527,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
530
527
|
inlineConfig.command ??= "lint";
|
|
531
528
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.lint({
|
|
532
529
|
options: execution.options,
|
|
533
|
-
|
|
530
|
+
initialConfig: this.#context.initialConfig,
|
|
531
|
+
inlineConfig
|
|
534
532
|
})));
|
|
535
533
|
this.context.debug("✔ Powerlines linting completed successfully");
|
|
536
534
|
timer();
|
|
@@ -550,7 +548,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
550
548
|
inlineConfig.command ??= "test";
|
|
551
549
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.test({
|
|
552
550
|
options: execution.options,
|
|
553
|
-
|
|
551
|
+
initialConfig: this.#context.initialConfig,
|
|
552
|
+
inlineConfig
|
|
554
553
|
})));
|
|
555
554
|
this.context.debug("✔ Powerlines testing completed successfully");
|
|
556
555
|
timer();
|
|
@@ -569,7 +568,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
569
568
|
this.context.info("📦 Building the Powerlines project");
|
|
570
569
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.build({
|
|
571
570
|
options: execution.options,
|
|
572
|
-
|
|
571
|
+
initialConfig: this.#context.initialConfig,
|
|
572
|
+
inlineConfig
|
|
573
573
|
})));
|
|
574
574
|
this.context.debug("✔ Powerlines build completed successfully");
|
|
575
575
|
timer();
|
|
@@ -586,7 +586,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
586
586
|
inlineConfig.command ??= "docs";
|
|
587
587
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.docs({
|
|
588
588
|
options: execution.options,
|
|
589
|
-
|
|
589
|
+
initialConfig: this.#context.initialConfig,
|
|
590
|
+
inlineConfig
|
|
590
591
|
})));
|
|
591
592
|
this.context.debug("✔ Powerlines documentation generation completed successfully");
|
|
592
593
|
timer();
|
|
@@ -605,7 +606,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
605
606
|
inlineConfig.command ??= "deploy";
|
|
606
607
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.deploy({
|
|
607
608
|
options: execution.options,
|
|
608
|
-
|
|
609
|
+
initialConfig: this.#context.initialConfig,
|
|
610
|
+
inlineConfig
|
|
609
611
|
})));
|
|
610
612
|
this.context.debug("✔ Powerlines deploy completed successfully");
|
|
611
613
|
timer();
|
|
@@ -632,6 +634,14 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
632
634
|
return this.finalize();
|
|
633
635
|
}
|
|
634
636
|
/**
|
|
637
|
+
* Create a new Powerlines Engine instance
|
|
638
|
+
*
|
|
639
|
+
* @param context - The Powerlines context
|
|
640
|
+
*/
|
|
641
|
+
constructor(context) {
|
|
642
|
+
this.#context = context;
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
635
645
|
* Handle incoming IPC messages from the worker processes, routing them to the appropriate handlers based on the message type.
|
|
636
646
|
*
|
|
637
647
|
* @param message - The IPC message received from a worker process
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, Engine, EngineContext, EngineOptions, LintInlineConfig, NewInlineConfig, PrepareInlineConfig, TestInlineConfig, TypesInlineConfig } from "@powerlines/core";
|
|
1
|
+
import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, Engine, EngineContext, EngineOptions, InitialConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig, TestInlineConfig, TypesInlineConfig } from "@powerlines/core";
|
|
2
2
|
import { PartialKeys } from "@stryke/types/base";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
@@ -16,19 +16,14 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
|
|
|
16
16
|
* Create a new Powerlines Engine instance
|
|
17
17
|
*
|
|
18
18
|
* @param options - The options to initialize the context with
|
|
19
|
+
* @param initialConfig - The initial configuration for the context, which can be used to provide additional context or override certain configuration values during initialization. This is particularly useful when initializing the context from a CLI command, where the CLI flags can be passed as part of the initial configuration to ensure they are properly merged with the configuration file and made available to plugins during their setup and execution.
|
|
19
20
|
* @returns A new instance of the Powerlines Engine
|
|
20
21
|
*/
|
|
21
|
-
static
|
|
22
|
+
static init(options: EngineOptions, initialConfig?: InitialConfig<any>): Promise<PowerlinesEngine>;
|
|
22
23
|
/**
|
|
23
24
|
* The Powerlines context
|
|
24
25
|
*/
|
|
25
26
|
get context(): EngineContext;
|
|
26
|
-
/**
|
|
27
|
-
* Create a new Powerlines Engine instance
|
|
28
|
-
*
|
|
29
|
-
* @param context - The Powerlines context
|
|
30
|
-
*/
|
|
31
|
-
protected constructor(context: EngineContext);
|
|
32
27
|
/**
|
|
33
28
|
* Generate the Powerlines typescript declaration file
|
|
34
29
|
*
|
|
@@ -123,6 +118,12 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
|
|
|
123
118
|
* Asynchronous disposal method for the Powerlines Engine, which will call the finalize method to perform any necessary cleanup when the engine is disposed of.
|
|
124
119
|
*/
|
|
125
120
|
[Symbol.asyncDispose](): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Create a new Powerlines Engine instance
|
|
123
|
+
*
|
|
124
|
+
* @param context - The Powerlines context
|
|
125
|
+
*/
|
|
126
|
+
protected constructor(context: EngineContext);
|
|
126
127
|
/**
|
|
127
128
|
* Handle incoming IPC messages from the worker processes, routing them to the appropriate handlers based on the message type.
|
|
128
129
|
*
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;AAgEA;;;;;;cAAa,gBAAA,YAA4B,MAAA,EAAQ,eAAA;EAAA;EA4DtC;;;;;;;EAAA,OA1CW,IAAA,CAClB,OAAA,EAAS,aAAA,EACT,aAAA,GAAe,aAAA,QACd,OAAA,CAAQ,gBAAA;EAkFO;;;EAAA,IAzDP,OAAA,CAAA,GAAW,aAAA;EA0DhB;;;;;;;;EA9CO,KAAA,CACX,YAAA,GAAc,WAAA,CACZ,IAAA,CAAK,iBAAA,8BAIN,OAAA;EA2CG;;;;;;;;EAPO,OAAA,CACX,YAAA,GACI,WAAA,CAAY,IAAA,CAAK,mBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,iBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,eAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,iBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,iBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,gBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,gBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,kBAAA,8BAEpB,OAAA;EAiC4B;;;;;;;;;EAAlB,GAAA,CAAI,YAAA,EAAc,WAAA,CAAY,eAAA,eAA2B,OAAA;EA6DpD;;;;;;;;;EAjCL,KAAA,CACX,YAAA,GACI,WAAA,CAAY,IAAA,CAAK,iBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,mBAAA,8BAEpB,OAAA;EA+De;;;;;;EArCL,IAAA,CACX,YAAA,GACI,WAAA,CAAY,IAAA,CAAK,gBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,iBAAA,8BAEpB,OAAA;EAgGM;;;;;;;;;EAnEI,IAAA,CACX,YAAA,GACI,WAAA,CAAY,IAAA,CAAK,gBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,iBAAA,8BAEpB,OAAA;EAiJW;;;;;;;;;EApHD,KAAA,CACX,YAAA,GAAc,WAAA,CACZ,IAAA,CAAK,iBAAA,8BAIN,OAAA;EAlQQ;;;;;;EA2RE,IAAA,CACX,YAAA,GAAc,WAAA,CACZ,IAAA,CAAK,gBAAA,8BAIN,OAAA;EAtQmB;;;;;;;;EAqST,MAAA,CACX,YAAA,GAAc,WAAA,CACZ,IAAA,CAAK,kBAAA,8BAIN,OAAA;EAnPe;;;;;;;;EAgRL,QAAA,CAAA,GAAQ,OAAA;EA7QH;;;EAAA,CA0RJ,MAAA,CAAO,YAAA,KAAa,OAAA;EAzRX;;;;;EAAA,UAkSd,WAAA,CAAa,OAAA,EAAS,aAAA;EAhSR;;;;;EAAA,QAyST,gBAAA;EAAA,QAuGA,cAAA;EAAA,QAsBA,kBAAA;EAAA,QAEA,gBAAA;EAAA,QAEA,mBAAA;AAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, Engine, EngineContext, EngineOptions, LintInlineConfig, NewInlineConfig, PrepareInlineConfig, TestInlineConfig, TypesInlineConfig } from "@powerlines/core";
|
|
1
|
+
import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, Engine, EngineContext, EngineOptions, InitialConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig, TestInlineConfig, TypesInlineConfig } from "@powerlines/core";
|
|
2
2
|
import { PartialKeys } from "@stryke/types/base";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
@@ -16,19 +16,14 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
|
|
|
16
16
|
* Create a new Powerlines Engine instance
|
|
17
17
|
*
|
|
18
18
|
* @param options - The options to initialize the context with
|
|
19
|
+
* @param initialConfig - The initial configuration for the context, which can be used to provide additional context or override certain configuration values during initialization. This is particularly useful when initializing the context from a CLI command, where the CLI flags can be passed as part of the initial configuration to ensure they are properly merged with the configuration file and made available to plugins during their setup and execution.
|
|
19
20
|
* @returns A new instance of the Powerlines Engine
|
|
20
21
|
*/
|
|
21
|
-
static
|
|
22
|
+
static init(options: EngineOptions, initialConfig?: InitialConfig<any>): Promise<PowerlinesEngine>;
|
|
22
23
|
/**
|
|
23
24
|
* The Powerlines context
|
|
24
25
|
*/
|
|
25
26
|
get context(): EngineContext;
|
|
26
|
-
/**
|
|
27
|
-
* Create a new Powerlines Engine instance
|
|
28
|
-
*
|
|
29
|
-
* @param context - The Powerlines context
|
|
30
|
-
*/
|
|
31
|
-
protected constructor(context: EngineContext);
|
|
32
27
|
/**
|
|
33
28
|
* Generate the Powerlines typescript declaration file
|
|
34
29
|
*
|
|
@@ -123,6 +118,12 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
|
|
|
123
118
|
* Asynchronous disposal method for the Powerlines Engine, which will call the finalize method to perform any necessary cleanup when the engine is disposed of.
|
|
124
119
|
*/
|
|
125
120
|
[Symbol.asyncDispose](): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Create a new Powerlines Engine instance
|
|
123
|
+
*
|
|
124
|
+
* @param context - The Powerlines context
|
|
125
|
+
*/
|
|
126
|
+
protected constructor(context: EngineContext);
|
|
126
127
|
/**
|
|
127
128
|
* Handle incoming IPC messages from the worker processes, routing them to the appropriate handlers based on the message type.
|
|
128
129
|
*
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;AAgEA;;;;;;cAAa,gBAAA,YAA4B,MAAA,EAAQ,eAAA;EAAA;EA4DtC;;;;;;;EAAA,OA1CW,IAAA,CAClB,OAAA,EAAS,aAAA,EACT,aAAA,GAAe,aAAA,QACd,OAAA,CAAQ,gBAAA;EAkFO;;;EAAA,IAzDP,OAAA,CAAA,GAAW,aAAA;EA0DhB;;;;;;;;EA9CO,KAAA,CACX,YAAA,GAAc,WAAA,CACZ,IAAA,CAAK,iBAAA,8BAIN,OAAA;EA2CG;;;;;;;;EAPO,OAAA,CACX,YAAA,GACI,WAAA,CAAY,IAAA,CAAK,mBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,iBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,eAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,iBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,iBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,gBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,gBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,kBAAA,8BAEpB,OAAA;EAiC4B;;;;;;;;;EAAlB,GAAA,CAAI,YAAA,EAAc,WAAA,CAAY,eAAA,eAA2B,OAAA;EA6DpD;;;;;;;;;EAjCL,KAAA,CACX,YAAA,GACI,WAAA,CAAY,IAAA,CAAK,iBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,mBAAA,8BAEpB,OAAA;EA+De;;;;;;EArCL,IAAA,CACX,YAAA,GACI,WAAA,CAAY,IAAA,CAAK,gBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,iBAAA,8BAEpB,OAAA;EAgGM;;;;;;;;;EAnEI,IAAA,CACX,YAAA,GACI,WAAA,CAAY,IAAA,CAAK,gBAAA,8BACjB,WAAA,CAAY,IAAA,CAAK,iBAAA,8BAEpB,OAAA;EAiJW;;;;;;;;;EApHD,KAAA,CACX,YAAA,GAAc,WAAA,CACZ,IAAA,CAAK,iBAAA,8BAIN,OAAA;EAlQQ;;;;;;EA2RE,IAAA,CACX,YAAA,GAAc,WAAA,CACZ,IAAA,CAAK,gBAAA,8BAIN,OAAA;EAtQmB;;;;;;;;EAqST,MAAA,CACX,YAAA,GAAc,WAAA,CACZ,IAAA,CAAK,kBAAA,8BAIN,OAAA;EAnPe;;;;;;;;EAgRL,QAAA,CAAA,GAAQ,OAAA;EA7QH;;;EAAA,CA0RJ,MAAA,CAAO,YAAA,KAAa,OAAA;EAzRX;;;;;EAAA,UAkSd,WAAA,CAAa,OAAA,EAAS,aAAA;EAhSR;;;;;EAAA,QAyST,gBAAA;EAAA,QAuGA,cAAA;EAAA,QAsBA,kBAAA;EAAA,QAEA,gBAAA;EAAA,QAEA,mBAAA;AAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PowerlinesEngineContext } from "./engine-context-
|
|
1
|
+
import { t as PowerlinesEngineContext } from "./engine-context-_RMFwG4J.mjs";
|
|
2
2
|
import { POWERLINES_API_FUNCTIONS } from "@powerlines/core/constants";
|
|
3
3
|
import { toArray } from "@stryke/convert/to-array";
|
|
4
4
|
import { resolvePackage } from "@stryke/fs/resolve";
|
|
@@ -408,10 +408,11 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
408
408
|
* Create a new Powerlines Engine instance
|
|
409
409
|
*
|
|
410
410
|
* @param options - The options to initialize the context with
|
|
411
|
+
* @param initialConfig - The initial configuration for the context, which can be used to provide additional context or override certain configuration values during initialization. This is particularly useful when initializing the context from a CLI command, where the CLI flags can be passed as part of the initial configuration to ensure they are properly merged with the configuration file and made available to plugins during their setup and execution.
|
|
411
412
|
* @returns A new instance of the Powerlines Engine
|
|
412
413
|
*/
|
|
413
|
-
static async
|
|
414
|
-
const api = new PowerlinesEngine(await PowerlinesEngineContext.
|
|
414
|
+
static async init(options, initialConfig = {}) {
|
|
415
|
+
const api = new PowerlinesEngine(await PowerlinesEngineContext.init(options, initialConfig));
|
|
415
416
|
const packagePath = await resolvePackage("@powerlines/engine");
|
|
416
417
|
if (!packagePath) throw new Error("Could not resolve `@powerlines/engine` package location.");
|
|
417
418
|
api.#worker = new Worker$1(joinPaths(packagePath, "./_internal/worker.mjs"), {
|
|
@@ -429,14 +430,6 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
429
430
|
return this.#context;
|
|
430
431
|
}
|
|
431
432
|
/**
|
|
432
|
-
* Create a new Powerlines Engine instance
|
|
433
|
-
*
|
|
434
|
-
* @param context - The Powerlines context
|
|
435
|
-
*/
|
|
436
|
-
constructor(context) {
|
|
437
|
-
this.#context = context;
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
433
|
* Generate the Powerlines typescript declaration file
|
|
441
434
|
*
|
|
442
435
|
* @remarks
|
|
@@ -451,7 +444,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
451
444
|
inlineConfig.command ??= "types";
|
|
452
445
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.types({
|
|
453
446
|
options: execution.options,
|
|
454
|
-
|
|
447
|
+
initialConfig: this.#context.initialConfig,
|
|
448
|
+
inlineConfig
|
|
455
449
|
})));
|
|
456
450
|
this.context.debug("✔ Powerlines types generation has completed successfully");
|
|
457
451
|
timer();
|
|
@@ -471,7 +465,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
471
465
|
inlineConfig.command ??= "prepare";
|
|
472
466
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.prepare({
|
|
473
467
|
options: execution.options,
|
|
474
|
-
|
|
468
|
+
initialConfig: this.#context.initialConfig,
|
|
469
|
+
inlineConfig
|
|
475
470
|
})));
|
|
476
471
|
this.context.debug("✔ Powerlines preparation has completed successfully");
|
|
477
472
|
timer();
|
|
@@ -491,7 +486,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
491
486
|
inlineConfig.command ??= "new";
|
|
492
487
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.new({
|
|
493
488
|
options: execution.options,
|
|
494
|
-
|
|
489
|
+
initialConfig: this.#context.initialConfig,
|
|
490
|
+
inlineConfig
|
|
495
491
|
})));
|
|
496
492
|
this.context.debug("✔ Powerlines new command completed successfully");
|
|
497
493
|
timer();
|
|
@@ -511,7 +507,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
511
507
|
inlineConfig.command ??= "clean";
|
|
512
508
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.clean({
|
|
513
509
|
options: execution.options,
|
|
514
|
-
|
|
510
|
+
initialConfig: this.#context.initialConfig,
|
|
511
|
+
inlineConfig
|
|
515
512
|
})));
|
|
516
513
|
this.context.debug("✔ Powerlines cleaning completed successfully");
|
|
517
514
|
timer();
|
|
@@ -528,7 +525,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
528
525
|
inlineConfig.command ??= "lint";
|
|
529
526
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.lint({
|
|
530
527
|
options: execution.options,
|
|
531
|
-
|
|
528
|
+
initialConfig: this.#context.initialConfig,
|
|
529
|
+
inlineConfig
|
|
532
530
|
})));
|
|
533
531
|
this.context.debug("✔ Powerlines linting completed successfully");
|
|
534
532
|
timer();
|
|
@@ -548,7 +546,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
548
546
|
inlineConfig.command ??= "test";
|
|
549
547
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.test({
|
|
550
548
|
options: execution.options,
|
|
551
|
-
|
|
549
|
+
initialConfig: this.#context.initialConfig,
|
|
550
|
+
inlineConfig
|
|
552
551
|
})));
|
|
553
552
|
this.context.debug("✔ Powerlines testing completed successfully");
|
|
554
553
|
timer();
|
|
@@ -567,7 +566,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
567
566
|
this.context.info("📦 Building the Powerlines project");
|
|
568
567
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.build({
|
|
569
568
|
options: execution.options,
|
|
570
|
-
|
|
569
|
+
initialConfig: this.#context.initialConfig,
|
|
570
|
+
inlineConfig
|
|
571
571
|
})));
|
|
572
572
|
this.context.debug("✔ Powerlines build completed successfully");
|
|
573
573
|
timer();
|
|
@@ -584,7 +584,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
584
584
|
inlineConfig.command ??= "docs";
|
|
585
585
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.docs({
|
|
586
586
|
options: execution.options,
|
|
587
|
-
|
|
587
|
+
initialConfig: this.#context.initialConfig,
|
|
588
|
+
inlineConfig
|
|
588
589
|
})));
|
|
589
590
|
this.context.debug("✔ Powerlines documentation generation completed successfully");
|
|
590
591
|
timer();
|
|
@@ -603,7 +604,8 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
603
604
|
inlineConfig.command ??= "deploy";
|
|
604
605
|
await Promise.all(this.#context.executions.map(async (execution) => this.#worker.deploy({
|
|
605
606
|
options: execution.options,
|
|
606
|
-
|
|
607
|
+
initialConfig: this.#context.initialConfig,
|
|
608
|
+
inlineConfig
|
|
607
609
|
})));
|
|
608
610
|
this.context.debug("✔ Powerlines deploy completed successfully");
|
|
609
611
|
timer();
|
|
@@ -630,6 +632,14 @@ var PowerlinesEngine = class PowerlinesEngine {
|
|
|
630
632
|
return this.finalize();
|
|
631
633
|
}
|
|
632
634
|
/**
|
|
635
|
+
* Create a new Powerlines Engine instance
|
|
636
|
+
*
|
|
637
|
+
* @param context - The Powerlines context
|
|
638
|
+
*/
|
|
639
|
+
constructor(context) {
|
|
640
|
+
this.#context = context;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
633
643
|
* Handle incoming IPC messages from the worker processes, routing them to the appropriate handlers based on the message type.
|
|
634
644
|
*
|
|
635
645
|
* @param message - The IPC message received from a worker process
|