@powerlines/engine 0.45.3 → 0.46.1

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 (52) hide show
  1. package/dist/_internal/worker.cjs +886 -803
  2. package/dist/_internal/worker.mjs +889 -806
  3. package/dist/_internal/worker.mjs.map +1 -1
  4. package/dist/api.cjs +292 -323
  5. package/dist/api.d.cts +44 -11
  6. package/dist/api.d.cts.map +1 -1
  7. package/dist/api.d.mts +44 -11
  8. package/dist/api.d.mts.map +1 -1
  9. package/dist/api.mjs +292 -323
  10. package/dist/api.mjs.map +1 -1
  11. package/dist/{base-context-Byizvf4F.cjs → base-context-D7G_24-i.cjs} +82 -76
  12. package/dist/{base-context-BSAC5sO9.mjs → base-context-DU0NRHDt.mjs} +85 -79
  13. package/dist/base-context-DU0NRHDt.mjs.map +1 -0
  14. package/dist/context/index.cjs +3 -3
  15. package/dist/context/index.d.cts +44 -617
  16. package/dist/context/index.d.cts.map +1 -1
  17. package/dist/context/index.d.mts +44 -617
  18. package/dist/context/index.d.mts.map +1 -1
  19. package/dist/context/index.mjs +3 -3
  20. package/dist/engine-context-BuJQY312.cjs +91 -0
  21. package/dist/engine-context-BvDfqfY7.mjs +86 -0
  22. package/dist/engine-context-BvDfqfY7.mjs.map +1 -0
  23. package/dist/execution-context-BpRfsnkE.d.mts +644 -0
  24. package/dist/execution-context-BpRfsnkE.d.mts.map +1 -0
  25. package/dist/{execution-context-BYGFYty0.cjs → execution-context-BrX9i_L8.cjs} +449 -364
  26. package/dist/{execution-context-Bkxp1fML.mjs → execution-context-CgDuoi8o.mjs} +451 -366
  27. package/dist/execution-context-CgDuoi8o.mjs.map +1 -0
  28. package/dist/execution-context-CodQucFX.d.cts +644 -0
  29. package/dist/execution-context-CodQucFX.d.cts.map +1 -0
  30. package/dist/index.cjs +15 -16
  31. package/dist/index.d.cts +3 -3
  32. package/dist/index.d.cts.map +1 -1
  33. package/dist/index.d.mts +3 -3
  34. package/dist/index.d.mts.map +1 -1
  35. package/dist/index.mjs +15 -16
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/{tsconfig-QMSxSwBD.cjs → tsconfig-BUDqmOaT.cjs} +13 -13
  38. package/dist/{tsconfig-CI6bla4E.mjs → tsconfig-MeFEs21S.mjs} +14 -14
  39. package/dist/tsconfig-MeFEs21S.mjs.map +1 -0
  40. package/dist/typescript/index.cjs +1 -1
  41. package/dist/typescript/index.d.cts +6 -6
  42. package/dist/typescript/index.d.cts.map +1 -1
  43. package/dist/typescript/index.d.mts +6 -6
  44. package/dist/typescript/index.d.mts.map +1 -1
  45. package/dist/typescript/index.mjs +1 -1
  46. package/package.json +17 -17
  47. package/dist/base-context-BSAC5sO9.mjs.map +0 -1
  48. package/dist/engine-context-CI_0NWIk.cjs +0 -73
  49. package/dist/engine-context-_RMFwG4J.mjs +0 -68
  50. package/dist/engine-context-_RMFwG4J.mjs.map +0 -1
  51. package/dist/execution-context-Bkxp1fML.mjs.map +0 -1
  52. package/dist/tsconfig-CI6bla4E.mjs.map +0 -1
@@ -9,40 +9,40 @@ import ts from "typescript";
9
9
  /**
10
10
  * Get the path to the tsconfig.json file.
11
11
  *
12
- * @param workspaceRoot - The root directory of the workspace.
13
- * @param projectRoot - The root directory of the project.
12
+ * @param cwd - The root directory of the workspace.
13
+ * @param root - The root directory of the project.
14
14
  * @param tsconfig - The path to the tsconfig.json file.
15
15
  * @returns The absolute path to the tsconfig.json file.
16
16
  * @throws If the tsconfig.json file does not exist.
17
17
  */
18
- function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
18
+ function getTsconfigFilePath(cwd, root, tsconfig) {
19
19
  let tsconfigFilePath;
20
- if (tsconfig) tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig);
20
+ if (tsconfig) tsconfigFilePath = tryTsconfigFilePath(cwd, root, tsconfig);
21
21
  else {
22
- tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.app.json");
22
+ tsconfigFilePath = tryTsconfigFilePath(cwd, root, "tsconfig.app.json");
23
23
  if (!tsconfigFilePath) {
24
- tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.lib.json");
25
- if (!tsconfigFilePath) tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.json");
24
+ tsconfigFilePath = tryTsconfigFilePath(cwd, root, "tsconfig.lib.json");
25
+ if (!tsconfigFilePath) tsconfigFilePath = tryTsconfigFilePath(cwd, root, "tsconfig.json");
26
26
  }
27
27
  }
28
- if (!tsconfigFilePath) throw new Error(`Cannot find the \`tsconfig.json\` configuration file for the project at ${projectRoot}.`);
28
+ if (!tsconfigFilePath) throw new Error(`Cannot find the \`tsconfig.json\` configuration file for the project at ${root}.`);
29
29
  return tsconfigFilePath;
30
30
  }
31
31
  /**
32
32
  * Get the path to the tsconfig.json file.
33
33
  *
34
- * @param workspaceRoot - The root directory of the workspace.
35
- * @param projectRoot - The root directory of the project.
34
+ * @param cwd - The root directory of the workspace.
35
+ * @param root - The root directory of the project.
36
36
  * @param tsconfig - The path to the tsconfig.json file.
37
37
  * @returns The absolute path to the tsconfig.json file.
38
38
  * @throws If the tsconfig.json file does not exist.
39
39
  */
40
- function tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
40
+ function tryTsconfigFilePath(cwd, root, tsconfig) {
41
41
  let tsconfigFilePath = tsconfig;
42
42
  if (!existsSync(tsconfigFilePath)) {
43
- tsconfigFilePath = appendPath(tsconfig, projectRoot);
43
+ tsconfigFilePath = appendPath(tsconfig, root);
44
44
  if (!existsSync(tsconfigFilePath)) {
45
- tsconfigFilePath = appendPath(tsconfig, appendPath(projectRoot, workspaceRoot));
45
+ tsconfigFilePath = appendPath(tsconfig, appendPath(root, cwd));
46
46
  if (!existsSync(tsconfigFilePath)) return;
47
47
  }
48
48
  }
@@ -152,4 +152,4 @@ ${parsedCommandLine.errors.map((error) => `- ${(error.category !== void 0 && err
152
152
 
153
153
  //#endregion
154
154
  export { isIncludeMatchFound as a, getTsconfigFilePath as i, findMatch as n, isMatchFound as o, getParsedTypeScriptConfig as r, tryTsconfigFilePath as s, findIncludeMatch as t };
155
- //# sourceMappingURL=tsconfig-CI6bla4E.mjs.map
155
+ //# sourceMappingURL=tsconfig-MeFEs21S.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tsconfig-MeFEs21S.mjs","names":[],"sources":["../src/typescript/tsconfig.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 { ParsedTypeScriptConfig, TSConfig } from \"@powerlines/core\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { readJsonFileSync } from \"@stryke/fs/json\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { FilterPattern } from \"@stryke/types/file\";\nimport { TsConfigJson } from \"@stryke/types/tsconfig\";\nimport defu from \"defu\";\nimport ts from \"typescript\";\n\n/**\n * Get the path to the tsconfig.json file.\n *\n * @param cwd - The root directory of the workspace.\n * @param root - The root directory of the project.\n * @param tsconfig - The path to the tsconfig.json file.\n * @returns The absolute path to the tsconfig.json file.\n * @throws If the tsconfig.json file does not exist.\n */\nexport function getTsconfigFilePath(\n cwd: string,\n root: string,\n tsconfig?: string\n): string {\n let tsconfigFilePath: string | undefined;\n if (tsconfig) {\n tsconfigFilePath = tryTsconfigFilePath(cwd, root, tsconfig);\n } else {\n tsconfigFilePath = tryTsconfigFilePath(cwd, root, \"tsconfig.app.json\");\n if (!tsconfigFilePath) {\n tsconfigFilePath = tryTsconfigFilePath(cwd, root, \"tsconfig.lib.json\");\n if (!tsconfigFilePath) {\n tsconfigFilePath = tryTsconfigFilePath(cwd, root, \"tsconfig.json\");\n }\n }\n }\n\n if (!tsconfigFilePath) {\n throw new Error(\n `Cannot find the \\`tsconfig.json\\` configuration file for the project at ${\n root\n }.`\n );\n }\n\n return tsconfigFilePath;\n}\n\n/**\n * Get the path to the tsconfig.json file.\n *\n * @param cwd - The root directory of the workspace.\n * @param root - The root directory of the project.\n * @param tsconfig - The path to the tsconfig.json file.\n * @returns The absolute path to the tsconfig.json file.\n * @throws If the tsconfig.json file does not exist.\n */\nexport function tryTsconfigFilePath(\n cwd: string,\n root: string,\n tsconfig: string\n): string | undefined {\n let tsconfigFilePath = tsconfig;\n if (!existsSync(tsconfigFilePath)) {\n tsconfigFilePath = appendPath(tsconfig, root);\n if (!existsSync(tsconfigFilePath)) {\n tsconfigFilePath = appendPath(tsconfig, appendPath(root, cwd));\n if (!existsSync(tsconfigFilePath)) {\n return undefined;\n }\n }\n }\n\n return tsconfigFilePath;\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function findMatch(\n tsconfigType: string | RegExp | null,\n types: (string | RegExp | null)[],\n extensions: string[] = [\".ts\", \".tsx\", \".d.ts\"]\n): string | RegExp | null | undefined {\n return types.find(\n type =>\n tsconfigType?.toString().toLowerCase() ===\n type?.toString().toLowerCase() ||\n tsconfigType?.toString().toLowerCase() ===\n `./${type?.toString().toLowerCase()}` ||\n `./${tsconfigType?.toString().toLowerCase()}` ===\n type?.toString().toLowerCase() ||\n extensions.some(\n ext =>\n `${tsconfigType?.toString().toLowerCase()}${ext}` ===\n type?.toString().toLowerCase() ||\n `${tsconfigType?.toString().toLowerCase()}${ext}` ===\n `./${type?.toString().toLowerCase()}` ||\n `${type?.toString().toLowerCase()}${ext}` ===\n `./${tsconfigType?.toString().toLowerCase()}` ||\n tsconfigType?.toString().toLowerCase() ===\n `${type?.toString().toLowerCase()}${ext}` ||\n tsconfigType?.toString().toLowerCase() ===\n `./${type?.toString().toLowerCase()}${ext}` ||\n type?.toString().toLowerCase() ===\n `./${tsconfigType?.toString().toLowerCase()}${ext}`\n )\n );\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function findIncludeMatch(\n tsconfigType: string | RegExp | null,\n types: (string | RegExp | null)[]\n): string | RegExp | null | undefined {\n return findMatch(tsconfigType, types, [\n \".ts\",\n \".tsx\",\n \".d.ts\",\n \".js\",\n \".jsx\",\n \".mjs\",\n \".cjs\",\n \".mts\",\n \".cts\",\n \"/*.ts\",\n \"/*.tsx\",\n \"/*.d.ts\",\n \"/*.js\",\n \"/*.jsx\",\n \"/*.mjs\",\n \"/*.cjs\",\n \"/*.mts\",\n \"/*.cts\",\n \"/**/*.ts\",\n \"/**/*.tsx\",\n \"/**/*.d.ts\",\n \"/**/*.js\",\n \"/**/*.jsx\",\n \"/**/*.mjs\",\n \"/**/*.cjs\",\n \"/**/*.mts\",\n \"/**/*.cts\"\n ]);\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function isMatchFound(\n tsconfigType: string | RegExp | null,\n types: (string | RegExp | null)[]\n): boolean {\n return findMatch(tsconfigType, types) !== undefined;\n}\n\n/**\n * Check if the TypeScript configuration type matches any of the provided types.\n *\n * @param tsconfigType - The type from the TypeScript configuration.\n * @param types - An array of type names to check against.\n * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.\n */\nexport function isIncludeMatchFound(\n tsconfigType: FilterPattern,\n types: FilterPattern[]\n): boolean {\n return (\n findIncludeMatch(\n tsconfigType as string | RegExp | null,\n types as (string | RegExp | null)[]\n ) !== undefined\n );\n}\n\n/**\n * Get the parsed TypeScript configuration.\n *\n * @param workspaceRoot - The root directory of the workspace.\n * @param projectRoot - The root directory of the project.\n * @param tsconfig - The path to the tsconfig.json file.\n * @param tsconfigRaw - The raw tsconfig.json content.\n * @param originalTsconfigJson - The original tsconfig.json content.\n * @param host - The TypeScript parse config host.\n * @returns The resolved TypeScript configuration.\n */\nexport function getParsedTypeScriptConfig(\n workspaceRoot: string,\n projectRoot: string,\n tsconfig?: string,\n tsconfigRaw: TSConfig = {},\n originalTsconfigJson?: TSConfig,\n host: ts.ParseConfigHost = ts.sys\n): ParsedTypeScriptConfig {\n const tsconfigFilePath = getTsconfigFilePath(\n workspaceRoot,\n projectRoot,\n tsconfig\n );\n const tsconfigJson = readJsonFileSync<TSConfig>(tsconfigFilePath);\n if (!tsconfigJson) {\n throw new Error(\n `Cannot find the \\`tsconfig.json\\` configuration file at ${joinPaths(\n projectRoot,\n tsconfig ?? \"tsconfig.json\"\n )}`\n );\n }\n\n const parsedCommandLine = ts.parseJsonConfigFileContent(\n defu(tsconfigRaw ?? {}, tsconfigJson),\n host,\n appendPath(projectRoot, workspaceRoot)\n );\n if (parsedCommandLine.errors.length > 0) {\n const errorMessage = `Cannot parse the TypeScript compiler options. Please investigate the following issues:\n${parsedCommandLine.errors\n .map(\n error =>\n `- ${\n (error.category !== undefined && error.code\n ? `[${error.category}-${error.code}]: `\n : \"\") + error.messageText.toString()\n }`\n )\n .join(\"\\n\")}\n `;\n\n throw new Error(errorMessage);\n }\n\n return {\n ...parsedCommandLine,\n originalTsconfigJson: (originalTsconfigJson ??\n tsconfigJson) as TsConfigJson,\n tsconfigJson,\n tsconfigFilePath\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAqCA,SAAgB,oBACd,KACA,MACA,UACQ;CACR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a,KACpC,KAAK,MAAM,UAAU,CAAC,aAAa,GAAG,SACxC,MAAM,UAAU,CAAC,aAAa,KAC5B,KAAK,cAAc,UAAU,CAAC,aAAa,GAAG,MACnD,CACJ;;;;;;;;;AAUH,SAAgB,iBACd,cACA,OACoC;AACpC,QAAO,UAAU,cAAc,OAAO;EACpC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;;;;;;;;;AAUJ,SAAgB,aACd,cACA,OACS;AACT,QAAO,UAAU,cAAc,MAAM,KAAK;;;;;;;;;AAU5C,SAAgB,oBACd,cACA,OACS;AACT,QACE,iBACE,cACA,MACD,KAAK;;;;;;;;;;;;;AAeV,SAAgB,0BACd,eACA,aACA,UACA,cAAwB,EAAE,EAC1B,sBACA,OAA2B,GAAG,KACN;CACxB,MAAM,mBAAmB,oBACvB,eACA,aACA,SACD;CACD,MAAM,eAAe,iBAA2B,iBAAiB;AACjE,KAAI,CAAC,aACH,OAAM,IAAI,MACR,2DAA2D,UACzD,aACA,YAAY,gBACb,GACF;CAGH,MAAM,oBAAoB,GAAG,2BAC3B,KAAK,eAAe,EAAE,EAAE,aAAa,EACrC,MACA,WAAW,aAAa,cAAc,CACvC;AACD,KAAI,kBAAkB,OAAO,SAAS,GAAG;EACvC,MAAM,eAAe;EACvB,kBAAkB,OACjB,KACC,UACE,MACG,MAAM,aAAa,UAAa,MAAM,OACnC,IAAI,MAAM,SAAS,GAAG,MAAM,KAAK,OACjC,MAAM,MAAM,YAAY,UAAU,GAE3C,CACA,KAAK,KAAK,CAAC;;AAGV,QAAM,IAAI,MAAM,aAAa;;AAG/B,QAAO;EACL,GAAG;EACH,sBAAuB,wBACrB;EACF;EACA;EACD"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_tsconfig = require('../tsconfig-QMSxSwBD.cjs');
2
+ const require_tsconfig = require('../tsconfig-BUDqmOaT.cjs');
3
3
  const require_ts_morph = require('../ts-morph-BaLPVAdB.cjs');
4
4
 
5
5
  exports.VirtualFileSystemHost = require_ts_morph.VirtualFileSystemHost;
@@ -40,23 +40,23 @@ declare function createProgram(context: Context, override: Partial<ProjectOption
40
40
  /**
41
41
  * Get the path to the tsconfig.json file.
42
42
  *
43
- * @param workspaceRoot - The root directory of the workspace.
44
- * @param projectRoot - The root directory of the project.
43
+ * @param cwd - The root directory of the workspace.
44
+ * @param root - The root directory of the project.
45
45
  * @param tsconfig - The path to the tsconfig.json file.
46
46
  * @returns The absolute path to the tsconfig.json file.
47
47
  * @throws If the tsconfig.json file does not exist.
48
48
  */
49
- declare function getTsconfigFilePath(workspaceRoot: string, projectRoot: string, tsconfig?: string): string;
49
+ declare function getTsconfigFilePath(cwd: string, root: string, tsconfig?: string): string;
50
50
  /**
51
51
  * Get the path to the tsconfig.json file.
52
52
  *
53
- * @param workspaceRoot - The root directory of the workspace.
54
- * @param projectRoot - The root directory of the project.
53
+ * @param cwd - The root directory of the workspace.
54
+ * @param root - The root directory of the project.
55
55
  * @param tsconfig - The path to the tsconfig.json file.
56
56
  * @returns The absolute path to the tsconfig.json file.
57
57
  * @throws If the tsconfig.json file does not exist.
58
58
  */
59
- declare function tryTsconfigFilePath(workspaceRoot: string, projectRoot: string, tsconfig: string): string | undefined;
59
+ declare function tryTsconfigFilePath(cwd: string, root: string, tsconfig: string): string | undefined;
60
60
  /**
61
61
  * Check if the TypeScript configuration type matches any of the provided types.
62
62
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/typescript/ts-morph.ts","../../src/typescript/tsconfig.ts"],"mappings":";;;;;;cA6Ba,qBAAA,SACH,sBAAA,YACG,cAAA;EAAA;cAIQ,OAAA,EAAS,OAAA;EAMZ,UAAA,CAAW,IAAA;EAIX,WAAA,CAAY,OAAA,WAAkB,eAAA;EAoBxB,Q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;iBAuBc,SAAA,CACd,YAAA,WAAuB,MAAA,SACvB,KAAA,YAAiB,MAAA,YACjB,UAAA,uBACU,MAAA;;;;;;;;iBAkCI,gBAAA,CACd,YAAA,WAAuB,MAAA,SACvB,KAAA,YAAiB,MAAA,sBACP,MAAA;;;;;;;;iBAuCI,YAAA,CACd,YAAA,WAAuB,MAAA,SACvB,KAAA,YAAiB,MAAA;;;;;;;;iBAYH,mBAAA,CACd,YAAA,EAAc,aAAA,EACd,KAAA,EAAO,aAAA;;;;;;;;;;;;iBAqBO,yBAAA,CACd,aAAA,UACA,WAAA,UACA,QAAA,WACA,WAAA,GAAa,QAAA,EACb,oBAAA,GAAuB,QAAA,EACvB,IAAA,GAAM,EAAA,CAAG,eAAA,GACR,sBAAA"}
@@ -40,23 +40,23 @@ declare function createProgram(context: Context, override: Partial<ProjectOption
40
40
  /**
41
41
  * Get the path to the tsconfig.json file.
42
42
  *
43
- * @param workspaceRoot - The root directory of the workspace.
44
- * @param projectRoot - The root directory of the project.
43
+ * @param cwd - The root directory of the workspace.
44
+ * @param root - The root directory of the project.
45
45
  * @param tsconfig - The path to the tsconfig.json file.
46
46
  * @returns The absolute path to the tsconfig.json file.
47
47
  * @throws If the tsconfig.json file does not exist.
48
48
  */
49
- declare function getTsconfigFilePath(workspaceRoot: string, projectRoot: string, tsconfig?: string): string;
49
+ declare function getTsconfigFilePath(cwd: string, root: string, tsconfig?: string): string;
50
50
  /**
51
51
  * Get the path to the tsconfig.json file.
52
52
  *
53
- * @param workspaceRoot - The root directory of the workspace.
54
- * @param projectRoot - The root directory of the project.
53
+ * @param cwd - The root directory of the workspace.
54
+ * @param root - The root directory of the project.
55
55
  * @param tsconfig - The path to the tsconfig.json file.
56
56
  * @returns The absolute path to the tsconfig.json file.
57
57
  * @throws If the tsconfig.json file does not exist.
58
58
  */
59
- declare function tryTsconfigFilePath(workspaceRoot: string, projectRoot: string, tsconfig: string): string | undefined;
59
+ declare function tryTsconfigFilePath(cwd: string, root: string, tsconfig: string): string | undefined;
60
60
  /**
61
61
  * Check if the TypeScript configuration type matches any of the provided types.
62
62
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/typescript/ts-morph.ts","../../src/typescript/tsconfig.ts"],"mappings":";;;;;;cA6Ba,qBAAA,SACH,sBAAA,YACG,cAAA;EAAA;cAIQ,OAAA,EAAS,OAAA;EAMZ,UAAA,CAAW,IAAA;EAIX,WAAA,CAAY,OAAA,WAAkB,eAAA;EAoBxB,QAAA,CAAS,QAAA,WAAgB,OAAA;EAQ/B,YAAA,CAAa,QAAA;EAQP,SAAA,CAAU,QAAA,UAAkB,QAAA,WAAgB,OAAA;EAIlD,aAAA,CAAc,QAAA,UAAkB,QAAA;EAI1B,KAAA,CAAM,OAAA,WAAe,OAAA;EAI3B,SAAA,CAAU,OAAA;EAIJ,IAAA,CAAK,OAAA,UAAiB,QAAA,WAAgB,OAAA;EAI5C,QAAA,CAAS,OAAA,UAAiB,QAAA;EAIpB,IAAA,CAAK,OAAA,UAAiB,QAAA,WAAgB,OAAA;EAI5C,QAAA,CAAS,OAAA,UAAiB,QAAA;EAIpB,UAAA,CAAW,QAAA,WAAgB,OAAA;EAIjC,cAAA,CAAe,QAAA;EAIT,eAAA,CAAgB,OAAA,WAAe,OAAA;EAIrC,mBAAA,CAAoB,OAAA;EAIpB,YAAA,CAAa,IAAA;EAIb,mBAAA,CAAA;EAIM,IAAA,CACpB,QAAA,EAAU,aAAA,WACT,OAAA;EAIa,QAAA,CAAS,QAAA,EAAU,aAAA;AAAA;;;;;;;iBAWrB,aAAA,CACd,OAAA,EAAS,OAAA,EACT,QAAA,EAAU,OAAA,CAAQ,cAAA,IACjB,OAAA;;;;;;AAhIH;;;;;;iBCQgB,mBAAA,CACd,aAAA,UACA,WAAA,UACA,QAAA;;;;;;;;;;iBAmDc,mBAAA,CACd,aAAA,UACA,WAAA,UACA,QAAA;;;;;;;;iBA0Bc,SAAA,CACd,YAAA,WAAuB,MAAA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EAIM,IAAA,CACpB,QAAA,EAAU,aAAA,WACT,OAAA;EAIa,QAAA,CAAS,QAAA,EAAU,aAAA;AAAA;;;;;;;iBAWrB,aAAA,CACd,OAAA,EAAS,OAAA,EACT,QAAA,EAAU,OAAA,CAAQ,cAAA,IACjB,OAAA;;;;;;AAhIH;;;;;;iBCQgB,mBAAA,CACd,GAAA,UACA,IAAA,UACA,QAAA;;;;;;;;;;iBAmCc,mBAAA,CACd,GAAA,UACA,IAAA,UACA,QAAA;;;;;;;;iBAuBc,SAAA,CACd,YAAA,WAAuB,MAAA,SACvB,KAAA,YAAiB,MAAA,YACjB,UAAA,uBACU,MAAA;;;;;;;;iBAkCI,gBAAA,CACd,YAAA,WAAuB,MAAA,SACvB,KAAA,YAAiB,MAAA,sBACP,MAAA;;;;;;;;iBAuCI,YAAA,CACd,YAAA,WAAuB,MAAA,SACvB,KAAA,YAAiB,MAAA;;;;;;;;iBAYH,mBAAA,CACd,YAAA,EAAc,aAAA,EACd,KAAA,EAAO,aAAA;;;;;;;;;;;;iBAqBO,yBAAA,CACd,aAAA,UACA,WAAA,UACA,QAAA,WACA,WAAA,GAAa,QAAA,EACb,oBAAA,GAAuB,QAAA,EACvB,IAAA,GAAM,EAAA,CAAG,eAAA,GACR,sBAAA"}
@@ -1,4 +1,4 @@
1
- import { a as isIncludeMatchFound, i as getTsconfigFilePath, n as findMatch, o as isMatchFound, r as getParsedTypeScriptConfig, s as tryTsconfigFilePath, t as findIncludeMatch } from "../tsconfig-CI6bla4E.mjs";
1
+ import { a as isIncludeMatchFound, i as getTsconfigFilePath, n as findMatch, o as isMatchFound, r as getParsedTypeScriptConfig, s as tryTsconfigFilePath, t as findIncludeMatch } from "../tsconfig-MeFEs21S.mjs";
2
2
  import { n as createProgram, t as VirtualFileSystemHost } from "../ts-morph-D0CaA37w.mjs";
3
3
 
4
4
  export { VirtualFileSystemHost, createProgram, findIncludeMatch, findMatch, getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound, isMatchFound, tryTsconfigFilePath };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/engine",
3
- "version": "0.45.3",
3
+ "version": "0.46.1",
4
4
  "private": false,
5
5
  "description": "An internal package containing the core engine modules for Powerlines.",
6
6
  "homepage": "https://stormsoftware.com",
@@ -137,22 +137,22 @@
137
137
  "@cacheable/memory": "^2.0.8",
138
138
  "@donedeal0/superdiff": "^3.2.0",
139
139
  "@jridgewell/sourcemap-codec": "^1.5.5",
140
- "@powerlines/core": "^0.45.3",
140
+ "@powerlines/core": "^0.46.1",
141
141
  "@storm-software/config": "^1.137.34",
142
142
  "@storm-software/config-tools": "^1.190.1",
143
- "@stryke/async": "^0.1.0",
144
- "@stryke/capnp": "^0.12.95",
145
- "@stryke/convert": "^0.7.2",
146
- "@stryke/env": "^0.20.86",
147
- "@stryke/fs": "^0.33.69",
148
- "@stryke/hash": "^0.13.22",
149
- "@stryke/helpers": "^0.10.11",
150
- "@stryke/http": "^0.12.57",
151
- "@stryke/json": "^0.14.15",
152
- "@stryke/path": "^0.28.1",
153
- "@stryke/string-format": "^0.17.12",
154
- "@stryke/type-checks": "^0.6.4",
155
- "@stryke/unique-id": "^0.3.80",
143
+ "@stryke/async": "^0.1.1",
144
+ "@stryke/capnp": "^0.12.96",
145
+ "@stryke/convert": "^0.7.3",
146
+ "@stryke/env": "^0.20.87",
147
+ "@stryke/fs": "^0.33.70",
148
+ "@stryke/hash": "^0.13.23",
149
+ "@stryke/helpers": "^0.10.12",
150
+ "@stryke/http": "^0.12.58",
151
+ "@stryke/json": "^0.14.16",
152
+ "@stryke/path": "^0.28.2",
153
+ "@stryke/string-format": "^0.17.13",
154
+ "@stryke/type-checks": "^0.6.5",
155
+ "@stryke/unique-id": "^0.3.81",
156
156
  "bundle-require": "^5.1.0",
157
157
  "chalk": "5.6.2",
158
158
  "compatx": "^0.2.0",
@@ -172,7 +172,7 @@
172
172
  },
173
173
  "devDependencies": {
174
174
  "@storm-software/testing-tools": "^1.119.155",
175
- "@stryke/types": "^0.11.6",
175
+ "@stryke/types": "^0.12.0",
176
176
  "@types/bun": "^1.3.13",
177
177
  "@types/node": "^25.6.0",
178
178
  "@types/semver": "^7.7.1",
@@ -180,5 +180,5 @@
180
180
  "typescript": "^6.0.3",
181
181
  "undici-types": "^7.25.0"
182
182
  },
183
- "gitHead": "8bd8d3c0e34fa7d04dafa0f05d740e5246a713cb"
183
+ "gitHead": "de70be13e6fd973ea0b1c56b8915223dcfb4a708"
184
184
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-context-BSAC5sO9.mjs","names":["joinPaths","#timestamp","createLogger"],"sources":["../src/_internal/helpers/resolver.ts","../src/context/base-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 { ResolvedConfig, Resolver } from \"@powerlines/core\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { JitiOptions, createJiti } from \"jiti\";\n\nexport type CreateResolverOptions = Omit<\n JitiOptions,\n \"fsCache\" | \"moduleCache\" | \"interopDefault\"\n> &\n Partial<Pick<ResolvedConfig, \"mode\" | \"skipCache\">> & {\n workspaceRoot: string;\n root: string;\n cacheDir: string;\n };\n\n/**\n * Create a Jiti resolver for the given workspace and project root.\n *\n * @param options - The options for creating the resolver.\n * @returns A Jiti instance configured for the specified workspace and project root.\n */\nfunction resolveOptions(options: CreateResolverOptions): JitiOptions {\n return defu(options, {\n interopDefault: true,\n fsCache:\n options.mode !== \"development\"\n ? joinPaths(options.cacheDir, \"jiti\")\n : false,\n moduleCache: options.mode !== \"development\"\n });\n}\n\n/**\n * Create a Jiti resolver for the given workspace and project root.\n *\n * @param options - The options for creating the resolver.\n * @returns A Jiti instance configured for the specified workspace and project root.\n */\nexport function createResolver(options: CreateResolverOptions): Resolver {\n const baseResolver = createJiti(\n joinPaths(options.workspaceRoot, options.root),\n resolveOptions(options)\n ) as Resolver;\n baseResolver.plugin = createJiti(\n joinPaths(options.workspaceRoot, options.root),\n resolveOptions(options)\n );\n\n return baseResolver;\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 type {\n BaseContext,\n EngineOptions,\n InitialConfig,\n LogFn,\n Logger,\n LoggerOptions,\n LogLevelResolvedConfig,\n LogMessage,\n Mode,\n ParsedUserConfig,\n Resolver,\n WorkspaceConfig\n} from \"@powerlines/core\";\nimport { loadUserConfigFile } from \"@powerlines/core/lib/config\";\nimport { resolveLogLevel } from \"@powerlines/core/plugin-utils\";\nimport {\n createLogger,\n extendLogger\n} from \"@powerlines/core/plugin-utils/logging\";\nimport { tryGetWorkspaceConfig } from \"@storm-software/config-tools/get-config\";\nimport {\n isDevelopment,\n isProduction,\n isTest\n} from \"@stryke/env/environment-checks\";\nimport { EnvPaths, getEnvPaths } from \"@stryke/env/get-env-paths\";\nimport { readJsonFile } from \"@stryke/fs\";\nimport { resolvePackage } from \"@stryke/fs/resolve\";\nimport { joinPaths } from \"@stryke/path\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { isEqual } from \"@stryke/path/is-equal\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport chalk from \"chalk\";\nimport { formatDistanceToNowStrict } from \"date-fns/formatDistanceToNowStrict\";\nimport defu from \"defu\";\nimport { existsSync } from \"node:fs\";\nimport { UserConfig } from \"tsdown/config\";\nimport { createResolver } from \"../_internal/helpers/resolver\";\n\nexport class PowerlinesBaseContext implements BaseContext {\n #timestamp: number = Date.now();\n\n /**\n * The path to the Powerlines package\n */\n public powerlinesPath!: string;\n\n /**\n * The module resolver for the project\n */\n public resolver!: Resolver;\n\n /**\n * The options provided to the Powerlines process\n */\n public options!: EngineOptions;\n\n /**\n * The input options used to initialize the context, which may be used when cloning the context to ensure the same configuration is applied to the new context\n */\n public initialOptions: Partial<EngineOptions> = {};\n\n /**\n * The initial configuration provided when initializing the context, which may be used during the setup process to ensure that the configuration is properly merged and applied to the context. This is typically the user configuration provided in the Powerlines configuration file, but may also include additional configuration options provided by plugins or other sources.\n */\n public initialConfig: InitialConfig<any> = {};\n\n /**\n * The parsed configuration file for the project\n */\n public configFile!: ParsedUserConfig;\n\n /**\n * The logger instance for the context, which can be used to create log messages with consistent formatting and metadata. This logger is extended by plugin contexts to include additional metadata such as the plugin name and category, which can be used to filter and format log messages in a more granular way.\n */\n public get logger(): Logger {\n return this.createLogger({});\n }\n\n /**\n * A timestamp representing when the context was initialized\n */\n public get timestamp(): number {\n return this.#timestamp;\n }\n\n public get logLevel(): LogLevelResolvedConfig {\n return resolveLogLevel(this.options.logLevel, this.options.mode);\n }\n\n /**\n * The environment paths for the project\n */\n public get envPaths(): EnvPaths {\n return getEnvPaths({\n orgId: this.options.organization,\n appId: this.options.framework || \"powerlines\",\n workspaceRoot: this.options.cwd\n });\n }\n\n /**\n * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.\n *\n * @remarks\n * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.\n *\n * @returns A promise that resolves to the cloned context.\n */\n public async clone(): Promise<BaseContext> {\n const clone = new PowerlinesBaseContext();\n await clone.init(this.options, this.initialConfig);\n\n return clone;\n }\n\n /**\n * A logging function for fatal messages\n *\n * @param message - The message to log.\n */\n public fatal(message: string | LogMessage) {\n this.logger.error(message);\n }\n\n /**\n * A logging function for error messages\n *\n * @param message - The message to log.\n */\n public error(message: string | LogMessage) {\n this.logger.error(message);\n }\n\n /**\n * A logging function for warning messages\n *\n * @param message - The message to log.\n */\n public warn(message: string | LogMessage) {\n this.logger.warn(message);\n }\n\n /**\n * A logging function for informational messages\n *\n * @param message - The message to log.\n */\n public info(message: string | LogMessage) {\n this.logger.info(message);\n }\n\n /**\n * A logging function for debug messages\n *\n * @param message - The message to log.\n */\n public debug(message: string | LogMessage) {\n this.logger.debug(message);\n }\n\n /**\n * A logging function for trace messages\n *\n * @param message - The message to log.\n */\n public trace(message: string | LogMessage) {\n this.logger.trace(message);\n }\n\n /**\n * A function to create a timer for measuring the duration of asynchronous operations\n *\n * @example\n * ```ts\n * const stopTimer = context.timer(\"Your Async Operation\");\n * await performAsyncOperation();\n * stopTimer(); // \"Your Async Operation completed in 123.45 milliseconds\"\n * ```\n *\n * @param name - The name of the timer.\n * @returns A function that, when called, stops the timer and logs the duration.\n */\n public timer(name: string): () => void {\n const startDate = Date.now();\n const startDuration = performance.now();\n\n return () => {\n const duration = performance.now() - startDuration;\n this.logger.info({\n meta: {\n category: \"performance\"\n },\n message: `${chalk.bold.cyanBright(name)} completed in ${chalk.bold.cyanBright(\n duration < 1000\n ? `${duration.toFixed(2)} milliseconds`\n : formatDistanceToNowStrict(startDate)\n )}`\n });\n };\n }\n\n /**\n * Create a new logger instance\n *\n * @param options - The configuration options to use for the logger instance, which can be used to customize the appearance and behavior of the log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance.\n * @param logFn - The custom logging function to use for logging messages, which can be used to override the default logging behavior of the original logger.\n * @returns A logger client instance that can be used to generate log messages with consistent formatting and metadata.\n */\n public createLogger(options: LoggerOptions, logFn?: LogFn): Logger {\n return createLogger(\n this.options.name || this.options.root,\n { ...this.configFile.config, ...this.options, ...options },\n logFn\n );\n }\n\n /**\n * Extend the base logger with additional configuration options\n *\n * @param options - The configuration options to extend the base logger with, which can be used to add additional metadata or customize the appearance of log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance, as well as any additional metadata such as the plugin category or environment.\n * @returns A new logger client instance that extends the base logger with the provided configuration options.\n */\n public extendLogger(options: LoggerOptions): Logger {\n return extendLogger(this.logger, options);\n }\n\n /**\n * Retrieve the workspace configuration for the current project, if it exists. This function will look for a configuration file in the project root and return its contents as a JavaScript object. If no configuration file is found, it will return undefined.\n *\n * @returns A promise that resolves to the workspace configuration object, or undefined if no configuration file is found.\n */\n protected async getWorkspaceConfig(): Promise<WorkspaceConfig | undefined> {\n return tryGetWorkspaceConfig(\n false,\n this.options || this.initialOptions\n ? {\n cwd:\n this.options?.root || this.initialOptions?.root\n ? appendPath(\n this.options?.root || this.initialOptions?.root || \".\",\n this.options?.cwd || this.initialOptions?.cwd\n )\n : undefined,\n workspaceRoot: this.options?.cwd || this.initialOptions?.cwd\n }\n : undefined\n );\n }\n\n /**\n * Determine the default mode for the current execution based on the environment and workspace configuration. This function will check the `NODE_ENV` environment variable to determine if the current environment is development, production, or test. If `NODE_ENV` is not set, it will look for a `mode` property in the workspace configuration file. If no mode is specified in the workspace configuration, it will default to \"production\".\n *\n * @returns A promise that resolves to the default mode for the current execution, which can be \"development\", \"production\", or \"test\".\n */\n protected async getDefaultMode(): Promise<Mode> {\n const workspaceConfig = await this.getWorkspaceConfig();\n\n return isProduction\n ? \"production\"\n : isDevelopment\n ? \"development\"\n : isTest\n ? \"test\"\n : workspaceConfig?.mode || \"production\";\n }\n\n /**\n * Determine the default log level for the current execution based on the environment and workspace configuration. This function will check the `logLevel` property in the workspace configuration file and resolve it to a `LogLevelResolvedConfig` value. If no log level is specified in the workspace configuration, it will default to \"info\" for development mode and \"warn\" for production mode.\n *\n * @returns A promise that resolves to the default log level for the current execution, which can be \"fatal\", \"error\", \"warn\", \"info\", \"debug\", or \"trace\".\n */\n protected async getDefaultLogLevel(): Promise<LogLevelResolvedConfig> {\n const workspaceConfig = await this.getWorkspaceConfig();\n\n return resolveLogLevel(\n workspaceConfig?.logLevel\n ? workspaceConfig.logLevel === \"success\" ||\n workspaceConfig.logLevel === \"performance\"\n ? \"info\"\n : workspaceConfig.logLevel === \"all\"\n ? \"debug\"\n : workspaceConfig.logLevel === \"fatal\"\n ? \"error\"\n : workspaceConfig.logLevel\n : undefined,\n this.options?.mode ||\n this.initialOptions?.mode ||\n workspaceConfig?.mode ||\n (await this.getDefaultMode())\n );\n }\n\n /**\n * Initialize the context with the provided configuration options\n *\n * @remarks\n * This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.\n *\n * @param options - The configuration options to initialize the context with\n * @param initialConfig - The initial configuration to initialize the context with\n */\n protected async init(options: EngineOptions, initialConfig: InitialConfig) {\n this.initialOptions = { ...options };\n this.initialConfig = { ...initialConfig };\n\n if (!this.powerlinesPath) {\n const powerlinesPath = await resolvePackage(\"powerlines\");\n if (!powerlinesPath) {\n throw new Error(\"Could not resolve `powerlines` package location.\");\n }\n this.powerlinesPath = powerlinesPath;\n }\n\n const cwd = options.cwd || this.options?.cwd || process.cwd();\n const root = replacePath(\n (options.root || this.options?.root) &&\n (options.root || this.options.root).replace(/^\\.\\/?/, \"\") &&\n !isEqual(options.root || this.options.root, cwd)\n ? options.root || this.options.root\n : \".\",\n cwd\n );\n\n this.options = defu(\n {\n name: options.name || this.initialConfig.name,\n root,\n cwd,\n mode: options.mode || this.initialConfig.mode,\n logLevel: options.logLevel || this.initialConfig.logLevel,\n framework: options.framework || this.initialConfig.framework,\n organization: options.organization || this.initialConfig.organization,\n configFile: options.configFile || this.initialConfig.configFile\n },\n this.options ?? {},\n {\n mode: await this.getDefaultMode(),\n logLevel: await this.getDefaultLogLevel()\n }\n );\n\n this.resolver = createResolver({\n workspaceRoot: cwd,\n root,\n cacheDir: this.envPaths.cache,\n mode: this.options.mode\n });\n\n this.configFile = await loadUserConfigFile(this.options, this.resolver);\n if (!this.options.name) {\n if (this.configFile.config) {\n if (\n isSetObject(this.configFile.config) &&\n isSetString((this.configFile.config as UserConfig).name)\n ) {\n this.options.name = (this.configFile.config as UserConfig).name;\n } else if (Array.isArray(this.configFile.config)) {\n for (const config of this.configFile.config) {\n if (\n isSetObject(config) &&\n isSetString((config as UserConfig).name)\n ) {\n this.options.name = (config as UserConfig).name;\n break;\n }\n }\n }\n }\n\n if (!this.options.name) {\n const packageJsonPath = joinPaths(\n appendPath(this.options.root, this.options.cwd),\n \"package.json\"\n );\n if (existsSync(packageJsonPath)) {\n const packageJson = await readJsonFile(packageJsonPath);\n this.options.name = packageJson.name;\n }\n\n if (!this.options.name) {\n const projectJsonPath = joinPaths(\n appendPath(this.options.root, this.options.cwd),\n \"project.json\"\n );\n if (existsSync(projectJsonPath)) {\n const projectJson = await readJsonFile(projectJsonPath);\n this.options.name = projectJson.name;\n }\n }\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,SAAS,eAAe,SAA6C;AACnE,QAAO,KAAK,SAAS;EACnB,gBAAgB;EAChB,SACE,QAAQ,SAAS,gBACbA,YAAU,QAAQ,UAAU,OAAO,GACnC;EACN,aAAa,QAAQ,SAAS;EAC/B,CAAC;;;;;;;;AASJ,SAAgB,eAAe,SAA0C;CACvE,MAAM,eAAe,WACnBA,YAAU,QAAQ,eAAe,QAAQ,KAAK,EAC9C,eAAe,QAAQ,CACxB;AACD,cAAa,SAAS,WACpBA,YAAU,QAAQ,eAAe,QAAQ,KAAK,EAC9C,eAAe,QAAQ,CACxB;AAED,QAAO;;;;;ACNT,IAAa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AAY,OAAO,IACnB,YAAa,OAAsB,KAAK,EACxC;AACA,WAAK,QAAQ,OAAQ,OAAsB;AAC3C;;;;AAMR,OAAI,CAAC,KAAK,QAAQ,MAAM;IACtB,MAAM,kBAAkB,UACtB,WAAW,KAAK,QAAQ,MAAM,KAAK,QAAQ,IAAI,EAC/C,eACD;AACD,QAAI,WAAW,gBAAgB,EAAE;KAC/B,MAAM,cAAc,MAAM,aAAa,gBAAgB;AACvD,UAAK,QAAQ,OAAO,YAAY;;AAGlC,QAAI,CAAC,KAAK,QAAQ,MAAM;KACtB,MAAM,kBAAkB,UACtB,WAAW,KAAK,QAAQ,MAAM,KAAK,QAAQ,IAAI,EAC/C,eACD;AACD,SAAI,WAAW,gBAAgB,EAAE;MAC/B,MAAM,cAAc,MAAM,aAAa,gBAAgB;AACvD,WAAK,QAAQ,OAAO,YAAY"}
@@ -1,73 +0,0 @@
1
- const require_chunk = require('./chunk-C0xms8kb.cjs');
2
- const require_base_context = require('./base-context-Byizvf4F.cjs');
3
- let _stryke_unique_id_uuid = require("@stryke/unique-id/uuid");
4
-
5
- //#region src/context/engine-context.ts
6
- var PowerlinesEngineContext = class PowerlinesEngineContext extends require_base_context.PowerlinesBaseContext {
7
- #executions = [];
8
- /**
9
- * Creates a new instance of the PowerlinesEngineContext class.
10
- *
11
- * @param options - The options to initialize the context with.
12
- * @returns A promise that resolves to an instance of the PowerlinesEngineContext class.
13
- */
14
- static async init(options, initialConfig = {}) {
15
- const context = new PowerlinesEngineContext();
16
- await context.init(options, initialConfig);
17
- if (!context.configFile?.config) {
18
- context.fatal("No configuration file found. Please ensure you have a valid configuration file in your project.");
19
- throw new Error("No configuration file found");
20
- }
21
- if (Array.isArray(context.configFile.config)) context.#executions = await Promise.all(context.configFile.config.map(async (_, executionIndex) => {
22
- const executionId = (0, _stryke_unique_id_uuid.uuid)();
23
- return {
24
- executionId,
25
- options: {
26
- cwd: process.cwd(),
27
- ...context.options,
28
- executionId,
29
- executionIndex
30
- },
31
- active: {
32
- command: null,
33
- hook: null,
34
- plugin: null
35
- }
36
- };
37
- }));
38
- else {
39
- const executionId = (0, _stryke_unique_id_uuid.uuid)();
40
- context.#executions = [{
41
- executionId,
42
- options: {
43
- cwd: process.cwd(),
44
- ...context.options,
45
- executionId,
46
- executionIndex: 0
47
- },
48
- active: {
49
- command: null,
50
- hook: null,
51
- plugin: null
52
- }
53
- }];
54
- }
55
- return context;
56
- }
57
- /**
58
- * A list of all command executions that will be run during the lifecycle of the engine
59
- *
60
- * @returns An array of {@link ExecutionState} representing each execution context for the engine.
61
- */
62
- get executions() {
63
- return this.#executions;
64
- }
65
- };
66
-
67
- //#endregion
68
- Object.defineProperty(exports, 'PowerlinesEngineContext', {
69
- enumerable: true,
70
- get: function () {
71
- return PowerlinesEngineContext;
72
- }
73
- });
@@ -1,68 +0,0 @@
1
- import { t as PowerlinesBaseContext } from "./base-context-BSAC5sO9.mjs";
2
- import { uuid } from "@stryke/unique-id/uuid";
3
-
4
- //#region src/context/engine-context.ts
5
- var PowerlinesEngineContext = class PowerlinesEngineContext extends PowerlinesBaseContext {
6
- #executions = [];
7
- /**
8
- * Creates a new instance of the PowerlinesEngineContext class.
9
- *
10
- * @param options - The options to initialize the context with.
11
- * @returns A promise that resolves to an instance of the PowerlinesEngineContext class.
12
- */
13
- static async init(options, initialConfig = {}) {
14
- const context = new PowerlinesEngineContext();
15
- await context.init(options, initialConfig);
16
- if (!context.configFile?.config) {
17
- context.fatal("No configuration file found. Please ensure you have a valid configuration file in your project.");
18
- throw new Error("No configuration file found");
19
- }
20
- if (Array.isArray(context.configFile.config)) context.#executions = await Promise.all(context.configFile.config.map(async (_, executionIndex) => {
21
- const executionId = uuid();
22
- return {
23
- executionId,
24
- options: {
25
- cwd: process.cwd(),
26
- ...context.options,
27
- executionId,
28
- executionIndex
29
- },
30
- active: {
31
- command: null,
32
- hook: null,
33
- plugin: null
34
- }
35
- };
36
- }));
37
- else {
38
- const executionId = uuid();
39
- context.#executions = [{
40
- executionId,
41
- options: {
42
- cwd: process.cwd(),
43
- ...context.options,
44
- executionId,
45
- executionIndex: 0
46
- },
47
- active: {
48
- command: null,
49
- hook: null,
50
- plugin: null
51
- }
52
- }];
53
- }
54
- return context;
55
- }
56
- /**
57
- * A list of all command executions that will be run during the lifecycle of the engine
58
- *
59
- * @returns An array of {@link ExecutionState} representing each execution context for the engine.
60
- */
61
- get executions() {
62
- return this.#executions;
63
- }
64
- };
65
-
66
- //#endregion
67
- export { PowerlinesEngineContext as t };
68
- //# sourceMappingURL=engine-context-_RMFwG4J.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"engine-context-_RMFwG4J.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 ExecutionState,\n InitialConfig\n} from \"@powerlines/core\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport { PowerlinesBaseContext } from \"./base-context\";\n\nexport class PowerlinesEngineContext\n extends PowerlinesBaseContext\n implements EngineContext\n{\n #executions: ExecutionState[] = [];\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 init(\n options: EngineOptions,\n initialConfig: InitialConfig<any> = {}\n ): Promise<PowerlinesEngineContext> {\n const context = new PowerlinesEngineContext();\n await context.init(options, initialConfig);\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 (_, executionIndex) => {\n const executionId = uuid();\n\n return {\n executionId,\n options: {\n cwd: process.cwd(),\n ...context.options,\n executionId,\n executionIndex\n },\n active: {\n command: null,\n hook: null,\n plugin: null\n }\n };\n })\n );\n } else {\n const executionId = uuid();\n context.#executions = [\n {\n executionId,\n options: {\n cwd: process.cwd(),\n ...context.options,\n executionId,\n executionIndex: 0\n },\n active: {\n command: null,\n hook: null,\n plugin: null\n }\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 {@link ExecutionState} representing each execution context for the engine.\n */\n public get executions(): ExecutionState[] {\n return this.#executions;\n }\n}\n"],"mappings":";;;;AA2BA,IAAa,0BAAb,MAAa,gCACH,sBAEV;CACE,cAAgC,EAAE;;;;;;;CAQlC,aAAoB,KAClB,SACA,gBAAoC,EAAE,EACJ;EAClC,MAAM,UAAU,IAAI,yBAAyB;AAC7C,QAAM,QAAQ,KAAK,SAAS,cAAc;AAE1C,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,mBAAmB;GACzD,MAAM,cAAc,MAAM;AAE1B,UAAO;IACL;IACA,SAAS;KACP,KAAK,QAAQ,KAAK;KAClB,GAAG,QAAQ;KACX;KACA;KACD;IACD,QAAQ;KACN,SAAS;KACT,MAAM;KACN,QAAQ;KACT;IACF;IACD,CACH;OACI;GACL,MAAM,cAAc,MAAM;AAC1B,YAAQA,aAAc,CACpB;IACE;IACA,SAAS;KACP,KAAK,QAAQ,KAAK;KAClB,GAAG,QAAQ;KACX;KACA,gBAAgB;KACjB;IACD,QAAQ;KACN,SAAS;KACT,MAAM;KACN,QAAQ;KACT;IACF,CACF;;AAGH,SAAO;;;;;;;CAQT,IAAW,aAA+B;AACxC,SAAO,MAAKA"}