Skip to content

Commit

Permalink
Editorial: add a diagram for storage model
Browse files Browse the repository at this point in the history
Fixes #151.

Co-authored-by: Anne van Kesteren <[email protected]>
Co-authored-by: Domenic Denicola <[email protected]>
  • Loading branch information
3 people authored Dec 1, 2022
1 parent 35e436d commit 8b93c4c
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/storage.spec.whatwg.org/
/deploy.sh
/storage.html
/node_modules/
/package-lock.json
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ local: storage.bs

deploy: storage.bs
curl --remote-name --fail https://resources.whatwg.org/build/deploy.sh
EXTRA_FILES="assets/*" \
bash ./deploy.sh
50 changes: 50 additions & 0 deletions assets/model-diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions model-diagram.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
erDiagram

%% This is the source file for `assets/model-diagram.svg`.
%% Build command: `npm i && npm run build-diagram`
%% Don't forget to adjust the size in storage.bs when modifying this.
%% (See viewBox attribute of the resulting SVG)

"User agent" ||--|| "Storage shed" : "holds (local)"
"Traversable navigable" ||--|| "Storage shed" : "holds (session)"
"Storage shed" ||--o{ "Storage shelf" : "for each storage key"
"Storage shelf" ||--|| "Storage bucket" : "holds (default)"
"Storage bucket" ||--|{ "Storage bottle" : "for each storage endpoint"
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"private": true,
"description": "Builds and compresses the diagram",
"dependencies": {
"@mermaid-js/mermaid-cli": "^9.2.2",
"svgo": "^3.0.2"
},
"scripts": {
"mmdc": "mmdc -c scripts/mmdc.config.json -i model-diagram.mmd -o assets/model-diagram.svg",
"svgo": "svgo --config scripts/svgo.config.js -f assets -o assets/",
"build-diagram": "npm run mmdc && npm run svgo"
}
}
6 changes: 6 additions & 0 deletions scripts/mmdc.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"useMaxWidth": false,
"er": {
"fontSize": 16
}
}
7 changes: 7 additions & 0 deletions scripts/svgo.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
multipass: true,
js2svg: {
indent: 2,
pretty: true,
},
};
2 changes: 2 additions & 0 deletions storage.bs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ either the <a>obtain a local storage bottle map</a> or the
<p class=note>If you are defining a standard for such an API, consider filing an issue against this
standard for assistance and review.

<p><img src=assets/model-diagram.svg alt="Storage model diagram (described in the next paragraph)." width=434 height=815>

<p>To isolate this data this standard defines a <a for=/>storage shed</a> which segments
<a>storage shelves</a> by a <a>storage key</a>. A <a>storage shelf</a> in turn consists of a
<a>storage bucket</a> and will likely consist of multiple <a>storage buckets</a> in the future to
Expand Down

0 comments on commit 8b93c4c

Please sign in to comment.