tsc-ts 0.1.1 → 0.1.3

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 (41) hide show
  1. package/README.md +7 -1
  2. package/dist/api/compiler/ast.d.ts +6 -0
  3. package/dist/api/compiler/ast.js +19 -3
  4. package/dist/api/compiler/checker-functions.js +5 -1
  5. package/dist/api/compiler/checker-grammar.d.ts +39 -4
  6. package/dist/api/compiler/checker-grammar.js +239 -75
  7. package/dist/api/compiler/checker-heritage.js +20 -14
  8. package/dist/api/compiler/checker-modules.js +4 -2
  9. package/dist/api/compiler/checker-narrowing.d.ts +7 -0
  10. package/dist/api/compiler/checker-narrowing.js +31 -4
  11. package/dist/api/compiler/checker-source-file.js +16 -1
  12. package/dist/api/compiler/checker-statements.js +11 -2
  13. package/dist/api/compiler/checker-type-factory.js +17 -7
  14. package/dist/api/compiler/checker-type-nodes.d.ts +1 -1
  15. package/dist/api/compiler/checker-type-nodes.js +5 -5
  16. package/dist/api/compiler/checker-unused.js +15 -10
  17. package/dist/api/compiler/checker.d.ts +4 -0
  18. package/dist/api/compiler/checker.js +6 -0
  19. package/dist/api/compiler/file-loader.d.ts +5 -0
  20. package/dist/api/compiler/file-loader.js +7 -0
  21. package/dist/api/compiler/program-checker.d.ts +18 -0
  22. package/dist/api/compiler/program-checker.js +27 -0
  23. package/package.json +14 -9
  24. package/src/compiler/ast.ts +20 -3
  25. package/src/compiler/checker-functions.ts +5 -0
  26. package/src/compiler/checker-grammar.ts +247 -88
  27. package/src/compiler/checker-heritage.ts +31 -17
  28. package/src/compiler/checker-modules.ts +4 -2
  29. package/src/compiler/checker-narrowing.ts +30 -4
  30. package/src/compiler/checker-source-file.ts +16 -1
  31. package/src/compiler/checker-statements.ts +10 -2
  32. package/src/compiler/checker-type-factory.ts +14 -7
  33. package/src/compiler/checker-type-nodes.ts +5 -5
  34. package/src/compiler/checker-unused.ts +13 -8
  35. package/src/compiler/checker.ts +6 -0
  36. package/src/compiler/file-loader.ts +8 -0
  37. package/src/compiler/parallel-check.ts +13 -1
  38. package/src/compiler/parse-thread.ts +24 -2
  39. package/src/compiler/program-checker.ts +28 -0
  40. package/src/compiler/run-records.ts +12 -5
  41. package/src/compiler/tsc-compile.ts +10 -1
@@ -878,6 +878,8 @@ export class Statistics {
878
878
  rows.push([prefix + 'Types', String(this.types)]);
879
879
  rows.push([prefix + 'Instantiations', String(this.instantiations)]);
880
880
  rows.push([prefix + 'Memory used', `${Math.floor(this.memoryUsed / 1024)}K`]);
881
+ // The table has tsgo's rows. No runtime counter matches its allocation count (runtime.MemStats.Mallocs),
882
+ // so this one stays 0.
881
883
  rows.push([prefix + 'Memory allocs', String(this.memoryAllocs)]);
882
884
  const t = this.times;
883
885
  if (t.configTime !== 0) rows.push([prefix + 'Config time', formatDuration(t.configTime)]);
@@ -916,7 +918,14 @@ export function statisticsOf(compilerProgram: CompilerProgram): Statistics {
916
918
  statistics.identifiers += file.identifierCount;
917
919
  statistics.symbols += file.symbolCount;
918
920
  }
919
- statistics.types = compilerProgram.checked.checker.typeCount;
921
+ // Every checker's counts, the checker threads' included, as tsgo's statisticsFromProgram reports them.
922
+ const counts = compilerProgram.checked.checkerCounts();
923
+ statistics.symbols += counts.symbols;
924
+ statistics.types = counts.types;
925
+ statistics.instantiations = counts.instantiations;
926
+ // tsgo reports the Go heap in use (runtime.MemStats.Alloc); the closest this runtime has is the
927
+ // process's resident set, which includes the checker threads' heaps.
928
+ statistics.memoryUsed = process.memoryUsage.rss();
920
929
  const t = statistics.times;
921
930
  const source = compilerProgram.times;
922
931
  t.configTime = source.configTime;