jsii-rosetta 5.8.22-dev.12 β†’ 5.8.22-dev.14

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.
package/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # ![jsii](https://raw.githubusercontent.com/aws/jsii/main/logo/png/128.png)
2
2
 
3
3
  [![Join the chat at https://cdk.Dev](https://img.shields.io/static/v1?label=Slack&message=cdk.dev&color=brightgreen&logo=slack)](https://cdk.dev)
4
- [![All Contributors](https://img.shields.io/github/all-contributors/aws/jsii/main?label=%E2%9C%A8%20All%20Contributors)](#contributors-)
5
4
  [![Build Status](https://github.com/aws/jsii-rosetta/workflows/build/badge.svg)](https://github.com/aws/jsii-rosetta/actions?query=workflow%3Abuild+branch%3Amain)
6
5
  [![npm](https://img.shields.io/npm/v/jsii-rosetta?logo=npm)](https://www.npmjs.com/package/jsii-rosetta)
7
6
 
@@ -302,6 +301,31 @@ jsii-rosetta extract \
302
301
  $(find . -name .jsii)
303
302
  ```
304
303
 
304
+ ## Debugging
305
+
306
+ ### Type Fingerprints
307
+
308
+ To debug type fingerprinting issues, set the `DEBUG_TYPE_FINGERPRINTS` environment variable to a file path.
309
+ This writes all computed type fingerprints to the specified file in alphabetically sorted format:
310
+
311
+ ```sh
312
+ DEBUG_TYPE_FINGERPRINTS=type-fingerprints.txt jsii-rosetta extract $(find . -name .jsii)
313
+ ```
314
+
315
+ The output file contains one line per type in the format `<fqn>: <hash>`, making it easy to compare
316
+ fingerprints across different runs using standard diff tools.
317
+
318
+ ### Translation Timing
319
+
320
+ To display timing information for snippet translations, set the `TIMING=1` environment variable:
321
+
322
+ ```sh
323
+ TIMING=1 jsii-rosetta extract $(find . -name .jsii)
324
+ ```
325
+
326
+ This outputs a table showing compilation time for each snippet, helping identify performance bottlenecks.
327
+ Note that timing is not supported when using batch compilation mode.
328
+
305
329
  ### Translations and pacmak
306
330
 
307
331
  `jsii-pacmak` will read translation from tablets to substitute translated examples
@@ -445,236 +469,6 @@ notShown();
445
469
  after();
446
470
  ```
447
471
 
448
- ## Contributors ✨
449
-
450
- Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
451
-
452
- <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
453
- <!-- prettier-ignore-start -->
454
- <!-- markdownlint-disable -->
455
- <table>
456
- <tbody>
457
- <tr>
458
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/costleya"><img src="https://avatars2.githubusercontent.com/u/1572163?v=4?s=100" width="100px;" alt="Aaron Costley"/><br /><sub><b>Aaron Costley</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Acostleya+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=costleya" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Acostleya+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Acostleya" title="Reviewed Pull Requests">πŸ‘€</a></td>
459
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/ahodieb"><img src="https://avatars1.githubusercontent.com/u/835502?v=4?s=100" width="100px;" alt="Abdallah Hodieb"/><br /><sub><b>Abdallah Hodieb</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aahodieb+label%3Abug" title="Bug reports">πŸ›</a></td>
460
- <td align="center" valign="top" width="14.28%"><a href="http://endoflineblog.com/"><img src="https://avatars2.githubusercontent.com/u/460937?v=4?s=100" width="100px;" alt="Adam Ruka"/><br /><sub><b>Adam Ruka</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Askinny85+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=skinny85" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Askinny85" title="Maintenance">🚧</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Askinny85" title="Reviewed Pull Requests">πŸ‘€</a></td>
461
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/agdimech"><img src="https://avatars.githubusercontent.com/u/51220968?v=4?s=100" width="100px;" alt="Adrian Dimech"/><br /><sub><b>Adrian Dimech</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=agdimech" title="Code">πŸ’»</a></td>
462
- <td align="center" valign="top" width="14.28%"><a href="http://adrianhesketh.com/"><img src="https://avatars.githubusercontent.com/u/1029947?v=4?s=100" width="100px;" alt="Adrian Hesketh"/><br /><sub><b>Adrian Hesketh</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=a-h" title="Code">πŸ’»</a></td>
463
- <td align="center" valign="top" width="14.28%"><a href="https://softwhat.com/"><img src="https://avatars0.githubusercontent.com/u/4362270?v=4?s=100" width="100px;" alt="Alex Pulver"/><br /><sub><b>Alex Pulver</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aalexpulver+label%3Abug" title="Bug reports">πŸ›</a></td>
464
- <td align="center" valign="top" width="14.28%"><a href="https://aws.amazon.com/"><img src="https://avatars.githubusercontent.com/u/54958958?v=4?s=100" width="100px;" alt="Amazon GitHub Automation"/><br /><sub><b>Amazon GitHub Automation</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=amazon-auto" title="Code">πŸ’»</a></td>
465
- </tr>
466
- <tr>
467
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/andipabst"><img src="https://avatars.githubusercontent.com/u/9639382?v=4?s=100" width="100px;" alt="Andi Pabst"/><br /><sub><b>Andi Pabst</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aandipabst+label%3Abug" title="Bug reports">πŸ›</a></td>
468
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/rectalogic"><img src="https://avatars.githubusercontent.com/u/11581?v=4?s=100" width="100px;" alt="Andrew Wason"/><br /><sub><b>Andrew Wason</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Arectalogic+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=rectalogic" title="Code">πŸ’»</a></td>
469
- <td align="center" valign="top" width="14.28%"><a href="https://www.aslezak.com/"><img src="https://avatars2.githubusercontent.com/u/6944605?v=4?s=100" width="100px;" alt="Andy Slezak"/><br /><sub><b>Andy Slezak</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=amslezak" title="Code">πŸ’»</a></td>
470
- <td align="center" valign="top" width="14.28%"><a href="https://ansgar.dev"><img src="https://avatars.githubusercontent.com/u/1112056?v=4?s=100" width="100px;" alt="Ansgar Mertens"/><br /><sub><b>Ansgar Mertens</b></sub></a><br /><a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Aansgarm" title="Maintenance">🚧</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=ansgarm" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Aansgarm+label%3Abug" title="Bug reports">πŸ›</a></td>
471
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/anshulguleria"><img src="https://avatars3.githubusercontent.com/u/993508?v=4?s=100" width="100px;" alt="Anshul Guleria"/><br /><sub><b>Anshul Guleria</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aanshulguleria+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
472
- <td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/aripalo/"><img src="https://avatars0.githubusercontent.com/u/679146?v=4?s=100" width="100px;" alt="Ari Palo"/><br /><sub><b>Ari Palo</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aaripalo+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
473
- <td align="center" valign="top" width="14.28%"><a href="https://armaan.tobaccowalla.com"><img src="https://avatars.githubusercontent.com/u/13340433?v=4?s=100" width="100px;" alt="Armaan Tobaccowalla"/><br /><sub><b>Armaan Tobaccowalla</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3AArmaanT+label%3Abug" title="Bug reports">πŸ›</a></td>
474
- </tr>
475
- <tr>
476
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/BiDzej"><img src="https://avatars1.githubusercontent.com/u/26255490?v=4?s=100" width="100px;" alt="BartΕ‚omiej Jurek"/><br /><sub><b>BartΕ‚omiej Jurek</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3ABiDzej+label%3Abug" title="Bug reports">πŸ›</a></td>
477
- <td align="center" valign="top" width="14.28%"><a href="http://twiiter.com/benbridts"><img src="https://avatars0.githubusercontent.com/u/1301221?v=4?s=100" width="100px;" alt="Ben Bridts"/><br /><sub><b>Ben Bridts</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=benbridts" title="Documentation">πŸ“–</a></td>
478
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/BenChaimberg"><img src="https://avatars.githubusercontent.com/u/3698184?v=4?s=100" width="100px;" alt="Ben Chaimberg"/><br /><sub><b>Ben Chaimberg</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=BenChaimberg" title="Documentation">πŸ“–</a></td>
479
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/benfarr"><img src="https://avatars0.githubusercontent.com/u/10361379?v=4?s=100" width="100px;" alt="Ben Farr"/><br /><sub><b>Ben Farr</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=benfarr" title="Documentation">πŸ“–</a></td>
480
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/BenWal"><img src="https://avatars0.githubusercontent.com/u/2656067?v=4?s=100" width="100px;" alt="Ben Walters"/><br /><sub><b>Ben Walters</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3ABenWal+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
481
- <td align="center" valign="top" width="14.28%"><a href="http://macher.dev"><img src="https://avatars0.githubusercontent.com/u/32685580?v=4?s=100" width="100px;" alt="Benjamin Macher"/><br /><sub><b>Benjamin Macher</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=bmacher" title="Documentation">πŸ“–</a></td>
482
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/bmaizels"><img src="https://avatars1.githubusercontent.com/u/36682168?v=4?s=100" width="100px;" alt="Benjamin Maizels"/><br /><sub><b>Benjamin Maizels</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=bmaizels" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Abmaizels" title="Reviewed Pull Requests">πŸ‘€</a></td>
483
- </tr>
484
- <tr>
485
- <td align="center" valign="top" width="14.28%"><a href="https://berviantoleo.my.id/"><img src="https://avatars.githubusercontent.com/u/15927349?v=4?s=100" width="100px;" alt="Bervianto Leo Pratama"/><br /><sub><b>Bervianto Leo Pratama</b></sub></a><br /><a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Aberviantoleo" title="Maintenance">🚧</a></td>
486
- <td align="center" valign="top" width="14.28%"><a href="http://wcauchois.github.io/"><img src="https://avatars1.githubusercontent.com/u/300544?v=4?s=100" width="100px;" alt="Bill Cauchois"/><br /><sub><b>Bill Cauchois</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Awcauchois+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
487
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/bverhoeve"><img src="https://avatars1.githubusercontent.com/u/46007524?v=4?s=100" width="100px;" alt="Brecht Verhoeve"/><br /><sub><b>Brecht Verhoeve</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Abverhoeve+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
488
- <td align="center" valign="top" width="14.28%"><a href="http://bdawg.org/"><img src="https://avatars1.githubusercontent.com/u/92937?v=4?s=100" width="100px;" alt="Breland Miley"/><br /><sub><b>Breland Miley</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=mindstorms6" title="Code">πŸ’»</a></td>
489
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/CaerusKaru"><img src="https://avatars3.githubusercontent.com/u/416563?v=4?s=100" width="100px;" alt="CaerusKaru"/><br /><sub><b>CaerusKaru</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=CaerusKaru" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3ACaerusKaru" title="Maintenance">🚧</a></td>
490
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/comcalvi"><img src="https://avatars.githubusercontent.com/u/66279577?v=4?s=100" width="100px;" alt="Calvin Combs"/><br /><sub><b>Calvin Combs</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=comcalvi" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Acomcalvi" title="Reviewed Pull Requests">πŸ‘€</a></td>
491
- <td align="center" valign="top" width="14.28%"><a href="https://camilobermudez85.github.io/"><img src="https://avatars0.githubusercontent.com/u/7834055?v=4?s=100" width="100px;" alt="Camilo BermΓΊdez"/><br /><sub><b>Camilo BermΓΊdez</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Acamilobermudez85+label%3Abug" title="Bug reports">πŸ›</a></td>
492
- </tr>
493
- <tr>
494
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/campionfellin"><img src="https://avatars3.githubusercontent.com/u/11984923?v=4?s=100" width="100px;" alt="Campion Fellin"/><br /><sub><b>Campion Fellin</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=campionfellin" title="Code">πŸ’»</a></td>
495
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/carterv"><img src="https://avatars2.githubusercontent.com/u/1551538?v=4?s=100" width="100px;" alt="Carter Van Deuren"/><br /><sub><b>Carter Van Deuren</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Acarterv+label%3Abug" title="Bug reports">πŸ›</a></td>
496
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/cgarvis"><img src="https://avatars.githubusercontent.com/u/213125?v=4?s=100" width="100px;" alt="Chris Garvis"/><br /><sub><b>Chris Garvis</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=cgarvis" title="Documentation">πŸ“–</a></td>
497
- <td align="center" valign="top" width="14.28%"><a href="https://christianmoore.me/"><img src="https://avatars.githubusercontent.com/u/36210509?v=4?s=100" width="100px;" alt="Christian Moore"/><br /><sub><b>Christian Moore</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Ashamelesscookie+label%3Abug" title="Bug reports">πŸ›</a></td>
498
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/ChristopheVico"><img src="https://avatars.githubusercontent.com/u/56592817?v=4?s=100" width="100px;" alt="Christophe Vico"/><br /><sub><b>Christophe Vico</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3AChristopheVico+label%3Abug" title="Bug reports">πŸ›</a></td>
499
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/christophercurrie"><img src="https://avatars0.githubusercontent.com/u/19510?v=4?s=100" width="100px;" alt="Christopher Currie"/><br /><sub><b>Christopher Currie</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=christophercurrie" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Achristophercurrie+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
500
- <td align="center" valign="top" width="14.28%"><a href="https://rybicki.io/"><img src="https://avatars2.githubusercontent.com/u/5008987?v=4?s=100" width="100px;" alt="Christopher Rybicki"/><br /><sub><b>Christopher Rybicki</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=Chriscbr" title="Documentation">πŸ“–</a> <a href="https://github.com/aws/jsii/issues?q=author%3AChriscbr+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=Chriscbr" title="Code">πŸ’»</a></td>
501
- </tr>
502
- <tr>
503
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/CommanderRoot"><img src="https://avatars.githubusercontent.com/u/4395417?v=4?s=100" width="100px;" alt="CommanderRoot"/><br /><sub><b>CommanderRoot</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=CommanderRoot" title="Code">πŸ’»</a></td>
504
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/corymhall"><img src="https://avatars.githubusercontent.com/u/43035978?v=4?s=100" width="100px;" alt="Cory Hall"/><br /><sub><b>Cory Hall</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Acorymhall+label%3Abug" title="Bug reports">πŸ›</a></td>
505
- <td align="center" valign="top" width="14.28%"><a href="http://mcristi.wordpress.com"><img src="https://avatars.githubusercontent.com/u/95209?v=4?s=100" width="100px;" alt="Cristian MΔƒgheruΘ™an-Stanciu"/><br /><sub><b>Cristian MΔƒgheruΘ™an-Stanciu</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3ACristim+label%3Abug" title="Bug reports">πŸ›</a></td>
506
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/CyrusNajmabadi"><img src="https://avatars3.githubusercontent.com/u/4564579?v=4?s=100" width="100px;" alt="CyrusNajmabadi"/><br /><sub><b>CyrusNajmabadi</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3ACyrusNajmabadi+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii/issues?q=author%3ACyrusNajmabadi+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
507
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/dsilbergleithcu-godaddy"><img src="https://avatars.githubusercontent.com/u/78872820?v=4?s=100" width="100px;" alt="Damian Silbergleith"/><br /><sub><b>Damian Silbergleith</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=dsilbergleithcu-godaddy" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Adsilbergleithcu-godaddy+label%3Abug" title="Bug reports">πŸ›</a></td>
508
- <td align="center" valign="top" width="14.28%"><a href="https://danieldinu.com/"><img src="https://avatars1.githubusercontent.com/u/236187?v=4?s=100" width="100px;" alt="Daniel Dinu"/><br /><sub><b>Daniel Dinu</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Addinu+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=ddinu" title="Code">πŸ’»</a></td>
509
- <td align="center" valign="top" width="14.28%"><a href="http://danielmschmidt.de/"><img src="https://avatars.githubusercontent.com/u/1337046?v=4?s=100" width="100px;" alt="Daniel Schmidt"/><br /><sub><b>Daniel Schmidt</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3ADanielMSchmidt+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=DanielMSchmidt" title="Code">πŸ’»</a></td>
510
- </tr>
511
- <tr>
512
- <td align="center" valign="top" width="14.28%"><a href="https://www.udondan.com/"><img src="https://avatars3.githubusercontent.com/u/6443408?v=4?s=100" width="100px;" alt="Daniel Schroeder"/><br /><sub><b>Daniel Schroeder</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Audondan+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=udondan" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=udondan" title="Documentation">πŸ“–</a> <a href="https://github.com/aws/jsii/issues?q=author%3Audondan+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Audondan" title="Maintenance">🚧</a></td>
513
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/slotnick"><img src="https://avatars3.githubusercontent.com/u/918175?v=4?s=100" width="100px;" alt="Dave Slotnick"/><br /><sub><b>Dave Slotnick</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aslotnick+label%3Abug" title="Bug reports">πŸ›</a></td>
514
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/dastbe"><img src="https://avatars.githubusercontent.com/u/634735?v=4?s=100" width="100px;" alt="David Bell"/><br /><sub><b>David Bell</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=dastbe" title="Code">πŸ’»</a></td>
515
- <td align="center" valign="top" width="14.28%"><a href="https://caremad.io/"><img src="https://avatars3.githubusercontent.com/u/145979?v=4?s=100" width="100px;" alt="Donald Stufft"/><br /><sub><b>Donald Stufft</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Adstufft+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=dstufft" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Adstufft+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Adstufft" title="Reviewed Pull Requests">πŸ‘€</a></td>
516
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/dagnir"><img src="https://avatars2.githubusercontent.com/u/261310?v=4?s=100" width="100px;" alt="Dongie Agnir"/><br /><sub><b>Dongie Agnir</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=dagnir" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Adagnir" title="Reviewed Pull Requests">πŸ‘€</a></td>
517
- <td align="center" valign="top" width="14.28%"><a href="https://eduardorabelo.me/"><img src="https://avatars.githubusercontent.com/u/829902?v=4?s=100" width="100px;" alt="Eduardo Rabelo"/><br /><sub><b>Eduardo Rabelo</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=oieduardorabelo" title="Documentation">πŸ“–</a></td>
518
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/edsenabr"><img src="https://avatars3.githubusercontent.com/u/15689137?v=4?s=100" width="100px;" alt="Eduardo Sena S. Rosa"/><br /><sub><b>Eduardo Sena S. Rosa</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aedsenabr+label%3Abug" title="Bug reports">πŸ›</a></td>
519
- </tr>
520
- <tr>
521
- <td align="center" valign="top" width="14.28%"><a href="http://eladb.github.com/"><img src="https://avatars3.githubusercontent.com/u/598796?v=4?s=100" width="100px;" alt="Elad Ben-Israel"/><br /><sub><b>Elad Ben-Israel</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aeladb+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=eladb" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Aeladb+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Aeladb" title="Maintenance">🚧</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Aeladb" title="Reviewed Pull Requests">πŸ‘€</a> <a href="#talk-eladb" title="Talks">πŸ“’</a></td>
522
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/iliapolo"><img src="https://avatars0.githubusercontent.com/u/1428812?v=4?s=100" width="100px;" alt="Eli Polonsky"/><br /><sub><b>Eli Polonsky</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Ailiapolo+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=iliapolo" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Ailiapolo+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Ailiapolo" title="Maintenance">🚧</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Ailiapolo" title="Reviewed Pull Requests">πŸ‘€</a></td>
523
- <td align="center" valign="top" width="14.28%"><a href="http://ericzbeard.com/"><img src="https://avatars0.githubusercontent.com/u/663183?v=4?s=100" width="100px;" alt="Eric Z. Beard"/><br /><sub><b>Eric Z. Beard</b></sub></a><br /><a href="#projectManagement-ericzbeard" title="Project Management">πŸ“†</a></td>
524
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/McDoit"><img src="https://avatars3.githubusercontent.com/u/16723686?v=4?s=100" width="100px;" alt="Erik Karlsson"/><br /><sub><b>Erik Karlsson</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3AMcDoit+label%3Abug" title="Bug reports">πŸ›</a></td>
525
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/kozlove-aws"><img src="https://avatars1.githubusercontent.com/u/68875428?v=4?s=100" width="100px;" alt="Eugene Kozlov"/><br /><sub><b>Eugene Kozlov</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=kozlove-aws" title="Code">πŸ’»</a></td>
526
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/FabioGentile"><img src="https://avatars2.githubusercontent.com/u/7030345?v=4?s=100" width="100px;" alt="Fabio Gentile"/><br /><sub><b>Fabio Gentile</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3AFabioGentile+label%3Abug" title="Bug reports">πŸ›</a></td>
527
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/workeitel"><img src="https://avatars1.githubusercontent.com/u/7794947?v=4?s=100" width="100px;" alt="Florian Eitel"/><br /><sub><b>Florian Eitel</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aworkeitel+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
528
- </tr>
529
- <tr>
530
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/gshpychka"><img src="https://avatars.githubusercontent.com/u/23005347?v=4?s=100" width="100px;" alt="Glib Shpychka"/><br /><sub><b>Glib Shpychka</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Agshpychka+label%3Abug" title="Bug reports">πŸ›</a></td>
531
- <td align="center" valign="top" width="14.28%"><a href="http://www.grahamlea.com/"><img src="https://avatars0.githubusercontent.com/u/754403?v=4?s=100" width="100px;" alt="Graham Lea"/><br /><sub><b>Graham Lea</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3AGrahamLea+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3AGrahamLea" title="Reviewed Pull Requests">πŸ‘€</a></td>
532
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/greglucas"><img src="https://avatars.githubusercontent.com/u/12417828?v=4?s=100" width="100px;" alt="Greg Lucas"/><br /><sub><b>Greg Lucas</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=greglucas" title="Code">πŸ’»</a></td>
533
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/assyadh"><img src="https://avatars0.githubusercontent.com/u/4091730?v=4?s=100" width="100px;" alt="Hamza Assyad"/><br /><sub><b>Hamza Assyad</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aassyadh+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=assyadh" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Aassyadh+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Aassyadh" title="Reviewed Pull Requests">πŸ‘€</a></td>
534
- <td align="center" valign="top" width="14.28%"><a href="https://harimenon.com/"><img src="https://avatars2.githubusercontent.com/u/171072?v=4?s=100" width="100px;" alt="Hari Pachuveetil"/><br /><sub><b>Hari Pachuveetil</b></sub></a><br /><a href="#blog-floydpink" title="Blogposts">πŸ“</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=floydpink" title="Documentation">πŸ“–</a></td>
535
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/SoManyHs"><img src="https://avatars0.githubusercontent.com/u/29964746?v=4?s=100" width="100px;" alt="Hsing-Hui Hsu"/><br /><sub><b>Hsing-Hui Hsu</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=SoManyHs" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=SoManyHs" title="Documentation">πŸ“–</a> <a href="https://github.com/aws/jsii/issues?q=author%3ASoManyHs+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3ASoManyHs" title="Reviewed Pull Requests">πŸ‘€</a></td>
536
- <td align="center" valign="top" width="14.28%"><a href="https://bandism.net/"><img src="https://avatars.githubusercontent.com/u/22633385?v=4?s=100" width="100px;" alt="Ikko Ashimine"/><br /><sub><b>Ikko Ashimine</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=eltociear" title="Documentation">πŸ“–</a></td>
537
- </tr>
538
- <tr>
539
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/Nycto"><img src="https://avatars.githubusercontent.com/u/30517?v=4?s=100" width="100px;" alt="James"/><br /><sub><b>James</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3ANycto+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=Nycto" title="Code">πŸ’»</a></td>
540
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/JKCT"><img src="https://avatars.githubusercontent.com/u/24870481?v=4?s=100" width="100px;" alt="James Kelley"/><br /><sub><b>James Kelley</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3AJKCT+label%3Abug" title="Bug reports">πŸ›</a></td>
541
- <td align="center" valign="top" width="14.28%"><a href="https://jamesmead.org/"><img src="https://avatars2.githubusercontent.com/u/3169?v=4?s=100" width="100px;" alt="James Mead"/><br /><sub><b>James Mead</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=floehopper" title="Code">πŸ’»</a></td>
542
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/jamesiri"><img src="https://avatars1.githubusercontent.com/u/22601145?v=4?s=100" width="100px;" alt="James Siri"/><br /><sub><b>James Siri</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=jamesiri" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Ajamesiri" title="Maintenance">🚧</a></td>
543
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/jasdel"><img src="https://avatars3.githubusercontent.com/u/961963?v=4?s=100" width="100px;" alt="Jason Del Ponte"/><br /><sub><b>Jason Del Ponte</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Ajasdel+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Ajasdel" title="Reviewed Pull Requests">πŸ‘€</a></td>
544
- <td align="center" valign="top" width="14.28%"><a href="http://aws.amazon.com/"><img src="https://avatars1.githubusercontent.com/u/193449?v=4?s=100" width="100px;" alt="Jason Fulghum"/><br /><sub><b>Jason Fulghum</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Afulghum+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="#projectManagement-fulghum" title="Project Management">πŸ“†</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Afulghum" title="Reviewed Pull Requests">πŸ‘€</a></td>
545
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/jmalins"><img src="https://avatars.githubusercontent.com/u/2001356?v=4?s=100" width="100px;" alt="Jeff Malins"/><br /><sub><b>Jeff Malins</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=jmalins" title="Code">πŸ’»</a></td>
546
- </tr>
547
- <tr>
548
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/Jerry-AWS"><img src="https://avatars3.githubusercontent.com/u/52084730?v=4?s=100" width="100px;" alt="Jerry Kindall"/><br /><sub><b>Jerry Kindall</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=Jerry-AWS" title="Documentation">πŸ“–</a> <a href="https://github.com/aws/jsii/issues?q=author%3AJerry-AWS+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
549
- <td align="center" valign="top" width="14.28%"><a href="http://nmussy.github.io/"><img src="https://avatars0.githubusercontent.com/u/2505696?v=4?s=100" width="100px;" alt="Jimmy Gaussen"/><br /><sub><b>Jimmy Gaussen</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Anmussy+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
550
- <td align="center" valign="top" width="14.28%"><a href="https://twitter.com/jowe"><img src="https://avatars.githubusercontent.com/u/569011?v=4?s=100" width="100px;" alt="Johannes Weber"/><br /><sub><b>Johannes Weber</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=johannes-weber" title="Documentation">πŸ“–</a></td>
551
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/jpantzlaff"><img src="https://avatars.githubusercontent.com/u/33850400?v=4?s=100" width="100px;" alt="John Pantzlaff"/><br /><sub><b>John Pantzlaff</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=jpantzlaff" title="Code">πŸ’»</a></td>
552
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/jsteinich"><img src="https://avatars0.githubusercontent.com/u/3868754?v=4?s=100" width="100px;" alt="Jon Steinich"/><br /><sub><b>Jon Steinich</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Ajsteinich+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii/issues?q=author%3Ajsteinich+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=jsteinich" title="Code">πŸ’»</a></td>
553
- <td align="center" valign="top" width="14.28%"><a href="https://joekiller.com/"><img src="https://avatars3.githubusercontent.com/u/1022919?v=4?s=100" width="100px;" alt="Joseph Lawson"/><br /><sub><b>Joseph Lawson</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Ajoekiller" title="Reviewed Pull Requests">πŸ‘€</a></td>
554
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/jpmartin2"><img src="https://avatars2.githubusercontent.com/u/2464249?v=4?s=100" width="100px;" alt="Joseph Martin"/><br /><sub><b>Joseph Martin</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Ajpmartin2+label%3Abug" title="Bug reports">πŸ›</a></td>
555
- </tr>
556
- <tr>
557
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/dxunix"><img src="https://avatars3.githubusercontent.com/u/11489831?v=4?s=100" width="100px;" alt="Junix"/><br /><sub><b>Junix</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Adxunix+label%3Abug" title="Bug reports">πŸ›</a></td>
558
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/jusdino"><img src="https://avatars.githubusercontent.com/u/11840575?v=4?s=100" width="100px;" alt="Justin Frahm"/><br /><sub><b>Justin Frahm</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Ajusdino+label%3Abug" title="Bug reports">πŸ›</a></td>
559
- <td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/jsdtaylor"><img src="https://avatars0.githubusercontent.com/u/15832750?v=4?s=100" width="100px;" alt="Justin Taylor"/><br /><sub><b>Justin Taylor</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Ajsdtaylor+label%3Abug" title="Bug reports">πŸ›</a></td>
560
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/kaizen3031593"><img src="https://avatars.githubusercontent.com/u/36202692?v=4?s=100" width="100px;" alt="Kaizen Conroy"/><br /><sub><b>Kaizen Conroy</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=kaizen3031593" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Akaizen3031593+label%3Abug" title="Bug reports">πŸ›</a></td>
561
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/kaizencc"><img src="https://avatars.githubusercontent.com/u/36202692?v=4?s=100" width="100px;" alt="Kaizen Conroy"/><br /><sub><b>Kaizen Conroy</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=kaizencc" title="Code">πŸ’»</a></td>
562
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/z3r0w0n"><img src="https://avatars.githubusercontent.com/u/6740347?v=4?s=100" width="100px;" alt="Kaushik Borra"/><br /><sub><b>Kaushik Borra</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Az3r0w0n+label%3Abug" title="Bug reports">πŸ›</a></td>
563
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/aws/aws-cdk"><img src="https://avatars.githubusercontent.com/u/53584728?v=4?s=100" width="100px;" alt="Kendra Neil"/><br /><sub><b>Kendra Neil</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=TheRealAmazonKendra" title="Code">πŸ’»</a></td>
564
- </tr>
565
- <tr>
566
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/KhurramJalil"><img src="https://avatars.githubusercontent.com/u/114917595?v=4?s=100" width="100px;" alt="Khurram Jalil"/><br /><sub><b>Khurram Jalil</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=KhurramJalil" title="Documentation">πŸ“–</a></td>
567
- <td align="center" valign="top" width="14.28%"><a href="http://findable.no/"><img src="https://avatars.githubusercontent.com/u/51441?v=4?s=100" width="100px;" alt="Knut O. Hellan"/><br /><sub><b>Knut O. Hellan</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Akhellan+label%3Abug" title="Bug reports">πŸ›</a></td>
568
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/kiiadi"><img src="https://avatars3.githubusercontent.com/u/4661536?v=4?s=100" width="100px;" alt="Kyle Thomson"/><br /><sub><b>Kyle Thomson</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=kiiadi" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Akiiadi" title="Reviewed Pull Requests">πŸ‘€</a></td>
569
- <td align="center" valign="top" width="14.28%"><a href="https://stackoverflow.com/users/2116873/pedreiro"><img src="https://avatars3.githubusercontent.com/u/10764017?v=4?s=100" width="100px;" alt="Leandro Padua"/><br /><sub><b>Leandro Padua</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aleandropadua+label%3Abug" title="Bug reports">πŸ›</a></td>
570
- <td align="center" valign="top" width="14.28%"><a href="https://liangzhou.dev"><img src="https://avatars.githubusercontent.com/u/1444104?v=4?s=100" width="100px;" alt="Liang Zhou"/><br /><sub><b>Liang Zhou</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Alzhoucs+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=lzhoucs" title="Code">πŸ’»</a></td>
571
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/madeline-k"><img src="https://avatars.githubusercontent.com/u/80541297?v=4?s=100" width="100px;" alt="Madeline Kusters"/><br /><sub><b>Madeline Kusters</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=madeline-k" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Amadeline-k+label%3Abug" title="Bug reports">πŸ›</a></td>
572
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/majasb"><img src="https://avatars2.githubusercontent.com/u/142510?v=4?s=100" width="100px;" alt="Maja S Bratseth"/><br /><sub><b>Maja S Bratseth</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Amajasb+label%3Abug" title="Bug reports">πŸ›</a></td>
573
- </tr>
574
- <tr>
575
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/marcosdiez"><img src="https://avatars2.githubusercontent.com/u/297498?v=4?s=100" width="100px;" alt="Marcos Diez"/><br /><sub><b>Marcos Diez</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Amarcosdiez+label%3Abug" title="Bug reports">πŸ›</a></td>
576
- <td align="center" valign="top" width="14.28%"><a href="https://polothy.github.io"><img src="https://avatars.githubusercontent.com/u/634657?v=4?s=100" width="100px;" alt="Mark Nielsen"/><br /><sub><b>Mark Nielsen</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=polothy" title="Code">πŸ’»</a></td>
577
- <td align="center" valign="top" width="14.28%"><a href="http://www.matthewbonig.com/"><img src="https://avatars2.githubusercontent.com/u/1559437?v=4?s=100" width="100px;" alt="Matthew Bonig"/><br /><sub><b>Matthew Bonig</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Ambonig+label%3Abug" title="Bug reports">πŸ›</a> <a href="#blog-mbonig" title="Blogposts">πŸ“</a></td>
578
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/mpiroc"><img src="https://avatars2.githubusercontent.com/u/1623344?v=4?s=100" width="100px;" alt="Matthew Pirocchi"/><br /><sub><b>Matthew Pirocchi</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=mpiroc" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Ampiroc+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Ampiroc" title="Reviewed Pull Requests">πŸ‘€</a></td>
579
- <td align="center" valign="top" width="14.28%"><a href="https://kane.mx"><img src="https://avatars.githubusercontent.com/u/843303?v=4?s=100" width="100px;" alt="Meng Xin Zhu"/><br /><sub><b>Meng Xin Zhu</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Azxkane+label%3Abug" title="Bug reports">πŸ›</a></td>
580
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/mneil"><img src="https://avatars.githubusercontent.com/u/1605808?v=4?s=100" width="100px;" alt="Michael Neil"/><br /><sub><b>Michael Neil</b></sub></a><br /><a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Amneil" title="Maintenance">🚧</a></td>
581
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/mikelane"><img src="https://avatars0.githubusercontent.com/u/6543713?v=4?s=100" width="100px;" alt="Mike Lane"/><br /><sub><b>Mike Lane</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Amikelane+label%3Abug" title="Bug reports">πŸ›</a></td>
582
- </tr>
583
- <tr>
584
- <td align="center" valign="top" width="14.28%"><a href="http://elastician.com/"><img src="https://avatars3.githubusercontent.com/u/2056?v=4?s=100" width="100px;" alt="Mitch Garnaat"/><br /><sub><b>Mitch Garnaat</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Agarnaat+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=garnaat" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Agarnaat+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Agarnaat" title="Reviewed Pull Requests">πŸ‘€</a></td>
585
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/MrArnoldPalmer"><img src="https://avatars0.githubusercontent.com/u/7221111?v=4?s=100" width="100px;" alt="Mitchell Valine"/><br /><sub><b>Mitchell Valine</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3AMrArnoldPalmer+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=MrArnoldPalmer" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3AMrArnoldPalmer+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3AMrArnoldPalmer" title="Maintenance">🚧</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3AMrArnoldPalmer" title="Reviewed Pull Requests">πŸ‘€</a></td>
586
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/MohamadSoufan"><img src="https://avatars3.githubusercontent.com/u/28849417?v=4?s=100" width="100px;" alt="Mohamad Soufan"/><br /><sub><b>Mohamad Soufan</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=MohamadSoufan" title="Documentation">πŸ“–</a></td>
587
- <td align="center" valign="top" width="14.28%"><a href="https://moritzkornher.de/"><img src="https://avatars.githubusercontent.com/u/379814?v=4?s=100" width="100px;" alt="Momo Kornher"/><br /><sub><b>Momo Kornher</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=mrgrain" title="Code">πŸ’»</a></td>
588
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/mmogylenko"><img src="https://avatars.githubusercontent.com/u/7536624?v=4?s=100" width="100px;" alt="Mykola Mogylenko"/><br /><sub><b>Mykola Mogylenko</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Ammogylenko+label%3Abug" title="Bug reports">πŸ›</a></td>
589
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/Naumel"><img src="https://avatars.githubusercontent.com/u/104374999?v=4?s=100" width="100px;" alt="Naumel"/><br /><sub><b>Naumel</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3ANaumel" title="Reviewed Pull Requests">πŸ‘€</a></td>
590
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/NetaNir"><img src="https://avatars0.githubusercontent.com/u/8578043?v=4?s=100" width="100px;" alt="Neta Nir"/><br /><sub><b>Neta Nir</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=NetaNir" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3ANetaNir+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3ANetaNir" title="Maintenance">🚧</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3ANetaNir" title="Reviewed Pull Requests">πŸ‘€</a></td>
591
- </tr>
592
- <tr>
593
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/njlynch"><img src="https://avatars3.githubusercontent.com/u/1376292?v=4?s=100" width="100px;" alt="Nick Lynch"/><br /><sub><b>Nick Lynch</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Anjlynch+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=njlynch" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Anjlynch" title="Maintenance">🚧</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Anjlynch" title="Reviewed Pull Requests">πŸ‘€</a></td>
594
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/nija-at"><img src="https://avatars2.githubusercontent.com/u/16217941?v=4?s=100" width="100px;" alt="Niranjan Jayakar"/><br /><sub><b>Niranjan Jayakar</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Anija-at+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=nija-at" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Anija-at+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Anija-at" title="Maintenance">🚧</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Anija-at" title="Reviewed Pull Requests">πŸ‘€</a></td>
595
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/NGL321"><img src="https://avatars0.githubusercontent.com/u/4944099?v=4?s=100" width="100px;" alt="Noah Litov"/><br /><sub><b>Noah Litov</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=NGL321" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3ANGL321" title="Maintenance">🚧</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3ANGL321" title="Reviewed Pull Requests">πŸ‘€</a></td>
596
- <td align="center" valign="top" width="14.28%"><a href="https://otaviomacedo.github.io/"><img src="https://avatars.githubusercontent.com/u/288203?v=4?s=100" width="100px;" alt="Otavio Macedo"/><br /><sub><b>Otavio Macedo</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=otaviomacedo" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Aotaviomacedo+label%3Abug" title="Bug reports">πŸ›</a></td>
597
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/Pidz-b"><img src="https://avatars3.githubusercontent.com/u/47750432?v=4?s=100" width="100px;" alt="PIDZ - Bart "/><br /><sub><b>PIDZ - Bart </b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3APidz-b+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
598
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/peterwoodworth"><img src="https://avatars.githubusercontent.com/u/44349620?v=4?s=100" width="100px;" alt="Peter Woodworth"/><br /><sub><b>Peter Woodworth</b></sub></a><br /><a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Apeterwoodworth" title="Maintenance">🚧</a></td>
599
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/donicek"><img src="https://avatars.githubusercontent.com/u/8548012?v=4?s=100" width="100px;" alt="Petr Kacer"/><br /><sub><b>Petr Kacer</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Adonicek+label%3Abug" title="Bug reports">πŸ›</a></td>
600
- </tr>
601
- <tr>
602
- <td align="center" valign="top" width="14.28%"><a href="http://petrabarus.net/"><img src="https://avatars3.githubusercontent.com/u/523289?v=4?s=100" width="100px;" alt="Petra Barus"/><br /><sub><b>Petra Barus</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=petrabarus" title="Code">πŸ’»</a></td>
603
- <td align="center" valign="top" width="14.28%"><a href="http://philcali.me/"><img src="https://avatars1.githubusercontent.com/u/105208?v=4?s=100" width="100px;" alt="Philip Cali"/><br /><sub><b>Philip Cali</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aphilcali+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
604
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/Kent1"><img src="https://avatars1.githubusercontent.com/u/83018?v=4?s=100" width="100px;" alt="Quentin Loos"/><br /><sub><b>Quentin Loos</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3AKent1+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
605
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/Console32"><img src="https://avatars1.githubusercontent.com/u/4870099?v=4?s=100" width="100px;" alt="Raphael"/><br /><sub><b>Raphael</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3AConsole32+label%3Abug" title="Bug reports">πŸ›</a></td>
606
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/richardhboyd"><img src="https://avatars0.githubusercontent.com/u/58230111?v=4?s=100" width="100px;" alt="Richard H Boyd"/><br /><sub><b>Richard H Boyd</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Arichardhboyd+label%3Abug" title="Bug reports">πŸ›</a></td>
607
- <td align="center" valign="top" width="14.28%"><a href="http://rix0r.nl/"><img src="https://avatars2.githubusercontent.com/u/524162?v=4?s=100" width="100px;" alt="Rico Huijbers"/><br /><sub><b>Rico Huijbers</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Arix0rrr+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=rix0rrr" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Arix0rrr+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Arix0rrr" title="Maintenance">🚧</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Arix0rrr" title="Reviewed Pull Requests">πŸ‘€</a></td>
608
- <td align="center" valign="top" width="14.28%"><a href="https://keybase.io/romainmuller"><img src="https://avatars2.githubusercontent.com/u/411689?v=4?s=100" width="100px;" alt="Romain Marcadier"/><br /><sub><b>Romain Marcadier</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3ARomainMuller+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=RomainMuller" title="Code">πŸ’»</a> <a href="#design-RomainMuller" title="Design">🎨</a> <a href="https://github.com/aws/jsii/issues?q=author%3ARomainMuller+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3ARomainMuller" title="Maintenance">🚧</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3ARomainMuller" title="Reviewed Pull Requests">πŸ‘€</a> <a href="#blog-RomainMuller" title="Blogposts">πŸ“</a></td>
609
- </tr>
610
- <tr>
611
- <td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/sadikkuzu/"><img src="https://avatars2.githubusercontent.com/u/23168063?v=4?s=100" width="100px;" alt="SADIK KUZU"/><br /><sub><b>SADIK KUZU</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Asadikkuzu" title="Reviewed Pull Requests">πŸ‘€</a></td>
612
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/skarode96"><img src="https://avatars2.githubusercontent.com/u/24491216?v=4?s=100" width="100px;" alt="SK"/><br /><sub><b>SK</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Askarode96+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
613
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/spfink"><img src="https://avatars1.githubusercontent.com/u/20525381?v=4?s=100" width="100px;" alt="Sam Fink"/><br /><sub><b>Sam Fink</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=spfink" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Aspfink" title="Reviewed Pull Requests">πŸ‘€</a></td>
614
- <td align="center" valign="top" width="14.28%"><a href="https://punch.dev/"><img src="https://avatars1.githubusercontent.com/u/38672686?v=4?s=100" width="100px;" alt="Sam Goodwin"/><br /><sub><b>Sam Goodwin</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Asam-goodwin" title="Reviewed Pull Requests">πŸ‘€</a></td>
615
- <td align="center" valign="top" width="14.28%"><a href="https://skorfmann.com/"><img src="https://avatars1.githubusercontent.com/u/136789?v=4?s=100" width="100px;" alt="Sebastian Korfmann"/><br /><sub><b>Sebastian Korfmann</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Askorfmann+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=skorfmann" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3Askorfmann+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
616
- <td align="center" valign="top" width="14.28%"><a href="https://sepehrlaal.com/"><img src="https://avatars.githubusercontent.com/u/5657848?v=4?s=100" width="100px;" alt="Sepehr Laal"/><br /><sub><b>Sepehr Laal</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3A3p3r+label%3Abug" title="Bug reports">πŸ›</a></td>
617
- <td align="center" valign="top" width="14.28%"><a href="https://digitalsanctum.com/"><img src="https://avatars3.githubusercontent.com/u/30923?v=4?s=100" width="100px;" alt="Shane Witbeck"/><br /><sub><b>Shane Witbeck</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Adigitalsanctum+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
618
- </tr>
619
- <tr>
620
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/shivlaks"><img src="https://avatars0.githubusercontent.com/u/32604953?v=4?s=100" width="100px;" alt="Shiv Lakshminarayan"/><br /><sub><b>Shiv Lakshminarayan</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=shivlaks" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Ashivlaks" title="Maintenance">🚧</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3Ashivlaks" title="Reviewed Pull Requests">πŸ‘€</a></td>
621
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/SomayaB"><img src="https://avatars3.githubusercontent.com/u/23043132?v=4?s=100" width="100px;" alt="Somaya"/><br /><sub><b>Somaya</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=SomayaB" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/issues?q=author%3ASomayaB+label%3Afeature-request" title="Feature requests">πŸ€”</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3ASomayaB" title="Maintenance">🚧</a> <a href="https://github.com/aws/jsii-rosetta/pulls?q=is%3Apr+reviewed-by%3ASomayaB" title="Reviewed Pull Requests">πŸ‘€</a></td>
622
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/skuenzli"><img src="https://avatars.githubusercontent.com/u/869201?v=4?s=100" width="100px;" alt="Stephen Kuenzli"/><br /><sub><b>Stephen Kuenzli</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=skuenzli" title="Documentation">πŸ“–</a></td>
623
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/touchez-du-bois"><img src="https://avatars.githubusercontent.com/u/434017?v=4?s=100" width="100px;" alt="Takahiro Sugiura"/><br /><sub><b>Takahiro Sugiura</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=touchez-du-bois" title="Documentation">πŸ“–</a></td>
624
- <td align="center" valign="top" width="14.28%"><a href="https://gitter.im/"><img src="https://avatars2.githubusercontent.com/u/8518239?v=4?s=100" width="100px;" alt="The Gitter Badger"/><br /><sub><b>The Gitter Badger</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=gitter-badger" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Agitter-badger" title="Maintenance">🚧</a></td>
625
- <td align="center" valign="top" width="14.28%"><a href="https://medium.com/@thomaspoignant"><img src="https://avatars2.githubusercontent.com/u/17908063?v=4?s=100" width="100px;" alt="Thomas Poignant"/><br /><sub><b>Thomas Poignant</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Athomaspoignant+label%3Abug" title="Bug reports">πŸ›</a></td>
626
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/ThomasSteinbach"><img src="https://avatars0.githubusercontent.com/u/1683246?v=4?s=100" width="100px;" alt="Thomas Steinbach"/><br /><sub><b>Thomas Steinbach</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3AThomasSteinbach+label%3Abug" title="Bug reports">πŸ›</a></td>
627
- </tr>
628
- <tr>
629
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/hoegertn"><img src="https://avatars2.githubusercontent.com/u/1287829?v=4?s=100" width="100px;" alt="Thorsten Hoeger"/><br /><sub><b>Thorsten Hoeger</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=hoegertn" title="Code">πŸ’»</a></td>
630
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/serverlessunicorn"><img src="https://avatars1.githubusercontent.com/u/54867311?v=4?s=100" width="100px;" alt="Tim Wagner"/><br /><sub><b>Tim Wagner</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aserverlessunicorn+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii/issues?q=author%3Aserverlessunicorn+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
631
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/tobli"><img src="https://avatars3.githubusercontent.com/u/540266?v=4?s=100" width="100px;" alt="Tobias Lidskog"/><br /><sub><b>Tobias Lidskog</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=tobli" title="Code">πŸ’»</a></td>
632
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/TomBonnerAtDerivitec"><img src="https://avatars.githubusercontent.com/u/83637254?v=4?s=100" width="100px;" alt="Tom Bonner"/><br /><sub><b>Tom Bonner</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3ATomBonnerAtDerivitec+label%3Abug" title="Bug reports">πŸ›</a></td>
633
- <td align="center" valign="top" width="14.28%"><a href="https://ty.coghlan.dev/"><img src="https://avatars2.githubusercontent.com/u/15920577?v=4?s=100" width="100px;" alt="Ty Coghlan"/><br /><sub><b>Ty Coghlan</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3AOphirr33+label%3Abug" title="Bug reports">πŸ›</a></td>
634
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/tvanhens"><img src="https://avatars1.githubusercontent.com/u/5342795?v=4?s=100" width="100px;" alt="Tyler van Hensbergen"/><br /><sub><b>Tyler van Hensbergen</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Atvanhens+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
635
- <td align="center" valign="top" width="14.28%"><a href="http://ultidev.com/Products/"><img src="https://avatars1.githubusercontent.com/u/757185?v=4?s=100" width="100px;" alt="Vlad Hrybok"/><br /><sub><b>Vlad Hrybok</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Avgribok+label%3Abug" title="Bug reports">πŸ›</a></td>
636
- </tr>
637
- <tr>
638
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/Lanayx"><img src="https://avatars2.githubusercontent.com/u/3329606?v=4?s=100" width="100px;" alt="Vladimir Shchur"/><br /><sub><b>Vladimir Shchur</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3ALanayx+label%3Abug" title="Bug reports">πŸ›</a></td>
639
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/Ragnoroct"><img src="https://avatars.githubusercontent.com/u/19155205?v=4?s=100" width="100px;" alt="Will Bender"/><br /><sub><b>Will Bender</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3ARagnoroct+label%3Abug" title="Bug reports">πŸ›</a></td>
640
- <td align="center" valign="top" width="14.28%"><a href="http://yanex.org/"><img src="https://avatars2.githubusercontent.com/u/95996?v=4?s=100" width="100px;" alt="Yan Zhulanow"/><br /><sub><b>Yan Zhulanow</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=yanex" title="Code">πŸ’»</a></td>
641
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/yglcode"><img src="https://avatars.githubusercontent.com/u/11893614?v=4?s=100" width="100px;" alt="Yigong Liu"/><br /><sub><b>Yigong Liu</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Ayglcode+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii/issues?q=author%3Ayglcode+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
642
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/ZachBien"><img src="https://avatars.githubusercontent.com/u/1245628?v=4?s=100" width="100px;" alt="Zach Bienenfeld"/><br /><sub><b>Zach Bienenfeld</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3AZachBien+label%3Abug" title="Bug reports">πŸ›</a></td>
643
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/ajnarang"><img src="https://avatars3.githubusercontent.com/u/52025281?v=4?s=100" width="100px;" alt="ajnarang"/><br /><sub><b>ajnarang</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aajnarang+label%3Afeature-request" title="Feature requests">πŸ€”</a></td>
644
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/aniljava"><img src="https://avatars.githubusercontent.com/u/412569?v=4?s=100" width="100px;" alt="aniljava"/><br /><sub><b>aniljava</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=aniljava" title="Code">πŸ’»</a></td>
645
- </tr>
646
- <tr>
647
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/arnogeurts-sqills"><img src="https://avatars.githubusercontent.com/u/79304871?v=4?s=100" width="100px;" alt="arnogeurts-sqills"/><br /><sub><b>arnogeurts-sqills</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aarnogeurts-sqills+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=arnogeurts-sqills" title="Code">πŸ’»</a></td>
648
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/cn-cit"><img src="https://avatars.githubusercontent.com/u/27255477?v=4?s=100" width="100px;" alt="cn-cit"/><br /><sub><b>cn-cit</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Acn-cit+label%3Abug" title="Bug reports">πŸ›</a></td>
649
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/deccy-mcc"><img src="https://avatars0.githubusercontent.com/u/45844893?v=4?s=100" width="100px;" alt="deccy-mcc"/><br /><sub><b>deccy-mcc</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Adeccy-mcc+label%3Abug" title="Bug reports">πŸ›</a></td>
650
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/apps/dependabot-preview"><img src="https://avatars3.githubusercontent.com/in/2141?v=4?s=100" width="100px;" alt="dependabot-preview[bot]"/><br /><sub><b>dependabot-preview[bot]</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Adependabot-preview[bot]+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Adependabot-preview[bot]" title="Maintenance">🚧</a></td>
651
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/apps/dependabot"><img src="https://avatars0.githubusercontent.com/in/29110?v=4?s=100" width="100px;" alt="dependabot[bot]"/><br /><sub><b>dependabot[bot]</b></sub></a><br /><a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Adependabot[bot]" title="Maintenance">🚧</a></td>
652
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/dheffx"><img src="https://avatars0.githubusercontent.com/u/22029918?v=4?s=100" width="100px;" alt="dheffx"/><br /><sub><b>dheffx</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Adheffx+label%3Abug" title="Bug reports">πŸ›</a></td>
653
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/gregswdl"><img src="https://avatars0.githubusercontent.com/u/47365273?v=4?s=100" width="100px;" alt="gregswdl"/><br /><sub><b>gregswdl</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Agregswdl+label%3Abug" title="Bug reports">πŸ›</a></td>
654
- </tr>
655
- <tr>
656
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/guyroberts21"><img src="https://avatars.githubusercontent.com/u/47118902?v=4?s=100" width="100px;" alt="guyroberts21"/><br /><sub><b>guyroberts21</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=guyroberts21" title="Documentation">πŸ“–</a></td>
657
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/mattBrzezinski"><img src="https://avatars.githubusercontent.com/u/4356074?v=4?s=100" width="100px;" alt="mattBrzezinski"/><br /><sub><b>mattBrzezinski</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=mattBrzezinski" title="Documentation">πŸ“–</a></td>
658
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/mergify"><img src="https://avatars.githubusercontent.com/u/18240476?v=4?s=100" width="100px;" alt="mergify"/><br /><sub><b>mergify</b></sub></a><br /><a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Amergify" title="Maintenance">🚧</a></td>
659
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/apps/mergify"><img src="https://avatars1.githubusercontent.com/in/10562?v=4?s=100" width="100px;" alt="mergify[bot]"/><br /><sub><b>mergify[bot]</b></sub></a><br /><a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Amergify[bot]" title="Maintenance">🚧</a></td>
660
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/nathannaveen"><img src="https://avatars.githubusercontent.com/u/42319948?v=4?s=100" width="100px;" alt="nathannaveen"/><br /><sub><b>nathannaveen</b></sub></a><br /><a href="https://github.com/aws/jsii/pulls?q=is%3Apr+author%3Anathannaveen" title="Maintenance">🚧</a></td>
661
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/seiyashima"><img src="https://avatars2.githubusercontent.com/u/4947101?v=4?s=100" width="100px;" alt="seiyashima42"/><br /><sub><b>seiyashima42</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Aseiyashima+label%3Abug" title="Bug reports">πŸ›</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=seiyashima" title="Code">πŸ’»</a> <a href="https://github.com/aws/jsii-rosetta/commits?author=seiyashima" title="Documentation">πŸ“–</a></td>
662
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/sullis"><img src="https://avatars3.githubusercontent.com/u/30938?v=4?s=100" width="100px;" alt="sullis"/><br /><sub><b>sullis</b></sub></a><br /><a href="https://github.com/aws/jsii-rosetta/commits?author=sullis" title="Code">πŸ’»</a></td>
663
- </tr>
664
- <tr>
665
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/vaneek"><img src="https://avatars1.githubusercontent.com/u/8113305?v=4?s=100" width="100px;" alt="vaneek"/><br /><sub><b>vaneek</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Avaneek+label%3Abug" title="Bug reports">πŸ›</a></td>
666
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/wendysophie"><img src="https://avatars.githubusercontent.com/u/54415551?v=4?s=100" width="100px;" alt="wendysophie"/><br /><sub><b>wendysophie</b></sub></a><br /><a href="https://github.com/aws/jsii/issues?q=author%3Awendysophie+label%3Abug" title="Bug reports">πŸ›</a></td>
667
- </tr>
668
- </tbody>
669
- </table>
670
-
671
- <!-- markdownlint-restore -->
672
- <!-- prettier-ignore-end -->
673
-
674
- <!-- ALL-CONTRIBUTORS-LIST:END -->
675
-
676
- This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification.
677
- Contributions of any kind welcome!
678
472
 
679
473
  ## :balance_scale: License
680
474
 
@@ -23,6 +23,10 @@ export declare class TypeFingerprinter {
23
23
  * in this assembly.
24
24
  */
25
25
  fingerprintType(fqn: string): string;
26
+ /**
27
+ * Write the fingerprint cache to a debug file
28
+ */
29
+ writeDebugFile(filename: string): void;
26
30
  private doFingerprint;
27
31
  private findType;
28
32
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TypeFingerprinter = void 0;
4
4
  const crypto = require("node:crypto");
5
+ const fs = require("node:fs");
5
6
  const spec = require("@jsii/spec");
6
7
  /**
7
8
  * Return a fingerprint for a type.
@@ -39,6 +40,14 @@ class TypeFingerprinter {
39
40
  fingerprintType(fqn) {
40
41
  return this.doFingerprint(fqn, new Set([fqn]));
41
42
  }
43
+ /**
44
+ * Write the fingerprint cache to a debug file
45
+ */
46
+ writeDebugFile(filename) {
47
+ const entries = Array.from(this.cache.entries()).sort(([a], [b]) => a.localeCompare(b));
48
+ const lines = entries.map(([fqn, hash]) => `${fqn}: ${hash}`);
49
+ fs.writeFileSync(filename, lines.join('\n') + '\n');
50
+ }
42
51
  doFingerprint(fqn, recursionBreaker) {
43
52
  // eslint-disable-next-line @typescript-eslint/no-this-alias
44
53
  const self = this;
@@ -1 +1 @@
1
- {"version":3,"file":"fingerprinting.js","sourceRoot":"","sources":["../../src/jsii/fingerprinting.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACtC,mCAAmC;AAEnC;;;;;;;;GAQG;AACH,MAAa,iBAAiB;IAI5B,YAAmB,UAA2B;QAH7B,UAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;QAClC,eAAU,GAAG,IAAI,GAAG,EAAyB,CAAC;QAG7D,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;YAClC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ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n * The fingerprint will change if the API of the given type changes.\n *\n * The fingerprint is an approximation, it's not exhaustive. It will not trace\n * into types from assemblies it can't see, for example. For the purposes of Rosetta,\n * we'll assume this is Good Enoughβ„’.\n */\nexport class TypeFingerprinter {\n private readonly cache = new Map<string, string>();\n private readonly assemblies = new Map<string, spec.Assembly>();\n\n public constructor(assemblies: spec.Assembly[]) {\n for (const assembly of assemblies) {\n this.assemblies.set(assembly.name, assembly);\n }\n }\n\n /**\n * Return a single fingerprint that encompasses all fqns in the list\n */\n public fingerprintAll(fqns: string[]) {\n const hash = crypto.createHash('sha256');\n for (const fqn of fqns) {\n hash.update(this.fingerprintType(fqn));\n }\n return hash.digest('hex');\n }\n\n /**\n * Return the fingerprint for the given FQN in the assembly of this fingerprinter\n *\n * The fingerprint is always going to contain the FQN, even if the type doesn't exist\n * in this assembly.\n */\n public fingerprintType(fqn: string) {\n return this.doFingerprint(fqn, new Set([fqn]));\n }\n\n private doFingerprint(fqn: string, recursionBreaker: Set<string>) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n\n const existing = this.cache.get(fqn);\n if (existing) {\n return existing;\n }\n\n const hash = crypto.createHash('sha256');\n hash.update(fqn);\n\n const type = this.findType(fqn);\n if (type) {\n hash.update(type.kind);\n switch (type.kind) {\n case spec.TypeKind.Enum:\n for (const member of sortedByName(type.members)) {\n hash.update(member.name);\n }\n break;\n case spec.TypeKind.Class:\n case spec.TypeKind.Interface:\n if (type.kind === spec.TypeKind.Class) {\n visitType(type.base);\n visitCallable(type.initializer);\n }\n\n for (const prop of sortedByName(type.properties ?? [])) {\n hash.update(prop.name);\n visitBools(prop.immutable, prop.static, prop.optional, prop.protected);\n visitTypeReference(prop.type);\n }\n for (const method of sortedByName(type.methods ?? [])) {\n hash.update(method.name);\n visitCallable(method);\n visitBools(method.returns?.optional);\n visitTypeReference(method.returns?.type);\n }\n for (const implint of type.interfaces ?? []) {\n visitType(implint);\n }\n\n break;\n }\n }\n\n const ret = hash.digest('hex');\n this.cache.set(fqn, ret);\n return ret;\n\n function visitType(fqnStr?: string) {\n if (!fqnStr) {\n return;\n }\n\n if (recursionBreaker.has(fqnStr)) {\n hash.update('$RECURSION$');\n return;\n }\n\n recursionBreaker.add(fqnStr);\n hash.update(self.doFingerprint(fqnStr, recursionBreaker));\n recursionBreaker.delete(fqnStr);\n }\n\n function visitCallable(callable?: spec.Callable) {\n if (!callable) {\n return;\n }\n\n visitBools(callable.protected);\n for (const param of callable.parameters ?? []) {\n visitBools(param.optional, param.variadic);\n visitTypeReference(param.type);\n }\n }\n\n function visitTypeReference(typeRef?: spec.TypeReference) {\n if (!typeRef) {\n return;\n }\n\n if (spec.isPrimitiveTypeReference(typeRef)) {\n hash.update(typeRef.primitive);\n }\n if (spec.isNamedTypeReference(typeRef)) {\n visitType(typeRef.fqn);\n }\n if (spec.isCollectionTypeReference(typeRef)) {\n hash.update(typeRef.collection.kind);\n visitTypeReference(typeRef.collection.elementtype);\n }\n if (spec.isUnionTypeReference(typeRef)) {\n for (const t of typeRef.union.types) {\n visitTypeReference(t);\n }\n }\n }\n\n function visitBools(...vs: Array<boolean | undefined>) {\n hash.update(vs.map((v) => (v ? '1' : '0')).join(''));\n }\n }\n\n private findType(fqn: string) {\n const assemblyName = fqn.split('.')[0];\n return this.assemblies.get(assemblyName)?.types?.[fqn];\n }\n}\n\nfunction sortedByName<A extends { name: string }>(xs: A[]): A[] {\n xs.sort((a, b) => a.name.localeCompare(b.name));\n return xs;\n}\n"]}
1
+ {"version":3,"file":"fingerprinting.js","sourceRoot":"","sources":["../../src/jsii/fingerprinting.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACtC,8BAA8B;AAC9B,mCAAmC;AAEnC;;;;;;;;GAQG;AACH,MAAa,iBAAiB;IAI5B,YAAmB,UAA2B;QAH7B,UAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;QAClC,eAAU,GAAG,IAAI,GAAG,EAAyB,CAAC;QAG7D,KAAK,MAAM,QAAQ,IAAI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AAC,EAAE,CAAC,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IAEO,QAAQ,CAAC,GAAW;QAC1B,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IACzD,CAAC;CACF;AArJD,8CAqJC;AAED,SAAS,YAAY,CAA6B,EAAO;IACvD,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import * as crypto from 'node:crypto';\nimport * as fs from 'node:fs';\nimport * as spec from '@jsii/spec';\n\n/**\n * Return a fingerprint for a type.\n *\n * The fingerprint will change if the API of the given type changes.\n *\n * The fingerprint is an approximation, it's not exhaustive. It will not trace\n * into types from assemblies it can't see, for example. For the purposes of Rosetta,\n * we'll assume this is Good Enoughβ„’.\n */\nexport class TypeFingerprinter {\n private readonly cache = new Map<string, string>();\n private readonly assemblies = new Map<string, spec.Assembly>();\n\n public constructor(assemblies: spec.Assembly[]) {\n for (const assembly of assemblies) {\n this.assemblies.set(assembly.name, assembly);\n }\n }\n\n /**\n * Return a single fingerprint that encompasses all fqns in the list\n */\n public fingerprintAll(fqns: string[]) {\n const hash = crypto.createHash('sha256');\n for (const fqn of fqns) {\n hash.update(this.fingerprintType(fqn));\n }\n return hash.digest('hex');\n }\n\n /**\n * Return the fingerprint for the given FQN in the assembly of this fingerprinter\n *\n * The fingerprint is always going to contain the FQN, even if the type doesn't exist\n * in this assembly.\n */\n public fingerprintType(fqn: string) {\n return this.doFingerprint(fqn, new Set([fqn]));\n }\n\n /**\n * Write the fingerprint cache to a debug file\n */\n public writeDebugFile(filename: string) {\n const entries = Array.from(this.cache.entries()).sort(([a], [b]) => a.localeCompare(b));\n const lines = entries.map(([fqn, hash]) => `${fqn}: ${hash}`);\n fs.writeFileSync(filename, lines.join('\\n') + '\\n');\n }\n\n private doFingerprint(fqn: string, recursionBreaker: Set<string>) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n\n const existing = this.cache.get(fqn);\n if (existing) {\n return existing;\n }\n\n const hash = crypto.createHash('sha256');\n hash.update(fqn);\n\n const type = this.findType(fqn);\n if (type) {\n hash.update(type.kind);\n switch (type.kind) {\n case spec.TypeKind.Enum:\n for (const member of sortedByName(type.members)) {\n hash.update(member.name);\n }\n break;\n case spec.TypeKind.Class:\n case spec.TypeKind.Interface:\n if (type.kind === spec.TypeKind.Class) {\n visitType(type.base);\n visitCallable(type.initializer);\n }\n\n for (const prop of sortedByName(type.properties ?? [])) {\n hash.update(prop.name);\n visitBools(prop.immutable, prop.static, prop.optional, prop.protected);\n visitTypeReference(prop.type);\n }\n for (const method of sortedByName(type.methods ?? [])) {\n hash.update(method.name);\n visitCallable(method);\n visitBools(method.returns?.optional);\n visitTypeReference(method.returns?.type);\n }\n for (const implint of type.interfaces ?? []) {\n visitType(implint);\n }\n\n break;\n }\n }\n\n const ret = hash.digest('hex');\n this.cache.set(fqn, ret);\n return ret;\n\n function visitType(fqnStr?: string) {\n if (!fqnStr) {\n return;\n }\n\n if (recursionBreaker.has(fqnStr)) {\n hash.update('$RECURSION$');\n return;\n }\n\n recursionBreaker.add(fqnStr);\n hash.update(self.doFingerprint(fqnStr, recursionBreaker));\n recursionBreaker.delete(fqnStr);\n }\n\n function visitCallable(callable?: spec.Callable) {\n if (!callable) {\n return;\n }\n\n visitBools(callable.protected);\n for (const param of callable.parameters ?? []) {\n visitBools(param.optional, param.variadic);\n visitTypeReference(param.type);\n }\n }\n\n function visitTypeReference(typeRef?: spec.TypeReference) {\n if (!typeRef) {\n return;\n }\n\n if (spec.isPrimitiveTypeReference(typeRef)) {\n hash.update(typeRef.primitive);\n }\n if (spec.isNamedTypeReference(typeRef)) {\n visitType(typeRef.fqn);\n }\n if (spec.isCollectionTypeReference(typeRef)) {\n hash.update(typeRef.collection.kind);\n visitTypeReference(typeRef.collection.elementtype);\n }\n if (spec.isUnionTypeReference(typeRef)) {\n for (const t of typeRef.union.types) {\n visitTypeReference(t);\n }\n }\n }\n\n function visitBools(...vs: Array<boolean | undefined>) {\n hash.update(vs.map((v) => (v ? '1' : '0')).join(''));\n }\n }\n\n private findType(fqn: string) {\n const assemblyName = fqn.split('.')[0];\n return this.assemblies.get(assemblyName)?.types?.[fqn];\n }\n}\n\nfunction sortedByName<A extends { name: string }>(xs: A[]): A[] {\n xs.sort((a, b) => a.name.localeCompare(b.name));\n return xs;\n}\n"]}
@@ -141,6 +141,9 @@ class RosettaTranslator {
141
141
  }
142
142
  }
143
143
  const fingerprinted = result.translatedSnippets.map((snippet) => snippet.withFingerprint(this.fingerprinter.fingerprintAll(snippet.fqnsReferenced())));
144
+ if (process.env.DEBUG_TYPE_FINGERPRINTS) {
145
+ this.fingerprinter.writeDebugFile(process.env.DEBUG_TYPE_FINGERPRINTS);
146
+ }
144
147
  if (options?.addToTablet ?? true) {
145
148
  this.tablet.addSnippets(...fingerprinted);
146
149
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rosetta-translator.js","sourceRoot":"","sources":["../src/rosetta-translator.ts"],"names":[],"mappings":";;;AAAA,qCAAyC;AAGzC,0DAA0D;AAC1D,2CAA+C;AAC/C,qCAAqC;AACrC,uCAA8D;AAC9D,iEAKgC;AAChC,uCAA2C;AAC3C,+CAAsE;AACtE,mDAAmE;AAoCnE;;;;;GAKG;AACH,MAAa,iBAAiB;IAc5B,YAAmB,UAAoC,EAAE;QAbzD;;;;WAIG;QACa,WAAM,GAAG,IAAI,wBAAc,EAAE,CAAC;QAE9B,UAAK,GAAG,IAAI,wBAAc,EAAE,CAAC;QAO3C,IAAI,CAAC,aAAa,GAAG,IAAI,kCAAiB,C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,aAAa,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC5D,CAAC;IAED,MAAM,WAAW,GAAG,IAAA,wBAAc,EAAC,aAAa,CAAC,KAAK,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC;IACnF,MAAM,eAAe,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,4BAAgB,CAAC,CAAC,KAAK,CAC7D,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,UAAU,CAAC,OAAO,CAC/F,CAAC;IACF,MAAM,UAAU,GAAG,aAAa,CAAC,cAAc,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,KAAK,SAAS,CAAC,OAAO,CAAC,eAAe,CAAC;IAClH,MAAM,iBAAiB,GAAG,YAAY,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC;IAExE,IAAI,WAAW,IAAI,eAAe,IAAI,UAAU,IAAI,iBAAiB,EAAE,CAAC;QACtE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChH,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC7D,CAAC;AAcD,SAAS,SAAS,CAAC,OAA0B;IAC3C,OAAO,OAAO,CAAC,UAAU,EAAE,OAAO,KAAK,SAAS,CAAC;AACnD,CAAC","sourcesContent":["import { promises as fs } from 'node:fs';\nimport * as spec from '@jsii/spec';\n\nimport { TypeFingerprinter } from './jsii/fingerprinting';\nimport { TARGET_LANGUAGES } from './languages';\nimport * as logging from './logging';\nimport { TypeScriptSnippet, completeSource } from './snippet';\nimport {\n collectDependencies,\n validateAvailableDependencies,\n prepareDependencyDirectory,\n expandWithTransitiveDependencies,\n} from './snippet-dependencies';\nimport { snippetKey } from './tablets/key';\nimport { LanguageTablet, TranslatedSnippet } from './tablets/tablets';\nimport { translateAll, TranslateAllResult } from './translate_all';\n\nexport interface RosettaTranslatorOptions {\n /**\n * Assemblies to use for fingerprinting\n *\n * The set of assemblies here are used to invalidate the cache. Any types that are\n * used in snippets are looked up in this set of assemblies. If found, their type\n * information is fingerprinted and compared to the type information at the time\n * compilation of the cached sample. If different, this is considered to be a cache\n * miss.\n *\n * You must use the same set of assemblies when generating and reading the cache\n * file, otherwise the fingerprint is guaranteed to be different and the cache will\n * be useless (e.g. if you generate the cache WITH assembly information but\n * read it without, or vice versa).\n *\n * @default No assemblies.\n */\n readonly assemblies?: spec.Assembly[];\n\n /**\n * Whether to include compiler diagnostics in the compilation results.\n *\n * @default false\n */\n readonly includeCompilerDiagnostics?: boolean;\n\n /**\n * Allow reading dirty translations from cache\n *\n * @default false\n */\n readonly allowDirtyTranslations?: boolean;\n}\n\n/**\n * Entry point for consumers that want to translate code on-the-fly\n *\n * If you want to generate and translate code on-the-fly, in ways that cannot\n * be achieved by the rosetta CLI, use this class.\n */\nexport class RosettaTranslator {\n /**\n * Tablet with fresh translations\n *\n * All new translations (not read from cache) are added to this tablet.\n */\n public readonly tablet = new LanguageTablet();\n\n public readonly cache = new LanguageTablet();\n\n private readonly fingerprinter: TypeFingerprinter;\n private readonly includeCompilerDiagnostics: boolean;\n private readonly allowDirtyTranslations: boolean;\n\n public constructor(options: RosettaTranslatorOptions = {}) {\n this.fingerprinter = new TypeFingerprinter(options?.assemblies ?? []);\n this.includeCompilerDiagnostics = options.includeCompilerDiagnostics ?? false;\n this.allowDirtyTranslations = options.allowDirtyTranslations ?? false;\n }\n\n /**\n * @deprecated use `addToCache` instead\n */\n public async loadCache(fileName: string) {\n try {\n await this.cache.load(fileName);\n } catch (e: any) {\n logging.warn(`Error reading cache ${fileName}: ${e.message}`);\n }\n }\n\n public async addToCache(filename: string) {\n const tab = await LanguageTablet.fromOptionalFile(filename);\n this.cache.addTablet(tab);\n }\n\n public addTabletsToCache(...tablets: LanguageTablet[]) {\n for (const tab of tablets) {\n this.cache.addTablet(tab);\n }\n }\n\n public hasCache() {\n return this.cache.count > 0;\n }\n\n /**\n * For all the given snippets, try to read translations from the cache\n *\n * Will remove the cached snippets from the input array.\n */\n public readFromCache(snippets: TypeScriptSnippet[], addToTablet = true, compiledOnly = false): ReadFromCacheResults {\n const translations = new Array<TranslatedSnippet>();\n const remaining = new Array<TypeScriptSnippet>();\n\n let infusedCount = 0;\n let dirtyCount = 0;\n let dirtySourceCount = 0;\n let dirtyTypesCount = 0;\n let dirtyTranslatorCount = 0;\n let dirtyDidntCompile = 0;\n\n for (const snippet of snippets) {\n const fromCache = tryReadFromCache(snippet, this.cache, this.fingerprinter, compiledOnly);\n switch (fromCache.type) {\n case 'hit':\n if (addToTablet) {\n this.tablet.addSnippets(fromCache.snippet);\n }\n translations.push(fromCache.snippet);\n\n infusedCount += fromCache.infused ? 1 : 0;\n break;\n\n case 'dirty':\n dirtyCount += 1;\n dirtySourceCount += fromCache.dirtySource ? 1 : 0;\n dirtyTranslatorCount += fromCache.dirtyTranslator ? 1 : 0;\n dirtyTypesCount += fromCache.dirtyTypes ? 1 : 0;\n dirtyDidntCompile += fromCache.dirtyDidntCompile ? 1 : 0;\n\n if (this.allowDirtyTranslations) {\n translations.push(fromCache.translation);\n } else {\n remaining.push(snippet);\n }\n break;\n\n case 'miss':\n remaining.push(snippet);\n break;\n }\n }\n\n return {\n translations,\n remaining,\n infusedCount,\n dirtyCount,\n dirtySourceCount,\n dirtyTranslatorCount,\n dirtyTypesCount,\n dirtyDidntCompile,\n };\n }\n\n public async translateAll(snippets: TypeScriptSnippet[], addToTablet?: boolean): Promise<TranslateAllResult>;\n public async translateAll(snippets: TypeScriptSnippet[], options?: TranslateAllOptions): Promise<TranslateAllResult>;\n public async translateAll(\n snippets: TypeScriptSnippet[],\n optionsOrAddToTablet?: boolean | TranslateAllOptions,\n ): Promise<TranslateAllResult> {\n const options =\n optionsOrAddToTablet && typeof optionsOrAddToTablet === 'object'\n ? optionsOrAddToTablet\n : { addToTablet: optionsOrAddToTablet };\n\n const exampleDependencies = collectDependencies(snippets);\n await expandWithTransitiveDependencies(exampleDependencies);\n\n let compilationDirectory;\n let cleanCompilationDir = false;\n if (options?.compilationDirectory) {\n // If the user provided a directory, we're going to trust-but-confirm.\n await validateAvailableDependencies(options.compilationDirectory, exampleDependencies);\n compilationDirectory = options.compilationDirectory;\n } else {\n compilationDirectory = await prepareDependencyDirectory(exampleDependencies);\n cleanCompilationDir = true;\n }\n\n const origDir = process.cwd();\n // Easiest way to get a fixed working directory (for sources) in is to chdir\n process.chdir(compilationDirectory);\n\n let result;\n try {\n result = await translateAll(snippets, this.includeCompilerDiagnostics, options?.batchSize);\n } finally {\n process.chdir(origDir);\n if (cleanCompilationDir) {\n if (options.cleanup ?? true) {\n await fs.rm(compilationDirectory, { force: true, recursive: true });\n } else {\n logging.info(`Leaving directory uncleaned: ${compilationDirectory}`);\n }\n }\n }\n\n const fingerprinted = result.translatedSnippets.map((snippet) =>\n snippet.withFingerprint(this.fingerprinter.fingerprintAll(snippet.fqnsReferenced())),\n );\n\n if (options?.addToTablet ?? true) {\n this.tablet.addSnippets(...fingerprinted);\n }\n\n return {\n translatedSnippets: fingerprinted,\n diagnostics: result.diagnostics,\n };\n }\n}\n\n/**\n * Try to find the translation for the given snippet in the given cache\n *\n * Rules for cacheability are:\n * - id is the same (== visible source didn't change)\n * - complete source is the same (== fixture didn't change)\n * - all types involved have the same fingerprint (== API surface didn't change)\n * - the versions of all translations match the versions on the available translators (== translator itself didn't change)\n *\n * For the versions check: we could have selectively picked some translations\n * from the cache while performing others. However, since the big work is in\n * parsing the TypeScript, and the rendering itself is peanutes (assumption), it\n * doesn't really make a lot of difference. So, for simplification's sake,\n * we'll regen all translations if there's at least one that's outdated.\n */\nfunction tryReadFromCache(\n sourceSnippet: TypeScriptSnippet,\n cache: LanguageTablet,\n fingerprinter: TypeFingerprinter,\n compiledOnly: boolean,\n): CacheHit {\n const fromCache = cache.tryGetSnippet(snippetKey(sourceSnippet));\n\n if (!fromCache) {\n return { type: 'miss' };\n }\n\n // infused snippets won't pass the full source check or the fingerprinter\n // but there is no reason to try to recompile it, so return cached snippet\n // if there exists one.\n if (isInfused(sourceSnippet)) {\n return { type: 'hit', snippet: fromCache, infused: true };\n }\n\n const dirtySource = completeSource(sourceSnippet) !== fromCache.snippet.fullSource;\n const dirtyTranslator = !Object.entries(TARGET_LANGUAGES).every(\n ([lang, translator]) => fromCache.snippet.translations?.[lang]?.version === translator.version,\n );\n const dirtyTypes = fingerprinter.fingerprintAll(fromCache.fqnsReferenced()) !== fromCache.snippet.fqnsFingerprint;\n const dirtyDidntCompile = compiledOnly && !fromCache.snippet.didCompile;\n\n if (dirtySource || dirtyTranslator || dirtyTypes || dirtyDidntCompile) {\n return { type: 'dirty', translation: fromCache, dirtySource, dirtyTranslator, dirtyTypes, dirtyDidntCompile };\n }\n return { type: 'hit', snippet: fromCache, infused: false };\n}\n\nexport type CacheHit =\n | { readonly type: 'miss' }\n | { readonly type: 'hit'; readonly snippet: TranslatedSnippet; readonly infused: boolean }\n | {\n readonly type: 'dirty';\n readonly translation: TranslatedSnippet;\n readonly dirtySource: boolean;\n readonly dirtyTranslator: boolean;\n readonly dirtyTypes: boolean;\n readonly dirtyDidntCompile: boolean;\n };\n\nfunction isInfused(snippet: TypeScriptSnippet) {\n return snippet.parameters?.infused !== undefined;\n}\n\nexport interface ReadFromCacheResults {\n /**\n * Successful translations\n */\n readonly translations: TranslatedSnippet[];\n\n /**\n * Successful but dirty hits\n */\n readonly remaining: TypeScriptSnippet[];\n\n /**\n * How many successfully hit translations were infused\n */\n readonly infusedCount: number;\n\n readonly dirtyCount: number;\n\n // Counts for dirtiness (a single snippet may be dirty for more than one reason)\n readonly dirtySourceCount: number;\n readonly dirtyTranslatorCount: number;\n readonly dirtyTypesCount: number;\n readonly dirtyDidntCompile: number;\n}\n\nexport interface TranslateAllOptions {\n /**\n * @default - Create a temporary directory with all necessary packages\n */\n readonly compilationDirectory?: string;\n\n /**\n * @default true\n */\n readonly addToTablet?: boolean;\n\n /**\n * @default true\n */\n readonly cleanup?: boolean;\n\n /**\n * Batch size for compiling snippets together\n *\n * @default undefined (no batching)\n */\n readonly batchSize?: number;\n}\n"]}
1
+ {"version":3,"file":"rosetta-translator.js","sourceRoot":"","sources":["../src/rosetta-translator.ts"],"names":[],"mappings":";;;AAAA,qCAAyC;AAGzC,0DAA0D;AAC1D,2CAA+C;AAC/C,qCAAqC;AACrC,uCAA8D;AAC9D,iEAKgC;AAChC,uCAA2C;AAC3C,+CAAsE;AACtE,mDAAmE;AAoCnE;;;;;GAKG;AACH,MAAa,iBAAiB;IAc5B,YAAmB,UAAoC,EAAE;QAbzD;;;;WAIG;QACa,WAAM,GAAG,IAAI,wBAAc,EAAE,CAAC;QAE9B,UAAK,GAAG,IAAI,wBAAc,EAAE,CAAC;QAO3C,IAAI,CAAC,aAAa,GAAG,IAAI,kCAAiB,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC;QACtE,IAAI,CAAC,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,IAAI,KAAK,CAAC;QAC9E,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,IAAI,KAAK,CAAC;IACxE,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,SAAS,CAAC,QAAgB;QACrC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,OAAO,CAAC,IAAI,CAAC,uBAAuB,QAAQ,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAChE,CAAC;IACH,CA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C,IAAI,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,UAAU,CAAC,OAAO,CAC/F,CAAC;IACF,MAAM,UAAU,GAAG,aAAa,CAAC,cAAc,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,KAAK,SAAS,CAAC,OAAO,CAAC,eAAe,CAAC;IAClH,MAAM,iBAAiB,GAAG,YAAY,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC;IAExE,IAAI,WAAW,IAAI,eAAe,IAAI,UAAU,IAAI,iBAAiB,EAAE,CAAC;QACtE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChH,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC7D,CAAC;AAcD,SAAS,SAAS,CAAC,OAA0B;IAC3C,OAAO,OAAO,CAAC,UAAU,EAAE,OAAO,KAAK,SAAS,CAAC;AACnD,CAAC","sourcesContent":["import { promises as fs } from 'node:fs';\nimport * as spec from '@jsii/spec';\n\nimport { TypeFingerprinter } from './jsii/fingerprinting';\nimport { TARGET_LANGUAGES } from './languages';\nimport * as logging from './logging';\nimport { TypeScriptSnippet, completeSource } from './snippet';\nimport {\n collectDependencies,\n validateAvailableDependencies,\n prepareDependencyDirectory,\n expandWithTransitiveDependencies,\n} from './snippet-dependencies';\nimport { snippetKey } from './tablets/key';\nimport { LanguageTablet, TranslatedSnippet } from './tablets/tablets';\nimport { translateAll, TranslateAllResult } from './translate_all';\n\nexport interface RosettaTranslatorOptions {\n /**\n * Assemblies to use for fingerprinting\n *\n * The set of assemblies here are used to invalidate the cache. Any types that are\n * used in snippets are looked up in this set of assemblies. If found, their type\n * information is fingerprinted and compared to the type information at the time\n * compilation of the cached sample. If different, this is considered to be a cache\n * miss.\n *\n * You must use the same set of assemblies when generating and reading the cache\n * file, otherwise the fingerprint is guaranteed to be different and the cache will\n * be useless (e.g. if you generate the cache WITH assembly information but\n * read it without, or vice versa).\n *\n * @default No assemblies.\n */\n readonly assemblies?: spec.Assembly[];\n\n /**\n * Whether to include compiler diagnostics in the compilation results.\n *\n * @default false\n */\n readonly includeCompilerDiagnostics?: boolean;\n\n /**\n * Allow reading dirty translations from cache\n *\n * @default false\n */\n readonly allowDirtyTranslations?: boolean;\n}\n\n/**\n * Entry point for consumers that want to translate code on-the-fly\n *\n * If you want to generate and translate code on-the-fly, in ways that cannot\n * be achieved by the rosetta CLI, use this class.\n */\nexport class RosettaTranslator {\n /**\n * Tablet with fresh translations\n *\n * All new translations (not read from cache) are added to this tablet.\n */\n public readonly tablet = new LanguageTablet();\n\n public readonly cache = new LanguageTablet();\n\n private readonly fingerprinter: TypeFingerprinter;\n private readonly includeCompilerDiagnostics: boolean;\n private readonly allowDirtyTranslations: boolean;\n\n public constructor(options: RosettaTranslatorOptions = {}) {\n this.fingerprinter = new TypeFingerprinter(options?.assemblies ?? []);\n this.includeCompilerDiagnostics = options.includeCompilerDiagnostics ?? false;\n this.allowDirtyTranslations = options.allowDirtyTranslations ?? false;\n }\n\n /**\n * @deprecated use `addToCache` instead\n */\n public async loadCache(fileName: string) {\n try {\n await this.cache.load(fileName);\n } catch (e: any) {\n logging.warn(`Error reading cache ${fileName}: ${e.message}`);\n }\n }\n\n public async addToCache(filename: string) {\n const tab = await LanguageTablet.fromOptionalFile(filename);\n this.cache.addTablet(tab);\n }\n\n public addTabletsToCache(...tablets: LanguageTablet[]) {\n for (const tab of tablets) {\n this.cache.addTablet(tab);\n }\n }\n\n public hasCache() {\n return this.cache.count > 0;\n }\n\n /**\n * For all the given snippets, try to read translations from the cache\n *\n * Will remove the cached snippets from the input array.\n */\n public readFromCache(snippets: TypeScriptSnippet[], addToTablet = true, compiledOnly = false): ReadFromCacheResults {\n const translations = new Array<TranslatedSnippet>();\n const remaining = new Array<TypeScriptSnippet>();\n\n let infusedCount = 0;\n let dirtyCount = 0;\n let dirtySourceCount = 0;\n let dirtyTypesCount = 0;\n let dirtyTranslatorCount = 0;\n let dirtyDidntCompile = 0;\n\n for (const snippet of snippets) {\n const fromCache = tryReadFromCache(snippet, this.cache, this.fingerprinter, compiledOnly);\n switch (fromCache.type) {\n case 'hit':\n if (addToTablet) {\n this.tablet.addSnippets(fromCache.snippet);\n }\n translations.push(fromCache.snippet);\n\n infusedCount += fromCache.infused ? 1 : 0;\n break;\n\n case 'dirty':\n dirtyCount += 1;\n dirtySourceCount += fromCache.dirtySource ? 1 : 0;\n dirtyTranslatorCount += fromCache.dirtyTranslator ? 1 : 0;\n dirtyTypesCount += fromCache.dirtyTypes ? 1 : 0;\n dirtyDidntCompile += fromCache.dirtyDidntCompile ? 1 : 0;\n\n if (this.allowDirtyTranslations) {\n translations.push(fromCache.translation);\n } else {\n remaining.push(snippet);\n }\n break;\n\n case 'miss':\n remaining.push(snippet);\n break;\n }\n }\n\n return {\n translations,\n remaining,\n infusedCount,\n dirtyCount,\n dirtySourceCount,\n dirtyTranslatorCount,\n dirtyTypesCount,\n dirtyDidntCompile,\n };\n }\n\n public async translateAll(snippets: TypeScriptSnippet[], addToTablet?: boolean): Promise<TranslateAllResult>;\n public async translateAll(snippets: TypeScriptSnippet[], options?: TranslateAllOptions): Promise<TranslateAllResult>;\n public async translateAll(\n snippets: TypeScriptSnippet[],\n optionsOrAddToTablet?: boolean | TranslateAllOptions,\n ): Promise<TranslateAllResult> {\n const options =\n optionsOrAddToTablet && typeof optionsOrAddToTablet === 'object'\n ? optionsOrAddToTablet\n : { addToTablet: optionsOrAddToTablet };\n\n const exampleDependencies = collectDependencies(snippets);\n await expandWithTransitiveDependencies(exampleDependencies);\n\n let compilationDirectory;\n let cleanCompilationDir = false;\n if (options?.compilationDirectory) {\n // If the user provided a directory, we're going to trust-but-confirm.\n await validateAvailableDependencies(options.compilationDirectory, exampleDependencies);\n compilationDirectory = options.compilationDirectory;\n } else {\n compilationDirectory = await prepareDependencyDirectory(exampleDependencies);\n cleanCompilationDir = true;\n }\n\n const origDir = process.cwd();\n // Easiest way to get a fixed working directory (for sources) in is to chdir\n process.chdir(compilationDirectory);\n\n let result;\n try {\n result = await translateAll(snippets, this.includeCompilerDiagnostics, options?.batchSize);\n } finally {\n process.chdir(origDir);\n if (cleanCompilationDir) {\n if (options.cleanup ?? true) {\n await fs.rm(compilationDirectory, { force: true, recursive: true });\n } else {\n logging.info(`Leaving directory uncleaned: ${compilationDirectory}`);\n }\n }\n }\n\n const fingerprinted = result.translatedSnippets.map((snippet) =>\n snippet.withFingerprint(this.fingerprinter.fingerprintAll(snippet.fqnsReferenced())),\n );\n\n if (process.env.DEBUG_TYPE_FINGERPRINTS) {\n this.fingerprinter.writeDebugFile(process.env.DEBUG_TYPE_FINGERPRINTS);\n }\n\n if (options?.addToTablet ?? true) {\n this.tablet.addSnippets(...fingerprinted);\n }\n\n return {\n translatedSnippets: fingerprinted,\n diagnostics: result.diagnostics,\n };\n }\n}\n\n/**\n * Try to find the translation for the given snippet in the given cache\n *\n * Rules for cacheability are:\n * - id is the same (== visible source didn't change)\n * - complete source is the same (== fixture didn't change)\n * - all types involved have the same fingerprint (== API surface didn't change)\n * - the versions of all translations match the versions on the available translators (== translator itself didn't change)\n *\n * For the versions check: we could have selectively picked some translations\n * from the cache while performing others. However, since the big work is in\n * parsing the TypeScript, and the rendering itself is peanutes (assumption), it\n * doesn't really make a lot of difference. So, for simplification's sake,\n * we'll regen all translations if there's at least one that's outdated.\n */\nfunction tryReadFromCache(\n sourceSnippet: TypeScriptSnippet,\n cache: LanguageTablet,\n fingerprinter: TypeFingerprinter,\n compiledOnly: boolean,\n): CacheHit {\n const fromCache = cache.tryGetSnippet(snippetKey(sourceSnippet));\n\n if (!fromCache) {\n return { type: 'miss' };\n }\n\n // infused snippets won't pass the full source check or the fingerprinter\n // but there is no reason to try to recompile it, so return cached snippet\n // if there exists one.\n if (isInfused(sourceSnippet)) {\n return { type: 'hit', snippet: fromCache, infused: true };\n }\n\n const dirtySource = completeSource(sourceSnippet) !== fromCache.snippet.fullSource;\n const dirtyTranslator = !Object.entries(TARGET_LANGUAGES).every(\n ([lang, translator]) => fromCache.snippet.translations?.[lang]?.version === translator.version,\n );\n const dirtyTypes = fingerprinter.fingerprintAll(fromCache.fqnsReferenced()) !== fromCache.snippet.fqnsFingerprint;\n const dirtyDidntCompile = compiledOnly && !fromCache.snippet.didCompile;\n\n if (dirtySource || dirtyTranslator || dirtyTypes || dirtyDidntCompile) {\n return { type: 'dirty', translation: fromCache, dirtySource, dirtyTranslator, dirtyTypes, dirtyDidntCompile };\n }\n return { type: 'hit', snippet: fromCache, infused: false };\n}\n\nexport type CacheHit =\n | { readonly type: 'miss' }\n | { readonly type: 'hit'; readonly snippet: TranslatedSnippet; readonly infused: boolean }\n | {\n readonly type: 'dirty';\n readonly translation: TranslatedSnippet;\n readonly dirtySource: boolean;\n readonly dirtyTranslator: boolean;\n readonly dirtyTypes: boolean;\n readonly dirtyDidntCompile: boolean;\n };\n\nfunction isInfused(snippet: TypeScriptSnippet) {\n return snippet.parameters?.infused !== undefined;\n}\n\nexport interface ReadFromCacheResults {\n /**\n * Successful translations\n */\n readonly translations: TranslatedSnippet[];\n\n /**\n * Successful but dirty hits\n */\n readonly remaining: TypeScriptSnippet[];\n\n /**\n * How many successfully hit translations were infused\n */\n readonly infusedCount: number;\n\n readonly dirtyCount: number;\n\n // Counts for dirtiness (a single snippet may be dirty for more than one reason)\n readonly dirtySourceCount: number;\n readonly dirtyTranslatorCount: number;\n readonly dirtyTypesCount: number;\n readonly dirtyDidntCompile: number;\n}\n\nexport interface TranslateAllOptions {\n /**\n * @default - Create a temporary directory with all necessary packages\n */\n readonly compilationDirectory?: string;\n\n /**\n * @default true\n */\n readonly addToTablet?: boolean;\n\n /**\n * @default true\n */\n readonly cleanup?: boolean;\n\n /**\n * Batch size for compiling snippets together\n *\n * @default undefined (no batching)\n */\n readonly batchSize?: number;\n}\n"]}
@@ -120,6 +120,11 @@ export declare class BatchSnippetTranslator {
120
120
  *
121
121
  * Reduce it down to only the information we need.
122
122
  */
123
+ export interface SnippetTimingInfo {
124
+ readonly name: string;
125
+ readonly snippetKey: string;
126
+ readonly durationMs: number;
127
+ }
123
128
  export interface RosettaDiagnostic {
124
129
  /**
125
130
  * If this is an error diagnostic or not
@@ -135,8 +140,18 @@ export interface RosettaDiagnostic {
135
140
  * Ends in a newline.
136
141
  */
137
142
  readonly formattedMessage: string;
143
+ /**
144
+ * Optional timing information for snippet translation
145
+ */
146
+ readonly timingInfo?: SnippetTimingInfo;
138
147
  }
139
148
  export declare function makeRosettaDiagnostic(isError: boolean, formattedMessage: string): RosettaDiagnostic;
149
+ export declare function makeTimingDiagnostic(snippetKey: string, name: string, durationMs: number): RosettaDiagnostic;
150
+ export declare function extractTimingInfo(diagnostics: readonly RosettaDiagnostic[]): {
151
+ timings: SnippetTimingInfo[];
152
+ diagnostics: RosettaDiagnostic[];
153
+ };
154
+ export declare function formatTimingTable(timings: SnippetTimingInfo[]): string;
140
155
  /**
141
156
  * Turn TypeScript diagnostics into Rosetta diagnostics
142
157
  */
package/lib/translate.js CHANGED
@@ -9,6 +9,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.BatchSnippetTranslator = exports.SnippetTranslator = exports.Translator = void 0;
10
10
  exports.translateTypeScript = translateTypeScript;
11
11
  exports.makeRosettaDiagnostic = makeRosettaDiagnostic;
12
+ exports.makeTimingDiagnostic = makeTimingDiagnostic;
13
+ exports.extractTimingInfo = extractTimingInfo;
14
+ exports.formatTimingTable = formatTimingTable;
12
15
  exports.rosettaDiagFromTypescript = rosettaDiagFromTypescript;
13
16
  const path = require("node:path");
14
17
  const node_util_1 = require("node:util");
@@ -21,7 +24,6 @@ const o_tree_1 = require("./o-tree");
21
24
  const renderer_1 = require("./renderer");
22
25
  const snippet_1 = require("./snippet");
23
26
  const submodule_reference_1 = require("./submodule-reference");
24
- const key_1 = require("./tablets/key");
25
27
  const schema_1 = require("./tablets/schema");
26
28
  const tablets_1 = require("./tablets/tablets");
27
29
  const syntax_kind_counter_1 = require("./typescript/syntax-kind-counter");
@@ -68,14 +70,8 @@ class Translator {
68
70
  * Translates a single snippet in its own TS context.
69
71
  */
70
72
  translate(snip, languages = Object.values(languages_1.TargetLanguage)) {
71
- const start = performance.now();
72
- logging.debug(`Translating ${(0, key_1.snippetKey)(snip)} ${(0, node_util_1.inspect)(snip.parameters ?? {})}`);
73
73
  const translator = this.translatorFor(snip);
74
74
  const translated = this.translateSnippet(snip, translator, languages);
75
- const duration = performance.now() - start;
76
- logging.debug(`Completed ${(0, key_1.snippetKey)(snip)} ${(0, node_util_1.inspect)({
77
- duration: `${(duration / 1000).toFixed(2)}s`,
78
- })}`);
79
75
  return translated;
80
76
  }
81
77
  /**
@@ -274,6 +270,49 @@ function filterVisibleDiagnostics(diags, visibleSpans) {
274
270
  function makeRosettaDiagnostic(isError, formattedMessage) {
275
271
  return { isError, formattedMessage, isFromStrictAssembly: false };
276
272
  }
273
+ function makeTimingDiagnostic(snippetKey, name, durationMs) {
274
+ return {
275
+ isError: false,
276
+ isFromStrictAssembly: false,
277
+ formattedMessage: '',
278
+ timingInfo: { snippetKey, name, durationMs },
279
+ };
280
+ }
281
+ function extractTimingInfo(diagnostics) {
282
+ const timings = [];
283
+ const regular = [];
284
+ for (const diag of diagnostics) {
285
+ if (diag.timingInfo) {
286
+ timings.push(diag.timingInfo);
287
+ }
288
+ else {
289
+ regular.push(diag);
290
+ }
291
+ }
292
+ return { timings, diagnostics: regular };
293
+ }
294
+ function formatTimingTable(timings) {
295
+ if (timings.length === 0) {
296
+ return '';
297
+ }
298
+ const totalTime = timings.reduce((sum, t) => sum + t.durationMs, 0);
299
+ const sorted = timings.sort((a, b) => b.durationMs - a.durationMs).slice(0, 10);
300
+ const lines = [
301
+ '',
302
+ '=== Top 10 Slowest Snippets ===',
303
+ 'Rank | Time (s) | % of Total | Snippet ',
304
+ '-----|----------|------------|--------------------------------',
305
+ ];
306
+ for (const [idx, timing] of sorted.entries()) {
307
+ const timeS = (timing.durationMs / 1000).toFixed(2).padStart(8);
308
+ const pct = ((timing.durationMs / totalTime) * 100).toFixed(1).padStart(9) + '%';
309
+ lines.push(`${(idx + 1).toString().padEnd(4)} | ${timeS} | ${pct} | ${timing.name}`);
310
+ }
311
+ lines.push('');
312
+ lines.push(`Total translation time: ${(totalTime / 1000).toFixed(2)}s`);
313
+ lines.push('');
314
+ return lines.join('\n');
315
+ }
277
316
  /**
278
317
  * Turn TypeScript diagnostics into Rosetta diagnostics
279
318
  */
@@ -1 +1 @@
1
- {"version":3,"file":"translate.js","sourceRoot":"","sources":["../src/translate.ts"],"names":[],"mappings":";;;;;;;;;AAyBA,kDAeC;AAkYD,sDAEC;AAKD,8DAMC;AAvbD,kCAAkC;AAClC,yCAAoC;AACpC,iCAAiC;AAEjC,2CAA+D;AAC/D,qEAAwE;AACxE,iEAAgF;AAChF,qCAAqC;AACrC,qCAAsC;AACtC,yCAAyE;AACzE,uCAAiG;AACjG,+DAAkF;AAClF,uCAA2C;AAC3C,6CAAwD;AACxD,+CAAsD;AACtD,0EAAqE;AACrE,0DAAyG;AACzG,8DAAmD;AACnD,iCAAmF;AAOnF,SAAgB,mBAAmB,CACjC,MAAY,EACZ,OAAwB,EACxB,UAAoC,EAAE;IAEtC,MAAM,UAAU,GAAG,IAAI,iBAAiB,CACtC,EAAE,aAAa,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE,EAAE,EACjG,OAAO,CACR,CAAC;IACF,MAAM,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAEnD,OAAO;QACL,WAAW,EAAE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C,QAAQ,KAAK,EAAE,CAAC,kBAAkB,CAAC,KAAK;QACtD,oBAAoB,EAAE,IAAA,wBAAiB,EAAC,IAAI,CAAC;QAC7C,gBAAgB,EAAE,EAAE,CAAC,oCAAoC,CAAC,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;KAC7E,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG;IAChB,mBAAmB;QACjB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,oBAAoB,CAAC,QAAgB;QACnC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,UAAU;QACR,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AAEF;;;GAGG;AACH,SAAS,aAAa,CAAC,CAAS;IAC9B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import * as path from 'node:path';\nimport { inspect } from 'node:util';\nimport * as ts from 'typescript';\n\nimport { TARGET_LANGUAGES, TargetLanguage } from './languages';\nimport { RecordReferencesVisitor } from './languages/record-references';\nimport { supportsTransitiveSubmoduleAccess } from './languages/target-language';\nimport * as logging from './logging';\nimport { renderTree } from './o-tree';\nimport { AstRenderer, AstHandler, AstRendererOptions } from './renderer';\nimport { TypeScriptSnippet, completeSource, SnippetParameters, formatLocation } from './snippet';\nimport { SubmoduleReference, SubmoduleReferenceMap } from './submodule-reference';\nimport { snippetKey } from './tablets/key';\nimport { ORIGINAL_SNIPPET_KEY } from './tablets/schema';\nimport { TranslatedSnippet } from './tablets/tablets';\nimport { SyntaxKindCounter } from './typescript/syntax-kind-counter';\nimport { TypeScriptCompiler, CompilationResult, BatchCompilationResult } from './typescript/ts-compiler';\nimport { Spans } from './typescript/visible-spans';\nimport { annotateStrictDiagnostic, File, hasStrictBranding, mkDict } from './util';\n\nexport interface TranslateResult {\n translation: string;\n diagnostics: readonly RosettaDiagnostic[];\n}\n\nexport function translateTypeScript(\n source: File,\n visitor: AstHandler<any>,\n options: SnippetTranslatorOptions = {},\n): TranslateResult {\n const translator = new SnippetTranslator(\n { visibleSource: source.contents, location: { api: { api: 'file', fileName: source.fileName } } },\n options,\n );\n const translated = translator.renderUsing(visitor);\n\n return {\n translation: translated,\n diagnostics: translator.diagnostics.map(rosettaDiagFromTypescript),\n };\n}\n\n/**\n * Translate one or more TypeScript snippets into other languages\n *\n * Can be configured to fully typecheck the samples, or perform only syntactical\n * translation.\n */\nexport class Translator {\n private readonly compiler = new TypeScriptCompiler();\n #diagnostics: ts.Diagnostic[] = [];\n\n public get diagnostics(): readonly RosettaDiagnostic[] {\n return ts.sortAndDeduplicateDiagnostics(this.#diagnostics).map(rosettaDiagFromTypescript);\n }\n\n public constructor(private readonly includeCompilerDiagnostics: boolean) {}\n\n /**\n * Return the snippet translator for the given snippet\n *\n * We used to cache these, but each translator holds on to quite a bit of memory,\n * so we don't do that anymore.\n */\n public translatorFor(snippet: TypeScriptSnippet) {\n const translator = new SnippetTranslator(snippet, {\n compiler: this.compiler,\n includeCompilerDiagnostics: this.includeCompilerDiagnostics,\n });\n return translator;\n }\n\n /**\n * Translates a single snippet in its own TS context.\n */\n public translate(snip: TypeScriptSnippet, languages: readonly TargetLanguage[] = Object.values(TargetLanguage)) {\n const start = performance.now();\n logging.debug(`Translating ${snippetKey(snip)} ${inspect(snip.parameters ?? {})}`);\n\n const translator = this.translatorFor(snip);\n const translated = this.translateSnippet(snip, translator, languages);\n\n const duration = performance.now() - start;\n logging.debug(\n `Completed ${snippetKey(snip)} ${inspect({\n duration: `${(duration / 1000).toFixed(2)}s`,\n })}`,\n );\n\n return translated;\n }\n\n /**\n * Translates a batch of snippets, using a shared TS context.\n */\n public translateSnippets(\n snippets: TypeScriptSnippet[],\n languages: readonly TargetLanguage[] = Object.values(TargetLanguage),\n ): TranslatedSnippet[] {\n const start = performance.now();\n logging.debug(`Translating batch of ${snippets.length} snippets`);\n\n const res = this.translateBatch(snippets, languages);\n\n const duration = performance.now() - start;\n logging.debug(\n `Completed batch ${inspect({\n duration: `${(duration / 1000).toFixed(2)}s`,\n })}`,\n );\n\n return res;\n }\n\n private translateBatch(\n snippets: TypeScriptSnippet[],\n languages: readonly TargetLanguage[] = Object.values(TargetLanguage),\n ): TranslatedSnippet[] {\n const translatedSnippets: TranslatedSnippet[] = [];\n\n const batchTranslator = new BatchSnippetTranslator(snippets, {\n compiler: this.compiler,\n includeCompilerDiagnostics: this.includeCompilerDiagnostics,\n });\n\n for (const [snippet, translator] of batchTranslator) {\n translatedSnippets.push(this.translateSnippet(snippet, translator, languages));\n }\n\n return translatedSnippets;\n }\n\n private translateSnippet(\n snippet: TypeScriptSnippet,\n translator: ISnippetTranslator,\n languages: readonly TargetLanguage[],\n ): TranslatedSnippet {\n const translations = mkDict(\n languages.flatMap((lang, idx, array) => {\n if (array.slice(0, idx).includes(lang)) {\n return [];\n }\n const languageConverterFactory = TARGET_LANGUAGES[lang];\n const translated = translator.renderUsing(languageConverterFactory.createVisitor());\n return [[lang, { source: translated, version: languageConverterFactory.version }] as const];\n }),\n );\n\n if (snippet.parameters?.infused === undefined) {\n this.#diagnostics.push(...translator.diagnostics);\n }\n\n return TranslatedSnippet.fromSchema({\n translations: {\n ...translations,\n [ORIGINAL_SNIPPET_KEY]: { source: snippet.visibleSource, version: '0' },\n },\n location: snippet.location,\n didCompile: translator.didSuccessfullyCompile,\n fqnsReferenced: translator.fqnsReferenced(),\n fullSource: completeSource(snippet),\n syntaxKindCounter: translator.syntaxKindCounter(),\n });\n }\n}\n\nexport interface ISnippetTranslator {\n readonly diagnostics: readonly ts.Diagnostic[];\n readonly didSuccessfullyCompile: boolean | undefined;\n\n renderUsing(visitor: AstHandler<any>): string;\n syntaxKindCounter(): Partial<Record<ts.SyntaxKind, number>>;\n fqnsReferenced(): string[];\n}\n\nexport interface SnippetTranslatorOptions extends AstRendererOptions {\n /**\n * Re-use the given compiler if given\n */\n readonly compiler?: TypeScriptCompiler;\n\n /**\n * Include compiler errors in return diagnostics\n *\n * If false, only translation diagnostics will be returned.\n *\n * @default false\n */\n readonly includeCompilerDiagnostics?: boolean;\n}\n\n/**\n * Internal implementation of a single TypeScript snippet translator.\n *\n * Consumers should either use `SnippetTranslator` or `BatchSnippetTranslator`.\n */\nclass InternalSnippetTranslator implements ISnippetTranslator {\n public readonly translateDiagnostics: ts.Diagnostic[] = [];\n public readonly compileDiagnostics: ts.Diagnostic[] = [];\n\n private readonly visibleSpans: Spans;\n private readonly tryCompile: boolean;\n private readonly submoduleReferences: SubmoduleReferenceMap;\n\n public constructor(\n snippet: TypeScriptSnippet,\n private readonly compilation: CompilationResult,\n private readonly options: SnippetTranslatorOptions,\n ) {\n // Respect '/// !hide' and '/// !show' directives\n // Use the actual compiled source text to ensure spans match the AST\n this.visibleSpans = Spans.visibleSpansFromSource(compilation.rootFile.text);\n\n // Find submodule references on explicit imports\n this.submoduleReferences = SubmoduleReference.inSourceFile(\n compilation.rootFile,\n this.compilation.program.getTypeChecker(),\n );\n\n // This makes it about 5x slower, so only do it on demand\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n this.tryCompile = (this.options.includeCompilerDiagnostics || snippet.strict) ?? false;\n if (this.tryCompile) {\n const program = this.compilation.program;\n const diagnostics = [\n ...neverThrowing(program.getGlobalDiagnostics)(),\n ...neverThrowing(program.getSyntacticDiagnostics)(this.compilation.rootFile),\n ...neverThrowing(program.getDeclarationDiagnostics)(this.compilation.rootFile),\n ...neverThrowing(program.getSemanticDiagnostics)(this.compilation.rootFile),\n ];\n\n if (snippet.strict) {\n // In a strict assembly, so we'll need to brand all diagnostics here...\n for (const diag of diagnostics) {\n annotateStrictDiagnostic(diag);\n }\n }\n this.compileDiagnostics.push(...diagnostics);\n }\n }\n\n /**\n * Returns a boolean if compilation was attempted, and undefined if it was not.\n */\n public get didSuccessfullyCompile() {\n return this.tryCompile ? this.compileDiagnostics.length === 0 : undefined;\n }\n\n public renderUsing(visitor: AstHandler<any>) {\n const converter = new AstRenderer(\n this.compilation.rootFile,\n this.compilation.program.getTypeChecker(),\n visitor,\n this.options,\n // If we support transitive submodule access, don't provide a submodule reference map.\n supportsTransitiveSubmoduleAccess(visitor.language) ? undefined : this.submoduleReferences,\n );\n const converted = converter.convert(this.compilation.rootFile);\n this.translateDiagnostics.push(...filterVisibleDiagnostics(converter.diagnostics, this.visibleSpans));\n return renderTree(converted, { indentChar: visitor.indentChar, visibleSpans: this.visibleSpans });\n }\n\n public syntaxKindCounter(): Partial<Record<ts.SyntaxKind, number>> {\n const kindCounter = new SyntaxKindCounter(this.visibleSpans);\n return kindCounter.countKinds(this.compilation.rootFile);\n }\n\n public fqnsReferenced() {\n const visitor = new RecordReferencesVisitor(this.visibleSpans);\n const converter = new AstRenderer(\n this.compilation.rootFile,\n this.compilation.program.getTypeChecker(),\n visitor,\n this.options,\n this.submoduleReferences,\n );\n converter.convert(this.compilation.rootFile);\n return visitor.fqnsReferenced();\n }\n\n public get diagnostics(): readonly ts.Diagnostic[] {\n return ts.sortAndDeduplicateDiagnostics(this.compileDiagnostics.concat(this.translateDiagnostics));\n }\n}\n\n/**\n * Translate a single TypeScript snippet\n */\nexport class SnippetTranslator extends InternalSnippetTranslator {\n public constructor(snippet: TypeScriptSnippet, options: SnippetTranslatorOptions = {}) {\n const compiler = options.compiler ?? new TypeScriptCompiler();\n const source = completeSource(snippet);\n const fakeCurrentDirectory = snippet.parameters?.[SnippetParameters.$COMPILATION_DIRECTORY] ?? process.cwd();\n const compilation = compiler.compileBatchInMemory(\n [\n {\n filename: removeSlashes(formatLocation(snippet.location)),\n contents: source,\n },\n ],\n fakeCurrentDirectory,\n );\n\n super(\n snippet,\n {\n program: compilation.program,\n rootFile: compilation.rootFiles[0],\n },\n options,\n );\n }\n}\n\nexport interface BatchSnippetTranslatorOptions extends SnippetTranslatorOptions {\n /**\n * What directory to pretend the file is in (system parameter)\n *\n * Attached when compiling a literate file, as they compile in\n * the location where they are stored.\n *\n * @default - current working directory\n */\n readonly compilationDirectory?: string;\n}\n\n/**\n * Translate a single TypeScript snippet\n */\nexport class BatchSnippetTranslator {\n private readonly compilation: BatchCompilationResult;\n\n public constructor(\n private readonly snippets: TypeScriptSnippet[],\n private readonly options: BatchSnippetTranslatorOptions = {},\n ) {\n const compiler = options.compiler ?? new TypeScriptCompiler();\n const workingDir = options.compilationDirectory ?? process.cwd();\n\n const sources = snippets.map((snippet) => {\n const snippetLoc = snippet.parameters?.[SnippetParameters.$COMPILATION_DIRECTORY];\n const filename = removeSlashes(formatLocation(snippet.location));\n\n return {\n filename: snippetLoc ? path.relative(workingDir, path.join(snippetLoc, filename)) : filename,\n contents: completeSource(snippet),\n };\n });\n this.compilation = compiler.compileBatchInMemory(sources, workingDir);\n }\n\n *[Symbol.iterator](): Generator<[TypeScriptSnippet, ISnippetTranslator], void, unknown> {\n for (const [idx, snippet] of this.snippets.entries()) {\n const rootFile = this.compilation.rootFiles[idx];\n\n const translator: ISnippetTranslator = new InternalSnippetTranslator(\n snippet,\n {\n program: this.compilation.program,\n rootFile,\n },\n this.options,\n );\n\n yield [snippet, translator];\n }\n }\n}\n\n/**\n * Intercepts all exceptions thrown by the wrapped call, and logs them to\n * console.error instead of re-throwing, then returns an empty array. This\n * is here to avoid compiler crashes due to broken code examples that cause\n * the TypeScript compiler to hit a \"Debug Failure\".\n */\nfunction neverThrowing<A extends unknown[], R>(call: (...args: A) => readonly R[]): (...args: A) => readonly R[] {\n return (...args: A) => {\n try {\n return call(...args);\n } catch (err: any) {\n const isExpectedTypescriptError = err.message.includes('Debug Failure');\n\n if (!isExpectedTypescriptError) {\n console.error(`Failed to execute ${call.name}: ${err}`);\n }\n\n return [];\n }\n };\n}\n\n/**\n * Hide diagnostics that are rosetta-sourced if they are reported against a non-visible span\n */\nfunction filterVisibleDiagnostics(diags: readonly ts.Diagnostic[], visibleSpans: Spans): ts.Diagnostic[] {\n return diags.filter((d) => d.source !== 'rosetta' || d.start === undefined || visibleSpans.containsPosition(d.start));\n}\n\n/**\n * A translation of a TypeScript diagnostic into a data-only representation for Rosetta\n *\n * We cannot use the original `ts.Diagnostic` since it holds on to way too much\n * state (the source file and by extension the entire parse tree), which grows\n * too big to be properly serialized by a worker and also takes too much memory.\n *\n * Reduce it down to only the information we need.\n */\nexport interface RosettaDiagnostic {\n /**\n * If this is an error diagnostic or not\n */\n readonly isError: boolean;\n\n /**\n * If the diagnostic was emitted from an assembly that has its 'strict' flag set\n */\n readonly isFromStrictAssembly: boolean;\n\n /**\n * The formatted message, ready to be printed (will have colors and newlines in it)\n *\n * Ends in a newline.\n */\n readonly formattedMessage: string;\n}\n\nexport function makeRosettaDiagnostic(isError: boolean, formattedMessage: string): RosettaDiagnostic {\n return { isError, formattedMessage, isFromStrictAssembly: false };\n}\n\n/**\n * Turn TypeScript diagnostics into Rosetta diagnostics\n */\nexport function rosettaDiagFromTypescript(diag: ts.Diagnostic): RosettaDiagnostic {\n return {\n isError: diag.category === ts.DiagnosticCategory.Error,\n isFromStrictAssembly: hasStrictBranding(diag),\n formattedMessage: ts.formatDiagnosticsWithColorAndContext([diag], DIAG_HOST),\n };\n}\n\nconst DIAG_HOST = {\n getCurrentDirectory() {\n return '.';\n },\n getCanonicalFileName(fileName: string) {\n return fileName;\n },\n getNewLine() {\n return '\\n';\n },\n};\n\n/**\n * Remove slashes from a \"where\" description, as the TS compiler will interpret it as a directory\n * and we can't have that for compiling literate files\n */\nfunction removeSlashes(x: string) {\n return x.replace(/\\/|\\\\/g, '.');\n}\n"]}
1
+ {"version":3,"file":"translate.js","sourceRoot":"","sources":["../src/translate.ts"],"names":[],"mappings":";;;;;;;;;AAwBA,kDAeC;AAkYD,sDAEC;AAED,oDAOC;AAED,8CAgBC;AAED,8CA0BC;AAKD,8DAMC;AA7eD,kCAAkC;AAClC,yCAAoC;AACpC,iCAAiC;AAEjC,2CAA+D;AAC/D,qEAAwE;AACxE,iEAAgF;AAChF,qCAAqC;AACrC,qCAAsC;AACtC,yCAAyE;AACzE,uCAAiG;AACjG,+DAAkF;AAClF,6CAAwD;AACxD,+CAA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a,CAAC,CAAS;IAC9B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import * as path from 'node:path';\nimport { inspect } from 'node:util';\nimport * as ts from 'typescript';\n\nimport { TARGET_LANGUAGES, TargetLanguage } from './languages';\nimport { RecordReferencesVisitor } from './languages/record-references';\nimport { supportsTransitiveSubmoduleAccess } from './languages/target-language';\nimport * as logging from './logging';\nimport { renderTree } from './o-tree';\nimport { AstRenderer, AstHandler, AstRendererOptions } from './renderer';\nimport { TypeScriptSnippet, completeSource, SnippetParameters, formatLocation } from './snippet';\nimport { SubmoduleReference, SubmoduleReferenceMap } from './submodule-reference';\nimport { ORIGINAL_SNIPPET_KEY } from './tablets/schema';\nimport { TranslatedSnippet } from './tablets/tablets';\nimport { SyntaxKindCounter } from './typescript/syntax-kind-counter';\nimport { TypeScriptCompiler, CompilationResult, BatchCompilationResult } from './typescript/ts-compiler';\nimport { Spans } from './typescript/visible-spans';\nimport { annotateStrictDiagnostic, File, hasStrictBranding, mkDict } from './util';\n\nexport interface TranslateResult {\n translation: string;\n diagnostics: readonly RosettaDiagnostic[];\n}\n\nexport function translateTypeScript(\n source: File,\n visitor: AstHandler<any>,\n options: SnippetTranslatorOptions = {},\n): TranslateResult {\n const translator = new SnippetTranslator(\n { visibleSource: source.contents, location: { api: { api: 'file', fileName: source.fileName } } },\n options,\n );\n const translated = translator.renderUsing(visitor);\n\n return {\n translation: translated,\n diagnostics: translator.diagnostics.map(rosettaDiagFromTypescript),\n };\n}\n\n/**\n * Translate one or more TypeScript snippets into other languages\n *\n * Can be configured to fully typecheck the samples, or perform only syntactical\n * translation.\n */\nexport class Translator {\n private readonly compiler = new TypeScriptCompiler();\n #diagnostics: ts.Diagnostic[] = [];\n\n public get diagnostics(): readonly RosettaDiagnostic[] {\n return ts.sortAndDeduplicateDiagnostics(this.#diagnostics).map(rosettaDiagFromTypescript);\n }\n\n public constructor(private readonly includeCompilerDiagnostics: boolean) {}\n\n /**\n * Return the snippet translator for the given snippet\n *\n * We used to cache these, but each translator holds on to quite a bit of memory,\n * so we don't do that anymore.\n */\n public translatorFor(snippet: TypeScriptSnippet) {\n const translator = new SnippetTranslator(snippet, {\n compiler: this.compiler,\n includeCompilerDiagnostics: this.includeCompilerDiagnostics,\n });\n return translator;\n }\n\n /**\n * Translates a single snippet in its own TS context.\n */\n public translate(snip: TypeScriptSnippet, languages: readonly TargetLanguage[] = Object.values(TargetLanguage)) {\n const translator = this.translatorFor(snip);\n const translated = this.translateSnippet(snip, translator, languages);\n return translated;\n }\n\n /**\n * Translates a batch of snippets, using a shared TS context.\n */\n public translateSnippets(\n snippets: TypeScriptSnippet[],\n languages: readonly TargetLanguage[] = Object.values(TargetLanguage),\n ): TranslatedSnippet[] {\n const start = performance.now();\n logging.debug(`Translating batch of ${snippets.length} snippets`);\n\n const res = this.translateBatch(snippets, languages);\n\n const duration = performance.now() - start;\n logging.debug(\n `Completed batch ${inspect({\n duration: `${(duration / 1000).toFixed(2)}s`,\n })}`,\n );\n\n return res;\n }\n\n private translateBatch(\n snippets: TypeScriptSnippet[],\n languages: readonly TargetLanguage[] = Object.values(TargetLanguage),\n ): TranslatedSnippet[] {\n const translatedSnippets: TranslatedSnippet[] = [];\n\n const batchTranslator = new BatchSnippetTranslator(snippets, {\n compiler: this.compiler,\n includeCompilerDiagnostics: this.includeCompilerDiagnostics,\n });\n\n for (const [snippet, translator] of batchTranslator) {\n translatedSnippets.push(this.translateSnippet(snippet, translator, languages));\n }\n\n return translatedSnippets;\n }\n\n private translateSnippet(\n snippet: TypeScriptSnippet,\n translator: ISnippetTranslator,\n languages: readonly TargetLanguage[],\n ): TranslatedSnippet {\n const translations = mkDict(\n languages.flatMap((lang, idx, array) => {\n if (array.slice(0, idx).includes(lang)) {\n return [];\n }\n const languageConverterFactory = TARGET_LANGUAGES[lang];\n const translated = translator.renderUsing(languageConverterFactory.createVisitor());\n return [[lang, { source: translated, version: languageConverterFactory.version }] as const];\n }),\n );\n\n if (snippet.parameters?.infused === undefined) {\n this.#diagnostics.push(...translator.diagnostics);\n }\n\n return TranslatedSnippet.fromSchema({\n translations: {\n ...translations,\n [ORIGINAL_SNIPPET_KEY]: { source: snippet.visibleSource, version: '0' },\n },\n location: snippet.location,\n didCompile: translator.didSuccessfullyCompile,\n fqnsReferenced: translator.fqnsReferenced(),\n fullSource: completeSource(snippet),\n syntaxKindCounter: translator.syntaxKindCounter(),\n });\n }\n}\n\nexport interface ISnippetTranslator {\n readonly diagnostics: readonly ts.Diagnostic[];\n readonly didSuccessfullyCompile: boolean | undefined;\n\n renderUsing(visitor: AstHandler<any>): string;\n syntaxKindCounter(): Partial<Record<ts.SyntaxKind, number>>;\n fqnsReferenced(): string[];\n}\n\nexport interface SnippetTranslatorOptions extends AstRendererOptions {\n /**\n * Re-use the given compiler if given\n */\n readonly compiler?: TypeScriptCompiler;\n\n /**\n * Include compiler errors in return diagnostics\n *\n * If false, only translation diagnostics will be returned.\n *\n * @default false\n */\n readonly includeCompilerDiagnostics?: boolean;\n}\n\n/**\n * Internal implementation of a single TypeScript snippet translator.\n *\n * Consumers should either use `SnippetTranslator` or `BatchSnippetTranslator`.\n */\nclass InternalSnippetTranslator implements ISnippetTranslator {\n public readonly translateDiagnostics: ts.Diagnostic[] = [];\n public readonly compileDiagnostics: ts.Diagnostic[] = [];\n\n private readonly visibleSpans: Spans;\n private readonly tryCompile: boolean;\n private readonly submoduleReferences: SubmoduleReferenceMap;\n\n public constructor(\n snippet: TypeScriptSnippet,\n private readonly compilation: CompilationResult,\n private readonly options: SnippetTranslatorOptions,\n ) {\n // Respect '/// !hide' and '/// !show' directives\n // Use the actual compiled source text to ensure spans match the AST\n this.visibleSpans = Spans.visibleSpansFromSource(compilation.rootFile.text);\n\n // Find submodule references on explicit imports\n this.submoduleReferences = SubmoduleReference.inSourceFile(\n compilation.rootFile,\n this.compilation.program.getTypeChecker(),\n );\n\n // This makes it about 5x slower, so only do it on demand\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n this.tryCompile = (this.options.includeCompilerDiagnostics || snippet.strict) ?? false;\n if (this.tryCompile) {\n const program = this.compilation.program;\n const diagnostics = [\n ...neverThrowing(program.getGlobalDiagnostics)(),\n ...neverThrowing(program.getSyntacticDiagnostics)(this.compilation.rootFile),\n ...neverThrowing(program.getDeclarationDiagnostics)(this.compilation.rootFile),\n ...neverThrowing(program.getSemanticDiagnostics)(this.compilation.rootFile),\n ];\n\n if (snippet.strict) {\n // In a strict assembly, so we'll need to brand all diagnostics here...\n for (const diag of diagnostics) {\n annotateStrictDiagnostic(diag);\n }\n }\n this.compileDiagnostics.push(...diagnostics);\n }\n }\n\n /**\n * Returns a boolean if compilation was attempted, and undefined if it was not.\n */\n public get didSuccessfullyCompile() {\n return this.tryCompile ? this.compileDiagnostics.length === 0 : undefined;\n }\n\n public renderUsing(visitor: AstHandler<any>) {\n const converter = new AstRenderer(\n this.compilation.rootFile,\n this.compilation.program.getTypeChecker(),\n visitor,\n this.options,\n // If we support transitive submodule access, don't provide a submodule reference map.\n supportsTransitiveSubmoduleAccess(visitor.language) ? undefined : this.submoduleReferences,\n );\n const converted = converter.convert(this.compilation.rootFile);\n this.translateDiagnostics.push(...filterVisibleDiagnostics(converter.diagnostics, this.visibleSpans));\n return renderTree(converted, { indentChar: visitor.indentChar, visibleSpans: this.visibleSpans });\n }\n\n public syntaxKindCounter(): Partial<Record<ts.SyntaxKind, number>> {\n const kindCounter = new SyntaxKindCounter(this.visibleSpans);\n return kindCounter.countKinds(this.compilation.rootFile);\n }\n\n public fqnsReferenced() {\n const visitor = new RecordReferencesVisitor(this.visibleSpans);\n const converter = new AstRenderer(\n this.compilation.rootFile,\n this.compilation.program.getTypeChecker(),\n visitor,\n this.options,\n this.submoduleReferences,\n );\n converter.convert(this.compilation.rootFile);\n return visitor.fqnsReferenced();\n }\n\n public get diagnostics(): readonly ts.Diagnostic[] {\n return ts.sortAndDeduplicateDiagnostics(this.compileDiagnostics.concat(this.translateDiagnostics));\n }\n}\n\n/**\n * Translate a single TypeScript snippet\n */\nexport class SnippetTranslator extends InternalSnippetTranslator {\n public constructor(snippet: TypeScriptSnippet, options: SnippetTranslatorOptions = {}) {\n const compiler = options.compiler ?? new TypeScriptCompiler();\n const source = completeSource(snippet);\n const fakeCurrentDirectory = snippet.parameters?.[SnippetParameters.$COMPILATION_DIRECTORY] ?? process.cwd();\n const compilation = compiler.compileBatchInMemory(\n [\n {\n filename: removeSlashes(formatLocation(snippet.location)),\n contents: source,\n },\n ],\n fakeCurrentDirectory,\n );\n\n super(\n snippet,\n {\n program: compilation.program,\n rootFile: compilation.rootFiles[0],\n },\n options,\n );\n }\n}\n\nexport interface BatchSnippetTranslatorOptions extends SnippetTranslatorOptions {\n /**\n * What directory to pretend the file is in (system parameter)\n *\n * Attached when compiling a literate file, as they compile in\n * the location where they are stored.\n *\n * @default - current working directory\n */\n readonly compilationDirectory?: string;\n}\n\n/**\n * Translate a single TypeScript snippet\n */\nexport class BatchSnippetTranslator {\n private readonly compilation: BatchCompilationResult;\n\n public constructor(\n private readonly snippets: TypeScriptSnippet[],\n private readonly options: BatchSnippetTranslatorOptions = {},\n ) {\n const compiler = options.compiler ?? new TypeScriptCompiler();\n const workingDir = options.compilationDirectory ?? process.cwd();\n\n const sources = snippets.map((snippet) => {\n const snippetLoc = snippet.parameters?.[SnippetParameters.$COMPILATION_DIRECTORY];\n const filename = removeSlashes(formatLocation(snippet.location));\n\n return {\n filename: snippetLoc ? path.relative(workingDir, path.join(snippetLoc, filename)) : filename,\n contents: completeSource(snippet),\n };\n });\n this.compilation = compiler.compileBatchInMemory(sources, workingDir);\n }\n\n *[Symbol.iterator](): Generator<[TypeScriptSnippet, ISnippetTranslator], void, unknown> {\n for (const [idx, snippet] of this.snippets.entries()) {\n const rootFile = this.compilation.rootFiles[idx];\n\n const translator: ISnippetTranslator = new InternalSnippetTranslator(\n snippet,\n {\n program: this.compilation.program,\n rootFile,\n },\n this.options,\n );\n\n yield [snippet, translator];\n }\n }\n}\n\n/**\n * Intercepts all exceptions thrown by the wrapped call, and logs them to\n * console.error instead of re-throwing, then returns an empty array. This\n * is here to avoid compiler crashes due to broken code examples that cause\n * the TypeScript compiler to hit a \"Debug Failure\".\n */\nfunction neverThrowing<A extends unknown[], R>(call: (...args: A) => readonly R[]): (...args: A) => readonly R[] {\n return (...args: A) => {\n try {\n return call(...args);\n } catch (err: any) {\n const isExpectedTypescriptError = err.message.includes('Debug Failure');\n\n if (!isExpectedTypescriptError) {\n console.error(`Failed to execute ${call.name}: ${err}`);\n }\n\n return [];\n }\n };\n}\n\n/**\n * Hide diagnostics that are rosetta-sourced if they are reported against a non-visible span\n */\nfunction filterVisibleDiagnostics(diags: readonly ts.Diagnostic[], visibleSpans: Spans): ts.Diagnostic[] {\n return diags.filter((d) => d.source !== 'rosetta' || d.start === undefined || visibleSpans.containsPosition(d.start));\n}\n\n/**\n * A translation of a TypeScript diagnostic into a data-only representation for Rosetta\n *\n * We cannot use the original `ts.Diagnostic` since it holds on to way too much\n * state (the source file and by extension the entire parse tree), which grows\n * too big to be properly serialized by a worker and also takes too much memory.\n *\n * Reduce it down to only the information we need.\n */\nexport interface SnippetTimingInfo {\n readonly name: string;\n readonly snippetKey: string;\n readonly durationMs: number;\n}\n\nexport interface RosettaDiagnostic {\n /**\n * If this is an error diagnostic or not\n */\n readonly isError: boolean;\n\n /**\n * If the diagnostic was emitted from an assembly that has its 'strict' flag set\n */\n readonly isFromStrictAssembly: boolean;\n\n /**\n * The formatted message, ready to be printed (will have colors and newlines in it)\n *\n * Ends in a newline.\n */\n readonly formattedMessage: string;\n\n /**\n * Optional timing information for snippet translation\n */\n readonly timingInfo?: SnippetTimingInfo;\n}\n\nexport function makeRosettaDiagnostic(isError: boolean, formattedMessage: string): RosettaDiagnostic {\n return { isError, formattedMessage, isFromStrictAssembly: false };\n}\n\nexport function makeTimingDiagnostic(snippetKey: string, name: string, durationMs: number): RosettaDiagnostic {\n return {\n isError: false,\n isFromStrictAssembly: false,\n formattedMessage: '',\n timingInfo: { snippetKey, name, durationMs },\n };\n}\n\nexport function extractTimingInfo(diagnostics: readonly RosettaDiagnostic[]): {\n timings: SnippetTimingInfo[];\n diagnostics: RosettaDiagnostic[];\n} {\n const timings: SnippetTimingInfo[] = [];\n const regular: RosettaDiagnostic[] = [];\n\n for (const diag of diagnostics) {\n if (diag.timingInfo) {\n timings.push(diag.timingInfo);\n } else {\n regular.push(diag);\n }\n }\n\n return { timings, diagnostics: regular };\n}\n\nexport function formatTimingTable(timings: SnippetTimingInfo[]): string {\n if (timings.length === 0) {\n return '';\n }\n\n const totalTime = timings.reduce((sum, t) => sum + t.durationMs, 0);\n const sorted = timings.sort((a, b) => b.durationMs - a.durationMs).slice(0, 10);\n\n const lines = [\n '',\n '=== Top 10 Slowest Snippets ===',\n 'Rank | Time (s) | % of Total | Snippet ',\n '-----|----------|------------|--------------------------------',\n ];\n\n for (const [idx, timing] of sorted.entries()) {\n const timeS = (timing.durationMs / 1000).toFixed(2).padStart(8);\n const pct = ((timing.durationMs / totalTime) * 100).toFixed(1).padStart(9) + '%';\n lines.push(`${(idx + 1).toString().padEnd(4)} | ${timeS} | ${pct} | ${timing.name}`);\n }\n\n lines.push('');\n lines.push(`Total translation time: ${(totalTime / 1000).toFixed(2)}s`);\n lines.push('');\n\n return lines.join('\\n');\n}\n\n/**\n * Turn TypeScript diagnostics into Rosetta diagnostics\n */\nexport function rosettaDiagFromTypescript(diag: ts.Diagnostic): RosettaDiagnostic {\n return {\n isError: diag.category === ts.DiagnosticCategory.Error,\n isFromStrictAssembly: hasStrictBranding(diag),\n formattedMessage: ts.formatDiagnosticsWithColorAndContext([diag], DIAG_HOST),\n };\n}\n\nconst DIAG_HOST = {\n getCurrentDirectory() {\n return '.';\n },\n getCanonicalFileName(fileName: string) {\n return fileName;\n },\n getNewLine() {\n return '\\n';\n },\n};\n\n/**\n * Remove slashes from a \"where\" description, as the TS compiler will interpret it as a directory\n * and we can't have that for compiling literate files\n */\nfunction removeSlashes(x: string) {\n return x.replace(/\\/|\\\\/g, '.');\n}\n"]}
@@ -6,6 +6,7 @@ const path = require("node:path");
6
6
  const workerpool = require("workerpool");
7
7
  const logging = require("./logging");
8
8
  const tablets_1 = require("./tablets/tablets");
9
+ const translate_1 = require("./translate");
9
10
  /**
10
11
  * Divide the work evenly over all processors by running 'translate_all_worker' in Worker Threads, then combine results
11
12
  *
@@ -34,13 +35,20 @@ async function translateAll(snippets, includeCompilerDiagnostics, batchSize) {
34
35
  const shouldBatchCompilation = batchSize != null;
35
36
  const requests = batchSnippets(snippetArr, includeCompilerDiagnostics, batchSize, shouldBatchCompilation);
36
37
  const responses = await Promise.all(requests.map((request) => pool.exec('translateBatch', [request])));
37
- const diagnostics = new Array();
38
+ const allDiagnostics = new Array();
38
39
  const translatedSnippets = new Array();
39
40
  // Combine results
40
41
  for (const response of responses) {
41
- diagnostics.push(...response.diagnostics);
42
+ allDiagnostics.push(...response.diagnostics);
42
43
  translatedSnippets.push(...response.translatedSchemas.map(tablets_1.TranslatedSnippet.fromSchema));
43
44
  }
45
+ // Extract and display timing info if enabled
46
+ const { timings, diagnostics } = (0, translate_1.extractTimingInfo)(allDiagnostics);
47
+ if (process.env.TIMING === '1' && timings.length > 0) {
48
+ const table = (0, translate_1.formatTimingTable)(timings);
49
+ // emitted as warn so that it's always shown
50
+ logging.warn(table);
51
+ }
44
52
  return { diagnostics, translatedSnippets };
45
53
  }
46
54
  finally {
@@ -1 +1 @@
1
- {"version":3,"file":"translate_all.js","sourceRoot":"","sources":["../src/translate_all.ts"],"names":[],"mappings":";;AAoBA,oCAyCC;AA7DD,8BAA8B;AAC9B,kCAAkC;AAClC,yCAAyC;AAEzC,qCAAqC;AAErC,+CAAsD;AAItD;;;;;;;;;GASG;AACI,KAAK,UAAU,YAAY,CAChC,QAA6B,EAC7B,0BAAmC,EACnC,SAAkB;IAElB,6EAA6E;IAC7E,6EAA6E;IAC7E,qDAAqD;IACrD,2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,IAAI,SAAS,EAAE,CAAC;YACjC,WAAW,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;YAC1C,kBAAkB,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,iBAAiB,CAAC,GAAG,CAAC,2BAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;QAC3F,CAAC;QACD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAC7C,CAAC;YAAS,CAAC;QACT,yBAAyB;QACzB,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC;IACxB,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CACpB,QAA6B,EAC7B,0BAAmC,EACnC,SAAS,GAAG,EAAE,EACd,yBAAkC,KAAK;IAEvC,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IACnC,MAAM,GAAG,GAA4B,EAAE,CAAC;IAExC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC;QACpD,0EAA0E;QAC1E,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACtE,GAAG,CAAC,IAAI,CAAC;YACP,UAAU,EAAE,UAAU,QAAQ,EAAE;YAChC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;YAC1C,0BAA0B;YAC1B,QAAQ;YACR,SAAS,EAAE,sBAAsB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;SAC1D,CAAC,CAAC;IACL,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import * as os from 'node:os';\nimport * as path from 'node:path';\nimport * as workerpool from 'workerpool';\n\nimport * as logging from './logging';\nimport { TypeScriptSnippet } from './snippet';\nimport { TranslatedSnippet } from './tablets/tablets';\nimport { RosettaDiagnostic } from './translate';\nimport type { TranslateBatchRequest, TranslateBatchResponse } from './translate_all_worker';\n\n/**\n * Divide the work evenly over all processors by running 'translate_all_worker' in Worker Threads, then combine results\n *\n * The workers are fed small queues of work each. We used to divide the entire queue into N\n * but since the work is divided unevenly that led to some workers stopping early, idling while\n * waiting for more work.\n *\n * Never include 'translate_all_worker' directly, only do TypeScript type references (so that in\n * the script we may assume that 'worker_threads' successfully imports).\n */\nexport async function translateAll(\n snippets: TypeScriptSnippet[],\n includeCompilerDiagnostics: boolean,\n batchSize?: number,\n): Promise<TranslateAllResult> {\n // Use about half the advertised cores because hyperthreading doesn't seem to\n // help that much, or we become I/O-bound at some point. On my machine, using\n // more than half the cores actually makes it slower.\n // Cap to a reasonable top-level limit to prevent thrash on machines with many, many cores.\n const N = process.env.JSII_ROSETTA_MAX_WORKER_COUNT\n ? parseInt(process.env.JSII_ROSETTA_MAX_WORKER_COUNT)\n : Math.min(16, Math.max(1, Math.ceil(os.cpus().length / 2)));\n const snippetArr = Array.from(snippets);\n const batchesOf = batchSize ? ` (in batches of ${batchSize})` : '';\n logging.info(`Translating ${snippetArr.length} snippets using ${N} workers${batchesOf}`);\n\n const pool = workerpool.pool(path.join(__dirname, 'translate_all_worker.js'), {\n maxWorkers: N,\n });\n\n try {\n const shouldBatchCompilation = batchSize != null;\n const requests = batchSnippets(snippetArr, includeCompilerDiagnostics, batchSize, shouldBatchCompilation);\n\n const responses: TranslateBatchResponse[] = await Promise.all(\n requests.map((request) => pool.exec('translateBatch', [request])),\n );\n\n const diagnostics = new Array<RosettaDiagnostic>();\n const translatedSnippets = new Array<TranslatedSnippet>();\n\n // Combine results\n for (const response of responses) {\n diagnostics.push(...response.diagnostics);\n translatedSnippets.push(...response.translatedSchemas.map(TranslatedSnippet.fromSchema));\n }\n return { diagnostics, translatedSnippets };\n } finally {\n // Not waiting on purpose\n void pool.terminate();\n }\n}\n\nfunction batchSnippets(\n snippets: TypeScriptSnippet[],\n includeCompilerDiagnostics: boolean,\n batchSize = 10,\n shouldBatchCompilation: boolean = false,\n): TranslateBatchRequest[] {\n const logLevel = logging.current();\n const ret: TranslateBatchRequest[] = [];\n\n for (let i = 0; i < snippets.length; i += batchSize) {\n // create a unique worker name, purely for logging so can be pseudo random\n const workerId = Math.random().toString(16).slice(2, 6).toUpperCase();\n ret.push({\n workerName: `Worker#${workerId}`,\n snippets: snippets.slice(i, i + batchSize),\n includeCompilerDiagnostics,\n logLevel,\n batchSize: shouldBatchCompilation ? batchSize : undefined,\n });\n }\n\n return ret;\n}\n\nexport interface TranslateAllResult {\n translatedSnippets: TranslatedSnippet[];\n diagnostics: RosettaDiagnostic[];\n}\n"]}
1
+ {"version":3,"file":"translate_all.js","sourceRoot":"","sources":["../src/translate_all.ts"],"names":[],"mappings":";;AAoBA,oCAkDC;AAtED,8BAA8B;AAC9B,kCAAkC;AAClC,yCAAyC;AAEzC,qCAAqC;AAErC,+CAAsD;AACtD,2CAAsF;AAGtF;;;;;;;;;GASG;AACI,KAAK,UAAU,YAAY,CAChC,QAA6B,EAC7B,0BAAmC,EACnC,SAAkB;IAElB,6EAA6E;IAC7E,6EAA6E;IAC7E,qDAAqD;IACrD,2FAA2F;IAC3F,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B;QACjD,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC;QACrD,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/D,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxC,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,m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,KAAK,GAAG,IAAA,6BAAiB,EAAC,OAAO,CAAC,CAAC;YACzC,4CAA4C;YAC5C,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;QAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAC7C,CAAC;YAAS,CAAC;QACT,yBAAyB;QACzB,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC;IACxB,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CACpB,QAA6B,EAC7B,0BAAmC,EACnC,SAAS,GAAG,EAAE,EACd,yBAAkC,KAAK;IAEvC,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IACnC,MAAM,GAAG,GAA4B,EAAE,CAAC;IAExC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC;QACpD,0EAA0E;QAC1E,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACtE,GAAG,CAAC,IAAI,CAAC;YACP,UAAU,EAAE,UAAU,QAAQ,EAAE;YAChC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;YAC1C,0BAA0B;YAC1B,QAAQ;YACR,SAAS,EAAE,sBAAsB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;SAC1D,CAAC,CAAC;IACL,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import * as os from 'node:os';\nimport * as path from 'node:path';\nimport * as workerpool from 'workerpool';\n\nimport * as logging from './logging';\nimport { TypeScriptSnippet } from './snippet';\nimport { TranslatedSnippet } from './tablets/tablets';\nimport { RosettaDiagnostic, extractTimingInfo, formatTimingTable } from './translate';\nimport type { TranslateBatchRequest, TranslateBatchResponse } from './translate_all_worker';\n\n/**\n * Divide the work evenly over all processors by running 'translate_all_worker' in Worker Threads, then combine results\n *\n * The workers are fed small queues of work each. We used to divide the entire queue into N\n * but since the work is divided unevenly that led to some workers stopping early, idling while\n * waiting for more work.\n *\n * Never include 'translate_all_worker' directly, only do TypeScript type references (so that in\n * the script we may assume that 'worker_threads' successfully imports).\n */\nexport async function translateAll(\n snippets: TypeScriptSnippet[],\n includeCompilerDiagnostics: boolean,\n batchSize?: number,\n): Promise<TranslateAllResult> {\n // Use about half the advertised cores because hyperthreading doesn't seem to\n // help that much, or we become I/O-bound at some point. On my machine, using\n // more than half the cores actually makes it slower.\n // Cap to a reasonable top-level limit to prevent thrash on machines with many, many cores.\n const N = process.env.JSII_ROSETTA_MAX_WORKER_COUNT\n ? parseInt(process.env.JSII_ROSETTA_MAX_WORKER_COUNT)\n : Math.min(16, Math.max(1, Math.ceil(os.cpus().length / 2)));\n const snippetArr = Array.from(snippets);\n const batchesOf = batchSize ? ` (in batches of ${batchSize})` : '';\n logging.info(`Translating ${snippetArr.length} snippets using ${N} workers${batchesOf}`);\n\n const pool = workerpool.pool(path.join(__dirname, 'translate_all_worker.js'), {\n maxWorkers: N,\n });\n\n try {\n const shouldBatchCompilation = batchSize != null;\n const requests = batchSnippets(snippetArr, includeCompilerDiagnostics, batchSize, shouldBatchCompilation);\n\n const responses: TranslateBatchResponse[] = await Promise.all(\n requests.map((request) => pool.exec('translateBatch', [request])),\n );\n\n const allDiagnostics = new Array<RosettaDiagnostic>();\n const translatedSnippets = new Array<TranslatedSnippet>();\n\n // Combine results\n for (const response of responses) {\n allDiagnostics.push(...response.diagnostics);\n translatedSnippets.push(...response.translatedSchemas.map(TranslatedSnippet.fromSchema));\n }\n\n // Extract and display timing info if enabled\n const { timings, diagnostics } = extractTimingInfo(allDiagnostics);\n if (process.env.TIMING === '1' && timings.length > 0) {\n const table = formatTimingTable(timings);\n // emitted as warn so that it's always shown\n logging.warn(table);\n }\n\n return { diagnostics, translatedSnippets };\n } finally {\n // Not waiting on purpose\n void pool.terminate();\n }\n}\n\nfunction batchSnippets(\n snippets: TypeScriptSnippet[],\n includeCompilerDiagnostics: boolean,\n batchSize = 10,\n shouldBatchCompilation: boolean = false,\n): TranslateBatchRequest[] {\n const logLevel = logging.current();\n const ret: TranslateBatchRequest[] = [];\n\n for (let i = 0; i < snippets.length; i += batchSize) {\n // create a unique worker name, purely for logging so can be pseudo random\n const workerId = Math.random().toString(16).slice(2, 6).toUpperCase();\n ret.push({\n workerName: `Worker#${workerId}`,\n snippets: snippets.slice(i, i + batchSize),\n includeCompilerDiagnostics,\n logLevel,\n batchSize: shouldBatchCompilation ? batchSize : undefined,\n });\n }\n\n return ret;\n}\n\nexport interface TranslateAllResult {\n translatedSnippets: TranslatedSnippet[];\n diagnostics: RosettaDiagnostic[];\n}\n"]}
@@ -4,12 +4,18 @@ exports.singleThreadedTranslateAll = singleThreadedTranslateAll;
4
4
  /**
5
5
  * Pool worker for extract.ts
6
6
  */
7
+ const node_util_1 = require("node:util");
7
8
  const workerpool = require("workerpool");
8
9
  const logging = require("./logging");
10
+ const snippet_1 = require("./snippet");
11
+ const key_1 = require("./tablets/key");
9
12
  const translate_1 = require("./translate");
10
13
  function translateBatch(request) {
11
14
  // because we are in a worker process we need to explicitly configure the log level again
12
15
  logging.configure({ level: request.logLevel ?? logging.Level.QUIET, prefix: request.workerName });
16
+ if (process.env.TIMING === '1' && request.batchSize) {
17
+ logging.warn('TIMING=1 is not supported in batch compilation mode');
18
+ }
13
19
  const result = request.batchSize
14
20
  ? batchTranslateAll(request.snippets, request.includeCompilerDiagnostics)
15
21
  : singleThreadedTranslateAll(request.snippets, request.includeCompilerDiagnostics);
@@ -40,18 +46,27 @@ function batchTranslateAll(snippets, includeCompilerDiagnostics) {
40
46
  function singleThreadedTranslateAll(snippets, includeCompilerDiagnostics) {
41
47
  const translatedSnippets = new Array();
42
48
  const failures = new Array();
49
+ const timings = new Array();
43
50
  const translator = new translate_1.Translator(includeCompilerDiagnostics);
44
51
  for (const block of snippets) {
52
+ const start = performance.now();
53
+ const currentSnippetKey = (0, key_1.snippetKey)(block);
54
+ logging.debug(`Translating ${currentSnippetKey} ${(0, node_util_1.inspect)(block.parameters ?? {})}`);
45
55
  try {
46
56
  translatedSnippets.push(translator.translate(block));
47
57
  }
48
58
  catch (e) {
49
59
  failures.push((0, translate_1.makeRosettaDiagnostic)(true, `rosetta: error translating snippet: ${e}\n${e.stack}\n${block.completeSource}`));
50
60
  }
61
+ const timing = (0, translate_1.makeTimingDiagnostic)(currentSnippetKey, (0, snippet_1.formatLocation)(block.location), performance.now() - start);
62
+ timings.push(timing);
63
+ logging.debug(`Completed ${timing.timingInfo.snippetKey} ${(0, node_util_1.inspect)({
64
+ duration: `${(timing.timingInfo.durationMs / 1000).toFixed(2)}s`,
65
+ })}`);
51
66
  }
52
67
  return {
53
68
  translatedSnippets,
54
- diagnostics: [...translator.diagnostics, ...failures],
69
+ diagnostics: [...translator.diagnostics, ...failures, ...timings],
55
70
  };
56
71
  }
57
72
  workerpool.worker({ translateBatch });
@@ -1 +1 @@
1
- {"version":3,"file":"translate_all_worker.js","sourceRoot":"","sources":["../src/translate_all_worker.ts"],"names":[],"mappings":";;AA8DA,gEAuBC;AArFD;;GAEG;AACH,yCAAyC;AAEzC,qCAAqC;AAIrC,2CAAmF;AAiBnF,SAAS,cAAc,CAAC,OAA8B;IACpD,yFAAyF;IACzF,OAAO,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAClG,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS;QAC9B,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,0BAA0B,CAAC;QACzE,CAAC,CAAC,0BAA0B,CAAC,OAAO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UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QACvD,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,QAAQ,CAAC,IAAI,CACX,IAAA,iCAAqB,EAAC,IAAI,EAAE,uCAAuC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,cAAc,EAAE,CAAC,CAC7G,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO;QACL,kBAAkB;QAClB,WAAW,EAAE,CAAC,GAAG,UAAU,CAAC,WAAW,EAAE,GAAG,QAAQ,CAAC;KACtD,CAAC;AACJ,CAAC;AAED,UAAU,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC","sourcesContent":["/**\n * Pool worker for extract.ts\n */\nimport * as workerpool from 'workerpool';\n\nimport * as logging from './logging';\nimport { TypeScriptSnippet } from './snippet';\nimport { TranslatedSnippetSchema } from './tablets/schema';\nimport { TranslatedSnippet } from './tablets/tablets';\nimport { RosettaDiagnostic, makeRosettaDiagnostic, Translator } from './translate';\nimport { TranslateAllResult } from './translate_all';\n\nexport interface TranslateBatchRequest {\n readonly workerName: string;\n readonly snippets: TypeScriptSnippet[];\n readonly includeCompilerDiagnostics: boolean;\n readonly logLevel?: logging.Level;\n readonly batchSize?: number;\n}\n\nexport interface TranslateBatchResponse {\n // Cannot be 'TranslatedSnippet' because needs to be serializable\n readonly translatedSchemas: TranslatedSnippetSchema[];\n readonly diagnostics: RosettaDiagnostic[];\n}\n\nfunction translateBatch(request: TranslateBatchRequest): TranslateBatchResponse {\n // because we are in a worker process we need to explicitly configure the log level again\n logging.configure({ level: request.logLevel ?? logging.Level.QUIET, prefix: request.workerName });\n const result = request.batchSize\n ? batchTranslateAll(request.snippets, request.includeCompilerDiagnostics)\n : singleThreadedTranslateAll(request.snippets, request.includeCompilerDiagnostics);\n\n return {\n translatedSchemas: result.translatedSnippets.map((s) => s.snippet),\n diagnostics: result.diagnostics,\n };\n}\n\nfunction batchTranslateAll(snippets: TypeScriptSnippet[], includeCompilerDiagnostics: boolean): TranslateAllResult {\n const translatedSnippets = new Array<TranslatedSnippet>();\n\n const failures = new Array<RosettaDiagnostic>();\n\n const translator = new Translator(includeCompilerDiagnostics);\n\n try {\n const results = translator.translateSnippets(snippets);\n translatedSnippets.push(...results);\n } catch (e: any) {\n failures.push(makeRosettaDiagnostic(true, `rosetta: error translating batch: ${e}\\n${e.stack}`));\n }\n\n return {\n translatedSnippets,\n diagnostics: [...translator.diagnostics, ...failures],\n };\n}\n\n/**\n * Translate the given snippets using a single compiler\n */\nexport function singleThreadedTranslateAll(\n snippets: TypeScriptSnippet[],\n includeCompilerDiagnostics: boolean,\n): TranslateAllResult {\n const translatedSnippets = new Array<TranslatedSnippet>();\n\n const failures = new Array<RosettaDiagnostic>();\n\n const translator = new Translator(includeCompilerDiagnostics);\n for (const block of snippets) {\n try {\n translatedSnippets.push(translator.translate(block));\n } catch (e: any) {\n failures.push(\n makeRosettaDiagnostic(true, `rosetta: error translating snippet: ${e}\\n${e.stack}\\n${block.completeSource}`),\n );\n }\n }\n\n return {\n translatedSnippets,\n diagnostics: [...translator.diagnostics, ...failures],\n };\n}\n\nworkerpool.worker({ translateBatch });\n"]}
1
+ {"version":3,"file":"translate_all_worker.js","sourceRoot":"","sources":["../src/translate_all_worker.ts"],"names":[],"mappings":";;AAqEA,gEAmCC;AAxGD;;GAEG;AACH,yCAAoC;AACpC,yCAAyC;AAEzC,qCAAqC;AACrC,uCAA8D;AAC9D,uCAA2C;AAG3C,2CAAyG;AAiBzG,SAAS,cAAc,CAAC,OAA8B;IACpD,yFAAyF;IACzF,OAAO,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAElG,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,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,CAAC;IAED,OAAO;QACL,kBAAkB;QAClB,WAAW,EAAE,CAAC,GAAG,UAAU,CAAC,WAAW,EAAE,GAAG,QAAQ,EAAE,GAAG,OAAO,CAAC;KAClE,CAAC;AACJ,CAAC;AAED,UAAU,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC","sourcesContent":["/**\n * Pool worker for extract.ts\n */\nimport { inspect } from 'node:util';\nimport * as workerpool from 'workerpool';\n\nimport * as logging from './logging';\nimport { formatLocation, TypeScriptSnippet } from './snippet';\nimport { snippetKey } from './tablets/key';\nimport { TranslatedSnippetSchema } from './tablets/schema';\nimport { TranslatedSnippet } from './tablets/tablets';\nimport { RosettaDiagnostic, makeRosettaDiagnostic, makeTimingDiagnostic, Translator } from './translate';\nimport { TranslateAllResult } from './translate_all';\n\nexport interface TranslateBatchRequest {\n readonly workerName: string;\n readonly snippets: TypeScriptSnippet[];\n readonly includeCompilerDiagnostics: boolean;\n readonly logLevel?: logging.Level;\n readonly batchSize?: number;\n}\n\nexport interface TranslateBatchResponse {\n // Cannot be 'TranslatedSnippet' because needs to be serializable\n readonly translatedSchemas: TranslatedSnippetSchema[];\n readonly diagnostics: RosettaDiagnostic[];\n}\n\nfunction translateBatch(request: TranslateBatchRequest): TranslateBatchResponse {\n // because we are in a worker process we need to explicitly configure the log level again\n logging.configure({ level: request.logLevel ?? logging.Level.QUIET, prefix: request.workerName });\n\n if (process.env.TIMING === '1' && request.batchSize) {\n logging.warn('TIMING=1 is not supported in batch compilation mode');\n }\n\n const result = request.batchSize\n ? batchTranslateAll(request.snippets, request.includeCompilerDiagnostics)\n : singleThreadedTranslateAll(request.snippets, request.includeCompilerDiagnostics);\n\n return {\n translatedSchemas: result.translatedSnippets.map((s) => s.snippet),\n diagnostics: result.diagnostics,\n };\n}\n\nfunction batchTranslateAll(snippets: TypeScriptSnippet[], includeCompilerDiagnostics: boolean): TranslateAllResult {\n const translatedSnippets = new Array<TranslatedSnippet>();\n\n const failures = new Array<RosettaDiagnostic>();\n\n const translator = new Translator(includeCompilerDiagnostics);\n\n try {\n const results = translator.translateSnippets(snippets);\n translatedSnippets.push(...results);\n } catch (e: any) {\n failures.push(makeRosettaDiagnostic(true, `rosetta: error translating batch: ${e}\\n${e.stack}`));\n }\n\n return {\n translatedSnippets,\n diagnostics: [...translator.diagnostics, ...failures],\n };\n}\n\n/**\n * Translate the given snippets using a single compiler\n */\nexport function singleThreadedTranslateAll(\n snippets: TypeScriptSnippet[],\n includeCompilerDiagnostics: boolean,\n): TranslateAllResult {\n const translatedSnippets = new Array<TranslatedSnippet>();\n const failures = new Array<RosettaDiagnostic>();\n const timings = new Array<RosettaDiagnostic>();\n\n const translator = new Translator(includeCompilerDiagnostics);\n for (const block of snippets) {\n const start = performance.now();\n const currentSnippetKey = snippetKey(block);\n logging.debug(`Translating ${currentSnippetKey} ${inspect(block.parameters ?? {})}`);\n\n try {\n translatedSnippets.push(translator.translate(block));\n } catch (e: any) {\n failures.push(\n makeRosettaDiagnostic(true, `rosetta: error translating snippet: ${e}\\n${e.stack}\\n${block.completeSource}`),\n );\n }\n\n const timing = makeTimingDiagnostic(currentSnippetKey, formatLocation(block.location), performance.now() - start);\n timings.push(timing);\n logging.debug(\n `Completed ${timing.timingInfo!.snippetKey} ${inspect({\n duration: `${(timing.timingInfo!.durationMs / 1000).toFixed(2)}s`,\n })}`,\n );\n }\n\n return {\n translatedSnippets,\n diagnostics: [...translator.diagnostics, ...failures, ...timings],\n };\n}\n\nworkerpool.worker({ translateBatch });\n"]}
package/package.json CHANGED
@@ -59,7 +59,7 @@
59
59
  "memfs": "^4.51.1",
60
60
  "mock-fs": "^5.5.0",
61
61
  "prettier": "^2.8.8",
62
- "projen": "^0.98.29",
62
+ "projen": "^0.98.30",
63
63
  "tar": "^6.2.1",
64
64
  "ts-jest": "^29.4.6",
65
65
  "ts-node": "^10.9.2"
@@ -88,7 +88,7 @@
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  },
91
- "version": "5.8.22-dev.12",
91
+ "version": "5.8.22-dev.14",
92
92
  "types": "lib/index.d.ts",
93
93
  "exports": {
94
94
  ".": "./lib/index.js",