Skip to content

Commit

Permalink
chore: explain "infuse" in rosetta README (#3159)
Browse files Browse the repository at this point in the history
---

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
  • Loading branch information
rix0rrr authored Nov 12, 2021
1 parent c3b30c0 commit 7501547
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions packages/jsii-rosetta/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,57 @@ If you get out of memory errors running too many workers, run a command like thi
$ /sbin/sysctl -w vm.max_map_count=2251954
```

## Infuse

The `rosetta infuse` feature will copy code samples (for example, as found in
the README), to the classes that are referenced in the code sample. This will make
sure the same examples are rendered in multiple places, and increases their visibility
without additional work on the author's part.

The infuse command will modify the relevant assemblies and tablet files:

- Assembly: it will add new `example` sections to types in the assembly.
- Tablet: every newly added `example` will require a new copy of the example (with
a unique identifier) added to the tablet.

### Data flow

The diagram below shows how data flows through the jsii tools when used together:

```text
┌───────────┐
│ │
│ Source ├───┐
│ │ │ ╔══════════╗ ┌────────────┐ ╔═══════════════╗ ┌──────────┐
└───────────┘ │ ║ ║ │ │ ║ rosetta ║ │ │
├───▶║ jsii ║───▶│ assembly │────▶║ extract ║───▶│ tablet │
┌───────────┐ │ ║ ║ │ │ ║ ║ │ │
│ │ │ ╚══════════╝ └────────────┘ ╚═══════════════╝ └──────────┘
│ README │───┘ │ │
│ │ │ │
└───────────┘ │ ╔═══════════════╗ │
│ ║ rosetta ║ │
└──────────▶║ infuse ║◀─────────┘
║ ║
╚═══════════════╝
┌───────────────────┴───────────────────┐
│ │
▼ ▼
┌────────────┐ ┌──────────┐
│ │ │ │
│ assembly' │ │ tablet' │
│ │ │ │
└────────────┘ └──────────┘
│ │
│ │
│ ▼ ┌─────────────┐
│ ╔═══════════════╗ ┌┴────────────┐│
│ ║ ║ │ ││
└──────────────────────────────▶║ pacmak ║────▶│ packages ││
║ ║ │ ├┘
╚═══════════════╝ └─────────────┘
(potentially
live-translates)
```

0 comments on commit 7501547

Please sign in to comment.