@powerlines/engine 0.15.0 → 0.15.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 (195) hide show
  1. package/dist/api/build.cjs +66 -0
  2. package/dist/api/build.d.cts +14 -0
  3. package/dist/api/build.d.cts.map +1 -0
  4. package/dist/api/build.d.mts +14 -0
  5. package/dist/api/build.d.mts.map +1 -0
  6. package/dist/api/build.mjs +64 -0
  7. package/dist/api/build.mjs.map +1 -0
  8. package/dist/api/clean.cjs +29 -0
  9. package/dist/api/clean.d.cts +14 -0
  10. package/dist/api/clean.d.cts.map +1 -0
  11. package/dist/api/clean.d.mts +14 -0
  12. package/dist/api/clean.d.mts.map +1 -0
  13. package/dist/api/clean.mjs +28 -0
  14. package/dist/api/clean.mjs.map +1 -0
  15. package/dist/api/create.cjs +59 -0
  16. package/dist/api/create.d.cts +14 -0
  17. package/dist/api/create.d.cts.map +1 -0
  18. package/dist/api/create.d.mts +14 -0
  19. package/dist/api/create.d.mts.map +1 -0
  20. package/dist/api/create.mjs +57 -0
  21. package/dist/api/create.mjs.map +1 -0
  22. package/dist/api/deploy.cjs +25 -0
  23. package/dist/api/deploy.d.cts +17 -0
  24. package/dist/api/deploy.d.cts.map +1 -0
  25. package/dist/api/deploy.d.mts +17 -0
  26. package/dist/api/deploy.d.mts.map +1 -0
  27. package/dist/api/deploy.mjs +24 -0
  28. package/dist/api/deploy.mjs.map +1 -0
  29. package/dist/api/docs.cjs +25 -0
  30. package/dist/api/docs.d.cts +17 -0
  31. package/dist/api/docs.d.cts.map +1 -0
  32. package/dist/api/docs.d.mts +17 -0
  33. package/dist/api/docs.d.mts.map +1 -0
  34. package/dist/api/docs.mjs +24 -0
  35. package/dist/api/docs.mjs.map +1 -0
  36. package/dist/api/lint.cjs +28 -0
  37. package/dist/api/lint.d.cts +17 -0
  38. package/dist/api/lint.d.cts.map +1 -0
  39. package/dist/api/lint.d.mts +17 -0
  40. package/dist/api/lint.d.mts.map +1 -0
  41. package/dist/api/lint.mjs +27 -0
  42. package/dist/api/lint.mjs.map +1 -0
  43. package/dist/api/prepare.cjs +69 -0
  44. package/dist/api/prepare.d.cts +14 -0
  45. package/dist/api/prepare.d.cts.map +1 -0
  46. package/dist/api/prepare.d.mts +14 -0
  47. package/dist/api/prepare.d.mts.map +1 -0
  48. package/dist/api/prepare.mjs +68 -0
  49. package/dist/api/prepare.mjs.map +1 -0
  50. package/dist/api/test.cjs +28 -0
  51. package/dist/api/test.d.cts +17 -0
  52. package/dist/api/test.d.cts.map +1 -0
  53. package/dist/api/test.d.mts +17 -0
  54. package/dist/api/test.d.mts.map +1 -0
  55. package/dist/api/test.mjs +27 -0
  56. package/dist/api/test.mjs.map +1 -0
  57. package/dist/api/types.cjs +71 -0
  58. package/dist/api/types.d.cts +17 -0
  59. package/dist/api/types.d.cts.map +1 -0
  60. package/dist/api/types.d.mts +17 -0
  61. package/dist/api/types.d.mts.map +1 -0
  62. package/dist/api/types.mjs +70 -0
  63. package/dist/api/types.mjs.map +1 -0
  64. package/dist/api-6w4hZL6n.d.cts +135 -0
  65. package/dist/api-6w4hZL6n.d.cts.map +1 -0
  66. package/dist/api-Cdw4v0W4.d.mts +135 -0
  67. package/dist/api-Cdw4v0W4.d.mts.map +1 -0
  68. package/dist/config-BNe23XHx.d.mts +204 -0
  69. package/dist/config-BNe23XHx.d.mts.map +1 -0
  70. package/dist/config-D6xUniHh.d.cts +204 -0
  71. package/dist/config-D6xUniHh.d.cts.map +1 -0
  72. package/dist/context/engine-context.cjs +175 -0
  73. package/dist/context/engine-context.d.cts +2 -0
  74. package/dist/context/engine-context.d.mts +2 -0
  75. package/dist/context/engine-context.mjs +173 -0
  76. package/dist/context/engine-context.mjs.map +1 -0
  77. package/dist/context/index.cjs +2 -9
  78. package/dist/context/index.d.cts +2 -660
  79. package/dist/context/index.d.mts +2 -660
  80. package/dist/context/index.mjs +2 -4
  81. package/dist/context-DzgsMSWr.d.mts +149 -0
  82. package/dist/context-DzgsMSWr.d.mts.map +1 -0
  83. package/dist/context-epL7NPvL.d.cts +149 -0
  84. package/dist/context-epL7NPvL.d.cts.map +1 -0
  85. package/dist/engine-context-DEotmVzB.d.mts +54 -0
  86. package/dist/engine-context-DEotmVzB.d.mts.map +1 -0
  87. package/dist/engine-context-Dw8odBCo.d.cts +54 -0
  88. package/dist/engine-context-Dw8odBCo.d.cts.map +1 -0
  89. package/dist/engine.cjs +268 -0
  90. package/dist/engine.d.cts +143 -0
  91. package/dist/engine.d.cts.map +1 -0
  92. package/dist/engine.d.mts +143 -0
  93. package/dist/engine.d.mts.map +1 -0
  94. package/dist/engine.mjs +264 -0
  95. package/dist/engine.mjs.map +1 -0
  96. package/dist/execution-host.cjs +44 -0
  97. package/dist/execution-host.d.cts +14 -0
  98. package/dist/execution-host.d.cts.map +1 -0
  99. package/dist/execution-host.d.mts +14 -0
  100. package/dist/execution-host.d.mts.map +1 -0
  101. package/dist/execution-host.mjs +36 -0
  102. package/dist/execution-host.mjs.map +1 -0
  103. package/dist/helpers/create-execution-host.cjs +51 -0
  104. package/dist/helpers/create-execution-host.d.cts +21 -0
  105. package/dist/helpers/create-execution-host.d.cts.map +1 -0
  106. package/dist/helpers/create-execution-host.d.mts +21 -0
  107. package/dist/helpers/create-execution-host.d.mts.map +1 -0
  108. package/dist/helpers/create-execution-host.mjs +50 -0
  109. package/dist/helpers/create-execution-host.mjs.map +1 -0
  110. package/dist/helpers/execution-host-worker.cjs +308 -0
  111. package/dist/helpers/execution-host-worker.d.cts +68 -0
  112. package/dist/helpers/execution-host-worker.d.cts.map +1 -0
  113. package/dist/helpers/execution-host-worker.d.mts +68 -0
  114. package/dist/helpers/execution-host-worker.d.mts.map +1 -0
  115. package/dist/helpers/execution-host-worker.mjs +307 -0
  116. package/dist/helpers/execution-host-worker.mjs.map +1 -0
  117. package/dist/helpers/finalize.cjs +27 -0
  118. package/dist/helpers/finalize.d.cts +12 -0
  119. package/dist/helpers/finalize.d.cts.map +1 -0
  120. package/dist/helpers/finalize.d.mts +12 -0
  121. package/dist/helpers/finalize.d.mts.map +1 -0
  122. package/dist/helpers/finalize.mjs +26 -0
  123. package/dist/helpers/finalize.mjs.map +1 -0
  124. package/dist/helpers/rpc.cjs +140 -0
  125. package/dist/helpers/rpc.d.cts +7 -0
  126. package/dist/helpers/rpc.d.cts.map +1 -0
  127. package/dist/helpers/rpc.d.mts +7 -0
  128. package/dist/helpers/rpc.d.mts.map +1 -0
  129. package/dist/helpers/rpc.mjs +139 -0
  130. package/dist/helpers/rpc.mjs.map +1 -0
  131. package/dist/index-CNgSR_kt.d.mts +1 -0
  132. package/dist/index-D_TYgLX3.d.cts +1 -0
  133. package/dist/index.cjs +13 -567
  134. package/dist/index.d.cts +9 -126
  135. package/dist/index.d.mts +9 -126
  136. package/dist/index.mjs +7 -567
  137. package/package.json +101 -129
  138. package/dist/_internal/worker.cjs +0 -4843
  139. package/dist/_internal/worker.d.cts +0 -38
  140. package/dist/_internal/worker.d.cts.map +0 -1
  141. package/dist/_internal/worker.d.mts +0 -38
  142. package/dist/_internal/worker.d.mts.map +0 -1
  143. package/dist/_internal/worker.mjs +0 -4804
  144. package/dist/_internal/worker.mjs.map +0 -1
  145. package/dist/api.cjs +0 -1274
  146. package/dist/api.d.cts +0 -265
  147. package/dist/api.d.cts.map +0 -1
  148. package/dist/api.d.mts +0 -265
  149. package/dist/api.d.mts.map +0 -1
  150. package/dist/api.mjs +0 -1270
  151. package/dist/api.mjs.map +0 -1
  152. package/dist/base-context-BUnL_9z8.mjs +0 -241
  153. package/dist/base-context-BUnL_9z8.mjs.map +0 -1
  154. package/dist/base-context-CFvO2N9I.cjs +0 -248
  155. package/dist/context/index.d.cts.map +0 -1
  156. package/dist/context/index.d.mts.map +0 -1
  157. package/dist/engine-context-BuD9AGfd.mjs +0 -41
  158. package/dist/engine-context-BuD9AGfd.mjs.map +0 -1
  159. package/dist/engine-context-NO6enYev.cjs +0 -45
  160. package/dist/execution-context-BgGV4xyW.cjs +0 -2614
  161. package/dist/execution-context-D_CXpe9I.mjs +0 -2570
  162. package/dist/execution-context-D_CXpe9I.mjs.map +0 -1
  163. package/dist/fs-D1nIP45P.mjs +0 -226
  164. package/dist/fs-D1nIP45P.mjs.map +0 -1
  165. package/dist/fs-XogSgMqT.cjs +0 -262
  166. package/dist/index.d.cts.map +0 -1
  167. package/dist/index.d.mts.map +0 -1
  168. package/dist/index.mjs.map +0 -1
  169. package/dist/schemas.cjs +0 -9
  170. package/dist/schemas.d.cts +0 -127
  171. package/dist/schemas.d.cts.map +0 -1
  172. package/dist/schemas.d.mts +0 -127
  173. package/dist/schemas.d.mts.map +0 -1
  174. package/dist/schemas.mjs +0 -3
  175. package/dist/storage/index.cjs +0 -9
  176. package/dist/storage/index.d.cts +0 -419
  177. package/dist/storage/index.d.cts.map +0 -1
  178. package/dist/storage/index.d.mts +0 -419
  179. package/dist/storage/index.d.mts.map +0 -1
  180. package/dist/storage/index.mjs +0 -3
  181. package/dist/ts-morph-BaLPVAdB.cjs +0 -114
  182. package/dist/ts-morph-D0CaA37w.mjs +0 -102
  183. package/dist/ts-morph-D0CaA37w.mjs.map +0 -1
  184. package/dist/tsconfig-Cstsoprg.mjs +0 -155
  185. package/dist/tsconfig-Cstsoprg.mjs.map +0 -1
  186. package/dist/tsconfig-DeyWQC2N.cjs +0 -198
  187. package/dist/typescript/index.cjs +0 -13
  188. package/dist/typescript/index.d.cts +0 -106
  189. package/dist/typescript/index.d.cts.map +0 -1
  190. package/dist/typescript/index.d.mts +0 -106
  191. package/dist/typescript/index.d.mts.map +0 -1
  192. package/dist/typescript/index.mjs +0 -4
  193. package/dist/virtual-BNdKVkRw.cjs +0 -548
  194. package/dist/virtual-gIlTc3Lj.mjs +0 -513
  195. package/dist/virtual-gIlTc3Lj.mjs.map +0 -1
@@ -1,155 +0,0 @@
1
- import defu from "defu";
2
- import { joinPaths } from "@stryke/path/join-paths";
3
- import { existsSync } from "@stryke/fs/exists";
4
- import { appendPath } from "@stryke/path/append";
5
- import { readJsonFileSync } from "@stryke/fs/json";
6
- import ts from "typescript";
7
-
8
- //#region src/typescript/tsconfig.ts
9
- /**
10
- * Get the path to the tsconfig.json file.
11
- *
12
- * @param workspaceRoot - The root directory of the workspace.
13
- * @param projectRoot - The root directory of the project.
14
- * @param tsconfig - The path to the tsconfig.json file.
15
- * @returns The absolute path to the tsconfig.json file.
16
- * @throws If the tsconfig.json file does not exist.
17
- */
18
- function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
19
- let tsconfigFilePath;
20
- if (tsconfig) tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig);
21
- else {
22
- tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.app.json");
23
- if (!tsconfigFilePath) {
24
- tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.lib.json");
25
- if (!tsconfigFilePath) tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.json");
26
- }
27
- }
28
- if (!tsconfigFilePath) throw new Error(`Cannot find the \`tsconfig.json\` configuration file for the project at ${projectRoot}.`);
29
- return tsconfigFilePath;
30
- }
31
- /**
32
- * Get the path to the tsconfig.json file.
33
- *
34
- * @param workspaceRoot - The root directory of the workspace.
35
- * @param projectRoot - The root directory of the project.
36
- * @param tsconfig - The path to the tsconfig.json file.
37
- * @returns The absolute path to the tsconfig.json file.
38
- * @throws If the tsconfig.json file does not exist.
39
- */
40
- function tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
41
- let tsconfigFilePath = tsconfig;
42
- if (!existsSync(tsconfigFilePath)) {
43
- tsconfigFilePath = appendPath(tsconfig, projectRoot);
44
- if (!existsSync(tsconfigFilePath)) {
45
- tsconfigFilePath = appendPath(tsconfig, appendPath(projectRoot, workspaceRoot));
46
- if (!existsSync(tsconfigFilePath)) return;
47
- }
48
- }
49
- return tsconfigFilePath;
50
- }
51
- /**
52
- * Check if the TypeScript configuration type matches any of the provided types.
53
- *
54
- * @param tsconfigType - The type from the TypeScript configuration.
55
- * @param types - An array of type names to check against.
56
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
57
- */
58
- function findMatch(tsconfigType, types, extensions = [
59
- ".ts",
60
- ".tsx",
61
- ".d.ts"
62
- ]) {
63
- return types.find((type) => tsconfigType?.toString().toLowerCase() === type?.toString().toLowerCase() || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}` || `./${tsconfigType?.toString().toLowerCase()}` === type?.toString().toLowerCase() || extensions.some((ext) => `${tsconfigType?.toString().toLowerCase()}${ext}` === type?.toString().toLowerCase() || `${tsconfigType?.toString().toLowerCase()}${ext}` === `./${type?.toString().toLowerCase()}` || `${type?.toString().toLowerCase()}${ext}` === `./${tsconfigType?.toString().toLowerCase()}` || tsconfigType?.toString().toLowerCase() === `${type?.toString().toLowerCase()}${ext}` || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}${ext}` || type?.toString().toLowerCase() === `./${tsconfigType?.toString().toLowerCase()}${ext}`));
64
- }
65
- /**
66
- * Check if the TypeScript configuration type matches any of the provided types.
67
- *
68
- * @param tsconfigType - The type from the TypeScript configuration.
69
- * @param types - An array of type names to check against.
70
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
71
- */
72
- function findIncludeMatch(tsconfigType, types) {
73
- return findMatch(tsconfigType, types, [
74
- ".ts",
75
- ".tsx",
76
- ".d.ts",
77
- ".js",
78
- ".jsx",
79
- ".mjs",
80
- ".cjs",
81
- ".mts",
82
- ".cts",
83
- "/*.ts",
84
- "/*.tsx",
85
- "/*.d.ts",
86
- "/*.js",
87
- "/*.jsx",
88
- "/*.mjs",
89
- "/*.cjs",
90
- "/*.mts",
91
- "/*.cts",
92
- "/**/*.ts",
93
- "/**/*.tsx",
94
- "/**/*.d.ts",
95
- "/**/*.js",
96
- "/**/*.jsx",
97
- "/**/*.mjs",
98
- "/**/*.cjs",
99
- "/**/*.mts",
100
- "/**/*.cts"
101
- ]);
102
- }
103
- /**
104
- * Check if the TypeScript configuration type matches any of the provided types.
105
- *
106
- * @param tsconfigType - The type from the TypeScript configuration.
107
- * @param types - An array of type names to check against.
108
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
109
- */
110
- function isMatchFound(tsconfigType, types) {
111
- return findMatch(tsconfigType, types) !== void 0;
112
- }
113
- /**
114
- * Check if the TypeScript configuration type matches any of the provided types.
115
- *
116
- * @param tsconfigType - The type from the TypeScript configuration.
117
- * @param types - An array of type names to check against.
118
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
119
- */
120
- function isIncludeMatchFound(tsconfigType, types) {
121
- return findIncludeMatch(tsconfigType, types) !== void 0;
122
- }
123
- /**
124
- * Get the parsed TypeScript configuration.
125
- *
126
- * @param workspaceRoot - The root directory of the workspace.
127
- * @param projectRoot - The root directory of the project.
128
- * @param tsconfig - The path to the tsconfig.json file.
129
- * @param tsconfigRaw - The raw tsconfig.json content.
130
- * @param originalTsconfigJson - The original tsconfig.json content.
131
- * @param host - The TypeScript parse config host.
132
- * @returns The resolved TypeScript configuration.
133
- */
134
- function getParsedTypeScriptConfig(workspaceRoot, projectRoot, tsconfig, tsconfigRaw = {}, originalTsconfigJson, host = ts.sys) {
135
- const tsconfigFilePath = getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig);
136
- const tsconfigJson = readJsonFileSync(tsconfigFilePath);
137
- if (!tsconfigJson) throw new Error(`Cannot find the \`tsconfig.json\` configuration file at ${joinPaths(projectRoot, tsconfig ?? "tsconfig.json")}`);
138
- const parsedCommandLine = ts.parseJsonConfigFileContent(defu(tsconfigRaw ?? {}, tsconfigJson), host, appendPath(projectRoot, workspaceRoot));
139
- if (parsedCommandLine.errors.length > 0) {
140
- const errorMessage = `Cannot parse the TypeScript compiler options. Please investigate the following issues:
141
- ${parsedCommandLine.errors.map((error) => `- ${(error.category !== void 0 && error.code ? `[${error.category}-${error.code}]: ` : "") + error.messageText.toString()}`).join("\n")}
142
- `;
143
- throw new Error(errorMessage);
144
- }
145
- return {
146
- ...parsedCommandLine,
147
- originalTsconfigJson: originalTsconfigJson ?? tsconfigJson,
148
- tsconfigJson,
149
- tsconfigFilePath
150
- };
151
- }
152
-
153
- //#endregion
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-Cstsoprg.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tsconfig-Cstsoprg.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 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 * @returns The absolute path to the tsconfig.json file.\n * @throws If the tsconfig.json file does not exist.\n */\nexport function getTsconfigFilePath(\n workspaceRoot: string,\n projectRoot: string,\n tsconfig?: string\n): string {\n let tsconfigFilePath: string | undefined;\n if (tsconfig) {\n tsconfigFilePath = tryTsconfigFilePath(\n workspaceRoot,\n projectRoot,\n tsconfig\n );\n } else {\n tsconfigFilePath = tryTsconfigFilePath(\n workspaceRoot,\n projectRoot,\n \"tsconfig.app.json\"\n );\n if (!tsconfigFilePath) {\n tsconfigFilePath = tryTsconfigFilePath(\n workspaceRoot,\n projectRoot,\n \"tsconfig.lib.json\"\n );\n if (!tsconfigFilePath) {\n tsconfigFilePath = tryTsconfigFilePath(\n workspaceRoot,\n projectRoot,\n \"tsconfig.json\"\n );\n }\n }\n }\n\n if (!tsconfigFilePath) {\n throw new Error(\n `Cannot find the \\`tsconfig.json\\` configuration file for the project at ${\n projectRoot\n }.`\n );\n }\n\n return tsconfigFilePath;\n}\n\n/**\n * Get the path to the tsconfig.json file.\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 * @returns The absolute path to the tsconfig.json file.\n * @throws If the tsconfig.json file does not exist.\n */\nexport function tryTsconfigFilePath(\n workspaceRoot: string,\n projectRoot: string,\n tsconfig: string\n): string | undefined {\n let tsconfigFilePath = tsconfig;\n if (!existsSync(tsconfigFilePath)) {\n tsconfigFilePath = appendPath(tsconfig, projectRoot);\n if (!existsSync(tsconfigFilePath)) {\n tsconfigFilePath = appendPath(\n tsconfig,\n appendPath(projectRoot, workspaceRoot)\n );\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":"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"}
@@ -1,198 +0,0 @@
1
- const require_chunk = require('./chunk-C0xms8kb.cjs');
2
- let defu = require("defu");
3
- defu = require_chunk.__toESM(defu, 1);
4
- let _stryke_path_join_paths = require("@stryke/path/join-paths");
5
- let _stryke_fs_exists = require("@stryke/fs/exists");
6
- let _stryke_path_append = require("@stryke/path/append");
7
- let _stryke_fs_json = require("@stryke/fs/json");
8
- let typescript = require("typescript");
9
- typescript = require_chunk.__toESM(typescript, 1);
10
-
11
- //#region src/typescript/tsconfig.ts
12
- /**
13
- * Get the path to the tsconfig.json file.
14
- *
15
- * @param workspaceRoot - The root directory of the workspace.
16
- * @param projectRoot - The root directory of the project.
17
- * @param tsconfig - The path to the tsconfig.json file.
18
- * @returns The absolute path to the tsconfig.json file.
19
- * @throws If the tsconfig.json file does not exist.
20
- */
21
- function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
22
- let tsconfigFilePath;
23
- if (tsconfig) tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig);
24
- else {
25
- tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.app.json");
26
- if (!tsconfigFilePath) {
27
- tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.lib.json");
28
- if (!tsconfigFilePath) tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.json");
29
- }
30
- }
31
- if (!tsconfigFilePath) throw new Error(`Cannot find the \`tsconfig.json\` configuration file for the project at ${projectRoot}.`);
32
- return tsconfigFilePath;
33
- }
34
- /**
35
- * Get the path to the tsconfig.json file.
36
- *
37
- * @param workspaceRoot - The root directory of the workspace.
38
- * @param projectRoot - The root directory of the project.
39
- * @param tsconfig - The path to the tsconfig.json file.
40
- * @returns The absolute path to the tsconfig.json file.
41
- * @throws If the tsconfig.json file does not exist.
42
- */
43
- function tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
44
- let tsconfigFilePath = tsconfig;
45
- if (!(0, _stryke_fs_exists.existsSync)(tsconfigFilePath)) {
46
- tsconfigFilePath = (0, _stryke_path_append.appendPath)(tsconfig, projectRoot);
47
- if (!(0, _stryke_fs_exists.existsSync)(tsconfigFilePath)) {
48
- tsconfigFilePath = (0, _stryke_path_append.appendPath)(tsconfig, (0, _stryke_path_append.appendPath)(projectRoot, workspaceRoot));
49
- if (!(0, _stryke_fs_exists.existsSync)(tsconfigFilePath)) return;
50
- }
51
- }
52
- return tsconfigFilePath;
53
- }
54
- /**
55
- * Check if the TypeScript configuration type matches any of the provided types.
56
- *
57
- * @param tsconfigType - The type from the TypeScript configuration.
58
- * @param types - An array of type names to check against.
59
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
60
- */
61
- function findMatch(tsconfigType, types, extensions = [
62
- ".ts",
63
- ".tsx",
64
- ".d.ts"
65
- ]) {
66
- return types.find((type) => tsconfigType?.toString().toLowerCase() === type?.toString().toLowerCase() || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}` || `./${tsconfigType?.toString().toLowerCase()}` === type?.toString().toLowerCase() || extensions.some((ext) => `${tsconfigType?.toString().toLowerCase()}${ext}` === type?.toString().toLowerCase() || `${tsconfigType?.toString().toLowerCase()}${ext}` === `./${type?.toString().toLowerCase()}` || `${type?.toString().toLowerCase()}${ext}` === `./${tsconfigType?.toString().toLowerCase()}` || tsconfigType?.toString().toLowerCase() === `${type?.toString().toLowerCase()}${ext}` || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}${ext}` || type?.toString().toLowerCase() === `./${tsconfigType?.toString().toLowerCase()}${ext}`));
67
- }
68
- /**
69
- * Check if the TypeScript configuration type matches any of the provided types.
70
- *
71
- * @param tsconfigType - The type from the TypeScript configuration.
72
- * @param types - An array of type names to check against.
73
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
74
- */
75
- function findIncludeMatch(tsconfigType, types) {
76
- return findMatch(tsconfigType, types, [
77
- ".ts",
78
- ".tsx",
79
- ".d.ts",
80
- ".js",
81
- ".jsx",
82
- ".mjs",
83
- ".cjs",
84
- ".mts",
85
- ".cts",
86
- "/*.ts",
87
- "/*.tsx",
88
- "/*.d.ts",
89
- "/*.js",
90
- "/*.jsx",
91
- "/*.mjs",
92
- "/*.cjs",
93
- "/*.mts",
94
- "/*.cts",
95
- "/**/*.ts",
96
- "/**/*.tsx",
97
- "/**/*.d.ts",
98
- "/**/*.js",
99
- "/**/*.jsx",
100
- "/**/*.mjs",
101
- "/**/*.cjs",
102
- "/**/*.mts",
103
- "/**/*.cts"
104
- ]);
105
- }
106
- /**
107
- * Check if the TypeScript configuration type matches any of the provided types.
108
- *
109
- * @param tsconfigType - The type from the TypeScript configuration.
110
- * @param types - An array of type names to check against.
111
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
112
- */
113
- function isMatchFound(tsconfigType, types) {
114
- return findMatch(tsconfigType, types) !== void 0;
115
- }
116
- /**
117
- * Check if the TypeScript configuration type matches any of the provided types.
118
- *
119
- * @param tsconfigType - The type from the TypeScript configuration.
120
- * @param types - An array of type names to check against.
121
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
122
- */
123
- function isIncludeMatchFound(tsconfigType, types) {
124
- return findIncludeMatch(tsconfigType, types) !== void 0;
125
- }
126
- /**
127
- * Get the parsed TypeScript configuration.
128
- *
129
- * @param workspaceRoot - The root directory of the workspace.
130
- * @param projectRoot - The root directory of the project.
131
- * @param tsconfig - The path to the tsconfig.json file.
132
- * @param tsconfigRaw - The raw tsconfig.json content.
133
- * @param originalTsconfigJson - The original tsconfig.json content.
134
- * @param host - The TypeScript parse config host.
135
- * @returns The resolved TypeScript configuration.
136
- */
137
- function getParsedTypeScriptConfig(workspaceRoot, projectRoot, tsconfig, tsconfigRaw = {}, originalTsconfigJson, host = typescript.default.sys) {
138
- const tsconfigFilePath = getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig);
139
- const tsconfigJson = (0, _stryke_fs_json.readJsonFileSync)(tsconfigFilePath);
140
- if (!tsconfigJson) throw new Error(`Cannot find the \`tsconfig.json\` configuration file at ${(0, _stryke_path_join_paths.joinPaths)(projectRoot, tsconfig ?? "tsconfig.json")}`);
141
- const parsedCommandLine = typescript.default.parseJsonConfigFileContent((0, defu.default)(tsconfigRaw ?? {}, tsconfigJson), host, (0, _stryke_path_append.appendPath)(projectRoot, workspaceRoot));
142
- if (parsedCommandLine.errors.length > 0) {
143
- const errorMessage = `Cannot parse the TypeScript compiler options. Please investigate the following issues:
144
- ${parsedCommandLine.errors.map((error) => `- ${(error.category !== void 0 && error.code ? `[${error.category}-${error.code}]: ` : "") + error.messageText.toString()}`).join("\n")}
145
- `;
146
- throw new Error(errorMessage);
147
- }
148
- return {
149
- ...parsedCommandLine,
150
- originalTsconfigJson: originalTsconfigJson ?? tsconfigJson,
151
- tsconfigJson,
152
- tsconfigFilePath
153
- };
154
- }
155
-
156
- //#endregion
157
- Object.defineProperty(exports, 'findIncludeMatch', {
158
- enumerable: true,
159
- get: function () {
160
- return findIncludeMatch;
161
- }
162
- });
163
- Object.defineProperty(exports, 'findMatch', {
164
- enumerable: true,
165
- get: function () {
166
- return findMatch;
167
- }
168
- });
169
- Object.defineProperty(exports, 'getParsedTypeScriptConfig', {
170
- enumerable: true,
171
- get: function () {
172
- return getParsedTypeScriptConfig;
173
- }
174
- });
175
- Object.defineProperty(exports, 'getTsconfigFilePath', {
176
- enumerable: true,
177
- get: function () {
178
- return getTsconfigFilePath;
179
- }
180
- });
181
- Object.defineProperty(exports, 'isIncludeMatchFound', {
182
- enumerable: true,
183
- get: function () {
184
- return isIncludeMatchFound;
185
- }
186
- });
187
- Object.defineProperty(exports, 'isMatchFound', {
188
- enumerable: true,
189
- get: function () {
190
- return isMatchFound;
191
- }
192
- });
193
- Object.defineProperty(exports, 'tryTsconfigFilePath', {
194
- enumerable: true,
195
- get: function () {
196
- return tryTsconfigFilePath;
197
- }
198
- });
@@ -1,13 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_tsconfig = require('../tsconfig-DeyWQC2N.cjs');
3
- const require_ts_morph = require('../ts-morph-BaLPVAdB.cjs');
4
-
5
- exports.VirtualFileSystemHost = require_ts_morph.VirtualFileSystemHost;
6
- exports.createProgram = require_ts_morph.createProgram;
7
- exports.findIncludeMatch = require_tsconfig.findIncludeMatch;
8
- exports.findMatch = require_tsconfig.findMatch;
9
- exports.getParsedTypeScriptConfig = require_tsconfig.getParsedTypeScriptConfig;
10
- exports.getTsconfigFilePath = require_tsconfig.getTsconfigFilePath;
11
- exports.isIncludeMatchFound = require_tsconfig.isIncludeMatchFound;
12
- exports.isMatchFound = require_tsconfig.isMatchFound;
13
- exports.tryTsconfigFilePath = require_tsconfig.tryTsconfigFilePath;
@@ -1,106 +0,0 @@
1
- import { Context, ParsedTypeScriptConfig, TSConfig } from "@powerlines/core";
2
- import { FileSystemHost, InMemoryFileSystemHost, Project, ProjectOptions, RuntimeDirEntry } from "ts-morph";
3
- import { FilterPattern } from "@stryke/types/file";
4
- import ts from "typescript";
5
-
6
- //#region src/typescript/ts-morph.d.ts
7
- declare class VirtualFileSystemHost extends InMemoryFileSystemHost implements FileSystemHost {
8
- #private;
9
- constructor(context: Context);
10
- deleteSync(path: string): void;
11
- readDirSync(dirPath: string): RuntimeDirEntry[];
12
- readFile(filePath: string): Promise<string>;
13
- readFileSync(filePath: string): string;
14
- writeFile(filePath: string, fileText: string): Promise<void>;
15
- writeFileSync(filePath: string, fileText: string): void;
16
- mkdir(dirPath: string): Promise<void>;
17
- mkdirSync(dirPath: string): void;
18
- move(srcPath: string, destPath: string): Promise<void>;
19
- moveSync(srcPath: string, destPath: string): void;
20
- copy(srcPath: string, destPath: string): Promise<void>;
21
- copySync(srcPath: string, destPath: string): void;
22
- fileExists(filePath: string): Promise<boolean>;
23
- fileExistsSync(filePath: string): boolean;
24
- directoryExists(dirPath: string): Promise<boolean>;
25
- directoryExistsSync(dirPath: string): boolean;
26
- realpathSync(path: string): string;
27
- getCurrentDirectory(): string;
28
- glob(patterns: ReadonlyArray<string>): Promise<string[]>;
29
- globSync(patterns: ReadonlyArray<string>): string[];
30
- }
31
- /**
32
- * Create a ts-morph {@link Project} instance used for type reflection and module manipulation during processing
33
- *
34
- * @param context - The Powerlines context
35
- * @returns A ts-morph {@link Project} instance
36
- */
37
- declare function createProgram(context: Context, override: Partial<ProjectOptions>): Project;
38
- //#endregion
39
- //#region src/typescript/tsconfig.d.ts
40
- /**
41
- * Get the path to the tsconfig.json file.
42
- *
43
- * @param workspaceRoot - The root directory of the workspace.
44
- * @param projectRoot - The root directory of the project.
45
- * @param tsconfig - The path to the tsconfig.json file.
46
- * @returns The absolute path to the tsconfig.json file.
47
- * @throws If the tsconfig.json file does not exist.
48
- */
49
- declare function getTsconfigFilePath(workspaceRoot: string, projectRoot: string, tsconfig?: string): string;
50
- /**
51
- * Get the path to the tsconfig.json file.
52
- *
53
- * @param workspaceRoot - The root directory of the workspace.
54
- * @param projectRoot - The root directory of the project.
55
- * @param tsconfig - The path to the tsconfig.json file.
56
- * @returns The absolute path to the tsconfig.json file.
57
- * @throws If the tsconfig.json file does not exist.
58
- */
59
- declare function tryTsconfigFilePath(workspaceRoot: string, projectRoot: string, tsconfig: string): string | undefined;
60
- /**
61
- * Check if the TypeScript configuration type matches any of the provided types.
62
- *
63
- * @param tsconfigType - The type from the TypeScript configuration.
64
- * @param types - An array of type names to check against.
65
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
66
- */
67
- declare function findMatch(tsconfigType: string | RegExp | null, types: (string | RegExp | null)[], extensions?: string[]): string | RegExp | null | undefined;
68
- /**
69
- * Check if the TypeScript configuration type matches any of the provided types.
70
- *
71
- * @param tsconfigType - The type from the TypeScript configuration.
72
- * @param types - An array of type names to check against.
73
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
74
- */
75
- declare function findIncludeMatch(tsconfigType: string | RegExp | null, types: (string | RegExp | null)[]): string | RegExp | null | undefined;
76
- /**
77
- * Check if the TypeScript configuration type matches any of the provided types.
78
- *
79
- * @param tsconfigType - The type from the TypeScript configuration.
80
- * @param types - An array of type names to check against.
81
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
82
- */
83
- declare function isMatchFound(tsconfigType: string | RegExp | null, types: (string | RegExp | null)[]): boolean;
84
- /**
85
- * Check if the TypeScript configuration type matches any of the provided types.
86
- *
87
- * @param tsconfigType - The type from the TypeScript configuration.
88
- * @param types - An array of type names to check against.
89
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
90
- */
91
- declare function isIncludeMatchFound(tsconfigType: FilterPattern, types: FilterPattern[]): boolean;
92
- /**
93
- * Get the parsed TypeScript configuration.
94
- *
95
- * @param workspaceRoot - The root directory of the workspace.
96
- * @param projectRoot - The root directory of the project.
97
- * @param tsconfig - The path to the tsconfig.json file.
98
- * @param tsconfigRaw - The raw tsconfig.json content.
99
- * @param originalTsconfigJson - The original tsconfig.json content.
100
- * @param host - The TypeScript parse config host.
101
- * @returns The resolved TypeScript configuration.
102
- */
103
- declare function getParsedTypeScriptConfig(workspaceRoot: string, projectRoot: string, tsconfig?: string, tsconfigRaw?: TSConfig, originalTsconfigJson?: TSConfig, host?: ts.ParseConfigHost): ParsedTypeScriptConfig;
104
- //#endregion
105
- export { VirtualFileSystemHost, createProgram, findIncludeMatch, findMatch, getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound, isMatchFound, tryTsconfigFilePath };
106
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
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,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,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,106 +0,0 @@
1
- import ts from "typescript";
2
- import { FileSystemHost, InMemoryFileSystemHost, Project, ProjectOptions, RuntimeDirEntry } from "ts-morph";
3
- import { Context, ParsedTypeScriptConfig, TSConfig } from "@powerlines/core";
4
- import { FilterPattern } from "@stryke/types/file";
5
-
6
- //#region src/typescript/ts-morph.d.ts
7
- declare class VirtualFileSystemHost extends InMemoryFileSystemHost implements FileSystemHost {
8
- #private;
9
- constructor(context: Context);
10
- deleteSync(path: string): void;
11
- readDirSync(dirPath: string): RuntimeDirEntry[];
12
- readFile(filePath: string): Promise<string>;
13
- readFileSync(filePath: string): string;
14
- writeFile(filePath: string, fileText: string): Promise<void>;
15
- writeFileSync(filePath: string, fileText: string): void;
16
- mkdir(dirPath: string): Promise<void>;
17
- mkdirSync(dirPath: string): void;
18
- move(srcPath: string, destPath: string): Promise<void>;
19
- moveSync(srcPath: string, destPath: string): void;
20
- copy(srcPath: string, destPath: string): Promise<void>;
21
- copySync(srcPath: string, destPath: string): void;
22
- fileExists(filePath: string): Promise<boolean>;
23
- fileExistsSync(filePath: string): boolean;
24
- directoryExists(dirPath: string): Promise<boolean>;
25
- directoryExistsSync(dirPath: string): boolean;
26
- realpathSync(path: string): string;
27
- getCurrentDirectory(): string;
28
- glob(patterns: ReadonlyArray<string>): Promise<string[]>;
29
- globSync(patterns: ReadonlyArray<string>): string[];
30
- }
31
- /**
32
- * Create a ts-morph {@link Project} instance used for type reflection and module manipulation during processing
33
- *
34
- * @param context - The Powerlines context
35
- * @returns A ts-morph {@link Project} instance
36
- */
37
- declare function createProgram(context: Context, override: Partial<ProjectOptions>): Project;
38
- //#endregion
39
- //#region src/typescript/tsconfig.d.ts
40
- /**
41
- * Get the path to the tsconfig.json file.
42
- *
43
- * @param workspaceRoot - The root directory of the workspace.
44
- * @param projectRoot - The root directory of the project.
45
- * @param tsconfig - The path to the tsconfig.json file.
46
- * @returns The absolute path to the tsconfig.json file.
47
- * @throws If the tsconfig.json file does not exist.
48
- */
49
- declare function getTsconfigFilePath(workspaceRoot: string, projectRoot: string, tsconfig?: string): string;
50
- /**
51
- * Get the path to the tsconfig.json file.
52
- *
53
- * @param workspaceRoot - The root directory of the workspace.
54
- * @param projectRoot - The root directory of the project.
55
- * @param tsconfig - The path to the tsconfig.json file.
56
- * @returns The absolute path to the tsconfig.json file.
57
- * @throws If the tsconfig.json file does not exist.
58
- */
59
- declare function tryTsconfigFilePath(workspaceRoot: string, projectRoot: string, tsconfig: string): string | undefined;
60
- /**
61
- * Check if the TypeScript configuration type matches any of the provided types.
62
- *
63
- * @param tsconfigType - The type from the TypeScript configuration.
64
- * @param types - An array of type names to check against.
65
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
66
- */
67
- declare function findMatch(tsconfigType: string | RegExp | null, types: (string | RegExp | null)[], extensions?: string[]): string | RegExp | null | undefined;
68
- /**
69
- * Check if the TypeScript configuration type matches any of the provided types.
70
- *
71
- * @param tsconfigType - The type from the TypeScript configuration.
72
- * @param types - An array of type names to check against.
73
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
74
- */
75
- declare function findIncludeMatch(tsconfigType: string | RegExp | null, types: (string | RegExp | null)[]): string | RegExp | null | undefined;
76
- /**
77
- * Check if the TypeScript configuration type matches any of the provided types.
78
- *
79
- * @param tsconfigType - The type from the TypeScript configuration.
80
- * @param types - An array of type names to check against.
81
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
82
- */
83
- declare function isMatchFound(tsconfigType: string | RegExp | null, types: (string | RegExp | null)[]): boolean;
84
- /**
85
- * Check if the TypeScript configuration type matches any of the provided types.
86
- *
87
- * @param tsconfigType - The type from the TypeScript configuration.
88
- * @param types - An array of type names to check against.
89
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
90
- */
91
- declare function isIncludeMatchFound(tsconfigType: FilterPattern, types: FilterPattern[]): boolean;
92
- /**
93
- * Get the parsed TypeScript configuration.
94
- *
95
- * @param workspaceRoot - The root directory of the workspace.
96
- * @param projectRoot - The root directory of the project.
97
- * @param tsconfig - The path to the tsconfig.json file.
98
- * @param tsconfigRaw - The raw tsconfig.json content.
99
- * @param originalTsconfigJson - The original tsconfig.json content.
100
- * @param host - The TypeScript parse config host.
101
- * @returns The resolved TypeScript configuration.
102
- */
103
- declare function getParsedTypeScriptConfig(workspaceRoot: string, projectRoot: string, tsconfig?: string, tsconfigRaw?: TSConfig, originalTsconfigJson?: TSConfig, host?: ts.ParseConfigHost): ParsedTypeScriptConfig;
104
- //#endregion
105
- export { VirtualFileSystemHost, createProgram, findIncludeMatch, findMatch, getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound, isMatchFound, tryTsconfigFilePath };
106
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
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,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 +0,0 @@
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-Cstsoprg.mjs";
2
- import { n as createProgram, t as VirtualFileSystemHost } from "../ts-morph-D0CaA37w.mjs";
3
-
4
- export { VirtualFileSystemHost, createProgram, findIncludeMatch, findMatch, getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound, isMatchFound, tryTsconfigFilePath };