jsii-rosetta 1.75.0 → 4.9.0-dev.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 (511) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +1 -0
  3. package/README.md +287 -388
  4. package/bin/jsii-rosetta +1 -1
  5. package/lib/ambient/semver-intersect.d.ts +13 -0
  6. package/lib/ambient/semver-intersect.js +2 -0
  7. package/lib/ambient/semver-intersect.js.map +1 -0
  8. package/lib/commands/convert.js.map +1 -0
  9. package/lib/commands/coverage.js.map +1 -0
  10. package/lib/commands/extract.js +2 -2
  11. package/lib/commands/extract.js.map +1 -0
  12. package/lib/commands/infuse.js +2 -2
  13. package/lib/commands/infuse.js.map +1 -0
  14. package/lib/commands/read.js +6 -6
  15. package/lib/commands/read.js.map +1 -0
  16. package/lib/commands/transliterate.js +4 -4
  17. package/lib/commands/transliterate.js.map +1 -0
  18. package/lib/commands/trim-cache.js.map +1 -0
  19. package/lib/find-utils.js +4 -4
  20. package/lib/find-utils.js.map +1 -0
  21. package/lib/fixtures.js +2 -2
  22. package/lib/fixtures.js.map +1 -0
  23. package/lib/index.js.map +1 -0
  24. package/lib/jsii/assemblies.d.ts +1 -1
  25. package/lib/jsii/assemblies.js +14 -11
  26. package/lib/jsii/assemblies.js.map +1 -0
  27. package/lib/jsii/fingerprinting.js +9 -9
  28. package/lib/jsii/fingerprinting.js.map +1 -0
  29. package/lib/jsii/jsii-types.d.ts +4 -4
  30. package/lib/jsii/jsii-types.js +9 -4
  31. package/lib/jsii/jsii-types.js.map +1 -0
  32. package/lib/jsii/jsii-utils.d.ts +1 -1
  33. package/lib/jsii/jsii-utils.js +2 -2
  34. package/lib/jsii/jsii-utils.js.map +1 -0
  35. package/lib/jsii/packages.js.map +1 -0
  36. package/lib/languages/csharp.d.ts +3 -3
  37. package/lib/languages/csharp.js +2 -2
  38. package/lib/languages/csharp.js.map +1 -0
  39. package/lib/languages/default.d.ts +2 -2
  40. package/lib/languages/default.js.map +1 -0
  41. package/lib/languages/go.d.ts +3 -3
  42. package/lib/languages/go.js +20 -16
  43. package/lib/languages/go.js.map +1 -0
  44. package/lib/languages/index.d.ts +1 -1
  45. package/lib/languages/index.js +4 -4
  46. package/lib/languages/index.js.map +1 -0
  47. package/lib/languages/java.d.ts +2 -2
  48. package/lib/languages/java.js +2 -2
  49. package/lib/languages/java.js.map +1 -0
  50. package/lib/languages/python.d.ts +3 -3
  51. package/lib/languages/python.js +1 -1
  52. package/lib/languages/python.js.map +1 -0
  53. package/lib/languages/record-references-version.d.ts +2 -0
  54. package/lib/languages/record-references-version.js +6 -0
  55. package/lib/languages/record-references-version.js.map +1 -0
  56. package/lib/languages/record-references.d.ts +2 -2
  57. package/lib/languages/record-references.js +3 -2
  58. package/lib/languages/record-references.js.map +1 -0
  59. package/lib/languages/target-language.d.ts +0 -2
  60. package/lib/languages/target-language.js +2 -1
  61. package/lib/languages/target-language.js.map +1 -0
  62. package/lib/languages/visualize.d.ts +1 -1
  63. package/lib/languages/visualize.js +1 -1
  64. package/lib/languages/visualize.js.map +1 -0
  65. package/lib/logging.js +1 -1
  66. package/lib/logging.js.map +1 -0
  67. package/lib/main.d.ts +2 -0
  68. package/{bin/jsii-rosetta.js → lib/main.js} +21 -21
  69. package/lib/main.js.map +1 -0
  70. package/lib/markdown/escapes.js.map +1 -0
  71. package/lib/markdown/extract-snippets.d.ts +2 -2
  72. package/lib/markdown/extract-snippets.js +1 -1
  73. package/lib/markdown/extract-snippets.js.map +1 -0
  74. package/lib/markdown/index.js.map +1 -0
  75. package/lib/markdown/javadoc-renderer.js.map +1 -0
  76. package/lib/markdown/markdown-renderer.js.map +1 -0
  77. package/lib/markdown/markdown.js.map +1 -0
  78. package/lib/markdown/replace-code-renderer.d.ts +1 -1
  79. package/lib/markdown/replace-code-renderer.js.map +1 -0
  80. package/lib/markdown/replace-typescript-transform.d.ts +2 -2
  81. package/lib/markdown/replace-typescript-transform.js +1 -1
  82. package/lib/markdown/replace-typescript-transform.js.map +1 -0
  83. package/lib/markdown/structure-renderer.js.map +1 -0
  84. package/lib/markdown/types.js.map +1 -0
  85. package/lib/markdown/xml-comment-renderer.js.map +1 -0
  86. package/lib/o-tree.js +3 -3
  87. package/lib/o-tree.js.map +1 -0
  88. package/lib/renderer.js.map +1 -0
  89. package/lib/rosetta-reader.js.map +1 -0
  90. package/lib/rosetta-translator.d.ts +1 -1
  91. package/lib/rosetta-translator.js +2 -2
  92. package/lib/rosetta-translator.js.map +1 -0
  93. package/lib/snippet-dependencies.js +12 -12
  94. package/lib/snippet-dependencies.js.map +1 -0
  95. package/lib/snippet-selectors.d.ts +1 -1
  96. package/lib/snippet-selectors.js +2 -2
  97. package/lib/snippet-selectors.js.map +1 -0
  98. package/lib/snippet.d.ts +3 -3
  99. package/lib/snippet.js +5 -5
  100. package/lib/snippet.js.map +1 -0
  101. package/lib/strict.js.map +1 -0
  102. package/lib/submodule-reference.d.ts +1 -1
  103. package/lib/submodule-reference.js +11 -11
  104. package/lib/submodule-reference.js.map +1 -0
  105. package/lib/tablets/key.js +3 -3
  106. package/lib/tablets/key.js.map +1 -0
  107. package/lib/tablets/schema.js.map +1 -0
  108. package/lib/tablets/tablets.d.ts +1 -1
  109. package/lib/tablets/tablets.js +13 -13
  110. package/lib/tablets/tablets.js.map +1 -0
  111. package/lib/translate.d.ts +1 -1
  112. package/lib/translate.js +9 -7
  113. package/lib/translate.js.map +1 -0
  114. package/lib/translate_all.js +2 -2
  115. package/lib/translate_all.js.map +1 -0
  116. package/lib/translate_all_worker.js.map +1 -0
  117. package/lib/typescript/ast-utils.d.ts +2 -2
  118. package/lib/typescript/ast-utils.js +2 -4
  119. package/lib/typescript/ast-utils.js.map +1 -0
  120. package/lib/typescript/imports.d.ts +2 -2
  121. package/lib/typescript/imports.js +3 -3
  122. package/lib/typescript/imports.js.map +1 -0
  123. package/lib/typescript/syntax-kind-counter.d.ts +1 -1
  124. package/lib/typescript/syntax-kind-counter.js +1 -2
  125. package/lib/typescript/syntax-kind-counter.js.map +1 -0
  126. package/lib/typescript/ts-compiler.js.map +1 -0
  127. package/lib/typescript/types.d.ts +2 -2
  128. package/lib/typescript/types.js +1 -1
  129. package/lib/typescript/types.js.map +1 -0
  130. package/lib/typescript/visible-spans.js +6 -6
  131. package/lib/typescript/visible-spans.js.map +1 -0
  132. package/lib/util.d.ts +1 -1
  133. package/lib/util.js +2 -2
  134. package/lib/util.js.map +1 -0
  135. package/package.json +68 -37
  136. package/temp.tabl.json +48 -0
  137. package/bin/jsii-rosetta.d.ts +0 -2
  138. package/jest.config.mjs +0 -8
  139. package/jestsetup.js +0 -4
  140. package/test/commands/extract.test.d.ts +0 -2
  141. package/test/commands/extract.test.js +0 -698
  142. package/test/commands/infuse.test.d.ts +0 -2
  143. package/test/commands/infuse.test.js +0 -165
  144. package/test/commands/transliterate.test.d.ts +0 -2
  145. package/test/commands/transliterate.test.js +0 -1636
  146. package/test/commands/trim-cache.test.d.ts +0 -2
  147. package/test/commands/trim-cache.test.js +0 -85
  148. package/test/fixtures.test.d.ts +0 -2
  149. package/test/fixtures.test.js +0 -49
  150. package/test/jsii/assemblies.test.d.ts +0 -2
  151. package/test/jsii/assemblies.test.js +0 -230
  152. package/test/jsii/fake-assembly.d.ts +0 -3
  153. package/test/jsii/fake-assembly.js +0 -21
  154. package/test/jsii/fixtures/rosetta/explicit.ts-fixture +0 -7
  155. package/test/jsii/visible-spans.test.d.ts +0 -2
  156. package/test/jsii/visible-spans.test.js +0 -40
  157. package/test/jsii-imports.test.d.ts +0 -2
  158. package/test/jsii-imports.test.js +0 -438
  159. package/test/markdown/javadoc.test.d.ts +0 -2
  160. package/test/markdown/javadoc.test.js +0 -110
  161. package/test/markdown/roundtrip.test.d.ts +0 -2
  162. package/test/markdown/roundtrip.test.js +0 -126
  163. package/test/markdown/xmldoccomments.test.d.ts +0 -2
  164. package/test/markdown/xmldoccomments.test.js +0 -89
  165. package/test/otree.test.d.ts +0 -2
  166. package/test/otree.test.js +0 -36
  167. package/test/record-references.test.d.ts +0 -2
  168. package/test/record-references.test.js +0 -88
  169. package/test/rosetta/default.ts-fixture +0 -1
  170. package/test/rosetta-translator.test.d.ts +0 -2
  171. package/test/rosetta-translator.test.js +0 -33
  172. package/test/rosetta.test.d.ts +0 -2
  173. package/test/rosetta.test.js +0 -221
  174. package/test/snippet-selectors.test.d.ts +0 -2
  175. package/test/snippet-selectors.test.js +0 -57
  176. package/test/snippet.test.d.ts +0 -2
  177. package/test/snippet.test.js +0 -18
  178. package/test/syntax-counter.test.d.ts +0 -2
  179. package/test/syntax-counter.test.js +0 -60
  180. package/test/testutil.d.ts +0 -64
  181. package/test/testutil.js +0 -104
  182. package/test/translate.test.d.ts +0 -2
  183. package/test/translate.test.js +0 -175
  184. package/test/translations/calls/declaring_default_arguments.cs +0 -4
  185. package/test/translations/calls/declaring_default_arguments.go +0 -6
  186. package/test/translations/calls/declaring_default_arguments.java +0 -11
  187. package/test/translations/calls/declaring_default_arguments.py +0 -2
  188. package/test/translations/calls/default_struct_fields.cs +0 -9
  189. package/test/translations/calls/default_struct_fields.go +0 -7
  190. package/test/translations/calls/default_struct_fields.java +0 -21
  191. package/test/translations/calls/default_struct_fields.py +0 -2
  192. package/test/translations/calls/function_call.cs +0 -1
  193. package/test/translations/calls/function_call.go +0 -1
  194. package/test/translations/calls/function_call.java +0 -1
  195. package/test/translations/calls/function_call.py +0 -1
  196. package/test/translations/calls/list_of_anonymous_structs.cs +0 -9
  197. package/test/translations/calls/list_of_anonymous_structs.go +0 -12
  198. package/test/translations/calls/list_of_anonymous_structs.java +0 -6
  199. package/test/translations/calls/list_of_anonymous_structs.py +0 -9
  200. package/test/translations/calls/literal_map_argument.cs +0 -5
  201. package/test/translations/calls/literal_map_argument.go +0 -7
  202. package/test/translations/calls/literal_map_argument.java +0 -4
  203. package/test/translations/calls/literal_map_argument.py +0 -4
  204. package/test/translations/calls/method_call.cs +0 -1
  205. package/test/translations/calls/method_call.go +0 -1
  206. package/test/translations/calls/method_call.java +0 -1
  207. package/test/translations/calls/method_call.py +0 -1
  208. package/test/translations/calls/self_method_call.cs +0 -1
  209. package/test/translations/calls/self_method_call.go +0 -1
  210. package/test/translations/calls/self_method_call.java +0 -1
  211. package/test/translations/calls/self_method_call.py +0 -1
  212. package/test/translations/calls/shorthand_property.cs +0 -2
  213. package/test/translations/calls/shorthand_property.go +0 -4
  214. package/test/translations/calls/shorthand_property.java +0 -2
  215. package/test/translations/calls/shorthand_property.py +0 -2
  216. package/test/translations/calls/static_function_call.cs +0 -1
  217. package/test/translations/calls/static_function_call.go +0 -1
  218. package/test/translations/calls/static_function_call.java +0 -1
  219. package/test/translations/calls/static_function_call.py +0 -1
  220. package/test/translations/calls/this_argument.cs +0 -1
  221. package/test/translations/calls/this_argument.go +0 -1
  222. package/test/translations/calls/this_argument.java +0 -1
  223. package/test/translations/calls/this_argument.py +0 -1
  224. package/test/translations/calls/translate_object_literals_in_function_call.cs +0 -1
  225. package/test/translations/calls/translate_object_literals_in_function_call.go +0 -4
  226. package/test/translations/calls/translate_object_literals_in_function_call.java +0 -1
  227. package/test/translations/calls/translate_object_literals_in_function_call.py +0 -1
  228. package/test/translations/calls/translate_object_literals_only_one_level_deep.cs +0 -1
  229. package/test/translations/calls/translate_object_literals_only_one_level_deep.go +0 -7
  230. package/test/translations/calls/translate_object_literals_only_one_level_deep.java +0 -1
  231. package/test/translations/calls/translate_object_literals_only_one_level_deep.py +0 -1
  232. package/test/translations/calls/translate_object_literals_second_level_with_newlines.cs +0 -4
  233. package/test/translations/calls/translate_object_literals_second_level_with_newlines.go +0 -7
  234. package/test/translations/calls/translate_object_literals_second_level_with_newlines.java +0 -3
  235. package/test/translations/calls/translate_object_literals_second_level_with_newlines.py +0 -4
  236. package/test/translations/calls/translate_object_literals_with_multiple_newlines.cs +0 -5
  237. package/test/translations/calls/translate_object_literals_with_multiple_newlines.go +0 -5
  238. package/test/translations/calls/translate_object_literals_with_multiple_newlines.java +0 -4
  239. package/test/translations/calls/translate_object_literals_with_multiple_newlines.py +0 -5
  240. package/test/translations/calls/translate_object_literals_with_newlines.cs +0 -4
  241. package/test/translations/calls/translate_object_literals_with_newlines.go +0 -4
  242. package/test/translations/calls/translate_object_literals_with_newlines.java +0 -3
  243. package/test/translations/calls/translate_object_literals_with_newlines.py +0 -4
  244. package/test/translations/calls/will_type_deep_structs_directly_if_type_info_is_available.cs +0 -24
  245. package/test/translations/calls/will_type_deep_structs_directly_if_type_info_is_available.go +0 -24
  246. package/test/translations/calls/will_type_deep_structs_directly_if_type_info_is_available.java +0 -48
  247. package/test/translations/calls/will_type_deep_structs_directly_if_type_info_is_available.py +0 -7
  248. package/test/translations/classes/class_declaration_with_private_fields_and_constructor.cs +0 -9
  249. package/test/translations/classes/class_declaration_with_private_fields_and_constructor.go +0 -9
  250. package/test/translations/classes/class_declaration_with_private_fields_and_constructor.java +0 -7
  251. package/test/translations/classes/class_declaration_with_private_fields_and_constructor.py +0 -4
  252. package/test/translations/classes/class_declaration_with_public_fields_and_constructor.cs +0 -9
  253. package/test/translations/classes/class_declaration_with_public_fields_and_constructor.go +0 -9
  254. package/test/translations/classes/class_declaration_with_public_fields_and_constructor.java +0 -7
  255. package/test/translations/classes/class_declaration_with_public_fields_and_constructor.py +0 -4
  256. package/test/translations/classes/class_implementing_jsii_interface.cs +0 -7
  257. package/test/translations/classes/class_implementing_jsii_interface.go +0 -6
  258. package/test/translations/classes/class_implementing_jsii_interface.java +0 -5
  259. package/test/translations/classes/class_implementing_jsii_interface.py +0 -4
  260. package/test/translations/classes/class_with_different_name.cs +0 -6
  261. package/test/translations/classes/class_with_different_name.go +0 -7
  262. package/test/translations/classes/class_with_different_name.java +0 -4
  263. package/test/translations/classes/class_with_different_name.py +0 -3
  264. package/test/translations/classes/class_with_extends_and_implements.cs +0 -3
  265. package/test/translations/classes/class_with_extends_and_implements.go +0 -3
  266. package/test/translations/classes/class_with_extends_and_implements.java +0 -2
  267. package/test/translations/classes/class_with_inheritance.cs +0 -3
  268. package/test/translations/classes/class_with_inheritance.go +0 -3
  269. package/test/translations/classes/class_with_inheritance.java +0 -2
  270. package/test/translations/classes/class_with_inheritance.py +0 -2
  271. package/test/translations/classes/class_with_inheritance_and_super_class.cs +0 -6
  272. package/test/translations/classes/class_with_inheritance_and_super_class.go +0 -9
  273. package/test/translations/classes/class_with_inheritance_and_super_class.java +0 -5
  274. package/test/translations/classes/class_with_inheritance_and_super_class.py +0 -3
  275. package/test/translations/classes/class_with_method.cs +0 -7
  276. package/test/translations/classes/class_with_method.go +0 -7
  277. package/test/translations/classes/class_with_method.java +0 -5
  278. package/test/translations/classes/class_with_method.py +0 -3
  279. package/test/translations/classes/class_with_props_argument.cs +0 -14
  280. package/test/translations/classes/class_with_props_argument.go +0 -16
  281. package/test/translations/classes/class_with_props_argument.java +0 -26
  282. package/test/translations/classes/class_with_props_argument.py +0 -5
  283. package/test/translations/classes/constructor_with_optional_params.go +0 -10
  284. package/test/translations/classes/constructor_with_optional_params.java +0 -12
  285. package/test/translations/classes/empty_class.cs +0 -3
  286. package/test/translations/classes/empty_class.go +0 -2
  287. package/test/translations/classes/empty_class.java +0 -2
  288. package/test/translations/classes/empty_class.py +0 -2
  289. package/test/translations/classes/invisible_interfaces_do_not_affect_whitespace.cs +0 -11
  290. package/test/translations/classes/invisible_interfaces_do_not_affect_whitespace.go +0 -8
  291. package/test/translations/classes/invisible_interfaces_do_not_affect_whitespace.java +0 -8
  292. package/test/translations/classes/invisible_interfaces_do_not_affect_whitespace.py +0 -5
  293. package/test/translations/classes/whitespace_between_multiple_empty_members.cs +0 -15
  294. package/test/translations/classes/whitespace_between_multiple_empty_members.go +0 -12
  295. package/test/translations/classes/whitespace_between_multiple_empty_members.java +0 -11
  296. package/test/translations/classes/whitespace_between_multiple_empty_members.py +0 -9
  297. package/test/translations/classes/whitespace_between_multiple_members.cs +0 -17
  298. package/test/translations/classes/whitespace_between_multiple_members.go +0 -16
  299. package/test/translations/classes/whitespace_between_multiple_members.java +0 -13
  300. package/test/translations/classes/whitespace_between_multiple_members.py +0 -9
  301. package/test/translations/comments/empty_lines_in_comments.cs +0 -4
  302. package/test/translations/comments/empty_lines_in_comments.go +0 -4
  303. package/test/translations/comments/empty_lines_in_comments.java +0 -4
  304. package/test/translations/comments/empty_lines_in_comments.py +0 -4
  305. package/test/translations/comments/interleave_multiline_comments_with_function_call.cs +0 -7
  306. package/test/translations/comments/interleave_multiline_comments_with_function_call.go +0 -7
  307. package/test/translations/comments/interleave_multiline_comments_with_function_call.java +0 -6
  308. package/test/translations/comments/interleave_multiline_comments_with_function_call.py +0 -7
  309. package/test/translations/comments/interleave_single_line_comments_with_function_call.cs +0 -7
  310. package/test/translations/comments/interleave_single_line_comments_with_function_call.go +0 -7
  311. package/test/translations/comments/interleave_single_line_comments_with_function_call.java +0 -6
  312. package/test/translations/comments/interleave_single_line_comments_with_function_call.py +0 -7
  313. package/test/translations/comments/no_duplication_of_comments.cs +0 -2
  314. package/test/translations/comments/no_duplication_of_comments.go +0 -2
  315. package/test/translations/comments/no_duplication_of_comments.java +0 -2
  316. package/test/translations/comments/no_duplication_of_comments.py +0 -2
  317. package/test/translations/expressions/array_index.cs +0 -3
  318. package/test/translations/expressions/array_index.go +0 -3
  319. package/test/translations/expressions/array_index.java +0 -3
  320. package/test/translations/expressions/array_index.py +0 -3
  321. package/test/translations/expressions/as_expression.cs +0 -1
  322. package/test/translations/expressions/as_expression.go +0 -1
  323. package/test/translations/expressions/as_expression.java +0 -1
  324. package/test/translations/expressions/as_expression.py +0 -1
  325. package/test/translations/expressions/await.cs +0 -1
  326. package/test/translations/expressions/await.go +0 -1
  327. package/test/translations/expressions/await.java +0 -1
  328. package/test/translations/expressions/await.py +0 -1
  329. package/test/translations/expressions/backtick_string_w_o_substitutions.cs +0 -1
  330. package/test/translations/expressions/backtick_string_w_o_substitutions.go +0 -1
  331. package/test/translations/expressions/backtick_string_w_o_substitutions.java +0 -1
  332. package/test/translations/expressions/backtick_string_w_o_substitutions.py +0 -1
  333. package/test/translations/expressions/computed_key.cs +0 -4
  334. package/test/translations/expressions/computed_key.go +0 -8
  335. package/test/translations/expressions/computed_key.java +0 -4
  336. package/test/translations/expressions/computed_key.py +0 -4
  337. package/test/translations/expressions/double_quoted_dict_keys.cs +0 -1
  338. package/test/translations/expressions/double_quoted_dict_keys.go +0 -3
  339. package/test/translations/expressions/double_quoted_dict_keys.java +0 -1
  340. package/test/translations/expressions/double_quoted_dict_keys.py +0 -1
  341. package/test/translations/expressions/ellipsis_at_a_random_place.cs +0 -1
  342. package/test/translations/expressions/ellipsis_at_a_random_place.go +0 -1
  343. package/test/translations/expressions/ellipsis_at_a_random_place.java +0 -1
  344. package/test/translations/expressions/ellipsis_at_a_random_place.py +0 -1
  345. package/test/translations/expressions/enum_access.cs +0 -1
  346. package/test/translations/expressions/enum_access.go +0 -1
  347. package/test/translations/expressions/enum_access.java +0 -1
  348. package/test/translations/expressions/enum_access.py +0 -1
  349. package/test/translations/expressions/enum_like_access.cs +0 -1
  350. package/test/translations/expressions/enum_like_access.go +0 -1
  351. package/test/translations/expressions/enum_like_access.java +0 -1
  352. package/test/translations/expressions/enum_like_access.py +0 -1
  353. package/test/translations/expressions/map-literal.cs +0 -3
  354. package/test/translations/expressions/map-literal.go +0 -3
  355. package/test/translations/expressions/map-literal.java +0 -2
  356. package/test/translations/expressions/map-literal.py +0 -3
  357. package/test/translations/expressions/non_null_expression.cs +0 -1
  358. package/test/translations/expressions/non_null_expression.go +0 -1
  359. package/test/translations/expressions/non_null_expression.java +0 -1
  360. package/test/translations/expressions/non_null_expression.py +0 -1
  361. package/test/translations/expressions/string_interpolation.cs +0 -10
  362. package/test/translations/expressions/string_interpolation.go +0 -6
  363. package/test/translations/expressions/string_interpolation.java +0 -6
  364. package/test/translations/expressions/string_interpolation.py +0 -10
  365. package/test/translations/expressions/string_literal.cs +0 -9
  366. package/test/translations/expressions/string_literal.go +0 -9
  367. package/test/translations/expressions/string_literal.java +0 -1
  368. package/test/translations/expressions/string_literal.py +0 -9
  369. package/test/translations/expressions/struct_assignment.cs +0 -6
  370. package/test/translations/expressions/struct_assignment.go +0 -7
  371. package/test/translations/expressions/struct_assignment.java +0 -12
  372. package/test/translations/expressions/struct_assignment.py +0 -1
  373. package/test/translations/expressions/unary_and_binary_operators.cs +0 -3
  374. package/test/translations/expressions/unary_and_binary_operators.go +0 -3
  375. package/test/translations/expressions/unary_and_binary_operators.java +0 -3
  376. package/test/translations/expressions/unary_and_binary_operators.py +0 -3
  377. package/test/translations/hiding/hide_block_level_statements_using_void_directive.cs +0 -6
  378. package/test/translations/hiding/hide_block_level_statements_using_void_directive.go +0 -5
  379. package/test/translations/hiding/hide_block_level_statements_using_void_directive.java +0 -5
  380. package/test/translations/hiding/hide_block_level_statements_using_void_directive.py +0 -4
  381. package/test/translations/hiding/hide_expression_with_explicit_ellipsis.cs +0 -1
  382. package/test/translations/hiding/hide_expression_with_explicit_ellipsis.go +0 -1
  383. package/test/translations/hiding/hide_expression_with_explicit_ellipsis.java +0 -1
  384. package/test/translations/hiding/hide_expression_with_explicit_ellipsis.py +0 -1
  385. package/test/translations/hiding/hide_halfway_into_class_using_comments.cs +0 -3
  386. package/test/translations/hiding/hide_halfway_into_class_using_comments.go +0 -3
  387. package/test/translations/hiding/hide_halfway_into_class_using_comments.java +0 -3
  388. package/test/translations/hiding/hide_halfway_into_class_using_comments.py +0 -3
  389. package/test/translations/hiding/hide_parameter_sequence.cs +0 -1
  390. package/test/translations/hiding/hide_parameter_sequence.go +0 -1
  391. package/test/translations/hiding/hide_parameter_sequence.java +0 -1
  392. package/test/translations/hiding/hide_parameter_sequence.py +0 -1
  393. package/test/translations/hiding/hide_statements_with_explicit_ellipsis.cs +0 -3
  394. package/test/translations/hiding/hide_statements_with_explicit_ellipsis.go +0 -3
  395. package/test/translations/hiding/hide_statements_with_explicit_ellipsis.java +0 -3
  396. package/test/translations/hiding/hide_statements_with_explicit_ellipsis.py +0 -3
  397. package/test/translations/hiding/hide_top_level_statements_using_void_directive.cs +0 -1
  398. package/test/translations/hiding/hide_top_level_statements_using_void_directive.go +0 -1
  399. package/test/translations/hiding/hide_top_level_statements_using_void_directive.java +0 -1
  400. package/test/translations/hiding/hide_top_level_statements_using_void_directive.py +0 -1
  401. package/test/translations/identifiers/keyword.cs +0 -4
  402. package/test/translations/identifiers/keyword.go +0 -4
  403. package/test/translations/identifiers/keyword.java +0 -4
  404. package/test/translations/identifiers/keyword.py +0 -4
  405. package/test/translations/imports/import_require.cs +0 -2
  406. package/test/translations/imports/import_require.go +0 -2
  407. package/test/translations/imports/import_require.java +0 -2
  408. package/test/translations/imports/import_require.py +0 -2
  409. package/test/translations/imports/import_star_as.cs +0 -2
  410. package/test/translations/imports/import_star_as.go +0 -2
  411. package/test/translations/imports/import_star_as.java +0 -2
  412. package/test/translations/imports/import_star_as.py +0 -2
  413. package/test/translations/imports/multiple-imports.cs +0 -2
  414. package/test/translations/imports/multiple-imports.go +0 -2
  415. package/test/translations/imports/multiple-imports.java +0 -3
  416. package/test/translations/imports/multiple-imports.py +0 -2
  417. package/test/translations/imports/selective_import.cs +0 -4
  418. package/test/translations/imports/selective_import.go +0 -3
  419. package/test/translations/imports/selective_import.java +0 -6
  420. package/test/translations/imports/selective_import.py +0 -3
  421. package/test/translations/imports/submodule-import.cs +0 -15
  422. package/test/translations/imports/submodule-import.go +0 -23
  423. package/test/translations/imports/submodule-import.java +0 -17
  424. package/test/translations/imports/submodule-import.py +0 -15
  425. package/test/translations/interfaces/interface_with_method.cs +0 -4
  426. package/test/translations/interfaces/interface_with_method.go +0 -3
  427. package/test/translations/interfaces/interface_with_method.java +0 -3
  428. package/test/translations/interfaces/interface_with_props.cs +0 -4
  429. package/test/translations/interfaces/interface_with_props.go +0 -3
  430. package/test/translations/interfaces/interface_with_props.java +0 -3
  431. package/test/translations/misc/booleans_render_to_right_primitives.cs +0 -1
  432. package/test/translations/misc/booleans_render_to_right_primitives.go +0 -1
  433. package/test/translations/misc/booleans_render_to_right_primitives.java +0 -1
  434. package/test/translations/misc/booleans_render_to_right_primitives.py +0 -1
  435. package/test/translations/statements/block_without_braces.cs +0 -1
  436. package/test/translations/statements/block_without_braces.go +0 -3
  437. package/test/translations/statements/block_without_braces.java +0 -1
  438. package/test/translations/statements/block_without_braces.py +0 -1
  439. package/test/translations/statements/declare_var.cs +0 -1
  440. package/test/translations/statements/declare_var.go +0 -1
  441. package/test/translations/statements/declare_var.java +0 -1
  442. package/test/translations/statements/declare_var.py +0 -1
  443. package/test/translations/statements/empty_control_block.cs +0 -3
  444. package/test/translations/statements/empty_control_block.go +0 -1
  445. package/test/translations/statements/empty_control_block.java +0 -2
  446. package/test/translations/statements/empty_control_block.py +0 -2
  447. package/test/translations/statements/for_of_loop.cs +0 -4
  448. package/test/translations/statements/for_of_loop.go +0 -3
  449. package/test/translations/statements/for_of_loop.java +0 -3
  450. package/test/translations/statements/for_of_loop.py +0 -2
  451. package/test/translations/statements/if.cs +0 -4
  452. package/test/translations/statements/if.go +0 -3
  453. package/test/translations/statements/if.java +0 -3
  454. package/test/translations/statements/if.py +0 -2
  455. package/test/translations/statements/if_then_else.cs +0 -8
  456. package/test/translations/statements/if_then_else.go +0 -5
  457. package/test/translations/statements/if_then_else.java +0 -5
  458. package/test/translations/statements/if_then_else.py +0 -4
  459. package/test/translations/statements/initialize_object_literal.cs +0 -5
  460. package/test/translations/statements/initialize_object_literal.go +0 -8
  461. package/test/translations/statements/initialize_object_literal.java +0 -4
  462. package/test/translations/statements/initialize_object_literal.py +0 -5
  463. package/test/translations/statements/multiline_if_then_else.cs +0 -9
  464. package/test/translations/statements/multiline_if_then_else.go +0 -6
  465. package/test/translations/statements/multiline_if_then_else.java +0 -6
  466. package/test/translations/statements/multiline_if_then_else.py +0 -5
  467. package/test/translations/statements/statements_and_newlines.cs +0 -26
  468. package/test/translations/statements/statements_and_newlines.go +0 -21
  469. package/test/translations/statements/statements_and_newlines.java +0 -21
  470. package/test/translations/statements/statements_and_newlines.py +0 -16
  471. package/test/translations/statements/vararg_any_call.cs +0 -7
  472. package/test/translations/statements/vararg_any_call.go +0 -13
  473. package/test/translations/statements/vararg_any_call.java +0 -6
  474. package/test/translations/statements/vararg_any_call.py +0 -6
  475. package/test/translations/statements/whitespace_between_statements.cs +0 -3
  476. package/test/translations/statements/whitespace_between_statements.go +0 -3
  477. package/test/translations/statements/whitespace_between_statements.java +0 -3
  478. package/test/translations/statements/whitespace_between_statements.py +0 -3
  479. package/test/translations/statements/whitespace_between_statements_in_a_block.cs +0 -6
  480. package/test/translations/statements/whitespace_between_statements_in_a_block.go +0 -5
  481. package/test/translations/statements/whitespace_between_statements_in_a_block.java +0 -5
  482. package/test/translations/statements/whitespace_between_statements_in_a_block.py +0 -4
  483. package/test/translations/structs/any_type_never_a_struct.cs +0 -3
  484. package/test/translations/structs/any_type_never_a_struct.go +0 -3
  485. package/test/translations/structs/any_type_never_a_struct.java +0 -2
  486. package/test/translations/structs/any_type_never_a_struct.py +0 -3
  487. package/test/translations/structs/infer_struct_from_union.cs +0 -6
  488. package/test/translations/structs/infer_struct_from_union.go +0 -8
  489. package/test/translations/structs/infer_struct_from_union.java +0 -6
  490. package/test/translations/structs/infer_struct_from_union.py +0 -6
  491. package/test/translations/structs/optional_known_struct.cs +0 -3
  492. package/test/translations/structs/optional_known_struct.go +0 -3
  493. package/test/translations/structs/optional_known_struct.java +0 -3
  494. package/test/translations/structs/optional_known_struct.py +0 -3
  495. package/test/translations/structs/struct_starting_with_i.cs +0 -3
  496. package/test/translations/structs/struct_starting_with_i.go +0 -3
  497. package/test/translations/structs/struct_starting_with_i.java +0 -3
  498. package/test/translations/structs/struct_starting_with_i.py +0 -3
  499. package/test/translations/structs/var_new_class_known_struct.cs +0 -3
  500. package/test/translations/structs/var_new_class_known_struct.go +0 -3
  501. package/test/translations/structs/var_new_class_known_struct.java +0 -3
  502. package/test/translations/structs/var_new_class_known_struct.py +0 -3
  503. package/test/translations/structs/var_new_class_unknown_struct.cs +0 -3
  504. package/test/translations/structs/var_new_class_unknown_struct.go +0 -3
  505. package/test/translations/structs/var_new_class_unknown_struct.java +0 -3
  506. package/test/translations/structs/var_new_class_unknown_struct.py +0 -3
  507. package/test/translations.test.d.ts +0 -9
  508. package/test/translations.test.js +0 -112
  509. package/test/util.test.d.ts +0 -2
  510. package/test/util.test.js +0 -25
  511. package/vendor/semver-intersect.d.ts +0 -13
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visible-spans.js","sourceRoot":"","sources":["../../src/typescript/visible-spans.ts"],"names":[],"mappings":";;;AAIA;;GAEG;AACH,MAAa,KAAK;IAChB;;OAEG;IACI,MAAM,CAAC,sBAAsB,CAAC,MAAc;QACjD,OAAO,IAAI,KAAK,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,YAAoC,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAChD,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QAEzC,uBAAuB;QACvB,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YACjC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAEhC,IAAI,OAAO,CAAC,GAAG,KAAK,IAAI,CAAC,KAAK,EAAE;gBAC9B,2CAA2C;gBAC3C,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE;oBACvB,KAAK,EAAE,OAAO,CAAC,KAAK;oBACpB,GAAG,EAAE,IAAI,CAAC,GAA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AAE,CAAC,CAAC;aAC9D;YACD,OAAO,GAAG,MAAM,CAAC;YAEjB,yCAAyC;YACzC,SAAS,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;SAC/C;KACF;IAED,8CAA8C;IAC9C,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAEjE,gCAAgC;IAChC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,CAAO,EAAE,CAAO;IACzC,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC;AAC9C,CAAC;AAFD,gCAEC;AAED,SAAgB,YAAY,CAAC,CAAO,EAAE,QAAgB;IACpD,OAAO,CAAC,CAAC,KAAK,IAAI,QAAQ,IAAI,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC;AACjD,CAAC;AAFD,oCAEC","sourcesContent":["import * as ts from 'typescript';\n\nimport { Span } from '../o-tree';\n\n/**\n * A class representing a set of non-overlapping Spans.\n */\nexport class Spans {\n /**\n * Derive visible spans from marked source (`/// !show` and `/// !hide` directives).\n */\n public static visibleSpansFromSource(source: string) {\n return new Spans(calculateMarkedSpans(source).filter((s) => s.visible));\n }\n\n public constructor(private readonly _spans: Span[]) {\n _spans.sort((a, b) => a.start - b.start);\n\n // Merge adjacent spans\n let i = 0;\n while (i < this._spans.length - 1) {\n const current = this._spans[i];\n const next = this._spans[i + 1];\n\n if (current.end === next.start) {\n // Replace these two with a new, merged one\n this._spans.splice(i, 2, {\n start: current.start,\n end: next.end,\n });\n } else {\n // Else advance\n i++;\n }\n }\n }\n\n public get spans(): readonly Span[] {\n return this._spans;\n }\n\n /**\n * Whether another span is fully contained within this set of spans\n */\n public fullyContainsSpan(span: Span) {\n const candidate = this.findSpan(span.start);\n return !!candidate && spanInside(span, candidate);\n }\n\n public containsPosition(pos: number) {\n const candidate = this.findSpan(pos);\n return !!candidate && spanContains(candidate, pos);\n }\n\n /**\n * Return whether the START of the given node is visible\n *\n * For nodes that potentially span many lines (like class declarations)\n * this will check the first line.\n */\n public containsStartOfNode(node: ts.Node) {\n return this.containsPosition(node.getStart());\n }\n\n /**\n * Find the span that would contain the given position, if any\n *\n * Returns the highest span s.t. span.start <= position. Uses the fact that\n * spans are non-overlapping.\n */\n private findSpan(position: number): Span | undefined {\n // For now, using linear search as the amount of spans is rather trivial.\n // Change to binary search if this ever becomes an issue\n if (this.spans.length === 0 || position < this._spans[0].start) {\n return undefined;\n }\n\n let candidate = this._spans[0];\n let i = 1;\n while (i < this.spans.length && this.spans[i].start <= position) {\n candidate = this._spans[i];\n i++;\n }\n return candidate;\n }\n}\n\nexport function trimCompleteSourceToVisible(source: string): string {\n const spans = Spans.visibleSpansFromSource(source);\n\n return spans.spans\n .map((span) => source.substring(span.start, span.end))\n .join('')\n .trimRight();\n}\n\nexport interface MarkedSpan {\n start: number;\n end: number;\n visible: boolean;\n}\n\nfunction calculateMarkedSpans(source: string): MarkedSpan[] {\n const regEx = /^[ \\t]*[/]{3}[ \\t]*(!(?:show|hide))[ \\t]*$/gm;\n\n const ret = new Array<MarkedSpan>();\n let match;\n let spanStart;\n let visible = true;\n while ((match = regEx.exec(source)) != null) {\n const directiveStart = match.index;\n const directive = match[1].trim();\n if (['!hide', '!show'].includes(directive)) {\n const isShow = directive === '!show';\n if (spanStart === undefined) {\n // Add a span at the start which is the reverse of the actual first directive\n ret.push({ start: 0, end: directiveStart, visible: !isShow });\n } else {\n // Else add a span for the current directive\n ret.push({ start: spanStart, end: directiveStart, visible });\n }\n visible = isShow;\n\n // A directive eats its trailing newline.\n spanStart = match.index + match[0].length + 1;\n }\n }\n\n // Add the remainder under the last visibility\n ret.push({ start: spanStart ?? 0, end: source.length, visible });\n\n // Filter empty spans and return\n return ret.filter((s) => s.start < s.end);\n}\n\n/**\n * Whether span a is fully inside span b\n */\nexport function spanInside(a: Span, b: Span) {\n return b.start <= a.start && a.end <= b.end;\n}\n\nexport function spanContains(a: Span, position: number) {\n return a.start <= position && position < a.end;\n}\n"]}
package/lib/util.d.ts CHANGED
@@ -74,7 +74,7 @@ export declare function sortBy<A>(xs: A[], keyFn: (x: A) => Array<string | numbe
74
74
  export declare function groupBy<A>(xs: A[], keyFn: (x: A) => string): Record<string, A[]>;
75
75
  export declare function isDefined<A>(x: A): x is NonNullable<A>;
76
76
  export declare function indexBy<A>(xs: A[], fn: (x: A) => string): Record<string, A>;
77
- export declare type Mutable<T> = {
77
+ export type Mutable<T> = {
78
78
  -readonly [P in keyof T]: Mutable<T[P]>;
79
79
  };
80
80
  export declare function commentToken(language: string): "#" | "//";
package/lib/util.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.pathExists = exports.commentToken = exports.indexBy = exports.isDefined = exports.groupBy = exports.sortBy = exports.mapValues = exports.fmap = exports.mkDict = exports.setExtend = exports.partition = exports.flat = exports.divideEvenly = exports.hasStrictBranding = exports.annotateStrictDiagnostic = exports.StrictBrand = exports.formatList = exports.printDiagnostics = exports.startsWithUppercase = void 0;
4
- const fs_1 = require("fs");
4
+ const node_fs_1 = require("node:fs");
5
5
  function startsWithUppercase(x) {
6
6
  return /^[A-Z]/.exec(x) != null;
7
7
  }
@@ -184,7 +184,7 @@ function commentToken(language) {
184
184
  exports.commentToken = commentToken;
185
185
  async function pathExists(path) {
186
186
  try {
187
- await fs_1.promises.stat(path);
187
+ await node_fs_1.promises.stat(path);
188
188
  return true;
189
189
  }
190
190
  catch (err) {
@@ -0,0 +1 @@
1
+ {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B,CAAC;AAFD,8BAEC;AAED,SAAgB,OAAO,CAAI,EAAO,EAAE,EAAoB;IACtD,OAAO,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAU,CAAC,CAAC,CAAC;AACpD,CAAC;AAFD,0BAEC;AAID,SAAgB,YAAY,CAAC,QAAgB;IAC3C,mEAAmE;IACnE,QAAQ,QAAQ,EAAE;QAChB,KAAK,QAAQ,CAAC;QACd,KAAK,MAAM;YACT,OAAO,GAAG,CAAC;QACb,KAAK,QAAQ,CAAC;QACd,KAAK,MAAM,CAAC;QACZ,KAAK,IAAI,CAAC;QACV;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC;AAZD,oCAYC;AAEM,KAAK,UAAU,UAAU,CAAC,IAAY;IAC3C,IAAI;QACF,MAAM,kBAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpB,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,GAAQ,EAAE;QACjB,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;YACzB,OAAO,KAAK,CAAC;SACd;QACD,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE;YACd,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;SAC9B;QACD,MAAM,GAAG,CAAC;KACX;AACH,CAAC;AAbD,gCAaC","sourcesContent":["import { promises as fs } from 'node:fs';\nimport * as ts from 'typescript';\n\nimport { RosettaDiagnostic } from './translate';\n\nexport function startsWithUppercase(x: string): boolean {\n return /^[A-Z]/.exec(x) != null;\n}\n\nexport interface File {\n readonly contents: string;\n readonly fileName: string;\n}\n\nexport function printDiagnostics(diags: readonly RosettaDiagnostic[], stream: NodeJS.WritableStream) {\n // Don't print too much, at some point it just clogs up the log\n const maxDiags = 50;\n\n for (const diag of diags.slice(0, maxDiags)) {\n stream.write(diag.formattedMessage);\n }\n\n if (diags.length > maxDiags) {\n stream.write(`(...and ${diags.length - maxDiags} more diagnostics not shown)`);\n }\n}\n\nexport function formatList(xs: string[], n = 5) {\n const tooMany = xs.length - n;\n\n return tooMany > 0 ? `${xs.slice(0, n).join(', ')} (and ${tooMany} more)` : xs.join(', ');\n}\n\nexport const StrictBrand = 'jsii.strict';\ninterface MaybeStrictDiagnostic {\n readonly [StrictBrand]?: boolean;\n}\n\n/**\n * Annotate a diagnostic with a magic property to indicate it's a strict diagnostic\n */\nexport function annotateStrictDiagnostic(diag: ts.Diagnostic) {\n Object.defineProperty(diag, StrictBrand, {\n configurable: false,\n enumerable: true,\n value: true,\n writable: false,\n });\n}\n\n/**\n * Return whether or not the given diagnostic was annotated with the magic strict property\n */\nexport function hasStrictBranding(diag: ts.Diagnostic) {\n return !!(diag as MaybeStrictDiagnostic)[StrictBrand];\n}\n\n/**\n * Chunk an array of elements into approximately equal groups\n */\nexport function divideEvenly<A>(groups: number, xs: A[]): A[][] {\n const chunkSize = Math.ceil(xs.length / groups);\n const ret: A[][] = [];\n\n for (let i = 0; i < groups; i++) {\n ret.push(xs.slice(i * chunkSize, (i + 1) * chunkSize));\n }\n\n return ret;\n}\n\nexport function flat<A>(xs: A[][]): A[] {\n return Array.prototype.concat.apply([], xs);\n}\n\n/**\n * Partition a list in twain using a predicate\n *\n * Returns [elements-matching-predicate, elements-not-matching-predicate];\n */\nexport function partition<A>(xs: A[], pred: (x: A) => boolean): [A[], A[]] {\n const truthy = new Array<A>();\n const falsy = new Array<A>();\n\n for (const x of xs) {\n if (pred(x)) {\n truthy.push(x);\n } else {\n falsy.push(x);\n }\n }\n\n return [truthy, falsy];\n}\n\nexport function setExtend<A>(xs: Set<A>, els: Iterable<A>) {\n for (const el of els) {\n xs.add(el);\n }\n}\n\nexport function mkDict<A extends string, B>(xs: Array<readonly [A, B]>): Record<A, B> {\n const ret: any = {};\n for (const [key, value] of xs) {\n ret[key] = value;\n }\n return ret;\n}\n\n/**\n * Apply a function to a value, as long as it's not `undefined`\n *\n * This is a companion helper to TypeScript's nice `??` and `?.` nullish\n * operators. Those operators are helpful if you're calling methods:\n *\n * object?.method() <- returns 'undefined' if 'object' is nullish\n *\n * But are no help when you want to use free functions:\n *\n * func(object) <- but what if 'object' is nullish and func\n * expects it not to be?\n *\n * Yes you can write `object ? func(object) : undefined` but the trailing\n * `: undefined` clutters your code. Instead, you write:\n *\n * fmap(object, func)\n *\n * The name `fmap` is taken from Haskell: it's a \"Functor-map\" (although\n * only for the `Maybe` Functor).\n */\nexport function fmap<A, B>(value: NonNullable<A>, fn: (x: NonNullable<A>) => B): B;\nexport function fmap<A, B>(value: undefined | null, fn: (x: NonNullable<A>) => B): undefined;\nexport function fmap<A, B>(value: A | undefined | null, fn: (x: A) => B): B | undefined;\nexport function fmap<A, B>(value: A, fn: (x: A) => B): B | undefined {\n if (value == null) {\n return undefined;\n }\n return fn(value);\n}\n\nexport function mapValues<A, B>(xs: Record<string, A>, fn: (x: A) => B): Record<string, B> {\n const ret: Record<string, B> = {};\n for (const [key, value] of Object.entries(xs)) {\n ret[key] = fn(value);\n }\n return ret;\n}\n\n/**\n * Sort an array by a key function.\n *\n * Instead of having to write your own comparators for your types any time you\n * want to sort, you supply a function that maps a value to a compound sort key\n * consisting of numbers or strings. The sorting will happen by that sort key\n * instead.\n */\nexport function sortBy<A>(xs: A[], keyFn: (x: A) => Array<string | number>) {\n return xs.sort((a, b) => {\n const aKey = keyFn(a);\n const bKey = keyFn(b);\n\n for (let i = 0; i < Math.min(aKey.length, bKey.length); i++) {\n // Compare aKey[i] to bKey[i]\n const av = aKey[i];\n const bv = bKey[i];\n\n if (av === bv) {\n continue;\n }\n\n if (typeof av !== typeof bv) {\n throw new Error(`Type of sort key ${JSON.stringify(aKey)} not same as ${JSON.stringify(bKey)}`);\n }\n\n if (typeof av === 'number' && typeof bv === 'number') {\n return av - bv;\n }\n\n if (typeof av === 'string' && typeof bv === 'string') {\n return av.localeCompare(bv);\n }\n }\n\n return aKey.length - bKey.length;\n });\n}\n\n/**\n * Group elements by a key\n *\n * Supply a function that maps each element to a key string.\n *\n * Returns a map of the key to the list of elements that map to that key.\n */\nexport function groupBy<A>(xs: A[], keyFn: (x: A) => string): Record<string, A[]> {\n const ret: Record<string, A[]> = {};\n for (const x of xs) {\n const key = keyFn(x);\n if (ret[key]) {\n ret[key].push(x);\n } else {\n ret[key] = [x];\n }\n }\n return ret;\n}\n\nexport function isDefined<A>(x: A): x is NonNullable<A> {\n return x !== undefined;\n}\n\nexport function indexBy<A>(xs: A[], fn: (x: A) => string): Record<string, A> {\n return mkDict(xs.map((x) => [fn(x), x] as const));\n}\n\nexport type Mutable<T> = { -readonly [P in keyof T]: Mutable<T[P]> };\n\nexport function commentToken(language: string) {\n // This is future-proofed a bit, but don't read too much in this...\n switch (language) {\n case 'python':\n case 'ruby':\n return '#';\n case 'csharp':\n case 'java':\n case 'go':\n default:\n return '//';\n }\n}\n\nexport async function pathExists(path: string): Promise<boolean> {\n try {\n await fs.stat(path);\n return true;\n } catch (err: any) {\n if (err.code === 'ENOENT') {\n return false;\n }\n if (!err.stack) {\n Error.captureStackTrace(err);\n }\n throw err;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,56 +1,87 @@
1
1
  {
2
2
  "name": "jsii-rosetta",
3
- "version": "1.75.0",
4
- "description": "Translate TypeScript code snippets to other languages",
5
- "main": "lib/index.js",
3
+ "repository": {
4
+ "type": "git",
5
+ "url": "https://github.com/aws/jsii-rosetta.git"
6
+ },
6
7
  "bin": {
7
8
  "jsii-rosetta": "bin/jsii-rosetta"
8
9
  },
9
10
  "scripts": {
10
- "build": "yarn tsc --build && npm run lint",
11
- "watch": "yarn tsc --build -w",
12
- "lint": "eslint . --ext .js,.ts --ignore-path=.gitignore --ignore-pattern=examples/* --ignore-pattern=test/translations/*",
13
- "lint:fix": "yarn lint --fix",
14
- "test": "jest",
15
- "test:update": "jest -u",
16
- "package": "package-js"
11
+ "build": "npx projen build",
12
+ "clobber": "npx projen clobber",
13
+ "compile": "npx projen compile",
14
+ "default": "npx projen default",
15
+ "eject": "npx projen eject",
16
+ "eslint": "npx projen eslint",
17
+ "package": "npx projen package",
18
+ "post-compile": "npx projen post-compile",
19
+ "post-upgrade": "npx projen post-upgrade",
20
+ "pre-compile": "npx projen pre-compile",
21
+ "release": "npx projen release",
22
+ "tag-release": "npx projen tag-release",
23
+ "test": "npx projen test",
24
+ "test:watch": "npx projen test:watch",
25
+ "upgrade": "npx projen upgrade",
26
+ "watch": "npx projen watch",
27
+ "projen": "npx projen"
28
+ },
29
+ "author": {
30
+ "name": "Amazon Web Services",
31
+ "url": "https://aws.amazon.com",
32
+ "organization": false
17
33
  },
18
34
  "devDependencies": {
35
+ "@actions/core": "^1.10.0",
36
+ "@actions/github": "^5.1.1",
19
37
  "@types/commonmark": "^0.27.5",
38
+ "@types/jest": "^29.4.0",
20
39
  "@types/mock-fs": "^4.13.1",
40
+ "@types/node": "^14",
41
+ "@types/tar": "^6.1.4",
21
42
  "@types/workerpool": "^6.1.1",
22
- "@types/semver": "^7.3.13",
23
- "jsii-build-tools": "1.75.0",
24
- "jsii-calc": "3.20.120",
25
- "memory-streams": "^0.1.3",
26
- "mock-fs": "^5.2.0"
43
+ "@typescript-eslint/eslint-plugin": "^5",
44
+ "@typescript-eslint/parser": "^5",
45
+ "eslint": "^8",
46
+ "eslint-config-prettier": "^8.6.0",
47
+ "eslint-import-resolver-node": "^0.3.7",
48
+ "eslint-import-resolver-typescript": "^3.5.3",
49
+ "eslint-plugin-import": "^2.27.5",
50
+ "eslint-plugin-prettier": "^4.2.1",
51
+ "eslint-plugin-unicorn": "^45.0.2",
52
+ "jest": "^29.4.3",
53
+ "mock-fs": "^5.2.0",
54
+ "npm-check-updates": "^16",
55
+ "prettier": "^2.8.4",
56
+ "projen": "^0.67.66",
57
+ "tar": "^6.1.13",
58
+ "ts-jest": "^29.0.5",
59
+ "ts-node": "^10.9.1"
27
60
  },
28
61
  "dependencies": {
29
- "@jsii/check-node": "1.75.0",
30
- "@jsii/spec": "1.75.0",
31
- "commonmark": "^0.30.0",
32
- "typescript": "~3.9.10",
62
+ "@jsii/check-node": "^1.76.0",
63
+ "@jsii/spec": "^1.76.0",
33
64
  "@xmldom/xmldom": "^0.8.6",
34
- "workerpool": "^6.3.1",
35
- "yargs": "^16.2.0",
65
+ "commonmark": "*",
66
+ "fast-glob": "^3.2.12",
67
+ "jsii": "v4.9-next",
36
68
  "semver": "^7.3.8",
37
69
  "semver-intersect": "^1.4.0",
38
- "fast-glob": "^3.2.12",
39
- "jsii": "1.75.0"
70
+ "typescript": "~4.9.5",
71
+ "workerpool": "^6.4.0",
72
+ "yargs": "^17.7.1"
40
73
  },
41
- "license": "Apache-2.0",
42
- "author": {
43
- "name": "Amazon Web Services",
44
- "url": "https://aws.amazon.com",
45
- "organization": true
74
+ "engines": {
75
+ "node": ">= 14.18.0"
46
76
  },
47
- "homepage": "https://github.com/aws/jsii",
48
- "repository": {
49
- "type": "git",
50
- "url": "https://github.com/aws/jsii.git",
51
- "directory": "packages/jsii-rosetta"
77
+ "main": "lib/index.js",
78
+ "license": "Apache-2.0",
79
+ "homepage": "https://aws.github.io/jsii",
80
+ "version": "4.9.0-dev.0",
81
+ "types": "lib/index.d.ts",
82
+ "exports": {
83
+ ".": "./lib/index.js",
84
+ "./package.json": "./package.json"
52
85
  },
53
- "engines": {
54
- "node": ">= 14.6.0"
55
- }
56
- }
86
+ "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"."
87
+ }
package/temp.tabl.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "version": "2",
3
+ "toolVersion": "4.9.0-dev.0",
4
+ "snippets": {
5
+ "d54054dded92a8c59670816ed22b893ca888d5e2cab871b833af1723039662c9": {
6
+ "translations": {
7
+ "python": {
8
+ "source": "print(\"hello world\")",
9
+ "version": "2"
10
+ },
11
+ "csharp": {
12
+ "source": "Console.WriteLine(\"hello world\");",
13
+ "version": "1"
14
+ },
15
+ "java": {
16
+ "source": "System.out.println(\"hello world\");",
17
+ "version": "1"
18
+ },
19
+ "go": {
20
+ "source": "fmt.Println(\"hello world\")",
21
+ "version": "1"
22
+ },
23
+ "$": {
24
+ "source": "console.log(\"hello world\");",
25
+ "version": "0"
26
+ }
27
+ },
28
+ "location": {
29
+ "api": {
30
+ "api": "file",
31
+ "fileName": "test.ts"
32
+ }
33
+ },
34
+ "didCompile": false,
35
+ "fqnsReferenced": [],
36
+ "fullSource": "console.log(\"hello world\");",
37
+ "syntaxKindCounter": {
38
+ "10": 1,
39
+ "79": 2,
40
+ "208": 1,
41
+ "210": 1,
42
+ "241": 1,
43
+ "308": 1
44
+ },
45
+ "fqnsFingerprint": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
46
+ }
47
+ }
48
+ }
@@ -1,2 +0,0 @@
1
- import '@jsii/check-node/run';
2
- //# sourceMappingURL=jsii-rosetta.d.ts.map
package/jest.config.mjs DELETED
@@ -1,8 +0,0 @@
1
- import { createRequire } from 'node:module';
2
- import { default as defaultConfig, overriddenConfig } from '../../jest.config.mjs';
3
-
4
- export default overriddenConfig({
5
- setupFiles: [createRequire(import.meta.url).resolve('./jestsetup.js')],
6
- testTimeout: process.env.CI === 'true' ? 30_000 : defaultConfig.testTimeout,
7
- watchPathIgnorePatterns: ['(\\.d)?\\.tsx?$'],
8
- });
package/jestsetup.js DELETED
@@ -1,4 +0,0 @@
1
- // Require `mock-fs` before `jest` initializes, as `mock-fs` relies on
2
- // hijacking the `fs` module, which `jest` also hijacks (and that needs to
3
- // happen last).
4
- require('mock-fs');
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=extract.test.d.ts.map