Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions website/scripts/snapshot-remote-images.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Re-fetch the mutation state diagram, which used to be loaded from plantuml.com at view time.
*
* The docs serve a committed snapshot so the page keeps working if plantuml.com changes.
* The source is the "Edit on PlantUML" link in design/mutation.mdx: edit the diagram there,
* update the link, then re-run this.
*
* To go back to the live render instead, point the Markdown image at the source URL below.
*
* Usage (from website/):
* node scripts/snapshot-remote-images.mjs
*/

import { readFile, writeFile } from 'fs/promises';

const mutationDoc = await readFile('src/content/docs/design/mutation.mdx', 'utf8');
const [, plantumlEncoded] = mutationDoc.match(/plantuml\.com\/plantuml\/uml\/([\w-]+)/) ?? [];
if (!plantumlEncoded) throw new Error('No "Edit on PlantUML" link found in design/mutation.mdx');

const source = `https://www.plantuml.com/plantuml/svg/${plantumlEncoded}`;
const target = 'public/images/design/mutation-state-transitions.svg';

const res = await fetch(source);
if (!res.ok) throw new Error(`${source} responded ${res.status}`);
await writeFile(target, Buffer.from(await res.arrayBuffer()));
console.log(`${target} <- ${source}`);
4 changes: 0 additions & 4 deletions website/src/content/docs/community.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,3 @@ Welcome to the Actionbase community. Here you'll find everything you need to par
href="https://github.com/kakao/actionbase/blob/main/SECURITY.md"
/>
</CardGrid>

## Contributors

[![contributors](https://contrib.rocks/image?repo=kakao/actionbase)](https://github.com/kakao/actionbase/graphs/contributors)
2 changes: 1 addition & 1 deletion website/src/content/docs/design/mutation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ flowchart LR
<details>
<summary>Full state transition diagram</summary>

![Full State Transition Diagram](https://www.plantuml.com/plantuml/png/VPAnRiCW48PtdkAaRbLHcvKXYXKOaAoeIjmkYGTgKpKgmPKDxUlNLiw94JQJBOxlkn-uJUTKw_p5aFx7QP0xMSWi1mQgSkTVpS2UnrgsBUIxc9HSw_MDYwgVodIQaEDZ2PIk9-R3q9AGSO4U7pwCroLTtpiqFwm73c9VdAogAWQhanqQ-Ox1TY-oGl2HHtc0lhtoVWkYBtTKybnC-xQwBcEQYrp4zBZE2S7TwU0HZwbuWAlg6_bq-fZ7_4zrurpY6F0CLlz1qmuVZbAw2ayrOrNTrzKwxsnC3GltI-Gkl22Ck71FGK2PUkxGEec8fT1x3Rau0_4Zf8Se8KXDqG9EDjhM_cB-0G00)
![Full State Transition Diagram](/images/design/mutation-state-transitions.svg)

[Edit on PlantUML](https://www.plantuml.com/plantuml/uml/VPAnRiCW48PtdkAaRbLHcvKXYXKOaAoeIjmkYGTgKpKgmPKDxUlNLiw94JQJBOxlkn-uJUTKw_p5aFx7QP0xMSWi1mQgSkTVpS2UnrgsBUIxc9HSw_MDYwgVodIQaEDZ2PIk9-R3q9AGSO4U7pwCroLTtpiqFwm73c9VdAogAWQhanqQ-Ox1TY-oGl2HHtc0lhtoVWkYBtTKybnC-xQwBcEQYrp4zBZE2S7TwU0HZwbuWAlg6_bq-fZ7_4zrurpY6F0CLlz1qmuVZbAw2ayrOrNTrzKwxsnC3GltI-Gkl22Ck71FGK2PUkxGEec8fT1x3Rau0_4Zf8Se8KXDqG9EDjhM_cB-0G00)

Expand Down
Loading