crankscript 0.17.0 → 0.18.0-beta.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 (284) hide show
  1. package/CHANGELOG.md +11 -5
  2. package/assets/ImportMap/ImportMap.js +26 -65
  3. package/assets/ImportMap/ImportMap.js.map +1 -1
  4. package/assets/ImportMap/index.js +3 -6
  5. package/assets/ImportMap/index.js.map +1 -1
  6. package/assets/beforeEmit/getBeforeEmit.js +11 -16
  7. package/assets/beforeEmit/getBeforeEmit.js.map +1 -1
  8. package/assets/beforeEmit/index.js +3 -6
  9. package/assets/beforeEmit/index.js.map +1 -1
  10. package/assets/beforeEmit/withAutomaticImportWarning.js +4 -11
  11. package/assets/beforeEmit/withAutomaticImportWarning.js.map +1 -1
  12. package/assets/index.js +18 -28
  13. package/assets/index.js.map +1 -1
  14. package/assets/transformCallExpression/getTransformCallExpression.js +66 -18
  15. package/assets/transformCallExpression/getTransformCallExpression.js.map +1 -1
  16. package/assets/transformCallExpression/index.js +3 -6
  17. package/assets/transformCallExpression/index.js.map +1 -1
  18. package/assets/transformClassDeclaration/createClasCall.js +11 -24
  19. package/assets/transformClassDeclaration/createClasCall.js.map +1 -1
  20. package/assets/transformClassDeclaration/getExportedClassDeclarationStatements.js +14 -15
  21. package/assets/transformClassDeclaration/getExportedClassDeclarationStatements.js.map +1 -1
  22. package/assets/transformClassDeclaration/getTransformClassDeclaration.js +47 -43
  23. package/assets/transformClassDeclaration/getTransformClassDeclaration.js.map +1 -1
  24. package/assets/transformClassDeclaration/index.js +3 -6
  25. package/assets/transformClassDeclaration/index.js.map +1 -1
  26. package/assets/transformClassDeclaration/transformConstructor.js +44 -56
  27. package/assets/transformClassDeclaration/transformConstructor.js.map +1 -1
  28. package/assets/transformClassDeclaration/transformMethodDeclaration.js +12 -20
  29. package/assets/transformClassDeclaration/transformMethodDeclaration.js.map +1 -1
  30. package/assets/transformClassDeclaration/transformPropertyName.js +14 -19
  31. package/assets/transformClassDeclaration/transformPropertyName.js.map +1 -1
  32. package/assets/transformExportDeclaration/getTransformExportDeclaration.d.ts +6 -0
  33. package/assets/transformExportDeclaration/getTransformExportDeclaration.js +52 -0
  34. package/assets/transformExportDeclaration/getTransformExportDeclaration.js.map +1 -0
  35. package/assets/transformNewExpression/index.js +3 -6
  36. package/assets/transformNewExpression/index.js.map +1 -1
  37. package/assets/transformNewExpression/isBuiltinNewExpression.js +11 -15
  38. package/assets/transformNewExpression/isBuiltinNewExpression.js.map +1 -1
  39. package/assets/transformNewExpression/transformNewExpression.js +12 -23
  40. package/assets/transformNewExpression/transformNewExpression.js.map +1 -1
  41. package/assets/transformPropertyAccessExpression/a.js +24 -0
  42. package/assets/transformPropertyAccessExpression/a.js.map +1 -0
  43. package/assets/transformPropertyAccessExpression/getTransformPropertyAccessExpression.js +6 -13
  44. package/assets/transformPropertyAccessExpression/getTransformPropertyAccessExpression.js.map +1 -1
  45. package/assets/transformPropertyAccessExpression/index.js +3 -6
  46. package/assets/transformPropertyAccessExpression/index.js.map +1 -1
  47. package/assets/transformSuperExpression/index.js +3 -6
  48. package/assets/transformSuperExpression/index.js.map +1 -1
  49. package/assets/transformSuperExpression/transformSuperExpression.js +8 -16
  50. package/assets/transformSuperExpression/transformSuperExpression.js.map +1 -1
  51. package/assets/types.js +1 -4
  52. package/assets/types.js.map +1 -1
  53. package/package.json +8 -5
  54. package/src/commands/CompileCommand/CompileCommand.d.ts +1 -1
  55. package/src/commands/CompileCommand/CompileCommand.js +3 -10
  56. package/src/commands/CompileCommand/CompileCommand.js.map +1 -1
  57. package/src/commands/CompileCommand/components/Compile.d.ts +1 -1
  58. package/src/commands/CompileCommand/components/Compile.js +3 -7
  59. package/src/commands/CompileCommand/components/Compile.js.map +1 -1
  60. package/src/commands/CompileCommand/fn/getPdcPathFromEnvironment.d.ts +1 -1
  61. package/src/commands/CompileCommand/fn/getPdcPathFromEnvironment.js +1 -2
  62. package/src/commands/CompileCommand/fn/getPdcPathFromEnvironment.js.map +1 -1
  63. package/src/commands/CompileCommand/hooks/task/compile.d.ts +5 -2
  64. package/src/commands/CompileCommand/hooks/task/compile.js +10 -9
  65. package/src/commands/CompileCommand/hooks/task/compile.js.map +1 -1
  66. package/src/commands/CompileCommand/hooks/useCompileTasks.d.ts +5 -2
  67. package/src/commands/CompileCommand/hooks/useCompileTasks.js +33 -30
  68. package/src/commands/CompileCommand/hooks/useCompileTasks.js.map +1 -1
  69. package/src/commands/CompileCommand/index.js +0 -1
  70. package/src/commands/CompileCommand/index.js.map +1 -1
  71. package/src/commands/DoctorCommand.js +5 -12
  72. package/src/commands/DoctorCommand.js.map +1 -1
  73. package/src/commands/EnvironmentAwareCommand/EnvironmentAwareCommand.d.ts +2 -2
  74. package/src/commands/EnvironmentAwareCommand/EnvironmentAwareCommand.js +30 -30
  75. package/src/commands/EnvironmentAwareCommand/EnvironmentAwareCommand.js.map +1 -1
  76. package/src/commands/EnvironmentAwareCommand/components/HealthReport.d.ts +1 -1
  77. package/src/commands/EnvironmentAwareCommand/components/HealthReport.js +14 -15
  78. package/src/commands/EnvironmentAwareCommand/components/HealthReport.js.map +1 -1
  79. package/src/commands/EnvironmentAwareCommand/contexts/CrankScriptContext.js +5 -10
  80. package/src/commands/EnvironmentAwareCommand/contexts/CrankScriptContext.js.map +1 -1
  81. package/src/commands/EnvironmentAwareCommand/index.js +0 -1
  82. package/src/commands/EnvironmentAwareCommand/index.js.map +1 -1
  83. package/src/commands/GenerateTypes/GenerateTypesCommand.js +14 -21
  84. package/src/commands/GenerateTypes/GenerateTypesCommand.js.map +1 -1
  85. package/src/commands/GenerateTypes/components/GenerateTypes.d.ts +1 -1
  86. package/src/commands/GenerateTypes/components/GenerateTypes.js +11 -15
  87. package/src/commands/GenerateTypes/components/GenerateTypes.js.map +1 -1
  88. package/src/commands/GenerateTypes/constants.js +0 -1
  89. package/src/commands/GenerateTypes/constants.js.map +1 -1
  90. package/src/commands/GenerateTypes/fn/getApiDefinitions.d.ts +1 -1
  91. package/src/commands/GenerateTypes/fn/getApiDefinitions.js +12 -14
  92. package/src/commands/GenerateTypes/fn/getApiDefinitions.js.map +1 -1
  93. package/src/commands/GenerateTypes/fn/getDescriptionsFromHtml.d.ts +1 -1
  94. package/src/commands/GenerateTypes/fn/getDescriptionsFromHtml.js +38 -30
  95. package/src/commands/GenerateTypes/fn/getDescriptionsFromHtml.js.map +1 -1
  96. package/src/commands/GenerateTypes/fn/getFunctionTypeOverride.js +5 -4
  97. package/src/commands/GenerateTypes/fn/getFunctionTypeOverride.js.map +1 -1
  98. package/src/commands/GenerateTypes/fn/getHtmlForVersion.js +6 -9
  99. package/src/commands/GenerateTypes/fn/getHtmlForVersion.js.map +1 -1
  100. package/src/commands/GenerateTypes/fn/parseFunctionSignature.js +13 -10
  101. package/src/commands/GenerateTypes/fn/parseFunctionSignature.js.map +1 -1
  102. package/src/commands/GenerateTypes/hooks/useFetchHtml.js +10 -12
  103. package/src/commands/GenerateTypes/hooks/useFetchHtml.js.map +1 -1
  104. package/src/commands/GenerateTypes/hooks/useFormatTypeFile.js +23 -29
  105. package/src/commands/GenerateTypes/hooks/useFormatTypeFile.js.map +1 -1
  106. package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.d.ts +2 -2
  107. package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.js +44 -75
  108. package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.js.map +1 -1
  109. package/src/commands/GenerateTypes/hooks/useGetVersion.d.ts +1 -1
  110. package/src/commands/GenerateTypes/hooks/useGetVersion.js +19 -19
  111. package/src/commands/GenerateTypes/hooks/useGetVersion.js.map +1 -1
  112. package/src/commands/GenerateTypes/hooks/useParseDocumentation.d.ts +1 -1
  113. package/src/commands/GenerateTypes/hooks/useParseDocumentation.js +10 -12
  114. package/src/commands/GenerateTypes/hooks/useParseDocumentation.js.map +1 -1
  115. package/src/commands/GenerateTypes/index.js +0 -1
  116. package/src/commands/GenerateTypes/index.js.map +1 -1
  117. package/src/commands/GenerateTypes/types.d.ts +1 -1
  118. package/src/commands/GenerateTypes/types.js +1 -2
  119. package/src/commands/GenerateTypes/types.js.map +1 -1
  120. package/src/commands/GenerateTypes/utils/createTypeProvider.d.ts +2 -2
  121. package/src/commands/GenerateTypes/utils/createTypeProvider.js +63 -85
  122. package/src/commands/GenerateTypes/utils/createTypeProvider.js.map +1 -1
  123. package/src/commands/GenerateTypes/utils/functionTypeOverrides.d.ts +1 -1
  124. package/src/commands/GenerateTypes/utils/functionTypeOverrides.js +6 -7
  125. package/src/commands/GenerateTypes/utils/functionTypeOverrides.js.map +1 -1
  126. package/src/commands/NewCommand/NewCommand.js +9 -17
  127. package/src/commands/NewCommand/NewCommand.js.map +1 -1
  128. package/src/commands/NewCommand/components/New.d.ts +1 -1
  129. package/src/commands/NewCommand/components/New.js +19 -25
  130. package/src/commands/NewCommand/components/New.js.map +1 -1
  131. package/src/commands/NewLibCommand/NewLibCommand.js +9 -17
  132. package/src/commands/NewLibCommand/NewLibCommand.js.map +1 -1
  133. package/src/commands/NewLibCommand/components/NewLib.d.ts +1 -1
  134. package/src/commands/NewLibCommand/components/NewLib.js +19 -25
  135. package/src/commands/NewLibCommand/components/NewLib.js.map +1 -1
  136. package/src/commands/NewLibCommand/index.js +0 -1
  137. package/src/commands/NewLibCommand/index.js.map +1 -1
  138. package/src/commands/RenderableCommand.d.ts +1 -1
  139. package/src/commands/RenderableCommand.js +5 -3
  140. package/src/commands/RenderableCommand.js.map +1 -1
  141. package/src/commands/SimulatorCommand/SimulatorCommand.d.ts +1 -1
  142. package/src/commands/SimulatorCommand/SimulatorCommand.js +23 -38
  143. package/src/commands/SimulatorCommand/SimulatorCommand.js.map +1 -1
  144. package/src/commands/SimulatorCommand/components/Simulator.d.ts +3 -2
  145. package/src/commands/SimulatorCommand/components/Simulator.js +19 -17
  146. package/src/commands/SimulatorCommand/components/Simulator.js.map +1 -1
  147. package/src/commands/SimulatorCommand/components/TemporaryFolderCreator.d.ts +1 -1
  148. package/src/commands/SimulatorCommand/components/TemporaryFolderCreator.js +15 -22
  149. package/src/commands/SimulatorCommand/components/TemporaryFolderCreator.js.map +1 -1
  150. package/src/commands/SimulatorCommand/fn/createTemporaryFolderPathFromEntryFile.js +8 -6
  151. package/src/commands/SimulatorCommand/fn/createTemporaryFolderPathFromEntryFile.js.map +1 -1
  152. package/src/commands/SimulatorCommand/fn/getSimulatorPathFromEnvironment.d.ts +1 -1
  153. package/src/commands/SimulatorCommand/fn/getSimulatorPathFromEnvironment.js +1 -2
  154. package/src/commands/SimulatorCommand/fn/getSimulatorPathFromEnvironment.js.map +1 -1
  155. package/src/commands/SimulatorCommand/hooks/useFileWatcher.js +10 -10
  156. package/src/commands/SimulatorCommand/hooks/useFileWatcher.js.map +1 -1
  157. package/src/commands/SimulatorCommand/hooks/useSimulatorTasks.d.ts +6 -2
  158. package/src/commands/SimulatorCommand/hooks/useSimulatorTasks.js +52 -50
  159. package/src/commands/SimulatorCommand/hooks/useSimulatorTasks.js.map +1 -1
  160. package/src/commands/SimulatorCommand/index.js +0 -1
  161. package/src/commands/SimulatorCommand/index.js.map +1 -1
  162. package/src/commands/TestCommand/TestCommand.d.ts +12 -0
  163. package/src/commands/TestCommand/TestCommand.js +32 -0
  164. package/src/commands/TestCommand/TestCommand.js.map +1 -0
  165. package/src/commands/TestCommand/components/Test.d.ts +9 -0
  166. package/src/commands/TestCommand/components/Test.js +73 -0
  167. package/src/commands/TestCommand/components/Test.js.map +1 -0
  168. package/src/commands/TestCommand/components/TestLine.d.ts +10 -0
  169. package/src/commands/TestCommand/components/TestLine.js +11 -0
  170. package/src/commands/TestCommand/components/TestLine.js.map +1 -0
  171. package/src/commands/TestCommand/components/TestResult.d.ts +8 -0
  172. package/src/commands/TestCommand/components/TestResult.js +21 -0
  173. package/src/commands/TestCommand/components/TestResult.js.map +1 -0
  174. package/src/commands/TestCommand/components/TestSuite.d.ts +8 -0
  175. package/src/commands/TestCommand/components/TestSuite.js +60 -0
  176. package/src/commands/TestCommand/components/TestSuite.js.map +1 -0
  177. package/src/commands/TestCommand/components/TestSummary.d.ts +7 -0
  178. package/src/commands/TestCommand/components/TestSummary.js +9 -0
  179. package/src/commands/TestCommand/components/TestSummary.js.map +1 -0
  180. package/src/commands/TestCommand/hooks/useTestFiles.d.ts +3 -0
  181. package/src/commands/TestCommand/hooks/useTestFiles.js +8 -0
  182. package/src/commands/TestCommand/hooks/useTestFiles.js.map +1 -0
  183. package/src/commands/TestCommand/hooks/useTestServer.d.ts +5 -0
  184. package/src/commands/TestCommand/hooks/useTestServer.js +26 -0
  185. package/src/commands/TestCommand/hooks/useTestServer.js.map +1 -0
  186. package/src/commands/TestCommand/hooks/useTestTasks.d.ts +14 -0
  187. package/src/commands/TestCommand/hooks/useTestTasks.js +61 -0
  188. package/src/commands/TestCommand/hooks/useTestTasks.js.map +1 -0
  189. package/src/commands/TestCommand/index.d.ts +1 -0
  190. package/src/commands/TestCommand/index.js +2 -0
  191. package/src/commands/TestCommand/index.js.map +1 -0
  192. package/src/commands/TestCommand/server/TestServer.d.ts +72 -0
  193. package/src/commands/TestCommand/server/TestServer.js +249 -0
  194. package/src/commands/TestCommand/server/TestServer.js.map +1 -0
  195. package/src/commands/TestCommand/types.d.ts +4 -0
  196. package/src/commands/TestCommand/types.js +6 -0
  197. package/src/commands/TestCommand/types.js.map +1 -0
  198. package/src/commands/TestCommand/utils/formatTestError.d.ts +1 -0
  199. package/src/commands/TestCommand/utils/formatTestError.js +7 -0
  200. package/src/commands/TestCommand/utils/formatTestError.js.map +1 -0
  201. package/src/commands/TranspileCommand/TranspileCommand.d.ts +1 -0
  202. package/src/commands/TranspileCommand/TranspileCommand.js +23 -28
  203. package/src/commands/TranspileCommand/TranspileCommand.js.map +1 -1
  204. package/src/commands/TranspileCommand/components/Transpile.d.ts +4 -3
  205. package/src/commands/TranspileCommand/components/Transpile.js +4 -7
  206. package/src/commands/TranspileCommand/components/Transpile.js.map +1 -1
  207. package/src/commands/TranspileCommand/fn/getErrorMessage.d.ts +1 -1
  208. package/src/commands/TranspileCommand/fn/getErrorMessage.js +5 -6
  209. package/src/commands/TranspileCommand/fn/getErrorMessage.js.map +1 -1
  210. package/src/commands/TranspileCommand/fn/transpile.d.ts +4 -3
  211. package/src/commands/TranspileCommand/fn/transpile.js +21 -24
  212. package/src/commands/TranspileCommand/fn/transpile.js.map +1 -1
  213. package/src/commands/TranspileCommand/fn/validateEntryPoint.d.ts +1 -1
  214. package/src/commands/TranspileCommand/fn/validateEntryPoint.js +2 -3
  215. package/src/commands/TranspileCommand/fn/validateEntryPoint.js.map +1 -1
  216. package/src/commands/TranspileCommand/fn/validateExitPoint.d.ts +1 -1
  217. package/src/commands/TranspileCommand/fn/validateExitPoint.js +6 -6
  218. package/src/commands/TranspileCommand/fn/validateExitPoint.js.map +1 -1
  219. package/src/commands/TranspileCommand/hooks/useTranspileTasks.d.ts +6 -5
  220. package/src/commands/TranspileCommand/hooks/useTranspileTasks.js +35 -33
  221. package/src/commands/TranspileCommand/hooks/useTranspileTasks.js.map +1 -1
  222. package/src/commands/TranspileCommand/index.js +0 -1
  223. package/src/commands/TranspileCommand/index.js.map +1 -1
  224. package/src/commands/TranspileCommand/model/ValidatedEntryPoint.js +1 -2
  225. package/src/commands/TranspileCommand/model/ValidatedEntryPoint.js.map +1 -1
  226. package/src/commands/TranspileCommand/model/ValidatedExitPoint.js +1 -2
  227. package/src/commands/TranspileCommand/model/ValidatedExitPoint.js.map +1 -1
  228. package/src/commands/TranspileCommand/types.js +1 -2
  229. package/src/commands/TranspileCommand/types.js.map +1 -1
  230. package/src/components/CheckList/CheckList.d.ts +3 -2
  231. package/src/components/CheckList/CheckList.js +14 -21
  232. package/src/components/CheckList/CheckList.js.map +1 -1
  233. package/src/components/CheckList/Item.d.ts +3 -2
  234. package/src/components/CheckList/Item.js +47 -44
  235. package/src/components/CheckList/Item.js.map +1 -1
  236. package/src/components/CheckList/index.js +0 -1
  237. package/src/components/CheckList/index.js.map +1 -1
  238. package/src/components/ErrorBoundary.d.ts +14 -0
  239. package/src/components/ErrorBoundary.js +7 -13
  240. package/src/components/ErrorBoundary.js.map +1 -1
  241. package/src/components/Spinner.d.ts +1 -1
  242. package/src/components/Spinner.js +13 -18
  243. package/src/components/Spinner.js.map +1 -1
  244. package/src/constants.js +1 -6
  245. package/src/constants.js.map +1 -1
  246. package/src/environment/createEnvironment.d.ts +1 -1
  247. package/src/environment/createEnvironment.js +13 -16
  248. package/src/environment/createEnvironment.js.map +1 -1
  249. package/src/environment/dto/Environment.d.ts +1 -1
  250. package/src/environment/dto/Environment.js +1 -2
  251. package/src/environment/dto/Environment.js.map +1 -1
  252. package/src/environment/error/EnvironmentError.js +0 -1
  253. package/src/environment/error/EnvironmentError.js.map +1 -1
  254. package/src/environment/path/dto/PlaydateSdkPath.js +3 -4
  255. package/src/environment/path/dto/PlaydateSdkPath.js.map +1 -1
  256. package/src/environment/path/error/PlaydateSdkPathVariableNotSetError.js +1 -2
  257. package/src/environment/path/error/PlaydateSdkPathVariableNotSetError.js.map +1 -1
  258. package/src/environment/path/getPlaydateSdkPath.js +5 -3
  259. package/src/environment/path/getPlaydateSdkPath.js.map +1 -1
  260. package/src/index.js +7 -5
  261. package/src/index.js.map +1 -1
  262. package/src/types.d.ts +3 -3
  263. package/src/types.js +4 -5
  264. package/src/types.js.map +1 -1
  265. package/src/utils/appendExeOnWindows.js +1 -2
  266. package/src/utils/appendExeOnWindows.js.map +1 -1
  267. package/src/utils/dirname.js +0 -1
  268. package/src/utils/dirname.js.map +1 -1
  269. package/src/utils/platform.js +0 -1
  270. package/src/utils/platform.js.map +1 -1
  271. package/src/commands/TranspileCommand/fn/_tests/test-abstract/src/index.js +0 -4
  272. package/src/commands/TranspileCommand/fn/_tests/test-abstract/src/index.js.map +0 -1
  273. package/src/commands/TranspileCommand/fn/_tests/test-automatic-imports/src/index.js +0 -3
  274. package/src/commands/TranspileCommand/fn/_tests/test-automatic-imports/src/index.js.map +0 -1
  275. package/src/commands/TranspileCommand/fn/_tests/test-builtins/src/index.js +0 -4
  276. package/src/commands/TranspileCommand/fn/_tests/test-builtins/src/index.js.map +0 -1
  277. package/src/commands/TranspileCommand/fn/_tests/test-default-parameters/src/index.js +0 -17
  278. package/src/commands/TranspileCommand/fn/_tests/test-default-parameters/src/index.js.map +0 -1
  279. package/src/commands/TranspileCommand/fn/_tests/test-implicit-constructor/src/index.js +0 -10
  280. package/src/commands/TranspileCommand/fn/_tests/test-implicit-constructor/src/index.js.map +0 -1
  281. package/src/commands/TranspileCommand/fn/_tests/test-static/src/index.js +0 -18
  282. package/src/commands/TranspileCommand/fn/_tests/test-static/src/index.js.map +0 -1
  283. package/src/commands/TranspileCommand/fn/_tests/test-super/src/index.js +0 -24
  284. package/src/commands/TranspileCommand/fn/_tests/test-super/src/index.js.map +0 -1
@@ -1,9 +1,11 @@
1
- import { createHash } from 'crypto';
2
- import { tmpdir } from 'os';
3
- import { join } from 'path';
4
- export const createTemporaryFolderPathFromEntryFile = (entryFilePath)=>{
5
- const hash = createHash('sha256').update(entryFilePath).digest('hex').slice(0, 8);
1
+ import { createHash } from 'node:crypto';
2
+ import { tmpdir } from 'node:os';
3
+ import { join } from 'node:path';
4
+ export const createTemporaryFolderPathFromEntryFile = (entryFilePath) => {
5
+ const hash = createHash('sha256')
6
+ .update(entryFilePath)
7
+ .digest('hex')
8
+ .slice(0, 8);
6
9
  return join(tmpdir(), 'crankscript', `run-${hash}`);
7
10
  };
8
-
9
11
  //# sourceMappingURL=createTemporaryFolderPathFromEntryFile.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../libs/cli/src/commands/SimulatorCommand/fn/createTemporaryFolderPathFromEntryFile.ts"],"sourcesContent":["import { createHash } from 'crypto';\nimport { tmpdir } from 'os';\nimport { join } from 'path';\n\nexport const createTemporaryFolderPathFromEntryFile = (\n entryFilePath: string,\n) => {\n const hash = createHash('sha256')\n .update(entryFilePath)\n .digest('hex')\n .slice(0, 8);\n\n return join(tmpdir(), 'crankscript', `run-${hash}`);\n};\n"],"names":["createHash","tmpdir","join","createTemporaryFolderPathFromEntryFile","entryFilePath","hash","update","digest","slice"],"rangeMappings":";;;;;;","mappings":"AAAA,SAASA,UAAU,QAAQ,SAAS;AACpC,SAASC,MAAM,QAAQ,KAAK;AAC5B,SAASC,IAAI,QAAQ,OAAO;AAE5B,OAAO,MAAMC,yCAAyC,CAClDC;IAEA,MAAMC,OAAOL,WAAW,UACnBM,MAAM,CAACF,eACPG,MAAM,CAAC,OACPC,KAAK,CAAC,GAAG;IAEd,OAAON,KAAKD,UAAU,eAAe,CAAC,IAAI,EAAEI,KAAK,CAAC;AACtD,EAAE"}
1
+ {"version":3,"file":"createTemporaryFolderPathFromEntryFile.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/commands/SimulatorCommand/fn/createTemporaryFolderPathFromEntryFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAClD,aAAqB,EACvB,EAAE;IACA,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC;SAC5B,MAAM,CAAC,aAAa,CAAC;SACrB,MAAM,CAAC,KAAK,CAAC;SACb,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAEjB,OAAO,IAAI,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;AACxD,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- import { Environment } from '../../../environment/dto/Environment.js';
1
+ import type { Environment } from '../../../environment/dto/Environment.js';
2
2
  export declare const getSimulatorPathFromEnvironment: (environment: Environment) => string;
@@ -1,7 +1,6 @@
1
1
  import { join } from 'node:path';
2
2
  import { appendExeOnWindows } from '../../../utils/appendExeOnWindows.js';
3
- export const getSimulatorPathFromEnvironment = (environment)=>{
3
+ export const getSimulatorPathFromEnvironment = (environment) => {
4
4
  return join(environment.sdkPath.path, 'bin', appendExeOnWindows('PlaydateSimulator'));
5
5
  };
6
-
7
6
  //# sourceMappingURL=getSimulatorPathFromEnvironment.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../libs/cli/src/commands/SimulatorCommand/fn/getSimulatorPathFromEnvironment.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { Environment } from '@/cli/environment/dto/Environment.js';\nimport { appendExeOnWindows } from '@/cli/utils/appendExeOnWindows.js';\n\nexport const getSimulatorPathFromEnvironment = (environment: Environment) => {\n return join(\n environment.sdkPath.path,\n 'bin',\n appendExeOnWindows('PlaydateSimulator'),\n );\n};\n"],"names":["join","appendExeOnWindows","getSimulatorPathFromEnvironment","environment","sdkPath","path"],"rangeMappings":";;;;","mappings":"AAAA,SAASA,IAAI,QAAQ,YAAY;AAEjC,SAASC,kBAAkB,QAAQ,oCAAoC;AAEvE,OAAO,MAAMC,kCAAkC,CAACC;IAC5C,OAAOH,KACHG,YAAYC,OAAO,CAACC,IAAI,EACxB,OACAJ,mBAAmB;AAE3B,EAAE"}
1
+ {"version":3,"file":"getSimulatorPathFromEnvironment.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/commands/SimulatorCommand/fn/getSimulatorPathFromEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,WAAwB,EAAE,EAAE;IACxE,OAAO,IAAI,CACP,WAAW,CAAC,OAAO,CAAC,IAAI,EACxB,KAAK,EACL,kBAAkB,CAAC,mBAAmB,CAAC,CAC1C,CAAC;AACN,CAAC,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { watch } from 'chokidar';
2
2
  import { useEffect, useRef } from 'react';
3
- export const useFileWatcher = (options)=>{
3
+ export const useFileWatcher = (options) => {
4
4
  const watcher = useRef(null);
5
5
  const started = useRef(false);
6
- useEffect(()=>{
6
+ useEffect(() => {
7
7
  if (!options.enabled || started.current) {
8
8
  return;
9
9
  }
@@ -11,27 +11,27 @@ export const useFileWatcher = (options)=>{
11
11
  ignoreInitial: true,
12
12
  awaitWriteFinish: {
13
13
  stabilityThreshold: 200,
14
- pollInterval: 100
15
- }
14
+ pollInterval: 100,
15
+ },
16
16
  });
17
17
  if (options.additionalGlobs) {
18
18
  watcher.current.add(options.additionalGlobs);
19
19
  }
20
- watcher.current.on('change', ()=>{
20
+ watcher.current.on('change', () => {
21
21
  options.onChange();
22
22
  });
23
23
  started.current = true;
24
- return ()=>{
25
- var _watcher_current;
26
- (_watcher_current = watcher.current) == null ? void 0 : _watcher_current.close();
24
+ return () => {
25
+ var _a;
26
+ (_a = watcher.current) === null || _a === void 0 ? void 0 : _a.close();
27
27
  watcher.current = null;
28
28
  started.current = false;
29
29
  };
30
30
  }, [
31
31
  options.enabled,
32
32
  options.watchPath,
33
- options.onChange
33
+ options.onChange,
34
+ options.additionalGlobs,
34
35
  ]);
35
36
  };
36
-
37
37
  //# sourceMappingURL=useFileWatcher.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../libs/cli/src/commands/SimulatorCommand/hooks/useFileWatcher.ts"],"sourcesContent":["import { FSWatcher, watch } from 'chokidar';\nimport { useEffect, useRef } from 'react';\n\nexport const useFileWatcher = (options: {\n watchPath: string;\n additionalGlobs?: string[];\n onChange: () => void;\n enabled: boolean;\n}) => {\n const watcher = useRef<FSWatcher | null>(null);\n const started = useRef(false);\n\n useEffect(() => {\n if (!options.enabled || started.current) {\n return;\n }\n\n watcher.current = watch(options.watchPath, {\n ignoreInitial: true,\n awaitWriteFinish: {\n stabilityThreshold: 200,\n pollInterval: 100,\n },\n });\n\n if (options.additionalGlobs) {\n watcher.current.add(options.additionalGlobs);\n }\n\n watcher.current.on('change', () => {\n options.onChange();\n });\n\n started.current = true;\n\n return () => {\n watcher.current?.close();\n watcher.current = null;\n started.current = false;\n };\n }, [options.enabled, options.watchPath, options.onChange]);\n};\n"],"names":["watch","useEffect","useRef","useFileWatcher","options","watcher","started","enabled","current","watchPath","ignoreInitial","awaitWriteFinish","stabilityThreshold","pollInterval","additionalGlobs","add","on","onChange","close"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAAoBA,KAAK,QAAQ,WAAW;AAC5C,SAASC,SAAS,EAAEC,MAAM,QAAQ,QAAQ;AAE1C,OAAO,MAAMC,iBAAiB,CAACC;IAM3B,MAAMC,UAAUH,OAAyB;IACzC,MAAMI,UAAUJ,OAAO;IAEvBD,UAAU;QACN,IAAI,CAACG,QAAQG,OAAO,IAAID,QAAQE,OAAO,EAAE;YACrC;QACJ;QAEAH,QAAQG,OAAO,GAAGR,MAAMI,QAAQK,SAAS,EAAE;YACvCC,eAAe;YACfC,kBAAkB;gBACdC,oBAAoB;gBACpBC,cAAc;YAClB;QACJ;QAEA,IAAIT,QAAQU,eAAe,EAAE;YACzBT,QAAQG,OAAO,CAACO,GAAG,CAACX,QAAQU,eAAe;QAC/C;QAEAT,QAAQG,OAAO,CAACQ,EAAE,CAAC,UAAU;YACzBZ,QAAQa,QAAQ;QACpB;QAEAX,QAAQE,OAAO,GAAG;QAElB,OAAO;gBACHH;aAAAA,mBAAAA,QAAQG,OAAO,qBAAfH,iBAAiBa,KAAK;YACtBb,QAAQG,OAAO,GAAG;YAClBF,QAAQE,OAAO,GAAG;QACtB;IACJ,GAAG;QAACJ,QAAQG,OAAO;QAAEH,QAAQK,SAAS;QAAEL,QAAQa,QAAQ;KAAC;AAC7D,EAAE"}
1
+ {"version":3,"file":"useFileWatcher.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/commands/SimulatorCommand/hooks/useFileWatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,EAAE,MA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to/Environment.js';
1
+ import type { Environment } from '../../../environment/dto/Environment.js';
2
2
  interface Props {
3
3
  path: string;
4
4
  environment: Environment;
@@ -10,8 +10,12 @@ interface Props {
10
10
  gameOutputPath?: string;
11
11
  requireWithinProjectPath?: boolean;
12
12
  additionalGlobs?: string[];
13
+ targetName?: string;
14
+ sourceName?: string;
15
+ watchEntryFileOnly?: boolean;
16
+ preventAutoQuit?: boolean;
13
17
  }
14
- export declare const useSimulatorTasks: ({ path, environment, watchForChanges, recompileOnly, background, entryFile, luaOutputPath, gameOutputPath, requireWithinProjectPath, additionalGlobs, }: Props) => {
18
+ export declare const useSimulatorTasks: ({ path, environment, watchForChanges, recompileOnly, background, entryFile, luaOutputPath, gameOutputPath, requireWithinProjectPath, additionalGlobs, sourceName, targetName, watchEntryFileOnly, preventAutoQuit, }: Props) => {
15
19
  tasks: import("../../../types.js").CheckListItem<unknown>[];
16
20
  handleFinish: (hasFailure: boolean) => void;
17
21
  hasChanged: boolean;
@@ -1,109 +1,111 @@
1
1
  import { join } from 'node:path';
2
2
  import open from 'open';
3
- import { useCallback, useEffect, useMemo } from 'react';
4
- import { useState } from 'react';
5
- import { useRef } from 'react';
6
- import { isWindows } from '../../../utils/platform.js';
7
- import { isMac } from '../../../utils/platform.js';
8
- import { useFileWatcher } from './useFileWatcher.js';
3
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
4
+ import { isMac, isWindows } from '../../../utils/platform.js';
9
5
  import { getPdcPathFromEnvironment } from '../../CompileCommand/fn/getPdcPathFromEnvironment.js';
10
6
  import { useCompileTasks } from '../../CompileCommand/hooks/useCompileTasks.js';
11
7
  import { validateEntryPoint } from '../../TranspileCommand/fn/validateEntryPoint.js';
12
8
  import { validateExitPoint } from '../../TranspileCommand/fn/validateExitPoint.js';
13
9
  import { useTranspileTasks } from '../../TranspileCommand/hooks/useTranspileTasks.js';
14
- import { TranspileMode } from '../../TranspileCommand/types.js';
15
10
  import { getSimulatorPathFromEnvironment } from '../fn/getSimulatorPathFromEnvironment.js';
16
- export const useSimulatorTasks = ({ path, environment, watchForChanges, recompileOnly, background, entryFile, luaOutputPath, gameOutputPath, requireWithinProjectPath = true, additionalGlobs = [] })=>{
11
+ import { useFileWatcher } from './useFileWatcher.js';
12
+ export const useSimulatorTasks = ({ path, environment, watchForChanges, recompileOnly, background, entryFile, luaOutputPath, gameOutputPath, requireWithinProjectPath = true, additionalGlobs = [], sourceName, targetName, watchEntryFileOnly = false, preventAutoQuit = false, }) => {
17
13
  const [isWatching, setIsWatching] = useState(false);
18
14
  const [hasChanged, setHasChanged] = useState(false);
19
15
  const [hasChangedMessage, setHasChangedMessage] = useState(false);
20
16
  const [hasFailure, setHasFailure] = useState(false);
21
17
  const didRun = useRef(false);
22
- useEffect(()=>{
18
+ useEffect(() => {
23
19
  if (hasChanged) {
24
20
  setHasChanged(false);
25
21
  }
26
- }, [
27
- hasChanged,
28
- setHasChanged
29
- ]);
22
+ }, [hasChanged]);
30
23
  const transpileTasks = useTranspileTasks({
31
24
  entryPoint: validateEntryPoint({
32
25
  projectPath: path,
33
- entryFile: entryFile != null ? entryFile : join(path, 'src', 'index.ts'),
34
- requireWithinProjectPath
26
+ entryFile: entryFile !== null && entryFile !== void 0 ? entryFile : join(path, 'src', 'index.ts'),
27
+ requireWithinProjectPath,
35
28
  }),
36
29
  exitPoint: validateExitPoint({
37
30
  projectPath: path,
38
- exitFile: join(...luaOutputPath ? [
39
- luaOutputPath
40
- ] : [
41
- path,
42
- 'Source'
43
- ], 'main.lua'),
44
- requireWithinProjectPath
31
+ exitFile: join(...(luaOutputPath
32
+ ? [luaOutputPath, sourceName !== null && sourceName !== void 0 ? sourceName : 'Source']
33
+ : [path, sourceName !== null && sourceName !== void 0 ? sourceName : 'Source']), 'main.lua'),
34
+ requireWithinProjectPath,
45
35
  }),
46
- transpileMode: entryFile ? TranspileMode.File : TranspileMode.Project
47
36
  });
48
37
  const compileTasks = useCompileTasks({
49
38
  pdcPath: getPdcPathFromEnvironment(environment),
50
- outputPath: gameOutputPath
39
+ outputPath: gameOutputPath,
40
+ sourceName,
41
+ targetName,
42
+ path,
51
43
  });
52
- const handleFinish = useCallback((hasFailure)=>{
44
+ const handleFinish = useCallback((hasFailure) => {
53
45
  setHasFailure(hasFailure);
54
46
  if (didRun.current && recompileOnly) {
47
+ if (watchForChanges) {
48
+ setHasChangedMessage(false);
49
+ setIsWatching(true);
50
+ }
55
51
  return;
56
52
  }
57
53
  didRun.current = true;
58
- open(join(gameOutputPath != null ? gameOutputPath : process.cwd(), 'Game.pdx'), {
54
+ open(join(path, gameOutputPath !== null && gameOutputPath !== void 0 ? gameOutputPath : '', targetName !== null && targetName !== void 0 ? targetName : 'Game.pdx'), {
59
55
  background,
60
- app: isMac ? undefined : {
61
- name: getSimulatorPathFromEnvironment(environment)
62
- }
63
- }).then(()=>{
64
- if (!watchForChanges) {
56
+ app: isMac
57
+ ? undefined
58
+ : {
59
+ name: getSimulatorPathFromEnvironment(environment),
60
+ },
61
+ })
62
+ .then(() => {
63
+ if (!watchForChanges && !preventAutoQuit) {
65
64
  if (!isWindows) {
66
65
  process.exit();
67
66
  }
68
67
  setTimeout(process.exit, 1000);
69
- } else {
68
+ }
69
+ else {
70
+ setHasChangedMessage(false);
71
+ setIsWatching(true);
72
+ }
73
+ })
74
+ .catch(() => {
75
+ if (watchForChanges) {
70
76
  setHasChangedMessage(false);
71
77
  setIsWatching(true);
72
78
  }
73
79
  });
74
80
  }, [
75
- watchForChanges,
76
- recompileOnly,
77
- gameOutputPath,
81
+ background,
78
82
  environment,
79
- background
83
+ gameOutputPath,
84
+ path,
85
+ preventAutoQuit,
86
+ recompileOnly,
87
+ targetName,
88
+ watchForChanges,
80
89
  ]);
81
90
  useFileWatcher({
82
- watchPath: entryFile ? entryFile : join(path, 'src'),
91
+ watchPath: entryFile && watchEntryFileOnly ? entryFile : join(path, 'src'),
83
92
  enabled: isWatching,
84
- onChange: ()=>{
93
+ onChange: () => {
85
94
  setHasChanged(true);
86
95
  setHasChangedMessage(true);
87
96
  },
88
- additionalGlobs
97
+ additionalGlobs,
89
98
  });
90
- const tasks = useMemo(()=>{
91
- return [
92
- ...transpileTasks,
93
- ...compileTasks
94
- ];
95
- }, [
96
- transpileTasks,
97
- compileTasks
98
- ]);
99
+ const tasks = useMemo(() => {
100
+ return [...transpileTasks, ...compileTasks];
101
+ }, [transpileTasks, compileTasks]);
99
102
  return {
100
103
  tasks,
101
104
  handleFinish,
102
105
  hasChanged,
103
106
  isWatching,
104
107
  hasChangedMessage,
105
- hasFailure
108
+ hasFailure,
106
109
  };
107
110
  };
108
-
109
111
  //# sourceMappingURL=useSimulatorTasks.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../libs/cli/src/commands/SimulatorCommand/hooks/useSimulatorTasks.ts"],"sourcesContent":["import { join } from 'node:path';\nimport open from 'open';\nimport { useCallback, useEffect, useMemo } from 'react';\nimport { useState } from 'react';\nimport { useRef } from 'react';\nimport { CheckListProps } from '@/cli/components/CheckList/CheckList.js';\nimport { Environment } from '@/cli/environment/dto/Environment.js';\nimport { isWindows } from '@/cli/utils/platform.js';\nimport { isMac } from '@/cli/utils/platform.js';\nimport { useFileWatcher } from './useFileWatcher.js';\nimport { getPdcPathFromEnvironment } from '../../CompileCommand/fn/getPdcPathFromEnvironment.js';\nimport { useCompileTasks } from '../../CompileCommand/hooks/useCompileTasks.js';\nimport { validateEntryPoint } from '../../TranspileCommand/fn/validateEntryPoint.js';\nimport { validateExitPoint } from '../../TranspileCommand/fn/validateExitPoint.js';\nimport { useTranspileTasks } from '../../TranspileCommand/hooks/useTranspileTasks.js';\nimport { TranspileMode } from '../../TranspileCommand/types.js';\nimport { getSimulatorPathFromEnvironment } from '../fn/getSimulatorPathFromEnvironment.js';\n\ninterface Props {\n path: string;\n environment: Environment;\n watchForChanges: boolean;\n recompileOnly: boolean;\n background: boolean;\n entryFile?: string;\n luaOutputPath?: string;\n gameOutputPath?: string;\n requireWithinProjectPath?: boolean;\n additionalGlobs?: string[];\n}\n\nexport const useSimulatorTasks = ({\n path,\n environment,\n watchForChanges,\n recompileOnly,\n background,\n entryFile,\n luaOutputPath,\n gameOutputPath,\n requireWithinProjectPath = true,\n additionalGlobs = [],\n}: Props) => {\n const [isWatching, setIsWatching] = useState(false);\n const [hasChanged, setHasChanged] = useState(false);\n const [hasChangedMessage, setHasChangedMessage] = useState(false);\n const [hasFailure, setHasFailure] = useState(false);\n const didRun = useRef(false);\n\n useEffect(() => {\n if (hasChanged) {\n setHasChanged(false);\n }\n }, [hasChanged, setHasChanged]);\n\n const transpileTasks = useTranspileTasks({\n entryPoint: validateEntryPoint({\n projectPath: path,\n entryFile: entryFile ?? join(path, 'src', 'index.ts'),\n requireWithinProjectPath,\n }),\n exitPoint: validateExitPoint({\n projectPath: path,\n exitFile: join(\n ...(luaOutputPath ? [luaOutputPath] : [path, 'Source']),\n 'main.lua',\n ),\n requireWithinProjectPath,\n }),\n transpileMode: entryFile ? TranspileMode.File : TranspileMode.Project,\n });\n\n const compileTasks = useCompileTasks({\n pdcPath: getPdcPathFromEnvironment(environment),\n outputPath: gameOutputPath,\n });\n\n const handleFinish = useCallback(\n (hasFailure => {\n setHasFailure(hasFailure);\n\n if (didRun.current && recompileOnly) {\n return;\n }\n\n didRun.current = true;\n\n open(join(gameOutputPath ?? process.cwd(), 'Game.pdx'), {\n background,\n app: isMac\n ? undefined\n : {\n name: getSimulatorPathFromEnvironment(environment),\n },\n }).then(() => {\n if (!watchForChanges) {\n if (!isWindows) {\n process.exit();\n }\n setTimeout(process.exit, 1000);\n } else {\n setHasChangedMessage(false);\n setIsWatching(true);\n }\n });\n }) satisfies CheckListProps['onFinish'],\n [\n watchForChanges,\n recompileOnly,\n gameOutputPath,\n environment,\n background,\n ],\n );\n\n useFileWatcher({\n watchPath: entryFile ? entryFile : join(path, 'src'),\n enabled: isWatching,\n onChange: () => {\n setHasChanged(true);\n setHasChangedMessage(true);\n },\n additionalGlobs,\n });\n\n const tasks = useMemo(() => {\n return [...transpileTasks, ...compileTasks];\n }, [transpileTasks, compileTasks]);\n\n return {\n tasks,\n handleFinish,\n hasChanged,\n isWatching,\n hasChangedMessage,\n hasFailure,\n };\n};\n"],"names":["join","open","useCallback","useEffect","useMemo","useState","useRef","isWindows","isMac","useFileWatcher","getPdcPathFromEnvironment","useCompileTasks","validateEntryPoint","validateExitPoint","useTranspileTasks","TranspileMode","getSimulatorPathFromEnvironment","useSimulatorTasks","path","environment","watchForChanges","recompileOnly","background","entryFile","luaOutputPath","gameOutputPath","requireWithinProjectPath","additionalGlobs","isWatching","setIsWatching","hasChanged","setHasChanged","hasChangedMessage","setHasChangedMessage","hasFailure","setHasFailure","didRun","transpileTasks","entryPoint","projectPath","exitPoint","exitFile","transpileMode","File","Project","compileTasks","pdcPath","outputPath","handleFinish","current","process","cwd","app","undefined","name","then","exit","setTimeout","watchPath","enabled","onChange","tasks"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,IAAI,QAAQ,YAAY;AACjC,OAAOC,UAAU,OAAO;AACxB,SAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,QAAQ,QAAQ;AACxD,SAASC,QAAQ,QAAQ,QAAQ;AACjC,SAASC,MAAM,QAAQ,QAAQ;AAG/B,SAASC,SAAS,QAAQ,0BAA0B;AACpD,SAASC,KAAK,QAAQ,0BAA0B;AAChD,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SAASC,yBAAyB,QAAQ,uDAAuD;AACjG,SAASC,eAAe,QAAQ,gDAAgD;AAChF,SAASC,kBAAkB,QAAQ,kDAAkD;AACrF,SAASC,iBAAiB,QAAQ,iDAAiD;AACnF,SAASC,iBAAiB,QAAQ,oDAAoD;AACtF,SAASC,aAAa,QAAQ,kCAAkC;AAChE,SAASC,+BAA+B,QAAQ,2CAA2C;A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,IAAI,CAACb,WAAW;oBACZ2C,QAAQM,IAAI;gBAChB;gBACAC,WAAWP,QAAQM,IAAI,EAAE;YAC7B,OAAO;gBACHvB,qBAAqB;gBACrBJ,cAAc;YAClB;QACJ;IACJ,GACA;QACIT;QACAC;QACAI;QACAN;QACAG;KACH;IAGLb,eAAe;QACXiD,WAAWnC,YAAYA,YAAYvB,KAAKkB,MAAM;QAC9CyC,SAAS/B;QACTgC,UAAU;YACN7B,cAAc;YACdE,qBAAqB;QACzB;QACAN;IACJ;IAEA,MAAMkC,QAAQzD,QAAQ;QAClB,OAAO;eAAIiC;eAAmBQ;SAAa;IAC/C,GAAG;QAACR;QAAgBQ;KAAa;IAEjC,OAAO;QACHgB;QACAb;QACAlB;QACAF;QACAI;QACAE;IACJ;AACJ,EAAE"}
1
+ {"version":3,"file":"useSimulatorTasks.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/commands/SimulatorCommand/hooks/useSimulatorTasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,sDAAsD,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AACtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAmBrD,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IAAI,CAAC,CAAC;YACxB,CAAC;QACL,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE;YACR,IAAI,eAAe,EAAE,CAAC;gBAClB,oBAAoB,CAAC,KAAK,CAAC,CAAC;gBAC5B,aAAa,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC;QACL,CAAC,CAAC,CAAC;IACX,CAAC,EACD;QACI,UAAU;QACV,WAAW;QACX,cAAc;QACd,IAAI;QACJ,eAAe;QACf,aAAa;QACb,UAAU;QACV,eAAe;KAClB,CACJ,CAAC;IAEF,cAAc,CAAC;QACX,SAAS,EACL,SAAS,IAAI,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC;QACnE,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,GAAG,EAAE;YACX,aAAa,CAAC,IAAI,CAAC,CAAC;YACpB,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;QACD,eAAe;KAClB,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE;QACvB,OAAO,CAAC,GAAG,cAAc,EAAE,GAAG,YAAY,CAAC,CAAC;IAChD,CAAC,EAAE,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC,CAAC;IAEnC,OAAO;QACH,KAAK;QACL,YAAY;QACZ,UAAU;QACV,UAAU;QACV,iBAAiB;QACjB,UAAU;KACb,CAAC;AACN,CAAC,CAAC"}
@@ -1,3 +1,2 @@
1
1
  export * from './SimulatorCommand.js';
2
-
3
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/cli/src/commands/SimulatorCommand/index.ts"],"sourcesContent":["export * from './SimulatorCommand.js';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,wBAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/commands/SimulatorCommand/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { Environment } from '../../environment/dto/Environment.js';
3
+ import { EnvironmentAwareCommand } from '../EnvironmentAwareCommand/index.js';
4
+ import { OutputFormat } from './types.js';
5
+ export declare class TestCommand extends EnvironmentAwareCommand {
6
+ static paths: string[][];
7
+ static usage: import("clipanion").Usage;
8
+ projectPath: string;
9
+ watch: boolean;
10
+ format: OutputFormat;
11
+ renderWithEnvironment(environment: Environment): React.JSX.Element;
12
+ }
@@ -0,0 +1,32 @@
1
+ import { Command, Option } from 'clipanion';
2
+ import React from 'react';
3
+ import * as t from 'typanion';
4
+ import { EnvironmentAwareCommand } from '../EnvironmentAwareCommand/index.js';
5
+ import { Test } from './components/Test.js';
6
+ import { OutputFormat } from './types.js';
7
+ export class TestCommand extends EnvironmentAwareCommand {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.projectPath = Option.String('-p,--path', process.cwd(), {
11
+ description: 'The path to the project',
12
+ });
13
+ this.watch = Option.Boolean('-w,--watch', false, {
14
+ description: 'Watch for changes and rerun tests',
15
+ });
16
+ this.format = Option.String('--format', OutputFormat.Pretty, {
17
+ description: 'Output format for test results',
18
+ validator: t.isEnum(OutputFormat),
19
+ });
20
+ }
21
+ renderWithEnvironment(environment) {
22
+ if (this.format === OutputFormat.Json && this.watch) {
23
+ throw new Error('JSON format is not supported in watch mode');
24
+ }
25
+ return (React.createElement(Test, { environment: environment, path: this.projectPath, watch: this.watch, format: this.format }));
26
+ }
27
+ }
28
+ TestCommand.paths = [['test']];
29
+ TestCommand.usage = Command.Usage({
30
+ description: 'Transpile TypeScript files to Lua',
31
+ });
32
+ //# sourceMappingURL=TestCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestCommand.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/commands/TestCommand/TestCommand.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,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AAmC;CACnD,CAAC,AAFmB,CAElB"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { Environment } from '../../../environment/dto/Environment.js';
3
+ import { OutputFormat } from '../types.js';
4
+ export declare const Test: ({ environment, path, watch, format, }: {
5
+ environment: Environment;
6
+ path: string;
7
+ watch: boolean;
8
+ format?: OutputFormat;
9
+ }) => React.JSX.Element;
@@ -0,0 +1,73 @@
1
+ import { resolve } from 'node:path';
2
+ import { StatusMessage } from '@inkjs/ui';
3
+ import { Box } from 'ink';
4
+ import React, { useEffect, useRef } from 'react';
5
+ import { CheckList } from '../../../components/CheckList/index.js';
6
+ import { useTestServer } from '../hooks/useTestServer.js';
7
+ import { useTestTasks } from '../hooks/useTestTasks.js';
8
+ import { OutputFormat } from '../types.js';
9
+ import { TestSuite } from './TestSuite.js';
10
+ import { TestSummary } from './TestSummary.js';
11
+ const removeCircularReferences = (suite) => {
12
+ return {
13
+ name: suite.name,
14
+ testCount: suite.testCount,
15
+ status: suite.status,
16
+ tests: suite.tests,
17
+ children: suite.children.map((child) => removeCircularReferences(child)),
18
+ depth: suite.depth,
19
+ startTime: suite.startTime,
20
+ endTime: suite.endTime,
21
+ };
22
+ };
23
+ export const Test = ({ environment, path, watch, format = OutputFormat.Pretty, }) => {
24
+ const { testState, resetTestState } = useTestServer();
25
+ const { tasks, handleFinish, isWatching, hasChangedMessage, hasFailure, hasChanged, } = useTestTasks({
26
+ environment,
27
+ path: resolve(process.cwd(), path),
28
+ watch,
29
+ });
30
+ const compilationFinishedRef = useRef(false);
31
+ useEffect(() => {
32
+ if (format === OutputFormat.Pretty) {
33
+ process.stdout.write('\x1Bc');
34
+ }
35
+ }, [format]);
36
+ useEffect(() => {
37
+ if (hasChanged) {
38
+ if (format === OutputFormat.Pretty) {
39
+ process.stdout.write('\x1Bc');
40
+ }
41
+ resetTestState();
42
+ }
43
+ }, [hasChanged, format, resetTestState]);
44
+ useEffect(() => {
45
+ if (!watch && compilationFinishedRef.current && testState) {
46
+ const isTestingComplete = testState.status === 'completed' ||
47
+ testState.status === 'failed';
48
+ if (isTestingComplete) {
49
+ if (format === OutputFormat.Json) {
50
+ const jsonSafeTestState = Object.assign(Object.assign({}, testState), { suites: testState.suites.map((suite) => removeCircularReferences(suite)) });
51
+ console.log(JSON.stringify(jsonSafeTestState, null, 2));
52
+ }
53
+ process.exit(testState.status === 'failed' || testState.failedTests > 0
54
+ ? 1
55
+ : 0);
56
+ }
57
+ }
58
+ }, [watch, testState, format]);
59
+ const handleFinishWithTracking = (hasFailure) => {
60
+ compilationFinishedRef.current = true;
61
+ return handleFinish(hasFailure);
62
+ };
63
+ return (React.createElement(React.Fragment, null,
64
+ !hasChanged && (React.createElement(CheckList, { items: tasks, onFinish: handleFinishWithTracking, display: "silent" })),
65
+ format === OutputFormat.Pretty && (React.createElement(React.Fragment, null,
66
+ isWatching && !hasChangedMessage && (React.createElement(React.Fragment, null,
67
+ hasFailure && (React.createElement(StatusMessage, { variant: "warning" }, "Some steps failed:")),
68
+ React.createElement(StatusMessage, { variant: "info" }, "Watching for changes..."))),
69
+ testState && (React.createElement(Box, { flexDirection: "column" },
70
+ React.createElement(TestSummary, { testState: testState }),
71
+ testState.suites.map((suite) => (React.createElement(TestSuite, { key: suite.name, suite: suite })))))))));
72
+ };
73
+ //# sourceMappingURL=Test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Test.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/commands/TestCommand/components/Test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAEhE,OAAO,EAAE,aAAa,EA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,CAAC,CAAC,CAAC;IAE/B,MAAM,wBAAwB,GAAG,CAAC,UAAmB,EAAE,EAAE;QACrD,sBAAsB,CAAC,OAAO,GAAG,IAAI,CAAC;QACtC,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC,CAAC;IAEF,OAAO,CACH;QACK,CAAC,UAAU,IAAI,CACZ,oBAAC,SAAS,IACN,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,wBAAwB,EAClC,OAAO,EAAC,QAAQ,GAClB,CACL;QAEA,MAAM,KAAK,YAAY,CAAC,MAAM,IAAI,CAC/B;YACK,UAAU,IAAI,CAAC,iBAAiB,IAAI,CACjC;gBACK,UAAU,IAAI,CACX,oBAAC,aAAa,IAAC,OAAO,EAAC,SAAS,yBAEhB,CACnB;gBACD,oBAAC,aAAa,IAAC,OAAO,EAAC,MAAM,8BAEb,CACjB,CACN;YAEA,SAAS,IAAI,CACV,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ;gBACvB,oBAAC,WAAW,IAAC,SAAS,EAAE,SAAS,GAAI;gBACpC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC7B,oBAAC,SAAS,IAAC,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,GAAI,CAC/C,CAAC,CACA,CACT,CACF,CACN,CACF,CACN,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { TestLine as TestLineType } from '../server/TestServer.js';
3
+ interface TestLineProps {
4
+ line: TestLineType;
5
+ lineIndex: number;
6
+ testName: string;
7
+ suiteName: string;
8
+ }
9
+ export declare const TestLine: React.FC<TestLineProps>;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ import { Box, Text } from 'ink';
2
+ import React from 'react';
3
+ export const TestLine = ({ line, lineIndex, testName, suiteName, }) => (React.createElement(Box, { key: `${suiteName}-${testName}-line-${lineIndex}`, paddingLeft: 4 },
4
+ React.createElement(Text, { color: line.type === 'error' ? 'red' : 'white', dimColor: true },
5
+ "[",
6
+ line.timestamp,
7
+ "]"),
8
+ React.createElement(Text, { color: line.type === 'error' ? 'red' : 'white', dimColor: true },
9
+ ' ',
10
+ line.content)));
11
+ //# sourceMappingURL=TestLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestLine.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/commands/TestCommand/components/TestLine.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,CAAC,MAAM,QAAQ,GAA4B,CAAC,EAC9C,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,SAAS,GACZ,EAAE,EAAE,CAAC,CACF,oBAAC,GAAG,IAAC,GAAG,EAAE,GAAG,SAAS,IAAI,QAAQ,SAAS,SAAS,EAAE,EAAE,WAAW,EAAE,CAAC;IAClE,oBAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,QAAQ;;QACxD,IAAI,CAAC,SAAS;YACb;IACP,oBAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,QAAQ;QACzD,GAAG;QACH,IAAI,CAAC,OAAO,CACV,CACL,CACT,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { TestResult as TestResultType } from '../server/TestServer.js';
3
+ interface TestResultProps {
4
+ test: TestResultType;
5
+ suiteName: string;
6
+ }
7
+ export declare const TestResult: React.FC<TestResultProps>;
8
+ export {};
@@ -0,0 +1,21 @@
1
+ import { Box, Text } from 'ink';
2
+ import React from 'react';
3
+ import { formatTestError } from '../utils/formatTestError.js';
4
+ import { TestLine } from './TestLine.js';
5
+ export const TestResult = ({ test, suiteName }) => {
6
+ const errorLine = test.result === 'failed'
7
+ ? test.lines.find((line) => line.type === 'error')
8
+ : null;
9
+ return (React.createElement(Box, { key: `${suiteName}-${test.test}`, flexDirection: "column" },
10
+ React.createElement(Box, { gap: 1, paddingLeft: 2 },
11
+ React.createElement(Box, { gap: 1 },
12
+ React.createElement(Text, { color: test.result === 'passed' ? 'green' : 'red', bold: true }, test.result === 'passed' ? '✓' : '✗'),
13
+ React.createElement(Text, { dimColor: true }, test.test))),
14
+ test.result === 'failed' && errorLine && (React.createElement(Box, { paddingLeft: 4 },
15
+ React.createElement(Text, { color: "red" }, formatTestError(errorLine.content, errorLine.file, errorLine.line)))),
16
+ test.lines.length > 0 && test.result === 'failed' && (React.createElement(Box, { paddingLeft: 4, paddingTop: 1, paddingBottom: 1 },
17
+ React.createElement(Text, { color: "white", dimColor: true }, "Captured output"))),
18
+ test.lines.length > 0 && test.result === 'failed' && (React.createElement(Box, { paddingBottom: 1, flexDirection: "column" }, test.lines.map((line, lineIndex) => (React.createElement(Box, { key: `${suiteName}-${test.test}-line-${lineIndex}` },
19
+ React.createElement(TestLine, { line: line, lineIndex: lineIndex, testName: test.test, suiteName: suiteName }))))))));
20
+ };
21
+ //# sourceMappingURL=TestResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestResult.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/commands/TestCommand/components/TestResult.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAOzC,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE;IACzE,MAAM,SA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AAK,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,CAClD,oBAAC,GAAG,IAAC,aAAa,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ,IACxC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CACjC,oBAAC,GAAG,IACA,GAAG,EAAE,GAAG,SAAS,IAAI,IAAI,CAAC,IAAI,SAAS,SAAS,EAAE;YAElD,oBAAC,QAAQ,IACL,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,IAAI,CAAC,IAAI,EACnB,SAAS,EAAE,SAAS,GACtB,CACA,CACT,CAAC,CACA,CACT,CACC,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { TestSuite as TestSuiteType } from '../server/TestServer.js';
3
+ interface TestSuiteProps {
4
+ suite: TestSuiteType;
5
+ depth?: number;
6
+ }
7
+ export declare const TestSuite: React.FC<TestSuiteProps>;
8
+ export {};