@powerlines/engine 0.0.2

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.
Files changed (70) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +303 -0
  3. package/dist/_internal/worker.cjs +4824 -0
  4. package/dist/_internal/worker.d.cts +38 -0
  5. package/dist/_internal/worker.d.cts.map +1 -0
  6. package/dist/_internal/worker.d.mts +38 -0
  7. package/dist/_internal/worker.d.mts.map +1 -0
  8. package/dist/_internal/worker.mjs +4785 -0
  9. package/dist/_internal/worker.mjs.map +1 -0
  10. package/dist/api.cjs +1265 -0
  11. package/dist/api.d.cts +265 -0
  12. package/dist/api.d.cts.map +1 -0
  13. package/dist/api.d.mts +265 -0
  14. package/dist/api.d.mts.map +1 -0
  15. package/dist/api.mjs +1261 -0
  16. package/dist/api.mjs.map +1 -0
  17. package/dist/base-context-BUnL_9z8.mjs +241 -0
  18. package/dist/base-context-BUnL_9z8.mjs.map +1 -0
  19. package/dist/base-context-CFvO2N9I.cjs +248 -0
  20. package/dist/chunk-C0xms8kb.cjs +34 -0
  21. package/dist/context/index.cjs +11 -0
  22. package/dist/context/index.d.cts +658 -0
  23. package/dist/context/index.d.cts.map +1 -0
  24. package/dist/context/index.d.mts +658 -0
  25. package/dist/context/index.d.mts.map +1 -0
  26. package/dist/context/index.mjs +5 -0
  27. package/dist/engine-context-BuD9AGfd.mjs +41 -0
  28. package/dist/engine-context-BuD9AGfd.mjs.map +1 -0
  29. package/dist/engine-context-NO6enYev.cjs +45 -0
  30. package/dist/execution-context-BxANz9k2.cjs +2600 -0
  31. package/dist/execution-context-CNhvjS52.mjs +2556 -0
  32. package/dist/execution-context-CNhvjS52.mjs.map +1 -0
  33. package/dist/fs-D1nIP45P.mjs +226 -0
  34. package/dist/fs-D1nIP45P.mjs.map +1 -0
  35. package/dist/fs-XogSgMqT.cjs +262 -0
  36. package/dist/index.cjs +569 -0
  37. package/dist/index.d.cts +126 -0
  38. package/dist/index.d.cts.map +1 -0
  39. package/dist/index.d.mts +126 -0
  40. package/dist/index.d.mts.map +1 -0
  41. package/dist/index.mjs +568 -0
  42. package/dist/index.mjs.map +1 -0
  43. package/dist/schemas.cjs +9 -0
  44. package/dist/schemas.d.cts +127 -0
  45. package/dist/schemas.d.cts.map +1 -0
  46. package/dist/schemas.d.mts +127 -0
  47. package/dist/schemas.d.mts.map +1 -0
  48. package/dist/schemas.mjs +3 -0
  49. package/dist/storage/index.cjs +9 -0
  50. package/dist/storage/index.d.cts +419 -0
  51. package/dist/storage/index.d.cts.map +1 -0
  52. package/dist/storage/index.d.mts +419 -0
  53. package/dist/storage/index.d.mts.map +1 -0
  54. package/dist/storage/index.mjs +3 -0
  55. package/dist/ts-morph-BaLPVAdB.cjs +114 -0
  56. package/dist/ts-morph-D0CaA37w.mjs +102 -0
  57. package/dist/ts-morph-D0CaA37w.mjs.map +1 -0
  58. package/dist/tsconfig-Cstsoprg.mjs +155 -0
  59. package/dist/tsconfig-Cstsoprg.mjs.map +1 -0
  60. package/dist/tsconfig-DeyWQC2N.cjs +198 -0
  61. package/dist/typescript/index.cjs +13 -0
  62. package/dist/typescript/index.d.cts +106 -0
  63. package/dist/typescript/index.d.cts.map +1 -0
  64. package/dist/typescript/index.d.mts +106 -0
  65. package/dist/typescript/index.d.mts.map +1 -0
  66. package/dist/typescript/index.mjs +4 -0
  67. package/dist/virtual-BNdKVkRw.cjs +548 -0
  68. package/dist/virtual-gIlTc3Lj.mjs +513 -0
  69. package/dist/virtual-gIlTc3Lj.mjs.map +1 -0
  70. package/package.json +183 -0
@@ -0,0 +1,41 @@
1
+ import { t as PowerlinesBaseContext } from "./base-context-BUnL_9z8.mjs";
2
+
3
+ //#region src/context/engine-context.ts
4
+ var PowerlinesEngineContext = class PowerlinesEngineContext extends PowerlinesBaseContext {
5
+ #executions = [];
6
+ /**
7
+ * Creates a new instance of the PowerlinesEngineContext class.
8
+ *
9
+ * @param options - The options to initialize the context with.
10
+ * @returns A promise that resolves to an instance of the PowerlinesEngineContext class.
11
+ */
12
+ static async fromOptions(options) {
13
+ const context = new PowerlinesEngineContext();
14
+ await context.init(options);
15
+ if (!context.configFile?.config) {
16
+ context.fatal("No configuration file found. Please ensure you have a valid configuration file in your project.");
17
+ throw new Error("No configuration file found");
18
+ }
19
+ if (Array.isArray(context.configFile.config)) context.#executions = await Promise.all(context.configFile.config.map(async (_, configIndex) => ({
20
+ ...context.options,
21
+ configIndex
22
+ })));
23
+ else context.#executions = [{
24
+ ...context.options,
25
+ configIndex: 0
26
+ }];
27
+ return context;
28
+ }
29
+ /**
30
+ * A list of all command executions that will be run during the lifecycle of the engine
31
+ *
32
+ * @returns An array of ResolvedExecutionOptions representing each execution context for the engine.
33
+ */
34
+ get executions() {
35
+ return this.#executions;
36
+ }
37
+ };
38
+
39
+ //#endregion
40
+ export { PowerlinesEngineContext as t };
41
+ //# sourceMappingURL=engine-context-BuD9AGfd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine-context-BuD9AGfd.mjs","names":["#executions"],"sources":["../src/context/engine-context.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type {\n EngineContext,\n EngineOptions,\n ResolvedExecutionOptions\n} from \"@powerlines/core\";\nimport { PowerlinesBaseContext } from \"./base-context\";\n\nexport class PowerlinesEngineContext\n extends PowerlinesBaseContext\n implements EngineContext\n{\n #executions: ResolvedExecutionOptions[] = [];\n\n /**\n * Creates a new instance of the PowerlinesEngineContext class.\n *\n * @param options - The options to initialize the context with.\n * @returns A promise that resolves to an instance of the PowerlinesEngineContext class.\n */\n public static async fromOptions(\n options: EngineOptions\n ): Promise<PowerlinesEngineContext> {\n const context = new PowerlinesEngineContext();\n await context.init(options);\n\n if (!context.configFile?.config) {\n context.fatal(\n \"No configuration file found. Please ensure you have a valid configuration file in your project.\"\n );\n throw new Error(\"No configuration file found\");\n }\n\n if (Array.isArray(context.configFile.config)) {\n context.#executions = await Promise.all(\n context.configFile.config.map(async (_, configIndex) => ({\n ...context.options,\n configIndex\n }))\n );\n } else {\n context.#executions = [\n {\n ...context.options,\n configIndex: 0\n }\n ];\n }\n\n return context;\n }\n\n /**\n * A list of all command executions that will be run during the lifecycle of the engine\n *\n * @returns An array of ResolvedExecutionOptions representing each execution context for the engine.\n */\n public get executions(): ResolvedExecutionOptions[] {\n return this.#executions;\n }\n}\n"],"mappings":";;;AAyBA,IAAa,0BAAb,MAAa,gCACH,sBAEV;CACE,cAA0C,EAAE;;;;;;;CAQ5C,aAAoB,YAClB,SACkC;EAClC,MAAM,UAAU,IAAI,yBAAyB;AAC7C,QAAM,QAAQ,KAAK,QAAQ;AAE3B,MAAI,CAAC,QAAQ,YAAY,QAAQ;AAC/B,WAAQ,MACN,kGACD;AACD,SAAM,IAAI,MAAM,8BAA8B;;AAGhD,MAAI,MAAM,QAAQ,QAAQ,WAAW,OAAO,CAC1C,UAAQA,aAAc,MAAM,QAAQ,IAClC,QAAQ,WAAW,OAAO,IAAI,OAAO,GAAG,iBAAiB;GACvD,GAAG,QAAQ;GACX;GACD,EAAE,CACJ;MAED,UAAQA,aAAc,CACpB;GACE,GAAG,QAAQ;GACX,aAAa;GACd,CACF;AAGH,SAAO;;;;;;;CAQT,IAAW,aAAyC;AAClD,SAAO,MAAKA"}
@@ -0,0 +1,45 @@
1
+ const require_base_context = require('./base-context-CFvO2N9I.cjs');
2
+
3
+ //#region src/context/engine-context.ts
4
+ var PowerlinesEngineContext = class PowerlinesEngineContext extends require_base_context.PowerlinesBaseContext {
5
+ #executions = [];
6
+ /**
7
+ * Creates a new instance of the PowerlinesEngineContext class.
8
+ *
9
+ * @param options - The options to initialize the context with.
10
+ * @returns A promise that resolves to an instance of the PowerlinesEngineContext class.
11
+ */
12
+ static async fromOptions(options) {
13
+ const context = new PowerlinesEngineContext();
14
+ await context.init(options);
15
+ if (!context.configFile?.config) {
16
+ context.fatal("No configuration file found. Please ensure you have a valid configuration file in your project.");
17
+ throw new Error("No configuration file found");
18
+ }
19
+ if (Array.isArray(context.configFile.config)) context.#executions = await Promise.all(context.configFile.config.map(async (_, configIndex) => ({
20
+ ...context.options,
21
+ configIndex
22
+ })));
23
+ else context.#executions = [{
24
+ ...context.options,
25
+ configIndex: 0
26
+ }];
27
+ return context;
28
+ }
29
+ /**
30
+ * A list of all command executions that will be run during the lifecycle of the engine
31
+ *
32
+ * @returns An array of ResolvedExecutionOptions representing each execution context for the engine.
33
+ */
34
+ get executions() {
35
+ return this.#executions;
36
+ }
37
+ };
38
+
39
+ //#endregion
40
+ Object.defineProperty(exports, 'PowerlinesEngineContext', {
41
+ enumerable: true,
42
+ get: function () {
43
+ return PowerlinesEngineContext;
44
+ }
45
+ });