tstyche 7.2.5 → 8.0.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 (393) hide show
  1. package/README.md +4 -0
  2. package/dist/api.d.ts +16 -761
  3. package/dist/api.js +16 -6204
  4. package/dist/bin.js +2 -3
  5. package/dist/checker/BaseCheckerAdapter.d.ts +15 -0
  6. package/dist/checker/BaseCheckerAdapter.js +32 -0
  7. package/dist/checker/CompatCheckerAdapter.d.ts +70 -0
  8. package/dist/checker/CompatCheckerAdapter.js +221 -0
  9. package/dist/checker/NativeCheckerAdapter.d.ts +70 -0
  10. package/dist/checker/NativeCheckerAdapter.js +200 -0
  11. package/dist/checker/index.d.ts +3 -0
  12. package/dist/checker/index.js +2 -0
  13. package/dist/checker/types.d.ts +9 -0
  14. package/dist/checker/types.js +1 -0
  15. package/dist/cli/Cli.d.ts +5 -0
  16. package/dist/cli/Cli.js +144 -0
  17. package/dist/cli/CliDIagnosticText.d.ts +3 -0
  18. package/dist/cli/CliDIagnosticText.js +9 -0
  19. package/dist/cli/index.d.ts +1 -0
  20. package/dist/cli/index.js +1 -0
  21. package/dist/collect/CollectDiagnosticText.d.ts +3 -0
  22. package/dist/collect/CollectDiagnosticText.js +5 -0
  23. package/dist/collect/CollectService.d.ts +9 -0
  24. package/dist/collect/CollectService.js +150 -0
  25. package/dist/collect/ExpectNode.d.ts +16 -0
  26. package/dist/collect/ExpectNode.js +30 -0
  27. package/dist/collect/IdentifierLookup.d.ts +18 -0
  28. package/dist/collect/IdentifierLookup.js +90 -0
  29. package/dist/collect/TestTree.d.ts +16 -0
  30. package/dist/collect/TestTree.js +15 -0
  31. package/dist/collect/TestTreeNode.d.ts +15 -0
  32. package/dist/collect/TestTreeNode.js +27 -0
  33. package/dist/collect/TestTreeNodeBrand.enum.d.ts +6 -0
  34. package/dist/collect/TestTreeNodeBrand.enum.js +7 -0
  35. package/dist/collect/TestTreeNodeFlags.enum.d.ts +6 -0
  36. package/dist/collect/TestTreeNodeFlags.enum.js +7 -0
  37. package/dist/collect/index.d.ts +6 -0
  38. package/dist/collect/index.js +6 -0
  39. package/dist/config/CommandParser.d.ts +7 -0
  40. package/dist/config/CommandParser.js +107 -0
  41. package/dist/config/Config.d.ts +18 -0
  42. package/dist/config/Config.js +59 -0
  43. package/dist/config/ConfigDiagnosticText.d.ts +19 -0
  44. package/dist/config/ConfigDiagnosticText.js +57 -0
  45. package/dist/config/ConfigParser.d.ts +10 -0
  46. package/dist/config/ConfigParser.js +165 -0
  47. package/dist/config/Directive.d.ts +9 -0
  48. package/dist/config/Directive.js +119 -0
  49. package/dist/config/DirectiveDiagnosticText.d.ts +5 -0
  50. package/dist/config/DirectiveDiagnosticText.js +11 -0
  51. package/dist/config/OptionBrand.enum.d.ts +8 -0
  52. package/dist/config/OptionBrand.enum.js +9 -0
  53. package/dist/config/OptionGroup.enum.d.ts +5 -0
  54. package/dist/config/OptionGroup.enum.js +6 -0
  55. package/dist/config/Options.d.ts +29 -0
  56. package/dist/config/Options.js +290 -0
  57. package/dist/config/Target.d.ts +7 -0
  58. package/dist/config/Target.js +47 -0
  59. package/dist/config/defaultOptions.d.ts +2 -0
  60. package/dist/config/defaultOptions.js +14 -0
  61. package/dist/config/index.d.ts +8 -0
  62. package/dist/config/index.js +7 -0
  63. package/dist/config/types.d.ts +55 -0
  64. package/dist/config/types.js +1 -0
  65. package/dist/diagnostic/Diagnostic.d.ts +19 -0
  66. package/dist/diagnostic/Diagnostic.js +51 -0
  67. package/dist/diagnostic/DiagnosticCategory.enum.d.ts +4 -0
  68. package/dist/diagnostic/DiagnosticCategory.enum.js +5 -0
  69. package/dist/diagnostic/DiagnosticOrigin.d.ts +13 -0
  70. package/dist/diagnostic/DiagnosticOrigin.js +27 -0
  71. package/dist/diagnostic/helpers.d.ts +6 -0
  72. package/dist/diagnostic/helpers.js +74 -0
  73. package/dist/diagnostic/index.d.ts +5 -0
  74. package/dist/diagnostic/index.js +4 -0
  75. package/dist/diagnostic/types.d.ts +2 -0
  76. package/dist/diagnostic/types.js +1 -0
  77. package/dist/editor/TextEditor.d.ts +15 -0
  78. package/dist/editor/TextEditor.js +88 -0
  79. package/dist/editor/index.d.ts +2 -0
  80. package/dist/editor/index.js +1 -0
  81. package/dist/editor/types.d.ts +4 -0
  82. package/dist/editor/types.js +1 -0
  83. package/dist/environment/Environment.d.ts +5 -0
  84. package/dist/environment/Environment.js +89 -0
  85. package/dist/environment/environmentOptions.d.ts +1 -0
  86. package/dist/environment/environmentOptions.js +2 -0
  87. package/dist/environment/index.d.ts +2 -0
  88. package/dist/environment/index.js +1 -0
  89. package/dist/environment/types.d.ts +10 -0
  90. package/dist/environment/types.js +1 -0
  91. package/dist/events/EventEmitter.d.ts +14 -0
  92. package/dist/events/EventEmitter.js +42 -0
  93. package/dist/events/index.d.ts +2 -0
  94. package/dist/events/index.js +1 -0
  95. package/dist/events/types.d.ts +88 -0
  96. package/dist/events/types.js +1 -0
  97. package/dist/expect/AbilityMatcherBase.d.ts +16 -0
  98. package/dist/expect/AbilityMatcherBase.js +52 -0
  99. package/dist/expect/Ensure.d.ts +10 -0
  100. package/dist/expect/Ensure.js +51 -0
  101. package/dist/expect/ExpectDiagnosticText.d.ts +29 -0
  102. package/dist/expect/ExpectDiagnosticText.js +87 -0
  103. package/dist/expect/ExpectService.d.ts +21 -0
  104. package/dist/expect/ExpectService.js +90 -0
  105. package/dist/expect/RelationMatcherBase.d.ts +12 -0
  106. package/dist/expect/RelationMatcherBase.js +16 -0
  107. package/dist/expect/ToAcceptProps.d.ts +10 -0
  108. package/dist/expect/ToAcceptProps.js +52 -0
  109. package/dist/expect/ToBe.d.ts +13 -0
  110. package/dist/expect/ToBe.js +18 -0
  111. package/dist/expect/ToBeApplicable.d.ts +10 -0
  112. package/dist/expect/ToBeApplicable.js +72 -0
  113. package/dist/expect/ToBeAssignableFrom.d.ts +9 -0
  114. package/dist/expect/ToBeAssignableFrom.js +12 -0
  115. package/dist/expect/ToBeAssignableTo.d.ts +9 -0
  116. package/dist/expect/ToBeAssignableTo.js +12 -0
  117. package/dist/expect/ToBeCallableWith.d.ts +11 -0
  118. package/dist/expect/ToBeCallableWith.js +29 -0
  119. package/dist/expect/ToBeConstructableWith.d.ts +11 -0
  120. package/dist/expect/ToBeConstructableWith.js +29 -0
  121. package/dist/expect/ToBeInstantiableWith.d.ts +10 -0
  122. package/dist/expect/ToBeInstantiableWith.js +31 -0
  123. package/dist/expect/ToHaveProperty.d.ts +10 -0
  124. package/dist/expect/ToHaveProperty.js +59 -0
  125. package/dist/expect/ToRaiseError.d.ts +9 -0
  126. package/dist/expect/ToRaiseError.js +82 -0
  127. package/dist/expect/index.d.ts +2 -0
  128. package/dist/expect/index.js +1 -0
  129. package/dist/expect/types.d.ts +7 -0
  130. package/dist/expect/types.js +1 -0
  131. package/dist/file/FilePosition.d.ts +7 -0
  132. package/dist/file/FilePosition.js +16 -0
  133. package/dist/file/index.d.ts +1 -0
  134. package/dist/file/index.js +1 -0
  135. package/dist/glob/Braces.d.ts +4 -0
  136. package/dist/glob/Braces.js +56 -0
  137. package/dist/glob/Glob.d.ts +4 -0
  138. package/dist/glob/Glob.js +49 -0
  139. package/dist/glob/index.d.ts +1 -0
  140. package/dist/glob/index.js +1 -0
  141. package/dist/handlers/CancellationHandler.d.ts +7 -0
  142. package/dist/handlers/CancellationHandler.js +15 -0
  143. package/dist/handlers/ExitCodeHandler.d.ts +7 -0
  144. package/dist/handlers/ExitCodeHandler.js +20 -0
  145. package/dist/handlers/ResultHandler.d.ts +5 -0
  146. package/dist/handlers/ResultHandler.js +206 -0
  147. package/dist/handlers/index.d.ts +3 -0
  148. package/dist/handlers/index.js +3 -0
  149. package/dist/index.cjs +5 -5
  150. package/dist/index.d.cts +40 -45
  151. package/dist/index.d.ts +40 -45
  152. package/dist/index.js +1 -2
  153. package/dist/input/InputService.d.ts +6 -0
  154. package/dist/input/InputService.js +16 -0
  155. package/dist/input/index.d.ts +1 -0
  156. package/dist/input/index.js +1 -0
  157. package/dist/json/JsonNode.d.ts +11 -0
  158. package/dist/json/JsonNode.js +28 -0
  159. package/dist/json/JsonScanner.d.ts +14 -0
  160. package/dist/json/JsonScanner.js +105 -0
  161. package/dist/json/index.d.ts +3 -0
  162. package/dist/json/index.js +2 -0
  163. package/dist/json/types.d.ts +1 -0
  164. package/dist/json/types.js +1 -0
  165. package/dist/layers/AbilityLayer.d.ts +10 -0
  166. package/dist/layers/AbilityLayer.js +186 -0
  167. package/dist/layers/Layers.d.ts +11 -0
  168. package/dist/layers/Layers.js +47 -0
  169. package/dist/layers/SuppressedLayer.d.ts +11 -0
  170. package/dist/layers/SuppressedLayer.js +93 -0
  171. package/dist/layers/index.d.ts +2 -0
  172. package/dist/layers/index.js +1 -0
  173. package/dist/layers/types.d.ts +8 -0
  174. package/dist/layers/types.js +1 -0
  175. package/dist/output/CodeFrameText.d.ts +10 -0
  176. package/dist/output/CodeFrameText.js +71 -0
  177. package/dist/output/OutputService.d.ts +13 -0
  178. package/dist/output/OutputService.js +38 -0
  179. package/dist/output/StreamController.d.ts +10 -0
  180. package/dist/output/StreamController.js +16 -0
  181. package/dist/output/addsText.d.ts +4 -0
  182. package/dist/output/addsText.js +8 -0
  183. package/dist/output/describeNameText.d.ts +2 -0
  184. package/dist/output/describeNameText.js +5 -0
  185. package/dist/output/diagnosticText.d.ts +4 -0
  186. package/dist/output/diagnosticText.js +23 -0
  187. package/dist/output/dotText.d.ts +3 -0
  188. package/dist/output/dotText.js +11 -0
  189. package/dist/output/fileStatusText.d.ts +4 -0
  190. package/dist/output/fileStatusText.js +26 -0
  191. package/dist/output/formattedText.d.ts +2 -0
  192. package/dist/output/formattedText.js +19 -0
  193. package/dist/output/helpText.d.ts +3 -0
  194. package/dist/output/helpText.js +52 -0
  195. package/dist/output/helpers.d.ts +5 -0
  196. package/dist/output/helpers.js +23 -0
  197. package/dist/output/index.d.ts +16 -0
  198. package/dist/output/index.js +15 -0
  199. package/dist/output/prologueText.d.ts +2 -0
  200. package/dist/output/prologueText.js +5 -0
  201. package/dist/output/summaryText.d.ts +12 -0
  202. package/dist/output/summaryText.js +31 -0
  203. package/dist/output/testNameText.d.ts +3 -0
  204. package/dist/output/testNameText.js +24 -0
  205. package/dist/output/types.d.ts +5 -0
  206. package/dist/output/types.js +1 -0
  207. package/dist/output/usesText.d.ts +5 -0
  208. package/dist/output/usesText.js +22 -0
  209. package/dist/output/waitingForFileChangesText.d.ts +2 -0
  210. package/dist/output/waitingForFileChangesText.js +5 -0
  211. package/dist/output/watchUsageText.d.ts +2 -0
  212. package/dist/output/watchUsageText.js +12 -0
  213. package/dist/path/Path.d.ts +7 -0
  214. package/dist/path/Path.js +28 -0
  215. package/dist/path/index.d.ts +1 -0
  216. package/dist/path/index.js +1 -0
  217. package/dist/project/CompatMappedDiagnostic.d.ts +12 -0
  218. package/dist/project/CompatMappedDiagnostic.js +25 -0
  219. package/dist/project/CompatProjectService.d.ts +19 -0
  220. package/dist/project/CompatProjectService.js +188 -0
  221. package/dist/project/FileMapService.d.ts +6 -0
  222. package/dist/project/FileMapService.js +14 -0
  223. package/dist/project/NativeMappedDiagnostic.d.ts +14 -0
  224. package/dist/project/NativeMappedDiagnostic.js +29 -0
  225. package/dist/project/NativeProjectService.d.ts +21 -0
  226. package/dist/project/NativeProjectService.js +216 -0
  227. package/dist/project/ProjectConfigService.d.ts +8 -0
  228. package/dist/project/ProjectConfigService.js +73 -0
  229. package/dist/project/index.d.ts +3 -0
  230. package/dist/project/index.js +2 -0
  231. package/dist/project/types.d.ts +7 -0
  232. package/dist/project/types.js +1 -0
  233. package/dist/reject/Reject.d.ts +9 -0
  234. package/dist/reject/Reject.js +43 -0
  235. package/dist/reject/RejectDiagnosticText.d.ts +5 -0
  236. package/dist/reject/RejectDiagnosticText.js +16 -0
  237. package/dist/reject/helpers.d.ts +1 -0
  238. package/dist/reject/helpers.js +3 -0
  239. package/dist/reject/index.d.ts +1 -0
  240. package/dist/reject/index.js +1 -0
  241. package/dist/reporters/BaseReporter.d.ts +7 -0
  242. package/dist/reporters/BaseReporter.js +6 -0
  243. package/dist/reporters/DotReporter.d.ts +6 -0
  244. package/dist/reporters/DotReporter.js +51 -0
  245. package/dist/reporters/FileView.d.ts +13 -0
  246. package/dist/reporters/FileView.js +33 -0
  247. package/dist/reporters/ListReporter.d.ts +6 -0
  248. package/dist/reporters/ListReporter.js +125 -0
  249. package/dist/reporters/SetupReporter.d.ts +4 -0
  250. package/dist/reporters/SetupReporter.js +21 -0
  251. package/dist/reporters/SummaryReporter.d.ts +5 -0
  252. package/dist/reporters/SummaryReporter.js +19 -0
  253. package/dist/reporters/WatchReporter.d.ts +5 -0
  254. package/dist/reporters/WatchReporter.js +21 -0
  255. package/dist/reporters/index.d.ts +7 -0
  256. package/dist/reporters/index.js +6 -0
  257. package/dist/reporters/types.d.ts +5 -0
  258. package/dist/reporters/types.js +1 -0
  259. package/dist/result/DescribeResult.d.ts +9 -0
  260. package/dist/result/DescribeResult.js +11 -0
  261. package/dist/result/ExpectResult.d.ts +10 -0
  262. package/dist/result/ExpectResult.js +11 -0
  263. package/dist/result/FileResult.d.ts +15 -0
  264. package/dist/result/FileResult.js +13 -0
  265. package/dist/result/ProjectConfigKind.enum.d.ts +6 -0
  266. package/dist/result/ProjectConfigKind.enum.js +7 -0
  267. package/dist/result/ProjectResult.d.ts +8 -0
  268. package/dist/result/ProjectResult.js +9 -0
  269. package/dist/result/Result.d.ts +13 -0
  270. package/dist/result/Result.js +14 -0
  271. package/dist/result/ResultStatus.enum.d.ts +10 -0
  272. package/dist/result/ResultStatus.enum.js +11 -0
  273. package/dist/result/SuppressedResult.d.ts +5 -0
  274. package/dist/result/SuppressedResult.js +6 -0
  275. package/dist/result/TargetResult.d.ts +11 -0
  276. package/dist/result/TargetResult.js +12 -0
  277. package/dist/result/TestResult.d.ts +13 -0
  278. package/dist/result/TestResult.js +13 -0
  279. package/dist/result/helpers.d.ts +7 -0
  280. package/dist/result/helpers.js +21 -0
  281. package/dist/result/index.d.ts +11 -0
  282. package/dist/result/index.js +10 -0
  283. package/dist/result/types.d.ts +31 -0
  284. package/dist/result/types.js +1 -0
  285. package/dist/runner/FileRunner.d.ts +10 -0
  286. package/dist/runner/FileRunner.js +93 -0
  287. package/dist/runner/FixmeDiagnosticText.d.ts +4 -0
  288. package/dist/runner/FixmeDiagnosticText.js +8 -0
  289. package/dist/runner/FixmeService.d.ts +9 -0
  290. package/dist/runner/FixmeService.js +51 -0
  291. package/dist/runner/RunModeFlags.enum.d.ts +7 -0
  292. package/dist/runner/RunModeFlags.enum.js +8 -0
  293. package/dist/runner/Runner.d.ts +9 -0
  294. package/dist/runner/Runner.js +101 -0
  295. package/dist/runner/TestTreeWalker.d.ts +19 -0
  296. package/dist/runner/TestTreeWalker.js +169 -0
  297. package/dist/runner/index.d.ts +1 -0
  298. package/dist/runner/index.js +1 -0
  299. package/dist/scribbler/Color.enum.d.ts +10 -0
  300. package/dist/scribbler/Color.enum.js +11 -0
  301. package/dist/scribbler/Line.d.ts +9 -0
  302. package/dist/scribbler/Line.js +5 -0
  303. package/dist/scribbler/Scribbler.d.ts +10 -0
  304. package/dist/scribbler/Scribbler.js +53 -0
  305. package/dist/scribbler/Text.d.ts +9 -0
  306. package/dist/scribbler/Text.js +8 -0
  307. package/dist/scribbler/index.d.ts +5 -0
  308. package/dist/scribbler/index.js +4 -0
  309. package/dist/scribbler/jsxRuntime.d.ts +4 -0
  310. package/dist/scribbler/jsxRuntime.js +4 -0
  311. package/dist/scribbler/types.d.ts +19 -0
  312. package/dist/scribbler/types.js +1 -0
  313. package/dist/select/Select.d.ts +7 -0
  314. package/dist/select/Select.js +91 -0
  315. package/dist/select/SelectDiagnosticText.d.ts +6 -0
  316. package/dist/select/SelectDiagnosticText.js +24 -0
  317. package/dist/select/index.d.ts +2 -0
  318. package/dist/select/index.js +2 -0
  319. package/dist/store/Fetcher.d.ts +24 -0
  320. package/dist/store/Fetcher.js +68 -0
  321. package/dist/store/Lock.d.ts +5 -0
  322. package/dist/store/Lock.js +24 -0
  323. package/dist/store/LockService.d.ts +8 -0
  324. package/dist/store/LockService.js +36 -0
  325. package/dist/store/Manifest.d.ts +30 -0
  326. package/dist/store/Manifest.js +58 -0
  327. package/dist/store/ManifestService.d.ts +10 -0
  328. package/dist/store/ManifestService.js +91 -0
  329. package/dist/store/PackageService.d.ts +9 -0
  330. package/dist/store/PackageService.js +89 -0
  331. package/dist/store/Store.d.ts +12 -0
  332. package/dist/store/Store.js +103 -0
  333. package/dist/store/StoreDiagnosticText.d.ts +13 -0
  334. package/dist/store/StoreDiagnosticText.js +42 -0
  335. package/dist/store/TarReader.d.ts +9 -0
  336. package/dist/store/TarReader.js +56 -0
  337. package/dist/store/helpers.d.ts +1 -0
  338. package/dist/store/helpers.js +3 -0
  339. package/dist/store/index.d.ts +1 -0
  340. package/dist/store/index.js +1 -0
  341. package/dist/structure/ComparisonResult.enum.d.ts +5 -0
  342. package/dist/structure/ComparisonResult.enum.js +6 -0
  343. package/dist/structure/Structure.d.ts +24 -0
  344. package/dist/structure/Structure.js +481 -0
  345. package/dist/structure/index.d.ts +1 -0
  346. package/dist/structure/index.js +1 -0
  347. package/dist/suppressed/SuppressedDiagnosticText.d.ts +6 -0
  348. package/dist/suppressed/SuppressedDiagnosticText.js +18 -0
  349. package/dist/suppressed/SuppressedService.d.ts +5 -0
  350. package/dist/suppressed/SuppressedService.js +61 -0
  351. package/dist/suppressed/index.d.ts +1 -0
  352. package/dist/suppressed/index.js +1 -0
  353. package/dist/tag.d.ts +1 -3
  354. package/dist/tag.js +2 -5
  355. package/dist/text/TextFile.d.ts +11 -0
  356. package/dist/text/TextFile.js +41 -0
  357. package/dist/text/TextFileService.d.ts +10 -0
  358. package/dist/text/TextFileService.js +31 -0
  359. package/dist/text/index.d.ts +3 -0
  360. package/dist/text/index.js +2 -0
  361. package/dist/text/types.d.ts +5 -0
  362. package/dist/text/types.js +1 -0
  363. package/dist/token/CancellationReason.enum.d.ts +6 -0
  364. package/dist/token/CancellationReason.enum.js +7 -0
  365. package/dist/token/CancellationToken.d.ts +8 -0
  366. package/dist/token/CancellationToken.js +22 -0
  367. package/dist/token/index.d.ts +2 -0
  368. package/dist/token/index.js +2 -0
  369. package/dist/typescript/BaseAdapter.d.ts +36 -0
  370. package/dist/typescript/BaseAdapter.js +83 -0
  371. package/dist/typescript/CompatTypeScript.d.ts +21 -0
  372. package/dist/typescript/CompatTypeScript.js +37 -0
  373. package/dist/typescript/NativeTypeScript.d.ts +24 -0
  374. package/dist/typescript/NativeTypeScript.js +44 -0
  375. package/dist/typescript/index.d.ts +3 -0
  376. package/dist/typescript/index.js +2 -0
  377. package/dist/typescript/types.d.ts +69 -0
  378. package/dist/typescript/types.js +1 -0
  379. package/dist/version/Version.d.ts +6 -0
  380. package/dist/version/Version.js +30 -0
  381. package/dist/version/index.d.ts +1 -0
  382. package/dist/version/index.js +1 -0
  383. package/dist/watch/Debounce.d.ts +9 -0
  384. package/dist/watch/Debounce.js +27 -0
  385. package/dist/watch/FileWatcher.d.ts +5 -0
  386. package/dist/watch/FileWatcher.js +12 -0
  387. package/dist/watch/WatchService.d.ts +8 -0
  388. package/dist/watch/WatchService.js +96 -0
  389. package/dist/watch/Watcher.d.ts +10 -0
  390. package/dist/watch/Watcher.js +31 -0
  391. package/dist/watch/index.d.ts +3 -0
  392. package/dist/watch/index.js +3 -0
  393. package/package.json +10 -2
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "#scribbler/jsx-runtime";
2
+ import { Line, Text } from "#scribbler";
3
+ import { duration, getStatusColor, total } from "./helpers.js";
4
+ function RowText({ label, text }) {
5
+ return (_jsxs(Line, { children: [`${label}:`.padEnd(12), text] }));
6
+ }
7
+ function CountsText({ counts, total }) {
8
+ const countsText = Object.entries(counts).map(([status, count]) => {
9
+ return (_jsx(Text, { children: count > 0 ? (_jsxs(Text, { children: [_jsxs(Text, { color: getStatusColor(status), children: [count, " ", status] }), _jsx(Text, { children: ", " })] })) : undefined }));
10
+ });
11
+ const totalText = (_jsxs(Text, { children: [total, " ", "total"] }));
12
+ return (_jsxs(Text, { children: [countsText, totalText] }));
13
+ }
14
+ function DurationText({ timing }) {
15
+ const seconds = duration(timing) / 1000;
16
+ return _jsx(Text, { children: `${Math.round(seconds * 10) / 10}s` });
17
+ }
18
+ export function summaryText({ targetCounts, fileCounts, testCounts, assertionCounts, suppressedCounts, timing, }) {
19
+ const targetCountsTotal = total(targetCounts);
20
+ const targetCountsText = (_jsx(RowText, { label: "Targets", text: _jsx(CountsText, { counts: targetCounts, total: targetCountsTotal }) }));
21
+ const fileCountsTotal = total(fileCounts);
22
+ const fileCountsText = (_jsx(RowText, { label: "Test files", text: _jsx(CountsText, { counts: fileCounts, total: fileCountsTotal }) }));
23
+ const testCountsTotal = total(testCounts);
24
+ const testCountsText = testCountsTotal > 0 ? (_jsx(RowText, { label: "Tests", text: _jsx(CountsText, { counts: testCounts, total: testCountsTotal }) })) : undefined;
25
+ const assertionCountsTotal = total(assertionCounts);
26
+ const assertionCountsText = assertionCountsTotal > 0 ? (_jsx(RowText, { label: "Assertions", text: _jsx(CountsText, { counts: assertionCounts, total: assertionCountsTotal }) })) : undefined;
27
+ const suppressedCountsTotal = total(suppressedCounts);
28
+ const suppressedCountsText = suppressedCountsTotal > 0 ? (_jsx(RowText, { label: "Suppressed", text: _jsx(CountsText, { counts: suppressedCounts, total: suppressedCountsTotal }) })) : undefined;
29
+ const durationText = _jsx(RowText, { label: "Duration", text: _jsx(DurationText, { timing: timing }) });
30
+ return (_jsxs(Text, { children: [targetCountsText, fileCountsText, testCountsText, assertionCountsText, suppressedCountsText, durationText] }));
31
+ }
@@ -0,0 +1,3 @@
1
+ import { ResultStatus, type TestResultStatus } from "#result";
2
+ import { type ScribblerJsx } from "#scribbler";
3
+ export declare function testNameText(status: Exclude<TestResultStatus, ResultStatus.Runs>, name: string, indent?: number): ScribblerJsx.Element;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "#scribbler/jsx-runtime";
2
+ import { Line, Text } from "#scribbler";
3
+ import { getStatusColor } from "./helpers.js";
4
+ export function testNameText(status, name, indent = 0) {
5
+ let statusText;
6
+ switch (status) {
7
+ case "passed":
8
+ statusText = "+";
9
+ break;
10
+ case "failed":
11
+ statusText = "×";
12
+ break;
13
+ case "skipped":
14
+ statusText = "- skip";
15
+ break;
16
+ case "fixme":
17
+ statusText = "- fixme";
18
+ break;
19
+ case "todo":
20
+ statusText = "- todo";
21
+ break;
22
+ }
23
+ return (_jsxs(Line, { indent: indent + 1, children: [_jsx(Text, { color: getStatusColor(status), children: statusText }), " ", _jsx(Text, { color: "90", children: name })] }));
24
+ }
@@ -0,0 +1,5 @@
1
+ export interface CodeFrameOptions {
2
+ linesAbove?: number;
3
+ linesBelow?: number;
4
+ showBreadcrumbs?: boolean;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { type ProjectConfig } from "#result";
2
+ import { type ScribblerJsx } from "#scribbler";
3
+ export declare function usesText(compilerVersion: string, projectConfig: ProjectConfig, options?: {
4
+ short?: boolean;
5
+ }): ScribblerJsx.Element;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "#scribbler/jsx-runtime";
2
+ import { Path } from "#path";
3
+ import { Line, Text } from "#scribbler";
4
+ export function usesText(compilerVersion, projectConfig, options) {
5
+ if (options?.short) {
6
+ return _jsx(Text, { color: "34", children: compilerVersion });
7
+ }
8
+ let projectConfigText;
9
+ switch (projectConfig.kind) {
10
+ case 0:
11
+ case 2:
12
+ projectConfigText = (_jsxs(Text, { color: "90", children: [" with ", Path.relative("", projectConfig.specifier)] }));
13
+ break;
14
+ case 1:
15
+ projectConfigText = (_jsxs(Text, { color: "90", children: [" with ", projectConfig.specifier, " TSConfig"] }));
16
+ break;
17
+ case 3:
18
+ projectConfigText = _jsx(Text, { color: "90", children: " with inline TSConfig" });
19
+ break;
20
+ }
21
+ return (_jsxs(Text, { children: [_jsxs(Line, { children: [_jsx(Text, { color: "34", children: "uses" }), " TypeScript ", compilerVersion, projectConfigText] }), _jsx(Line, {})] }));
22
+ }
@@ -0,0 +1,2 @@
1
+ import { type ScribblerJsx } from "#scribbler";
2
+ export declare function waitingForFileChangesText(): ScribblerJsx.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "#scribbler/jsx-runtime";
2
+ import { Line } from "#scribbler";
3
+ export function waitingForFileChangesText() {
4
+ return _jsx(Line, { children: "Waiting for file changes." });
5
+ }
@@ -0,0 +1,2 @@
1
+ import { type ScribblerJsx } from "#scribbler";
2
+ export declare function watchUsageText(): ScribblerJsx.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "#scribbler/jsx-runtime";
2
+ import { Line, Text } from "#scribbler";
3
+ export function watchUsageText() {
4
+ const usage = [
5
+ ["a", "to run all tests."],
6
+ ["x", "to exit."],
7
+ ];
8
+ const usageText = usage.map(([keyText, actionText]) => {
9
+ return (_jsxs(Line, { children: [_jsx(Text, { color: "90", children: "Press" }), _jsx(Text, { children: ` ${keyText} ` }), _jsx(Text, { color: "90", children: actionText })] }));
10
+ });
11
+ return _jsx(Text, { children: usageText });
12
+ }
@@ -0,0 +1,7 @@
1
+ export declare class Path {
2
+ static normalizeSlashes: (filePath: string) => string;
3
+ static dirname(filePath: string): string;
4
+ static join(...filePaths: Array<string>): string;
5
+ static relative(from: string, to: string): string;
6
+ static resolve(...filePaths: Array<string>): string;
7
+ }
@@ -0,0 +1,28 @@
1
+ import path from "node:path";
2
+ export class Path {
3
+ static normalizeSlashes;
4
+ static {
5
+ if (path.sep === "/") {
6
+ Path.normalizeSlashes = (filePath) => filePath;
7
+ }
8
+ else {
9
+ Path.normalizeSlashes = (filePath) => filePath.replace(/\\/g, "/");
10
+ }
11
+ }
12
+ static dirname(filePath) {
13
+ return Path.normalizeSlashes(path.dirname(filePath));
14
+ }
15
+ static join(...filePaths) {
16
+ return Path.normalizeSlashes(path.join(...filePaths));
17
+ }
18
+ static relative(from, to) {
19
+ const relativePath = Path.normalizeSlashes(path.relative(from, to));
20
+ if (/^\.\.?\//.test(relativePath)) {
21
+ return relativePath;
22
+ }
23
+ return `./${relativePath}`;
24
+ }
25
+ static resolve(...filePaths) {
26
+ return Path.normalizeSlashes(path.resolve(...filePaths));
27
+ }
28
+ }
@@ -0,0 +1 @@
1
+ export { Path } from "./Path.js";
@@ -0,0 +1 @@
1
+ export { Path } from "./Path.js";
@@ -0,0 +1,12 @@
1
+ import type ts6 from "@typescript/typescript6";
2
+ import { type Offset } from "#editor";
3
+ export declare class CompatMappedDiagnostic {
4
+ category: ts6.DiagnosticCategory;
5
+ code: number;
6
+ file: ts6.SourceFile;
7
+ length: number | undefined;
8
+ messageText: string | ts6.DiagnosticMessageChain;
9
+ relatedInformation?: Array<ts6.DiagnosticRelatedInformation>;
10
+ start: number | undefined;
11
+ constructor(sourceFile: ts6.SourceFile, diagnostic: ts6.Diagnostic, offsets?: Array<Offset>);
12
+ }
@@ -0,0 +1,25 @@
1
+ import { TextEditor } from "#editor";
2
+ export class CompatMappedDiagnostic {
3
+ category;
4
+ code;
5
+ file;
6
+ length;
7
+ messageText;
8
+ relatedInformation;
9
+ start;
10
+ constructor(sourceFile, diagnostic, offsets = []) {
11
+ this.file = sourceFile;
12
+ if (diagnostic.start != null) {
13
+ this.start = diagnostic.start - TextEditor.getOffset(diagnostic.start, offsets);
14
+ this.length = diagnostic.length;
15
+ }
16
+ this.category = diagnostic.category;
17
+ this.code = diagnostic.code;
18
+ this.messageText = diagnostic.messageText;
19
+ if (diagnostic.relatedInformation != null) {
20
+ this.relatedInformation = diagnostic.relatedInformation.map((related) => related.file?.fileName === sourceFile.fileName
21
+ ? new CompatMappedDiagnostic(sourceFile, related, offsets)
22
+ : related);
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,19 @@
1
+ import type ts6 from "@typescript/typescript6";
2
+ import { CompatCheckerAdapter } from "#checker";
3
+ import { type ResolvedConfig } from "#config";
4
+ import type { Offset } from "#editor";
5
+ import type * as ts from "#typescript";
6
+ import { CompatMappedDiagnostic } from "./CompatMappedDiagnostic.js";
7
+ export declare class CompatProjectService {
8
+ #private;
9
+ constructor(compiler: typeof ts6, resolvedConfig: ResolvedConfig);
10
+ closeFile(filePath: string): void;
11
+ getChecker(): CompatCheckerAdapter;
12
+ getMappedDiagnostic(sourceFile: ts.SourceFile, diagnostic: ts.Diagnostic, offsets?: Array<Offset>): CompatMappedDiagnostic;
13
+ getProgram(): ts6.Program;
14
+ getSourceFile(filePath: string): ts6.SourceFile | undefined;
15
+ getSemanticDiagnostics(filePath: string): ReadonlyArray<ts6.Diagnostic>;
16
+ getSyntacticDiagnostics(filePath: string): ReadonlyArray<ts6.Diagnostic>;
17
+ openFile(filePath: string, fileText?: string): void;
18
+ openLayer(filePath: string, fileText: string): ReadonlyArray<ts.Diagnostic>;
19
+ }
@@ -0,0 +1,188 @@
1
+ import { CompatCheckerAdapter } from "#checker";
2
+ import { Options } from "#config";
3
+ import { Diagnostic } from "#diagnostic";
4
+ import { EventEmitter } from "#events";
5
+ import { Path } from "#path";
6
+ import { Select } from "#select";
7
+ import { TextFileService } from "#text";
8
+ import { Version } from "#version";
9
+ import { CompatMappedDiagnostic } from "./CompatMappedDiagnostic.js";
10
+ export class CompatProjectService {
11
+ #compiler;
12
+ #languageService;
13
+ #host;
14
+ #lastSeenProject = "none";
15
+ #projectConfig;
16
+ #resolvedConfig;
17
+ #seenProjects = new Set();
18
+ #service;
19
+ constructor(compiler, resolvedConfig) {
20
+ this.#compiler = compiler;
21
+ this.#projectConfig = this.#resolveProjectConfig(resolvedConfig);
22
+ this.#resolvedConfig = resolvedConfig;
23
+ const noop = () => undefined;
24
+ const noopLogger = {
25
+ close: noop,
26
+ endGroup: noop,
27
+ getLogFileName: noop,
28
+ hasLevel: () => false,
29
+ info: noop,
30
+ loggingEnabled: () => false,
31
+ msg: noop,
32
+ perftrc: noop,
33
+ startGroup: noop,
34
+ };
35
+ const noopWatcher = {
36
+ close: noop,
37
+ };
38
+ this.#host = {
39
+ ...compiler.sys,
40
+ clearImmediate,
41
+ clearTimeout,
42
+ setImmediate,
43
+ setTimeout,
44
+ watchDirectory: () => noopWatcher,
45
+ watchFile: () => noopWatcher,
46
+ };
47
+ if (this.#projectConfig.kind === 3) {
48
+ this.#host.readFile = (path) => path === this.#projectConfig.specifier ? resolvedConfig.tsconfig : compiler.sys.readFile(path);
49
+ }
50
+ this.#service = new this.#compiler.server.ProjectService({
51
+ allowLocalPluginLoads: true,
52
+ cancellationToken: this.#compiler.server.nullCancellationToken,
53
+ host: this.#host,
54
+ logger: noopLogger,
55
+ session: undefined,
56
+ useInferredProjectPerProjectRoot: true,
57
+ useSingleInferredProject: false,
58
+ });
59
+ this.#service.setCompilerOptionsForInferredProjects(this.#getDefaultCompilerOptions());
60
+ }
61
+ closeFile(filePath) {
62
+ TextFileService.close();
63
+ this.#service.closeClientFile(filePath);
64
+ }
65
+ #getDefaultCompilerOptions() {
66
+ const defaultCompilerOptions = {
67
+ allowJs: true,
68
+ checkJs: true,
69
+ allowImportingTsExtensions: true,
70
+ exactOptionalPropertyTypes: true,
71
+ jsx: this.#compiler.JsxEmit.Preserve,
72
+ module: this.#compiler.ModuleKind.NodeNext,
73
+ moduleResolution: this.#compiler.ModuleResolutionKind.NodeNext,
74
+ noEmit: true,
75
+ noUncheckedIndexedAccess: true,
76
+ resolveJsonModule: true,
77
+ strict: true,
78
+ target: this.#compiler.ScriptTarget.ESNext,
79
+ };
80
+ if (Version.isSatisfiedWith(this.#compiler.version, "5.6")) {
81
+ defaultCompilerOptions.noUncheckedSideEffectImports = true;
82
+ }
83
+ return defaultCompilerOptions;
84
+ }
85
+ getChecker() {
86
+ return new CompatCheckerAdapter(this.#compiler, this.#languageService.getProgram().getTypeChecker());
87
+ }
88
+ getMappedDiagnostic(sourceFile, diagnostic, offsets) {
89
+ return new CompatMappedDiagnostic(sourceFile, diagnostic, offsets);
90
+ }
91
+ getProgram() {
92
+ return this.#languageService.getProgram();
93
+ }
94
+ getSourceFile(filePath) {
95
+ return this.#languageService.getProgram().getSourceFile(filePath);
96
+ }
97
+ #getLanguageService(filePath) {
98
+ const project = this.#service.getDefaultProjectForFile(this.#compiler.server.toNormalizedPath(filePath), true);
99
+ const compilerOptions = project?.getCompilerOptions();
100
+ if (this.#resolvedConfig.checkDeclarationFiles && compilerOptions?.skipLibCheck) {
101
+ project?.setCompilerOptions({ ...compilerOptions, skipLibCheck: false });
102
+ }
103
+ return project?.getLanguageService(true);
104
+ }
105
+ getSemanticDiagnostics(filePath) {
106
+ return this.getProgram().getSemanticDiagnostics(this.getSourceFile(filePath));
107
+ }
108
+ getSyntacticDiagnostics(filePath) {
109
+ return this.getProgram().getSyntacticDiagnostics(this.getSourceFile(filePath));
110
+ }
111
+ #isFileIncluded(filePath) {
112
+ const configSourceFile = this.#compiler.readJsonConfigFile(this.#projectConfig.specifier, this.#host.readFile);
113
+ const { fileNames } = this.#compiler.parseJsonSourceFileConfigFileContent(configSourceFile, this.#host, Path.dirname(this.#projectConfig.specifier), undefined, this.#projectConfig.specifier);
114
+ return fileNames.includes(filePath);
115
+ }
116
+ openFile(filePath, fileText) {
117
+ switch (this.#projectConfig.kind) {
118
+ case 0:
119
+ break;
120
+ case 1:
121
+ this.#service.getConfigFileNameForFile = () => undefined;
122
+ break;
123
+ default:
124
+ this.#service.getConfigFileNameForFile = this.#isFileIncluded(filePath)
125
+ ? () => this.#projectConfig.specifier
126
+ : () => undefined;
127
+ }
128
+ const { configFileErrors, configFileName } = this.#service.openClientFile(filePath, fileText, undefined, this.#resolvedConfig.rootPath);
129
+ if (configFileName !== this.#lastSeenProject) {
130
+ this.#lastSeenProject = configFileName;
131
+ this.#languageService = this.#getLanguageService(filePath);
132
+ const projectConfig = configFileName != null
133
+ ? { ...this.#projectConfig, specifier: configFileName }
134
+ : { kind: 1, specifier: "baseline" };
135
+ EventEmitter.dispatch(["project:uses", { compilerVersion: this.#compiler.version, projectConfig }]);
136
+ if (configFileErrors && configFileErrors.length > 0) {
137
+ EventEmitter.dispatch(["project:error", { diagnostics: Diagnostic.fromDiagnostics(configFileErrors) }]);
138
+ }
139
+ }
140
+ const program = this.getProgram();
141
+ if (this.#seenProjects.has(configFileName)) {
142
+ return;
143
+ }
144
+ this.#seenProjects.add(configFileName);
145
+ const sourceFilesToCheck = program.getSourceFiles().filter((sourceFile) => {
146
+ if (program.isSourceFileFromExternalLibrary(sourceFile) || program.isSourceFileDefaultLibrary(sourceFile)) {
147
+ return false;
148
+ }
149
+ if (this.#resolvedConfig.checkDeclarationFiles && sourceFile.isDeclarationFile) {
150
+ return true;
151
+ }
152
+ if (Select.isFixtureFile(sourceFile.fileName, this.#resolvedConfig)) {
153
+ return true;
154
+ }
155
+ return false;
156
+ });
157
+ const diagnostics = [
158
+ ...program.getOptionsDiagnostics(),
159
+ ...sourceFilesToCheck.flatMap((sourceFile) => [
160
+ ...program.getSyntacticDiagnostics(sourceFile),
161
+ ...program.getSemanticDiagnostics(sourceFile),
162
+ ...program.getDeclarationDiagnostics(sourceFile),
163
+ ].sort((a, b) => a.start - b.start)),
164
+ ];
165
+ if (diagnostics.length > 0) {
166
+ EventEmitter.dispatch(["project:error", { diagnostics: Diagnostic.fromDiagnostics(diagnostics) }]);
167
+ }
168
+ }
169
+ openLayer(filePath, fileText) {
170
+ this.#service.openClientFile(filePath, fileText, undefined, this.#resolvedConfig.rootPath);
171
+ return this.getSemanticDiagnostics(filePath);
172
+ }
173
+ #resolveProjectConfig(resolvedConfig) {
174
+ if (resolvedConfig.tsconfig === "baseline") {
175
+ return { kind: 1, specifier: "baseline" };
176
+ }
177
+ if (resolvedConfig.tsconfig === "findup") {
178
+ return { kind: 0, specifier: "" };
179
+ }
180
+ if (Options.isJsonString(resolvedConfig.tsconfig)) {
181
+ return {
182
+ kind: 3,
183
+ specifier: Path.resolve(resolvedConfig.rootPath, `${Date.now().toString(36)}.tsconfig.json`),
184
+ };
185
+ }
186
+ return { kind: 2, specifier: resolvedConfig.tsconfig };
187
+ }
188
+ }
@@ -0,0 +1,6 @@
1
+ export declare class FileMapService {
2
+ #private;
3
+ add(path: string, text: string): void;
4
+ get(): Record<string, string>;
5
+ hasChanged(): boolean;
6
+ }
@@ -0,0 +1,14 @@
1
+ export class FileMapService {
2
+ #files = new Map();
3
+ add(path, text) {
4
+ this.#files.set(path, text);
5
+ }
6
+ get() {
7
+ const result = Object.fromEntries(this.#files);
8
+ this.#files.clear();
9
+ return result;
10
+ }
11
+ hasChanged() {
12
+ return this.#files.size > 0;
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ import type * as tsAst from "typescript/ast";
2
+ import type * as tsApi from "typescript/sync";
3
+ import { type Offset } from "#editor";
4
+ export declare class NativeMappedDiagnostic {
5
+ fileName: tsAst.RootedFilePath;
6
+ pos: number;
7
+ end: number;
8
+ code: number;
9
+ category: tsApi.DiagnosticCategory;
10
+ text: string;
11
+ messageChain?: Array<tsApi.Diagnostic>;
12
+ relatedInformation?: Array<tsApi.Diagnostic>;
13
+ constructor(sourceFile: tsAst.SourceFile, diagnostic: tsApi.Diagnostic, offsets?: Array<Offset>);
14
+ }
@@ -0,0 +1,29 @@
1
+ import { TextEditor } from "#editor";
2
+ export class NativeMappedDiagnostic {
3
+ fileName;
4
+ pos;
5
+ end;
6
+ code;
7
+ category;
8
+ text;
9
+ messageChain;
10
+ relatedInformation;
11
+ constructor(sourceFile, diagnostic, offsets = []) {
12
+ this.fileName = sourceFile.fileName;
13
+ this.pos = diagnostic.pos - TextEditor.getOffset(diagnostic.pos, offsets);
14
+ this.end = diagnostic.end - TextEditor.getOffset(diagnostic.end, offsets);
15
+ this.code = diagnostic.code;
16
+ this.category = diagnostic.category;
17
+ this.text = diagnostic.text;
18
+ if (diagnostic.messageChain != null) {
19
+ this.messageChain = diagnostic.messageChain.map((diagnostic) => diagnostic.fileName === sourceFile.fileName
20
+ ? new NativeMappedDiagnostic(sourceFile, diagnostic, offsets)
21
+ : diagnostic);
22
+ }
23
+ if (diagnostic.relatedInformation != null) {
24
+ this.relatedInformation = diagnostic.relatedInformation.map((diagnostic) => diagnostic.fileName === sourceFile.fileName
25
+ ? new NativeMappedDiagnostic(sourceFile, diagnostic, offsets)
26
+ : diagnostic);
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,21 @@
1
+ import type * as tsAst from "typescript/ast";
2
+ import type * as tsApi from "typescript/sync";
3
+ import { NativeCheckerAdapter } from "#checker";
4
+ import { type ResolvedConfig } from "#config";
5
+ import type { Offset } from "#editor";
6
+ import type * as ts from "#typescript";
7
+ import { NativeMappedDiagnostic } from "./NativeMappedDiagnostic.js";
8
+ export declare class NativeProjectService {
9
+ #private;
10
+ constructor(ts: ts.NativeTypeScript, resolvedConfig: ResolvedConfig);
11
+ close(): void;
12
+ closeFile(): void;
13
+ getChecker(): NativeCheckerAdapter;
14
+ getMappedDiagnostic(sourceFile: ts.SourceFile, diagnostic: ts.Diagnostic, offsets?: Array<Offset>): NativeMappedDiagnostic;
15
+ getProgram(): tsApi.Program;
16
+ getSourceFile(filePath: string): tsAst.SourceFile | undefined;
17
+ getSemanticDiagnostics(filePath: string): ReadonlyArray<tsApi.Diagnostic>;
18
+ getSyntacticDiagnostics(filePath: string): ReadonlyArray<tsApi.Diagnostic>;
19
+ openFile(filePath: tsAst.RootedFilePath, fileText?: string): void;
20
+ openLayer(filePath: string, fileText: string): ReadonlyArray<ts.Diagnostic>;
21
+ }