@appthreat/atom-parsetools 1.1.4 → 1.2.0

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 (309) hide show
  1. package/astgen.js +1067 -101
  2. package/package.json +9 -11
  3. package/plugins/bin/ruby_ast_gen +1 -1
  4. package/plugins/composer/installed.php +6 -6
  5. package/plugins/rubyastgen/Gemfile +3 -3
  6. package/plugins/rubyastgen/Gemfile.lock +7 -7
  7. package/plugins/rubyastgen/bundle/bundler/setup.rb +4 -4
  8. package/plugins/rubyastgen/bundle/ruby/4.0.0/bundler/gems/{ruby_ast_gen-e58f82cd4b36 → ruby_ast_gen-cc312ebf06b4}/exe/ruby_ast_gen +4 -1
  9. package/plugins/rubyastgen/bundle/ruby/4.0.0/bundler/gems/{ruby_ast_gen-e58f82cd4b36 → ruby_ast_gen-cc312ebf06b4}/lib/ruby_ast_gen/node_handling.rb +24 -8
  10. package/plugins/rubyastgen/bundle/ruby/4.0.0/bundler/gems/{ruby_ast_gen-e58f82cd4b36 → ruby_ast_gen-cc312ebf06b4}/lib/ruby_ast_gen/version.rb +1 -1
  11. package/plugins/rubyastgen/bundle/ruby/4.0.0/bundler/gems/{ruby_ast_gen-e58f82cd4b36 → ruby_ast_gen-cc312ebf06b4}/lib/ruby_ast_gen.rb +63 -14
  12. package/plugins/rubyastgen/bundle/ruby/4.0.0/extensions/x86_64-linux/4.0.0/{prism-1.7.0 → prism-1.9.0}/gem_make.out +12 -12
  13. package/plugins/rubyastgen/bundle/ruby/4.0.0/extensions/x86_64-linux/4.0.0/{prism-1.7.0 → prism-1.9.0}/mkmf.log +6 -6
  14. package/plugins/rubyastgen/bundle/ruby/4.0.0/extensions/x86_64-linux/4.0.0/prism-1.9.0/prism/prism.so +0 -0
  15. package/plugins/rubyastgen/bundle/ruby/4.0.0/extensions/x86_64-linux/4.0.0/racc-1.8.1/gem_make.out +5 -5
  16. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/current.rb +2 -2
  17. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/meta.rb +1 -1
  18. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/version.rb +1 -1
  19. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/Makefile +7 -1
  20. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/ext/prism/Makefile +1 -1
  21. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/ext/prism/extension.h +1 -1
  22. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/ast.h +4 -4
  23. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/version.h +2 -2
  24. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/compiler.rb +152 -152
  25. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/lex_compat.rb +133 -150
  26. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/node.rb +1131 -20
  27. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/parse_result.rb +9 -0
  28. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.9.0/lib/prism/prism.so +0 -0
  29. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/serialize.rb +1 -1
  30. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/translation/parser_current.rb +1 -1
  31. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.9.0/lib/prism/translation/parser_versions.rb +36 -0
  32. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.9.0/lib/prism/translation/ripper/filter.rb +53 -0
  33. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.9.0/lib/prism/translation/ripper/lexer.rb +135 -0
  34. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/translation/ripper.rb +84 -38
  35. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/translation/ruby_parser.rb +1 -1
  36. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/translation.rb +5 -5
  37. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/visitor.rb +152 -152
  38. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism.rb +1 -14
  39. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/rbi/prism/node.rbi +3 -0
  40. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.9.0/rbi/prism/translation/parser_versions.rbi +23 -0
  41. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/rbi/prism.rbi +0 -3
  42. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/node.rbs +4 -0
  43. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/parse_result.rbs +1 -0
  44. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism.rbs +54 -40
  45. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/prism.c +48 -27
  46. package/plugins/rubyastgen/setup.ps1 +13 -2
  47. package/plugins/rubyastgen/setup.sh +11 -0
  48. package/plugins/nikic/php-parser/README.md +0 -233
  49. package/plugins/rubyastgen/bundle/ruby/4.0.0/bundler/gems/ruby_ast_gen-e58f82cd4b36/Gemfile +0 -11
  50. package/plugins/rubyastgen/bundle/ruby/4.0.0/bundler/gems/ruby_ast_gen-e58f82cd4b36/LICENSE.txt +0 -213
  51. package/plugins/rubyastgen/bundle/ruby/4.0.0/bundler/gems/ruby_ast_gen-e58f82cd4b36/README.md +0 -49
  52. package/plugins/rubyastgen/bundle/ruby/4.0.0/bundler/gems/ruby_ast_gen-e58f82cd4b36/Rakefile +0 -8
  53. package/plugins/rubyastgen/bundle/ruby/4.0.0/bundler/gems/ruby_ast_gen-e58f82cd4b36/ruby_ast_gen.gemspec +0 -25
  54. package/plugins/rubyastgen/bundle/ruby/4.0.0/bundler/gems/ruby_ast_gen-e58f82cd4b36/spec/ruby_ast_gen_spec.rb +0 -440
  55. package/plugins/rubyastgen/bundle/ruby/4.0.0/bundler/gems/ruby_ast_gen-e58f82cd4b36/spec/spec_helper.rb +0 -15
  56. package/plugins/rubyastgen/bundle/ruby/4.0.0/extensions/x86_64-linux/4.0.0/prism-1.7.0/prism/prism.so +0 -0
  57. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/ast-2.4.3/README.YARD.md +0 -12
  58. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/CHANGELOG.md +0 -5239
  59. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/LICENSE.md +0 -22
  60. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/README.md +0 -58
  61. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/bundler.gemspec +0 -46
  62. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/lib/bundler/man/index.txt +0 -33
  63. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/lib/bundler/templates/Gemfile +0 -5
  64. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/Gemfile.tt +0 -24
  65. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +0 -11
  66. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +0 -15
  67. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +0 -6
  68. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/test/minitest/test_newgem.rb.tt +0 -13
  69. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +0 -15
  70. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +0 -6
  71. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/LICENSE.txt +0 -21
  72. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/LICENSE.md +0 -20
  73. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/bundler-2.6.7/lib/bundler/vendor/tsort/LICENSE.txt +0 -22
  74. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/ostruct-0.6.3/Gemfile +0 -10
  75. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/ostruct-0.6.3/README.md +0 -69
  76. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/ostruct-0.6.3/Rakefile +0 -18
  77. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/ostruct-0.6.3/ostruct.gemspec +0 -26
  78. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/parser-3.3.10.0/LICENSE.txt +0 -26
  79. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/parser-3.3.10.0/parser.gemspec +0 -43
  80. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/CHANGELOG.md +0 -756
  81. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/CODE_OF_CONDUCT.md +0 -76
  82. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/CONTRIBUTING.md +0 -58
  83. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/LICENSE.md +0 -7
  84. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/README.md +0 -143
  85. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/config.yml +0 -4739
  86. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/build_system.md +0 -119
  87. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/configuration.md +0 -68
  88. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/cruby_compilation.md +0 -27
  89. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/design.md +0 -53
  90. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/encoding.md +0 -121
  91. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/fuzzing.md +0 -88
  92. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/heredocs.md +0 -36
  93. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/javascript.md +0 -118
  94. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/local_variable_depth.md +0 -229
  95. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/mapping.md +0 -117
  96. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/parser_translation.md +0 -24
  97. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/parsing_rules.md +0 -22
  98. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/releasing.md +0 -77
  99. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/relocation.md +0 -34
  100. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/ripper_translation.md +0 -72
  101. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/ruby_api.md +0 -44
  102. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/ruby_parser_translation.md +0 -19
  103. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/serialization.md +0 -233
  104. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/docs/testing.md +0 -55
  105. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/lib/prism/prism.so +0 -0
  106. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/lib/prism/translation/parser33.rb +0 -13
  107. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/lib/prism/translation/parser34.rb +0 -13
  108. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/lib/prism/translation/parser35.rb +0 -8
  109. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/lib/prism/translation/parser40.rb +0 -13
  110. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/lib/prism/translation/parser41.rb +0 -13
  111. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/prism.gemspec +0 -178
  112. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/rbi/prism/translation/parser33.rbi +0 -6
  113. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/rbi/prism/translation/parser34.rbi +0 -6
  114. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/rbi/prism/translation/parser35.rbi +0 -4
  115. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/rbi/prism/translation/parser40.rbi +0 -6
  116. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/rbi/prism/translation/parser41.rbi +0 -6
  117. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/racc-1.8.1/doc/en/grammar.en.rdoc +0 -218
  118. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/racc-1.8.1/doc/en/grammar2.en.rdoc +0 -219
  119. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/racc-1.8.1/doc/ja/command.ja.html +0 -99
  120. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/racc-1.8.1/doc/ja/debug.ja.rdoc +0 -36
  121. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/racc-1.8.1/doc/ja/grammar.ja.rdoc +0 -348
  122. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/racc-1.8.1/doc/ja/index.ja.html +0 -10
  123. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/racc-1.8.1/doc/ja/parser.ja.rdoc +0 -125
  124. package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/racc-1.8.1/doc/ja/usage.ja.html +0 -414
  125. package/plugins/rubyastgen/bundle/ruby/4.0.0/specifications/ast-2.4.3.gemspec +0 -29
  126. package/plugins/rubyastgen/bundle/ruby/4.0.0/specifications/bundler-2.6.7.gemspec +0 -25
  127. package/plugins/rubyastgen/bundle/ruby/4.0.0/specifications/ostruct-0.6.3.gemspec +0 -22
  128. package/plugins/rubyastgen/bundle/ruby/4.0.0/specifications/parser-3.3.10.0.gemspec +0 -37
  129. package/plugins/rubyastgen/bundle/ruby/4.0.0/specifications/prism-1.7.0.gemspec +0 -24
  130. package/plugins/rubyastgen/bundle/ruby/4.0.0/specifications/racc-1.8.1.gemspec +0 -28
  131. /package/plugins/rubyastgen/bundle/ruby/4.0.0/bundler/gems/{ruby_ast_gen-e58f82cd4b36 → ruby_ast_gen-cc312ebf06b4}/.rspec +0 -0
  132. /package/plugins/rubyastgen/bundle/ruby/4.0.0/bundler/gems/{ruby_ast_gen-e58f82cd4b36 → ruby_ast_gen-cc312ebf06b4}/bin/console +0 -0
  133. /package/plugins/rubyastgen/bundle/ruby/4.0.0/bundler/gems/{ruby_ast_gen-e58f82cd4b36 → ruby_ast_gen-cc312ebf06b4}/bin/setup +0 -0
  134. /package/plugins/rubyastgen/bundle/ruby/4.0.0/bundler/gems/{ruby_ast_gen-e58f82cd4b36 → ruby_ast_gen-cc312ebf06b4}/update_version.rb +0 -0
  135. /package/plugins/rubyastgen/bundle/ruby/4.0.0/extensions/x86_64-linux/4.0.0/{prism-1.7.0 → prism-1.9.0}/gem.build_complete +0 -0
  136. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/bin/ruby-parse +0 -0
  137. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/bin/ruby-rewrite +0 -0
  138. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/gauntlet_parser.rb +0 -0
  139. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/all.rb +0 -0
  140. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ast/node.rb +0 -0
  141. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ast/processor.rb +0 -0
  142. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/base.rb +0 -0
  143. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/builders/default.rb +0 -0
  144. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/clobbering_error.rb +0 -0
  145. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/color.rb +0 -0
  146. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/context.rb +0 -0
  147. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/current_arg_stack.rb +0 -0
  148. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/deprecation.rb +0 -0
  149. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/diagnostic/engine.rb +0 -0
  150. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/diagnostic.rb +0 -0
  151. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/lexer/dedenter.rb +0 -0
  152. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/lexer/explanation.rb +0 -0
  153. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/lexer/literal.rb +0 -0
  154. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/lexer/stack_state.rb +0 -0
  155. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/lexer-F0.rb +0 -0
  156. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/lexer-F1.rb +0 -0
  157. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/lexer-strings.rb +0 -0
  158. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/macruby.rb +0 -0
  159. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/max_numparam_stack.rb +0 -0
  160. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/messages.rb +0 -0
  161. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/rewriter.rb +0 -0
  162. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ruby18.rb +0 -0
  163. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ruby19.rb +0 -0
  164. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ruby20.rb +0 -0
  165. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ruby21.rb +0 -0
  166. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ruby22.rb +0 -0
  167. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ruby23.rb +0 -0
  168. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ruby24.rb +0 -0
  169. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ruby25.rb +0 -0
  170. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ruby26.rb +0 -0
  171. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ruby27.rb +0 -0
  172. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ruby30.rb +0 -0
  173. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ruby31.rb +0 -0
  174. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ruby32.rb +0 -0
  175. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ruby33.rb +0 -0
  176. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/ruby34.rb +0 -0
  177. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/rubymotion.rb +0 -0
  178. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/runner/ruby_parse.rb +0 -0
  179. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/runner/ruby_rewrite.rb +0 -0
  180. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/runner.rb +0 -0
  181. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/buffer.rb +0 -0
  182. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/comment/associator.rb +0 -0
  183. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/comment.rb +0 -0
  184. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map/collection.rb +0 -0
  185. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map/condition.rb +0 -0
  186. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map/constant.rb +0 -0
  187. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map/definition.rb +0 -0
  188. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map/for.rb +0 -0
  189. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map/heredoc.rb +0 -0
  190. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map/index.rb +0 -0
  191. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map/keyword.rb +0 -0
  192. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map/method_definition.rb +0 -0
  193. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map/objc_kwarg.rb +0 -0
  194. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map/operator.rb +0 -0
  195. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map/rescue_body.rb +0 -0
  196. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map/send.rb +0 -0
  197. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map/ternary.rb +0 -0
  198. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map/variable.rb +0 -0
  199. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/map.rb +0 -0
  200. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/range.rb +0 -0
  201. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/rewriter/action.rb +0 -0
  202. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/rewriter.rb +0 -0
  203. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/tree_rewriter/action.rb +0 -0
  204. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/source/tree_rewriter.rb +0 -0
  205. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/static_environment.rb +0 -0
  206. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/syntax_error.rb +0 -0
  207. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/tree_rewriter.rb +0 -0
  208. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/unknown_encoding_in_magic_comment_error.rb +0 -0
  209. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser/variables_stack.rb +0 -0
  210. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{parser-3.3.10.0 → parser-3.3.11.1}/lib/parser.rb +0 -0
  211. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/BSDmakefile +0 -0
  212. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/ext/prism/api_node.c +0 -0
  213. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/ext/prism/api_pack.c +0 -0
  214. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/ext/prism/extconf.rb +0 -0
  215. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/ext/prism/extension.c +0 -0
  216. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/defines.h +0 -0
  217. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/diagnostic.h +0 -0
  218. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/encoding.h +0 -0
  219. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/node.h +0 -0
  220. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/options.h +0 -0
  221. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/pack.h +0 -0
  222. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/parser.h +0 -0
  223. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/prettyprint.h +0 -0
  224. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/regexp.h +0 -0
  225. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/static_literals.h +0 -0
  226. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/util/pm_buffer.h +0 -0
  227. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/util/pm_char.h +0 -0
  228. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/util/pm_constant_pool.h +0 -0
  229. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/util/pm_integer.h +0 -0
  230. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/util/pm_list.h +0 -0
  231. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/util/pm_memchr.h +0 -0
  232. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/util/pm_newline_list.h +0 -0
  233. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/util/pm_string.h +0 -0
  234. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/util/pm_strncasecmp.h +0 -0
  235. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism/util/pm_strpbrk.h +0 -0
  236. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/include/prism.h +0 -0
  237. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/desugar_compiler.rb +0 -0
  238. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/dispatcher.rb +0 -0
  239. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/dot_visitor.rb +0 -0
  240. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/dsl.rb +0 -0
  241. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/ffi.rb +0 -0
  242. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/inspect_visitor.rb +0 -0
  243. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/mutation_compiler.rb +0 -0
  244. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/node_ext.rb +0 -0
  245. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/pack.rb +0 -0
  246. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/parse_result/comments.rb +0 -0
  247. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/parse_result/errors.rb +0 -0
  248. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/parse_result/newlines.rb +0 -0
  249. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/pattern.rb +0 -0
  250. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/polyfill/append_as_bytes.rb +0 -0
  251. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/polyfill/byteindex.rb +0 -0
  252. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/polyfill/scan_byte.rb +0 -0
  253. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/polyfill/unpack1.rb +0 -0
  254. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/polyfill/warn.rb +0 -0
  255. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/reflection.rb +0 -0
  256. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/relocation.rb +0 -0
  257. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/string_query.rb +0 -0
  258. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/translation/parser/builder.rb +0 -0
  259. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/translation/parser/compiler.rb +0 -0
  260. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/translation/parser/lexer.rb +0 -0
  261. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/translation/parser.rb +0 -0
  262. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/translation/ripper/sexp.rb +0 -0
  263. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/lib/prism/translation/ripper/shim.rb +0 -0
  264. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/rbi/prism/compiler.rbi +0 -0
  265. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/rbi/prism/dsl.rbi +0 -0
  266. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/rbi/prism/inspect_visitor.rbi +0 -0
  267. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/rbi/prism/node_ext.rbi +0 -0
  268. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/rbi/prism/parse_result.rbi +0 -0
  269. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/rbi/prism/reflection.rbi +0 -0
  270. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/rbi/prism/string_query.rbi +0 -0
  271. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/rbi/prism/translation/parser.rbi +0 -0
  272. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/rbi/prism/translation/ripper.rbi +0 -0
  273. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/rbi/prism/visitor.rbi +0 -0
  274. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/compiler.rbs +0 -0
  275. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/dispatcher.rbs +0 -0
  276. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/dot_visitor.rbs +0 -0
  277. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/dsl.rbs +0 -0
  278. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/inspect_visitor.rbs +0 -0
  279. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/lex_compat.rbs +0 -0
  280. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/mutation_compiler.rbs +0 -0
  281. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/node_ext.rbs +0 -0
  282. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/pack.rbs +0 -0
  283. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/parse_result/comments.rbs +0 -0
  284. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/pattern.rbs +0 -0
  285. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/reflection.rbs +0 -0
  286. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/relocation.rbs +0 -0
  287. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/serialize.rbs +0 -0
  288. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/string_query.rbs +0 -0
  289. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/sig/prism/visitor.rbs +0 -0
  290. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/diagnostic.c +0 -0
  291. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/encoding.c +0 -0
  292. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/node.c +0 -0
  293. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/options.c +0 -0
  294. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/pack.c +0 -0
  295. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/prettyprint.c +0 -0
  296. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/regexp.c +0 -0
  297. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/serialize.c +0 -0
  298. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/static_literals.c +0 -0
  299. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/token_type.c +0 -0
  300. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/util/pm_buffer.c +0 -0
  301. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/util/pm_char.c +0 -0
  302. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/util/pm_constant_pool.c +0 -0
  303. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/util/pm_integer.c +0 -0
  304. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/util/pm_list.c +0 -0
  305. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/util/pm_memchr.c +0 -0
  306. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/util/pm_newline_list.c +0 -0
  307. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/util/pm_string.c +0 -0
  308. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/util/pm_strncasecmp.c +0 -0
  309. /package/plugins/rubyastgen/bundle/ruby/4.0.0/gems/{prism-1.7.0 → prism-1.9.0}/src/util/pm_strpbrk.c +0 -0
package/astgen.js CHANGED
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { join, dirname } from "path";
4
- import yargs from "yargs";
5
- import { hideBin } from "yargs/helpers";
3
+ import { join, dirname, relative, resolve } from "path";
4
+ import { fileURLToPath } from "url";
6
5
  import { parse } from "@babel/parser";
7
6
  import { parse as parseHermes } from "hermes-parser";
8
7
  import tsc from "typescript";
@@ -18,6 +17,284 @@ import { getAllFiles } from "@appthreat/atom-common";
18
17
 
19
18
  const ASTGEN_VERSION = "4.0.0";
20
19
 
20
+ const HELP_TEXT = `Options:
21
+ -i, --src Source directory [default: "."]
22
+ -o, --output Output directory for generated AST JSON files
23
+ [default: "ast_out"]
24
+ -t, --type Project type. Default auto-detect
25
+ -r, --recurse Recurse mode suitable for mono-repos [boolean] [default: true]
26
+ --tsTypes Generate type mappings using the TypeScript Compiler API
27
+ [boolean] [default: true]
28
+ --version Show version number [boolean]
29
+ -h, --help Show help [boolean]`;
30
+
31
+ const CLI_OPTIONS = {
32
+ src: { alias: "i", default: ".", type: "string" },
33
+ output: { alias: "o", default: "ast_out", type: "string" },
34
+ type: { alias: "t", type: "string" },
35
+ recurse: { alias: "r", default: true, type: "boolean" },
36
+ tsTypes: { default: true, type: "boolean" }
37
+ };
38
+
39
+ const CLI_ALIASES = Object.fromEntries(
40
+ Object.entries(CLI_OPTIONS)
41
+ .filter(([, option]) => option.alias)
42
+ .map(([name, option]) => [option.alias, name])
43
+ );
44
+
45
+ const normalizeOptionName = (name) =>
46
+ name.replace(/-([a-z])/g, (_, character) => character.toUpperCase());
47
+
48
+ const isOptionToken = (value) => value?.startsWith("-") && value !== "-";
49
+
50
+ const parseBooleanValue = (name, value) => {
51
+ if (value === undefined) {
52
+ return true;
53
+ }
54
+ if (typeof value === "boolean") {
55
+ return value;
56
+ }
57
+ const normalized = String(value).toLowerCase();
58
+ if (["true", "1", "yes", "y"].includes(normalized)) {
59
+ return true;
60
+ }
61
+ if (["false", "0", "no", "n"].includes(normalized)) {
62
+ return false;
63
+ }
64
+ throw new Error(`Invalid boolean value for --${name}: ${value}`);
65
+ };
66
+
67
+ const setParsedOption = (args, name, value) => {
68
+ const normalizedName = normalizeOptionName(name);
69
+ const option = CLI_OPTIONS[normalizedName];
70
+ if (!option) {
71
+ args[normalizedName] = value ?? true;
72
+ return;
73
+ }
74
+ args[normalizedName] =
75
+ option.type === "boolean"
76
+ ? parseBooleanValue(normalizedName, value)
77
+ : value;
78
+ };
79
+
80
+ const parseLongOption = (args, rawArgs, index) => {
81
+ const token = rawArgs[index];
82
+ const noPrefix = token.startsWith("--no-");
83
+ const optionToken = token.slice(noPrefix ? 5 : 2);
84
+ const equalsIndex = optionToken.indexOf("=");
85
+ const rawName =
86
+ equalsIndex === -1 ? optionToken : optionToken.slice(0, equalsIndex);
87
+ const name = normalizeOptionName(rawName);
88
+ const inlineValue =
89
+ equalsIndex === -1 ? undefined : optionToken.slice(equalsIndex + 1);
90
+ const option = CLI_OPTIONS[name];
91
+
92
+ if (noPrefix) {
93
+ setParsedOption(args, name, false);
94
+ return index;
95
+ }
96
+ if (!option) {
97
+ if (inlineValue !== undefined) {
98
+ setParsedOption(args, name, inlineValue);
99
+ } else if (
100
+ rawArgs[index + 1] !== undefined &&
101
+ !isOptionToken(rawArgs[index + 1])
102
+ ) {
103
+ setParsedOption(args, name, rawArgs[index + 1]);
104
+ return index + 1;
105
+ } else {
106
+ setParsedOption(args, name, true);
107
+ }
108
+ return index;
109
+ }
110
+ if (option?.type === "boolean") {
111
+ if (inlineValue !== undefined) {
112
+ setParsedOption(args, name, inlineValue);
113
+ } else if (
114
+ rawArgs[index + 1] !== undefined &&
115
+ !isOptionToken(rawArgs[index + 1])
116
+ ) {
117
+ setParsedOption(args, name, rawArgs[index + 1]);
118
+ return index + 1;
119
+ } else {
120
+ setParsedOption(args, name, true);
121
+ }
122
+ return index;
123
+ }
124
+ if (inlineValue !== undefined) {
125
+ setParsedOption(args, name, inlineValue);
126
+ return index;
127
+ }
128
+ if (rawArgs[index + 1] === undefined || isOptionToken(rawArgs[index + 1])) {
129
+ throw new Error(`Missing value for --${rawName}`);
130
+ }
131
+ setParsedOption(args, name, rawArgs[index + 1]);
132
+ return index + 1;
133
+ };
134
+
135
+ const parseShortOption = (args, rawArgs, index) => {
136
+ const token = rawArgs[index];
137
+ const equalsIndex = token.indexOf("=");
138
+ const letters = token.slice(1, equalsIndex === -1 ? undefined : equalsIndex);
139
+ const inlineValue =
140
+ equalsIndex === -1 ? undefined : token.slice(equalsIndex + 1);
141
+
142
+ for (let letterIndex = 0; letterIndex < letters.length; letterIndex++) {
143
+ const letter = letters[letterIndex];
144
+ const name = CLI_ALIASES[letter] ?? letter;
145
+ const option = CLI_OPTIONS[name];
146
+ const remainingLetters = letters.slice(letterIndex + 1);
147
+
148
+ if (letter === "h") {
149
+ args.help = true;
150
+ continue;
151
+ }
152
+ if (!option) {
153
+ if (remainingLetters) {
154
+ setParsedOption(args, name, remainingLetters);
155
+ return index;
156
+ }
157
+ if (inlineValue !== undefined) {
158
+ setParsedOption(args, name, inlineValue);
159
+ return index;
160
+ }
161
+ if (
162
+ rawArgs[index + 1] !== undefined &&
163
+ !isOptionToken(rawArgs[index + 1])
164
+ ) {
165
+ setParsedOption(args, name, rawArgs[index + 1]);
166
+ return index + 1;
167
+ }
168
+ setParsedOption(args, name, true);
169
+ continue;
170
+ }
171
+ if (option?.type === "boolean") {
172
+ if (inlineValue !== undefined) {
173
+ setParsedOption(args, name, inlineValue);
174
+ } else if (
175
+ !remainingLetters &&
176
+ rawArgs[index + 1] !== undefined &&
177
+ !isOptionToken(rawArgs[index + 1])
178
+ ) {
179
+ setParsedOption(args, name, rawArgs[index + 1]);
180
+ return index + 1;
181
+ } else {
182
+ setParsedOption(args, name, true);
183
+ }
184
+ continue;
185
+ }
186
+ if (remainingLetters) {
187
+ setParsedOption(args, name, remainingLetters);
188
+ return index;
189
+ }
190
+ if (inlineValue !== undefined) {
191
+ setParsedOption(args, name, inlineValue);
192
+ return index;
193
+ }
194
+ if (rawArgs[index + 1] === undefined || isOptionToken(rawArgs[index + 1])) {
195
+ throw new Error(`Missing value for -${letter}`);
196
+ }
197
+ setParsedOption(args, name, rawArgs[index + 1]);
198
+ return index + 1;
199
+ }
200
+ return index;
201
+ };
202
+
203
+ const parseCliArgs = (argvs) => {
204
+ const rawArgs = argvs.slice(2);
205
+ const args = Object.fromEntries(
206
+ Object.entries(CLI_OPTIONS)
207
+ .filter(([, option]) => option.default !== undefined)
208
+ .map(([name, option]) => [name, option.default])
209
+ );
210
+ args._ = [];
211
+
212
+ for (let index = 0; index < rawArgs.length; index++) {
213
+ const token = rawArgs[index];
214
+ if (token === "--") {
215
+ args._.push(...rawArgs.slice(index + 1));
216
+ break;
217
+ }
218
+ if (token === "--help") {
219
+ args.help = true;
220
+ continue;
221
+ }
222
+ if (token === "--version") {
223
+ args.version = true;
224
+ continue;
225
+ }
226
+ if (token.startsWith("--")) {
227
+ index = parseLongOption(args, rawArgs, index);
228
+ continue;
229
+ }
230
+ if (token.startsWith("-") && token !== "-") {
231
+ index = parseShortOption(args, rawArgs, index);
232
+ continue;
233
+ }
234
+ args._.push(token);
235
+ }
236
+ return args;
237
+ };
238
+
239
+ const babelSyntaxPlugins = [
240
+ "optionalChaining",
241
+ "classProperties",
242
+ "classPrivateProperties",
243
+ "classPrivateMethods",
244
+ "decorators-legacy",
245
+ "exportDefaultFrom",
246
+ "doExpressions",
247
+ "numericSeparator",
248
+ "dynamicImport",
249
+ "importAttributes",
250
+ "explicitResourceManagement",
251
+ "topLevelAwait",
252
+ "jsx"
253
+ ];
254
+
255
+ const makeTypescriptPlugin = (file) => [
256
+ "typescript",
257
+ {
258
+ dts:
259
+ file.endsWith(".d.ts") ||
260
+ file.endsWith(".d.mts") ||
261
+ file.endsWith(".d.cts"),
262
+ disallowAmbiguousJSXLike: false
263
+ }
264
+ ];
265
+
266
+ const getBabelPluginName = (plugin) =>
267
+ Array.isArray(plugin) ? plugin[0] : plugin;
268
+
269
+ const mergeBabelPlugins = (...pluginGroups) => {
270
+ const merged = [];
271
+ const seen = new Set();
272
+ for (const plugins of pluginGroups) {
273
+ for (const plugin of plugins || []) {
274
+ const pluginName = getBabelPluginName(plugin);
275
+ if (!seen.has(pluginName)) {
276
+ seen.add(pluginName);
277
+ merged.push(plugin);
278
+ }
279
+ }
280
+ }
281
+ return merged;
282
+ };
283
+
284
+ const makeBabelOptions = (baseOptions, file, extraPlugins = []) => ({
285
+ ...baseOptions,
286
+ plugins: mergeBabelPlugins(
287
+ baseOptions.plugins,
288
+ extraPlugins,
289
+ babelSyntaxPlugins,
290
+ (baseOptions.plugins || []).some(
291
+ (plugin) => getBabelPluginName(plugin) === "flow"
292
+ )
293
+ ? []
294
+ : [makeTypescriptPlugin(file)]
295
+ )
296
+ });
297
+
21
298
  const babelParserOptions = {
22
299
  sourceType: "unambiguous",
23
300
  allowImportExportEverywhere: true,
@@ -26,18 +303,7 @@ const babelParserOptions = {
26
303
  allowReturnOutsideFunction: true,
27
304
  allowSuperOutsideMethod: true,
28
305
  allowUndeclaredExports: true,
29
- errorRecovery: true,
30
- plugins: [
31
- "optionalChaining",
32
- "classProperties",
33
- "decorators-legacy",
34
- "exportDefaultFrom",
35
- "doExpressions",
36
- "numericSeparator",
37
- "dynamicImport",
38
- "jsx",
39
- "typescript"
40
- ]
306
+ errorRecovery: true
41
307
  };
42
308
 
43
309
  const babelFlowParserOptions = {
@@ -67,17 +333,7 @@ const babelSafeParserOptions = {
67
333
  allowImportExportEverywhere: true,
68
334
  allowAwaitOutsideFunction: true,
69
335
  allowReturnOutsideFunction: true,
70
- errorRecovery: true,
71
- plugins: [
72
- "optionalChaining",
73
- "classProperties",
74
- "decorators-legacy",
75
- "exportDefaultFrom",
76
- "doExpressions",
77
- "numericSeparator",
78
- "dynamicImport",
79
- "typescript"
80
- ]
336
+ errorRecovery: true
81
337
  };
82
338
 
83
339
  const babelSafeFlowParserOptions = {
@@ -111,7 +367,8 @@ const shouldIncludeNodeModulesBundles =
111
367
  * 2. ASTGEN_IGNORE_DIRS is non-empty and doesn't include "node_modules"
112
368
  */
113
369
  const getAllSrcJSAndTSFiles = (src) => {
114
- const filePattern = "\\.(js|jsx|cjs|mjs|ts|tsx|vue|svelte|xsjs|xsjslib|ejs)$";
370
+ const filePattern =
371
+ "\\.(js|jsx|cjs|mjs|ts|tsx|mts|cts|vue|svelte|xsjs|xsjslib|ejs)$";
115
372
  const bundledNodeModulesPattern =
116
373
  "node_modules[\\\\/].*[\\\\/](?:.*\\.)?(bundle|dist|index|min|app)\\.(js|cjs|mjs)$";
117
374
 
@@ -141,7 +398,8 @@ const getAllSrcJSAndTSFiles = (src) => {
141
398
  }
142
399
  // Step 2: Combine both lists
143
400
  return Promise.all([allFilesPromise, bundledFilesPromise]).then(
144
- ([allFiles, bundledFiles]) => [...allFiles, ...bundledFiles]
401
+ ([allFiles, bundledFiles]) =>
402
+ [...new Set([...allFiles, ...bundledFiles])].sort()
145
403
  );
146
404
  };
147
405
 
@@ -185,14 +443,17 @@ const codeToJsAst = (file, code, projectType) => {
185
443
  primaryBabelOptions = babelFlowParserOptions;
186
444
  secondaryBabelOptions = babelParserOptions;
187
445
  }
446
+ const primaryOptions = makeBabelOptions(primaryBabelOptions, file);
447
+ const secondaryOptions = makeBabelOptions(secondaryBabelOptions, file);
448
+ const safeOptions = makeBabelOptions(babelSafeParserOptions, file);
188
449
  try {
189
- return parse(code, primaryBabelOptions);
450
+ return parse(code, primaryOptions);
190
451
  } catch (errPrimary) {
191
452
  try {
192
- return parse(code, secondaryBabelOptions);
453
+ return parse(code, secondaryOptions);
193
454
  } catch (errSecondary) {
194
455
  try {
195
- return parse(code, babelSafeParserOptions);
456
+ return parse(code, safeOptions);
196
457
  } catch (errSafe) {
197
458
  try {
198
459
  return parse(code, babelSafeFlowParserOptions);
@@ -380,36 +641,202 @@ const toEjsAst = (file) => {
380
641
  return codeToJsAst(file, out.join(""), "ts");
381
642
  };
382
643
 
383
- function createTsc(srcFiles) {
644
+ const DEFAULT_TSC_OPTIONS = {
645
+ target: tsc.ScriptTarget.ES2022,
646
+ module: tsc.ModuleKind.CommonJS,
647
+ moduleResolution: tsc.ModuleResolutionKind.Node10,
648
+ allowImportingTsExtensions: false,
649
+ allowArbitraryExtensions: false,
650
+ allowSyntheticDefaultImports: true,
651
+ allowUmdGlobalAccess: true,
652
+ allowJs: true,
653
+ checkJs: true,
654
+ allowUnreachableCode: true,
655
+ allowUnusedLabels: true,
656
+ alwaysStrict: false,
657
+ emitDecoratorMetadata: true,
658
+ exactOptionalPropertyTypes: true,
659
+ experimentalDecorators: true,
660
+ ignoreDeprecations: "6.0",
661
+ noStrictGenericChecks: true,
662
+ noUncheckedIndexedAccess: false,
663
+ noPropertyAccessFromIndexSignature: false,
664
+ noEmit: true,
665
+ skipLibCheck: true,
666
+ resolveJsonModule: true,
667
+ jsx: tsc.JsxEmit.Preserve,
668
+ lib: ["lib.es2022.d.ts", "lib.dom.d.ts", "lib.dom.iterable.d.ts"]
669
+ };
670
+
671
+ const readJsonFileIfExists = (file) => {
384
672
  try {
385
- const program = tsc.createProgram(srcFiles, {
386
- target: tsc.ScriptTarget.ES2022,
387
- module: tsc.ModuleKind.CommonJS,
388
- moduleResolution: tsc.ModuleResolutionKind.Node10,
389
- allowImportingTsExtensions: false,
390
- allowArbitraryExtensions: false,
391
- allowSyntheticDefaultImports: true,
392
- allowUmdGlobalAccess: true,
673
+ if (!existsSync(file)) {
674
+ return undefined;
675
+ }
676
+ return JSON.parse(readFileSync(file, "utf8"));
677
+ } catch {
678
+ return undefined;
679
+ }
680
+ };
681
+
682
+ const findNearestPackageJson = (src) => {
683
+ let currentDir = resolve(src);
684
+ while (true) {
685
+ const packageJsonPath = join(currentDir, "package.json");
686
+ if (existsSync(packageJsonPath)) {
687
+ return packageJsonPath;
688
+ }
689
+ const parentDir = dirname(currentDir);
690
+ if (parentDir === currentDir) {
691
+ return undefined;
692
+ }
693
+ currentDir = parentDir;
694
+ }
695
+ };
696
+
697
+ const detectDefaultTscOptions = (srcFiles, src) => {
698
+ const packageJson = readJsonFileIfExists(findNearestPackageJson(src));
699
+ const usesNodeNextModuleResolution =
700
+ packageJson?.type === "module" ||
701
+ Boolean(packageJson?.exports) ||
702
+ Boolean(packageJson?.imports) ||
703
+ srcFiles.some((file) => /\.(?:mts|cts)$/.test(file));
704
+
705
+ if (!usesNodeNextModuleResolution) {
706
+ return DEFAULT_TSC_OPTIONS;
707
+ }
708
+
709
+ return {
710
+ ...DEFAULT_TSC_OPTIONS,
711
+ module: tsc.ModuleKind.NodeNext,
712
+ moduleResolution: tsc.ModuleResolutionKind.NodeNext,
713
+ resolvePackageJsonExports: true,
714
+ resolvePackageJsonImports: true,
715
+ allowImportingTsExtensions: true,
716
+ verbatimModuleSyntax: true
717
+ };
718
+ };
719
+
720
+ const hasExplicitTsCompilerOption = (config, optionName) =>
721
+ Object.prototype.hasOwnProperty.call(
722
+ config?.compilerOptions ?? {},
723
+ optionName
724
+ );
725
+
726
+ const normalizeImportedTypeSpecifier = (specifier, currentFileName) => {
727
+ let normalizedSpecifier = String(specifier).replaceAll("\\", "/");
728
+ const normalizedCurrentFileName = currentFileName?.replaceAll("\\", "/");
729
+
730
+ if (normalizedSpecifier.startsWith("file://")) {
731
+ try {
732
+ normalizedSpecifier = fileURLToPath(normalizedSpecifier).replaceAll(
733
+ "\\",
734
+ "/"
735
+ );
736
+ } catch {
737
+ // ignore malformed file URLs and leave the original specifier intact
738
+ }
739
+ }
740
+
741
+ if (normalizedCurrentFileName && normalizedSpecifier.startsWith("/")) {
742
+ const relativeSpecifier = relative(
743
+ dirname(normalizedCurrentFileName),
744
+ normalizedSpecifier
745
+ ).replaceAll("\\", "/");
746
+ normalizedSpecifier = relativeSpecifier.startsWith(".")
747
+ ? relativeSpecifier
748
+ : `./${relativeSpecifier}`;
749
+ }
750
+
751
+ return normalizedSpecifier.replace(
752
+ /(\.d)?\.(tsx?|jsx?|mts|cts|mjs|cjs)$/,
753
+ ""
754
+ );
755
+ };
756
+
757
+ const normalizeTypeString = (typeStr, context) => {
758
+ if (!typeStr || typeof typeStr !== "string") {
759
+ return typeStr;
760
+ }
761
+ const currentFileName = context?.getSourceFile?.()?.fileName;
762
+ return typeStr.replace(
763
+ /import\("([^"]+)"(?:,\s*{\s*with:\s*{\s*"resolution-mode":\s*"import"\s*}\s*})?\)/g,
764
+ (_, specifier) =>
765
+ `import("${normalizeImportedTypeSpecifier(specifier, currentFileName)}")`
766
+ );
767
+ };
768
+
769
+ const findTsConfig = (src) => {
770
+ const searchRoot = resolve(src);
771
+ return (
772
+ tsc.findConfigFile(searchRoot, tsc.sys.fileExists, "tsconfig.json") ||
773
+ tsc.findConfigFile(searchRoot, tsc.sys.fileExists, "jsconfig.json")
774
+ );
775
+ };
776
+
777
+ const createTscProgramConfig = (srcFiles, src) => {
778
+ const detectedDefaultOptions = detectDefaultTscOptions(srcFiles, src);
779
+ const configPath = findTsConfig(src);
780
+ if (!configPath) {
781
+ return {
782
+ rootNames: srcFiles,
783
+ options: detectedDefaultOptions
784
+ };
785
+ }
786
+
787
+ const configFile = tsc.readConfigFile(configPath, tsc.sys.readFile);
788
+ if (configFile.error) {
789
+ return {
790
+ rootNames: srcFiles,
791
+ options: detectedDefaultOptions
792
+ };
793
+ }
794
+
795
+ const shouldRespectExplicitModuleSettings =
796
+ hasExplicitTsCompilerOption(configFile.config, "module") ||
797
+ hasExplicitTsCompilerOption(configFile.config, "moduleResolution");
798
+ const configParseDefaults = shouldRespectExplicitModuleSettings
799
+ ? DEFAULT_TSC_OPTIONS
800
+ : detectedDefaultOptions;
801
+
802
+ const parsedConfig = tsc.parseJsonConfigFileContent(
803
+ configFile.config,
804
+ tsc.sys,
805
+ dirname(configPath),
806
+ configParseDefaults,
807
+ configPath
808
+ );
809
+ const rootNames = [
810
+ ...new Set([...srcFiles, ...parsedConfig.fileNames])
811
+ ].sort();
812
+ return {
813
+ rootNames,
814
+ options: {
815
+ ...DEFAULT_TSC_OPTIONS,
816
+ ...(shouldRespectExplicitModuleSettings ? {} : detectedDefaultOptions),
817
+ ...parsedConfig.options,
393
818
  allowJs: true,
394
819
  checkJs: true,
395
- allowUnreachableCode: true,
396
- allowUnusedLabels: true,
397
- alwaysStrict: false,
398
- emitDecoratorMetadata: true,
399
- exactOptionalPropertyTypes: true,
400
- experimentalDecorators: false,
401
- ignoreDeprecations: true,
402
- noStrictGenericChecks: true,
403
- noUncheckedIndexedAccess: false,
404
- noPropertyAccessFromIndexSignature: false,
405
- lib: ["lib.es2022.d.ts", "lib.dom.d.ts"]
406
- });
820
+ noEmit: true,
821
+ skipLibCheck: true,
822
+ resolveJsonModule: true
823
+ }
824
+ };
825
+ };
826
+
827
+ function createTsc(srcFiles, src) {
828
+ try {
829
+ const tscConfig = createTscProgramConfig(srcFiles, src);
830
+ const program = tsc.createProgram(tscConfig.rootNames, tscConfig.options);
407
831
  const typeChecker = program.getTypeChecker();
408
832
  const seenTypes = new Map();
409
833
 
410
- const safeTypeToString = (node) => {
834
+ const safeTypeToString = (type, context) => {
411
835
  try {
412
- return typeChecker.typeToString(node, TSC_FLAGS);
836
+ return normalizeTypeString(
837
+ typeChecker.typeToString(type, context, TSC_FLAGS),
838
+ context
839
+ );
413
840
  } catch (err) {
414
841
  return "any";
415
842
  }
@@ -417,13 +844,256 @@ function createTsc(srcFiles) {
417
844
 
418
845
  const safeTypeWithContextToString = (node, context) => {
419
846
  try {
420
- return typeChecker.typeToString(node, context, TSC_FLAGS);
847
+ return normalizeTypeString(
848
+ typeChecker.typeToString(node, context, TSC_FLAGS),
849
+ context
850
+ );
421
851
  } catch (err) {
422
852
  return "any";
423
853
  }
424
854
  };
425
855
 
426
- const addType = (node) => {
856
+ const addTypeAtPosition = (currentSeenTypes, position, typeStr) => {
857
+ const scoreTypeString = (value) => {
858
+ if (!value || isUnresolvedTypeString(value)) {
859
+ return 0;
860
+ }
861
+ if (value.includes("=>")) {
862
+ return 3;
863
+ }
864
+ if (
865
+ value.includes("import(") ||
866
+ value.includes("{") ||
867
+ value.includes("|")
868
+ ) {
869
+ return 2;
870
+ }
871
+ return 1;
872
+ };
873
+ if (
874
+ Number.isInteger(position) &&
875
+ position >= 0 &&
876
+ typeStr &&
877
+ ![
878
+ "any",
879
+ "unknown",
880
+ "any[]",
881
+ "unknown[]",
882
+ "error",
883
+ "/*unresolved*/ any"
884
+ ].includes(typeStr)
885
+ ) {
886
+ const existingType = currentSeenTypes.get(position);
887
+ if (!existingType) {
888
+ currentSeenTypes.set(position, typeStr);
889
+ return;
890
+ }
891
+ const existingScore = scoreTypeString(existingType);
892
+ const nextScore = scoreTypeString(typeStr);
893
+ if (
894
+ nextScore > existingScore ||
895
+ (nextScore === existingScore && typeStr.length >= existingType.length)
896
+ ) {
897
+ currentSeenTypes.set(position, typeStr);
898
+ }
899
+ }
900
+ };
901
+
902
+ const isUnresolvedTypeString = (typeStr) =>
903
+ [
904
+ "any",
905
+ "unknown",
906
+ "any[]",
907
+ "unknown[]",
908
+ "error",
909
+ "/*unresolved*/ any",
910
+ "Promise<any>",
911
+ "Promise<unknown>"
912
+ ].includes(typeStr);
913
+
914
+ const collectReturnExpressionTypes = (node, collectedTypes = new Set()) => {
915
+ if (!node || !node.kind) {
916
+ return collectedTypes;
917
+ }
918
+ if (tsc.isReturnStatement(node) && node.expression) {
919
+ const returnType = safeTypeWithContextToString(
920
+ typeChecker.getTypeAtLocation(node.expression),
921
+ node.expression
922
+ );
923
+ if (returnType && !isUnresolvedTypeString(returnType)) {
924
+ collectedTypes.add(returnType);
925
+ } else {
926
+ const inferredSyntaxType = inferExpressionTypeFromSyntax(
927
+ node.expression
928
+ );
929
+ if (
930
+ inferredSyntaxType &&
931
+ !isUnresolvedTypeString(inferredSyntaxType)
932
+ ) {
933
+ collectedTypes.add(inferredSyntaxType);
934
+ }
935
+ }
936
+ return collectedTypes;
937
+ }
938
+ if (
939
+ node !== undefined &&
940
+ !tsc.isFunctionDeclaration(node) &&
941
+ !tsc.isFunctionExpression(node) &&
942
+ !tsc.isArrowFunction(node) &&
943
+ !tsc.isMethodDeclaration(node)
944
+ ) {
945
+ tsc.forEachChild(node, (child) =>
946
+ collectReturnExpressionTypes(child, collectedTypes)
947
+ );
948
+ }
949
+ return collectedTypes;
950
+ };
951
+
952
+ const inferAsyncReturnTypeFromBody = (node) => {
953
+ if (!node.body) {
954
+ return undefined;
955
+ }
956
+ if (!tsc.isBlock(node.body)) {
957
+ const bodyType = safeTypeWithContextToString(
958
+ typeChecker.getTypeAtLocation(node.body),
959
+ node.body
960
+ );
961
+ return bodyType && !bodyType.startsWith("Promise<")
962
+ ? `Promise<${bodyType}>`
963
+ : bodyType;
964
+ }
965
+ const collectedTypes = collectReturnExpressionTypes(node.body);
966
+ if (collectedTypes.size === 0) {
967
+ return undefined;
968
+ }
969
+ const unionType = [...collectedTypes].sort().join(" | ");
970
+ return unionType.startsWith("Promise<")
971
+ ? unionType
972
+ : `Promise<${unionType}>`;
973
+ };
974
+
975
+ const buildFunctionSignatureType = (node, returnTypeStr) => {
976
+ if (!node.parameters) {
977
+ return undefined;
978
+ }
979
+ const parameters = node.parameters.map((param) => {
980
+ const parameterName = param.name?.getText?.() || "arg";
981
+ const parameterType = safeTypeWithContextToString(
982
+ typeChecker.getTypeAtLocation(param.name || param),
983
+ param.name || param
984
+ );
985
+ return `${parameterName}: ${parameterType}`;
986
+ });
987
+ return `(${parameters.join(", ")}) => ${returnTypeStr}`;
988
+ };
989
+
990
+ const inferExpressionTypeFromSyntax = (expression) => {
991
+ if (!expression) {
992
+ return undefined;
993
+ }
994
+ if (
995
+ tsc.isCallExpression(expression) &&
996
+ expression.expression.kind === tsc.SyntaxKind.ImportKeyword &&
997
+ expression.arguments.length > 0 &&
998
+ tsc.isStringLiteralLike(expression.arguments[0])
999
+ ) {
1000
+ return `Promise<typeof import("${normalizeImportedTypeSpecifier(
1001
+ expression.arguments[0].text,
1002
+ expression.getSourceFile().fileName
1003
+ )}")>`;
1004
+ }
1005
+ if (tsc.isAwaitExpression(expression)) {
1006
+ const awaitedType = inferExpressionTypeFromSyntax(
1007
+ expression.expression
1008
+ );
1009
+ return awaitedType?.startsWith("Promise<")
1010
+ ? awaitedType.slice(8, -1)
1011
+ : awaitedType;
1012
+ }
1013
+ if (tsc.isIdentifier(expression)) {
1014
+ const symbol = typeChecker.getSymbolAtLocation(expression);
1015
+ const declaration = symbol?.valueDeclaration;
1016
+ if (tsc.isVariableDeclaration(declaration) && declaration.initializer) {
1017
+ return inferExpressionTypeFromSyntax(declaration.initializer);
1018
+ }
1019
+ }
1020
+ if (tsc.isPropertyAccessExpression(expression)) {
1021
+ const baseType = inferExpressionTypeFromSyntax(expression.expression);
1022
+ if (baseType) {
1023
+ return `${baseType}.${expression.name.getText()}`;
1024
+ }
1025
+ }
1026
+ return undefined;
1027
+ };
1028
+
1029
+ const inferFunctionDeclarationReturnType = (declaration) => {
1030
+ const signature = typeChecker.getSignatureFromDeclaration(declaration);
1031
+ if (!signature) {
1032
+ return undefined;
1033
+ }
1034
+ let inferredType = safeTypeToString(
1035
+ typeChecker.getReturnTypeOfSignature(signature),
1036
+ declaration.name || declaration
1037
+ );
1038
+ if (
1039
+ isUnresolvedTypeString(inferredType) &&
1040
+ (tsc.getCombinedModifierFlags(declaration) &
1041
+ tsc.ModifierFlags.Async) !==
1042
+ 0
1043
+ ) {
1044
+ inferredType =
1045
+ inferAsyncReturnTypeFromSyntaxBody(declaration) ||
1046
+ inferAsyncReturnTypeFromBody(declaration) ||
1047
+ inferredType;
1048
+ }
1049
+ return inferredType;
1050
+ };
1051
+
1052
+ const inferAsyncReturnTypeFromSyntaxBody = (node) => {
1053
+ if (!node?.body) {
1054
+ return undefined;
1055
+ }
1056
+ const collectedTypes = new Set();
1057
+ const visit = (currentNode) => {
1058
+ if (!currentNode || !currentNode.kind) {
1059
+ return;
1060
+ }
1061
+ if (tsc.isReturnStatement(currentNode) && currentNode.expression) {
1062
+ const inferredType = inferExpressionTypeFromSyntax(
1063
+ currentNode.expression
1064
+ );
1065
+ if (inferredType) {
1066
+ collectedTypes.add(inferredType);
1067
+ }
1068
+ return;
1069
+ }
1070
+ if (
1071
+ !tsc.isFunctionDeclaration(currentNode) &&
1072
+ !tsc.isFunctionExpression(currentNode) &&
1073
+ !tsc.isArrowFunction(currentNode) &&
1074
+ !tsc.isMethodDeclaration(currentNode)
1075
+ ) {
1076
+ tsc.forEachChild(currentNode, visit);
1077
+ }
1078
+ };
1079
+ if (tsc.isBlock(node.body)) {
1080
+ visit(node.body);
1081
+ } else {
1082
+ const inferredType = inferExpressionTypeFromSyntax(node.body);
1083
+ if (inferredType) {
1084
+ collectedTypes.add(inferredType);
1085
+ }
1086
+ }
1087
+ if (collectedTypes.size === 0) {
1088
+ return undefined;
1089
+ }
1090
+ const unionType = [...collectedTypes].sort().join(" | ");
1091
+ return unionType.startsWith("Promise<")
1092
+ ? unionType
1093
+ : `Promise<${unionType}>`;
1094
+ };
1095
+
1096
+ const addType = (node, currentSeenTypes = seenTypes) => {
427
1097
  // STRUCTURAL/CONTAINER NODES
428
1098
  if (
429
1099
  node.kind === tsc.SyntaxKind.SourceFile ||
@@ -438,11 +1108,15 @@ function createTsc(srcFiles) {
438
1108
  node.kind === tsc.SyntaxKind.InterfaceDeclaration ||
439
1109
  node.kind === tsc.SyntaxKind.ModuleDeclaration
440
1110
  ) {
441
- tsc.forEachChild(node, addType);
1111
+ tsc.forEachChild(node, (child) => addType(child, currentSeenTypes));
442
1112
  return;
443
1113
  }
444
1114
 
445
1115
  let typeStr;
1116
+ const isDirectCalleeIdentifier =
1117
+ tsc.isIdentifier(node) &&
1118
+ tsc.isCallExpression(node.parent) &&
1119
+ node.parent.expression === node;
446
1120
 
447
1121
  try {
448
1122
  // WRAPPER NODES
@@ -450,14 +1124,15 @@ function createTsc(srcFiles) {
450
1124
  (tsc.SyntaxKind.SatisfiesExpression &&
451
1125
  node.kind === tsc.SyntaxKind.SatisfiesExpression) ||
452
1126
  node.kind === tsc.SyntaxKind.AsExpression ||
453
- node.kind === tsc.SyntaxKind.TypeAssertionExpression
1127
+ node.kind === tsc.SyntaxKind.TypeAssertionExpression ||
1128
+ node.kind === tsc.SyntaxKind.NonNullExpression
454
1129
  ) {
455
1130
  typeStr = safeTypeWithContextToString(
456
1131
  typeChecker.getTypeAtLocation(node.expression),
457
1132
  node.expression
458
1133
  );
459
1134
  }
460
- // FUNCTION/METHOD SIGNATURES
1135
+ // FUNCTION/METHOD SIGNATURES - extract return type AND parameter types
461
1136
  else if (
462
1137
  tsc.isFunctionLike(node) ||
463
1138
  tsc.isMethodDeclaration(node) ||
@@ -469,7 +1144,41 @@ function createTsc(srcFiles) {
469
1144
  const signature = typeChecker.getSignatureFromDeclaration(node);
470
1145
  if (signature) {
471
1146
  const returnType = typeChecker.getReturnTypeOfSignature(signature);
472
- typeStr = safeTypeToString(returnType);
1147
+ typeStr = safeTypeToString(returnType, node.name || node);
1148
+ if (
1149
+ isUnresolvedTypeString(typeStr) &&
1150
+ (tsc.getCombinedModifierFlags(node) & tsc.ModifierFlags.Async) !==
1151
+ 0
1152
+ ) {
1153
+ typeStr =
1154
+ inferAsyncReturnTypeFromSyntaxBody(node) ||
1155
+ inferAsyncReturnTypeFromBody(node) ||
1156
+ typeStr;
1157
+ }
1158
+ // Also extract parameter types
1159
+ if (node.parameters) {
1160
+ for (const param of node.parameters) {
1161
+ try {
1162
+ const paramType = typeChecker.getTypeAtLocation(param);
1163
+ const paramTypeStr = safeTypeToString(
1164
+ paramType,
1165
+ param.name || param
1166
+ );
1167
+ if (paramTypeStr && paramTypeStr !== "any") {
1168
+ currentSeenTypes.set(param.getStart(), paramTypeStr);
1169
+ }
1170
+ } catch {
1171
+ // ignore parameter type errors
1172
+ }
1173
+ }
1174
+ }
1175
+ if (node.name) {
1176
+ addTypeAtPosition(
1177
+ currentSeenTypes,
1178
+ node.name.getStart(),
1179
+ buildFunctionSignatureType(node, typeStr)
1180
+ );
1181
+ }
473
1182
  } else {
474
1183
  const funcType = typeChecker.getTypeAtLocation(node);
475
1184
  const callSignatures = typeChecker.getSignaturesOfType(
@@ -477,10 +1186,251 @@ function createTsc(srcFiles) {
477
1186
  tsc.SignatureKind.Call
478
1187
  );
479
1188
  if (callSignatures.length > 0) {
480
- typeStr = safeTypeToString(callSignatures[0].getReturnType());
1189
+ typeStr = safeTypeToString(
1190
+ callSignatures[0].getReturnType(),
1191
+ node.name || node
1192
+ );
1193
+ }
1194
+ }
1195
+ }
1196
+ // CLASS PROPERTIES - extract types for property declarations
1197
+ else if (node.kind === tsc.SyntaxKind.PropertyDeclaration) {
1198
+ if (node.type) {
1199
+ const propType = typeChecker.getTypeFromTypeNode(node.type);
1200
+ typeStr = safeTypeToString(propType, node.type);
1201
+ } else if (node.initializer) {
1202
+ const initType = typeChecker.getTypeAtLocation(node.initializer);
1203
+ typeStr = safeTypeWithContextToString(initType, node.initializer);
1204
+ }
1205
+ }
1206
+ // VARIABLE DECLARATIONS - extract types for loop variables and destructuring
1207
+ else if (
1208
+ node.kind === tsc.SyntaxKind.VariableDeclaration &&
1209
+ node.name
1210
+ ) {
1211
+ const varType = typeChecker.getTypeAtLocation(node.name);
1212
+ typeStr = safeTypeWithContextToString(varType, node.name);
1213
+ if (node.initializer) {
1214
+ const initializerTarget = tsc.isPropertyAccessExpression(
1215
+ node.initializer
1216
+ )
1217
+ ? node.initializer.name
1218
+ : tsc.isElementAccessExpression(node.initializer) &&
1219
+ node.initializer.argumentExpression
1220
+ ? node.initializer.argumentExpression
1221
+ : node.initializer;
1222
+ const initializerType = safeTypeWithContextToString(
1223
+ typeChecker.getTypeAtLocation(initializerTarget),
1224
+ initializerTarget
1225
+ );
1226
+ if (
1227
+ !isUnresolvedTypeString(initializerType) &&
1228
+ (isUnresolvedTypeString(typeStr) ||
1229
+ initializerType.length > typeStr.length)
1230
+ ) {
1231
+ typeStr = initializerType;
1232
+ }
1233
+ if (
1234
+ isUnresolvedTypeString(typeStr) &&
1235
+ tsc.isCallExpression(node.initializer) &&
1236
+ tsc.isIdentifier(node.initializer.expression)
1237
+ ) {
1238
+ const symbol = typeChecker.getSymbolAtLocation(
1239
+ node.initializer.expression
1240
+ );
1241
+ const declaration = symbol?.declarations?.find(
1242
+ (candidate) =>
1243
+ tsc.isFunctionDeclaration(candidate) ||
1244
+ tsc.isMethodDeclaration(candidate) ||
1245
+ tsc.isFunctionExpression(candidate) ||
1246
+ tsc.isArrowFunction(candidate)
1247
+ );
1248
+ if (declaration) {
1249
+ typeStr =
1250
+ inferFunctionDeclarationReturnType(declaration) || typeStr;
1251
+ }
1252
+ }
1253
+ }
1254
+ addTypeAtPosition(currentSeenTypes, node.name.getStart(), typeStr);
1255
+ }
1256
+ // BINDING ELEMENTS - capture destructured member types precisely
1257
+ else if (node.kind === tsc.SyntaxKind.BindingElement && node.name) {
1258
+ const bindingType = typeChecker.getTypeAtLocation(node.name);
1259
+ typeStr = safeTypeWithContextToString(bindingType, node.name);
1260
+ }
1261
+ // PARAMETERS - capture parameter types even when not covered by signature extraction
1262
+ else if (node.kind === tsc.SyntaxKind.Parameter && node.name) {
1263
+ const parameterType = typeChecker.getTypeAtLocation(node.name);
1264
+ typeStr = safeTypeWithContextToString(parameterType, node.name);
1265
+ }
1266
+ // OBJECT LITERAL PROPERTIES - extract property value types
1267
+ else if (
1268
+ node.kind === tsc.SyntaxKind.PropertyAssignment &&
1269
+ node.initializer
1270
+ ) {
1271
+ const propType = typeChecker.getTypeAtLocation(node.initializer);
1272
+ typeStr = safeTypeWithContextToString(propType, node.initializer);
1273
+ }
1274
+ // SHORTHAND OBJECT PROPERTIES - preserve referenced symbol type
1275
+ else if (node.kind === tsc.SyntaxKind.ShorthandPropertyAssignment) {
1276
+ const shorthandType = typeChecker.getTypeAtLocation(node.name);
1277
+ typeStr = safeTypeWithContextToString(shorthandType, node.name);
1278
+ }
1279
+ // IMPORT CALLS - preserve module namespace typing for dynamic import()
1280
+ else if (
1281
+ node.kind === tsc.SyntaxKind.CallExpression &&
1282
+ node.expression?.kind === tsc.SyntaxKind.ImportKeyword
1283
+ ) {
1284
+ const importType = typeChecker.getTypeAtLocation(node);
1285
+ typeStr = safeTypeWithContextToString(importType, node);
1286
+ }
1287
+ // CALL EXPRESSIONS - extract return types
1288
+ else if (node.kind === tsc.SyntaxKind.CallExpression) {
1289
+ const callSig = typeChecker.getResolvedSignature(node);
1290
+ if (callSig) {
1291
+ const retType = callSig.getReturnType();
1292
+ typeStr = safeTypeToString(retType, node);
1293
+ if (
1294
+ isUnresolvedTypeString(typeStr) &&
1295
+ tsc.isIdentifier(node.expression)
1296
+ ) {
1297
+ const symbol = typeChecker.getSymbolAtLocation(node.expression);
1298
+ const declaration = symbol?.declarations?.find(
1299
+ (candidate) =>
1300
+ tsc.isFunctionDeclaration(candidate) ||
1301
+ tsc.isMethodDeclaration(candidate) ||
1302
+ tsc.isFunctionExpression(candidate) ||
1303
+ tsc.isArrowFunction(candidate)
1304
+ );
1305
+ if (declaration) {
1306
+ typeStr =
1307
+ inferFunctionDeclarationReturnType(declaration) || typeStr;
1308
+ }
1309
+ }
1310
+ }
1311
+ }
1312
+ // NEW EXPRESSIONS - extract constructor return types
1313
+ else if (node.kind === tsc.SyntaxKind.NewExpression) {
1314
+ const newSig = typeChecker.getResolvedSignature(node);
1315
+ if (newSig) {
1316
+ const retType = newSig.getReturnType();
1317
+ typeStr = safeTypeToString(retType, node);
1318
+ }
1319
+ }
1320
+ // PROPERTY ACCESS - extract property types
1321
+ else if (
1322
+ node.kind === tsc.SyntaxKind.PropertyAccessExpression ||
1323
+ node.kind === tsc.SyntaxKind.ElementAccessExpression
1324
+ ) {
1325
+ const propType = typeChecker.getTypeAtLocation(node);
1326
+ typeStr = safeTypeWithContextToString(propType, node);
1327
+ if (node.kind === tsc.SyntaxKind.PropertyAccessExpression) {
1328
+ addTypeAtPosition(currentSeenTypes, node.name.getStart(), typeStr);
1329
+ } else if (node.argumentExpression) {
1330
+ addTypeAtPosition(
1331
+ currentSeenTypes,
1332
+ node.argumentExpression.getStart(),
1333
+ typeStr
1334
+ );
1335
+ }
1336
+ }
1337
+ // BINARY EXPRESSIONS - extract result types
1338
+ else if (node.kind === tsc.SyntaxKind.BinaryExpression) {
1339
+ const binType = typeChecker.getTypeAtLocation(node);
1340
+ typeStr = safeTypeWithContextToString(binType, node);
1341
+ }
1342
+ // CONDITIONAL EXPRESSIONS - extract union types
1343
+ else if (node.kind === tsc.SyntaxKind.ConditionalExpression) {
1344
+ const condType = typeChecker.getTypeAtLocation(node);
1345
+ typeStr = safeTypeWithContextToString(condType, node);
1346
+ }
1347
+ // LOGICAL EXPRESSIONS - extract result types
1348
+ else if (node.kind === tsc.SyntaxKind.LogicalExpression) {
1349
+ const logType = typeChecker.getTypeAtLocation(node);
1350
+ typeStr = safeTypeWithContextToString(logType, node);
1351
+ }
1352
+ // ARROW FUNCTION EXPRESSIONS - extract return types
1353
+ else if (node.kind === tsc.SyntaxKind.ArrowFunction) {
1354
+ const arrowSig = typeChecker.getSignatureFromDeclaration(node);
1355
+ if (arrowSig) {
1356
+ const retType = arrowSig.getReturnType();
1357
+ typeStr = safeTypeToString(retType, node);
1358
+ // Also extract parameter types for arrow functions
1359
+ if (node.parameters) {
1360
+ for (const param of node.parameters) {
1361
+ try {
1362
+ const paramType = typeChecker.getTypeAtLocation(param);
1363
+ const paramTypeStr = safeTypeToString(
1364
+ paramType,
1365
+ param.name || param
1366
+ );
1367
+ if (paramTypeStr && paramTypeStr !== "any") {
1368
+ currentSeenTypes.set(param.getStart(), paramTypeStr);
1369
+ }
1370
+ } catch {
1371
+ // ignore
1372
+ }
1373
+ }
481
1374
  }
482
1375
  }
483
1376
  }
1377
+ // CLASS DECLARATIONS - extract class instance types
1378
+ else if (
1379
+ node.kind === tsc.SyntaxKind.ClassDeclaration ||
1380
+ node.kind === tsc.SyntaxKind.ClassExpression
1381
+ ) {
1382
+ const classType = typeChecker.getTypeAtLocation(node);
1383
+ const constructSigs = typeChecker.getSignaturesOfType(
1384
+ classType,
1385
+ tsc.SignatureKind.Construct
1386
+ );
1387
+ if (constructSigs.length > 0) {
1388
+ typeStr = safeTypeToString(constructSigs[0].getReturnType(), node);
1389
+ }
1390
+ }
1391
+ // ENUM MEMBERS - preserve literal enum member types for TypeScript projects
1392
+ else if (node.kind === tsc.SyntaxKind.EnumMember) {
1393
+ const enumMemberType = typeChecker.getTypeAtLocation(node);
1394
+ typeStr = safeTypeWithContextToString(enumMemberType, node);
1395
+ }
1396
+ // TEMPLATE EXPRESSIONS - extract string types
1397
+ else if (
1398
+ node.kind === tsc.SyntaxKind.TemplateExpression ||
1399
+ node.kind === tsc.SyntaxKind.NoSubstitutionTemplateLiteral
1400
+ ) {
1401
+ const tmplType = typeChecker.getTypeAtLocation(node);
1402
+ typeStr = safeTypeWithContextToString(tmplType, node);
1403
+ }
1404
+ // TAGGED TEMPLATE EXPRESSIONS - extract tagged template types
1405
+ else if (node.kind === tsc.SyntaxKind.TaggedTemplateExpression) {
1406
+ const tagType = typeChecker.getTypeAtLocation(node);
1407
+ typeStr = safeTypeWithContextToString(tagType, node);
1408
+ }
1409
+ // YIELD EXPRESSIONS - extract yielded types
1410
+ else if (node.kind === tsc.SyntaxKind.YieldExpression) {
1411
+ const yieldType = typeChecker.getTypeAtLocation(node);
1412
+ typeStr = safeTypeWithContextToString(yieldType, node);
1413
+ }
1414
+ // SPREAD ELEMENTS - extract spread element types
1415
+ else if (node.kind === tsc.SyntaxKind.SpreadElement) {
1416
+ const spreadType = typeChecker.getTypeAtLocation(node.expression);
1417
+ typeStr = safeTypeWithContextToString(spreadType, node.expression);
1418
+ }
1419
+ // DELETE EXPRESSIONS - extract result types
1420
+ else if (node.kind === tsc.SyntaxKind.DeleteExpression) {
1421
+ const delType = typeChecker.getTypeAtLocation(node);
1422
+ typeStr = safeTypeWithContextToString(delType, node);
1423
+ }
1424
+ // TYPEOF EXPRESSIONS - extract result types
1425
+ else if (node.kind === tsc.SyntaxKind.TypeOfExpression) {
1426
+ const typeofType = typeChecker.getTypeAtLocation(node);
1427
+ typeStr = safeTypeWithContextToString(typeofType, node);
1428
+ }
1429
+ // VOID EXPRESSIONS - extract result types
1430
+ else if (node.kind === tsc.SyntaxKind.VoidExpression) {
1431
+ const voidType = typeChecker.getTypeAtLocation(node);
1432
+ typeStr = safeTypeWithContextToString(voidType, node);
1433
+ }
484
1434
  // STANDARD EXPRESSIONS & IDENTIFIERS
485
1435
  else {
486
1436
  let typeObj = typeChecker.getTypeAtLocation(node);
@@ -497,6 +1447,7 @@ function createTsc(srcFiles) {
497
1447
  typeStr = safeTypeWithContextToString(typeObj, node);
498
1448
  }
499
1449
  if (
1450
+ !isDirectCalleeIdentifier &&
500
1451
  typeStr &&
501
1452
  ![
502
1453
  "any",
@@ -507,18 +1458,26 @@ function createTsc(srcFiles) {
507
1458
  "/*unresolved*/ any"
508
1459
  ].includes(typeStr)
509
1460
  ) {
510
- seenTypes.set(node.getStart(), typeStr);
1461
+ addTypeAtPosition(currentSeenTypes, node.getStart(), typeStr);
511
1462
  }
512
1463
  } catch (err) {
513
1464
  // Silently fail on type resolution errors
514
1465
  }
515
- tsc.forEachChild(node, addType);
1466
+ tsc.forEachChild(node, (child) => addType(child, currentSeenTypes));
1467
+ };
1468
+
1469
+ const collectTypes = (sourceFile) => {
1470
+ const fileSeenTypes = new Map();
1471
+ tsc.forEachChild(sourceFile, (node) => addType(node, fileSeenTypes));
1472
+ return fileSeenTypes;
516
1473
  };
517
1474
 
518
1475
  return {
519
1476
  program: program,
520
1477
  typeChecker: typeChecker,
1478
+ rootNames: tscConfig.rootNames,
521
1479
  addType: addType,
1480
+ collectTypes: collectTypes,
522
1481
  seenTypes: seenTypes
523
1482
  };
524
1483
  } catch (err) {
@@ -532,18 +1491,41 @@ function createTsc(srcFiles) {
532
1491
  const createJSAst = async (options) => {
533
1492
  try {
534
1493
  const promiseMap = await getAllSrcJSAndTSFiles(options.src);
535
- const srcFiles = promiseMap.flatMap((d) => d);
536
- const CONCURRENCY_LIMIT = 10;
537
- const chunks = [];
538
- for (let i = 0; i < srcFiles.length; i += CONCURRENCY_LIMIT) {
539
- chunks.push(srcFiles.slice(i, i + CONCURRENCY_LIMIT));
540
- }
1494
+ let srcFiles = promiseMap.flatMap((d) => d).sort();
541
1495
  let ts;
542
1496
  if (options.tsTypes) {
543
1497
  const projectFiles = !shouldIncludeNodeModulesBundles
544
1498
  ? srcFiles.filter((file) => !file.includes("node_modules"))
545
1499
  : srcFiles;
546
- ts = createTsc(projectFiles);
1500
+ ts = createTsc(projectFiles, options.src);
1501
+ if (ts?.rootNames) {
1502
+ const srcRoot = resolve(options.src);
1503
+ const srcFileByResolvedPath = new Map(
1504
+ srcFiles.map((file) => [resolve(file), file])
1505
+ );
1506
+ for (const file of ts.rootNames) {
1507
+ const resolvedFile = resolve(file);
1508
+ if (
1509
+ resolvedFile.startsWith(srcRoot) &&
1510
+ /\.(?:js|jsx|cjs|mjs|ts|tsx|mts|cts)$/.test(file) &&
1511
+ !srcFileByResolvedPath.has(resolvedFile)
1512
+ ) {
1513
+ srcFileByResolvedPath.set(
1514
+ resolvedFile,
1515
+ join(options.src, relative(srcRoot, resolvedFile))
1516
+ );
1517
+ }
1518
+ }
1519
+ srcFiles = [...srcFileByResolvedPath.values()].sort();
1520
+ }
1521
+ }
1522
+ const CONCURRENCY_LIMIT = Math.max(
1523
+ 1,
1524
+ Number.parseInt(process.env.ASTGEN_CONCURRENCY || "10", 10) || 10
1525
+ );
1526
+ const chunks = [];
1527
+ for (let i = 0; i < srcFiles.length; i += CONCURRENCY_LIMIT) {
1528
+ chunks.push(srcFiles.slice(i, i + CONCURRENCY_LIMIT));
547
1529
  }
548
1530
  for (const chunk of chunks) {
549
1531
  await Promise.all(chunk.map((file) => processFile(file, options, ts)));
@@ -574,9 +1556,15 @@ const processFile = (file, options, ts) => {
574
1556
  try {
575
1557
  const tsAst = ts.program.getSourceFile(file);
576
1558
  if (tsAst) {
577
- tsc.forEachChild(tsAst, ts.addType);
578
- writeTypesFile(file, ts.seenTypes, options);
579
- ts.seenTypes.clear();
1559
+ const seenTypes = ts.collectTypes
1560
+ ? ts.collectTypes(tsAst)
1561
+ : (() => {
1562
+ tsc.forEachChild(tsAst, ts.addType);
1563
+ const collectedTypes = new Map(ts.seenTypes);
1564
+ ts.seenTypes.clear();
1565
+ return collectedTypes;
1566
+ })();
1567
+ writeTypesFile(file, seenTypes, options);
580
1568
  }
581
1569
  } catch (err) {
582
1570
  console.warn("Process file", file, ":", err.message);
@@ -695,34 +1683,12 @@ const start = async (options) => {
695
1683
  };
696
1684
 
697
1685
  async function main(argvs) {
698
- const args = yargs(hideBin(argvs))
699
- .option("src", {
700
- alias: "i",
701
- default: ".",
702
- description: "Source directory"
703
- })
704
- .option("output", {
705
- alias: "o",
706
- default: "ast_out",
707
- description: "Output directory for generated AST json files"
708
- })
709
- .option("type", {
710
- alias: "t",
711
- description: "Project type. Default auto-detect"
712
- })
713
- .option("recurse", {
714
- alias: "r",
715
- default: true,
716
- type: "boolean",
717
- description: "Recurse mode suitable for mono-repos"
718
- })
719
- .option("tsTypes", {
720
- default: true,
721
- type: "boolean",
722
- description: "Generate type mappings using the Typescript Compiler API"
723
- })
724
- .version(ASTGEN_VERSION)
725
- .help("h").argv;
1686
+ const args = parseCliArgs(argvs);
1687
+
1688
+ if (args.help) {
1689
+ console.log(HELP_TEXT);
1690
+ process.exit(0);
1691
+ }
726
1692
 
727
1693
  if (args.version) {
728
1694
  console.log(ASTGEN_VERSION);