diff --git a/.gitignore b/.gitignore index 6394ea5..e9b7c64 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /storage.spec.whatwg.org/ /deploy.sh /storage.html +/node_modules/ +/package-lock.json diff --git a/Makefile b/Makefile index aa7d226..a8d8c24 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/assets/model-diagram.svg b/assets/model-diagram.svg new file mode 100644 index 0000000..faa537b --- /dev/null +++ b/assets/model-diagram.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + User agent + + Storage shed + + Traversable navigable + + Storage shelf + + Storage bucket + + Storage bottle + + holds (local) + + holds (session) + + for each storage key + + holds (default) + + for each storage endpoint + diff --git a/model-diagram.mmd b/model-diagram.mmd new file mode 100644 index 0000000..36975e8 --- /dev/null +++ b/model-diagram.mmd @@ -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" diff --git a/package.json b/package.json new file mode 100644 index 0000000..e80e470 --- /dev/null +++ b/package.json @@ -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" + } +} diff --git a/scripts/mmdc.config.json b/scripts/mmdc.config.json new file mode 100644 index 0000000..303de86 --- /dev/null +++ b/scripts/mmdc.config.json @@ -0,0 +1,6 @@ +{ + "useMaxWidth": false, + "er": { + "fontSize": 16 + } +} diff --git a/scripts/svgo.config.js b/scripts/svgo.config.js new file mode 100644 index 0000000..4a27845 --- /dev/null +++ b/scripts/svgo.config.js @@ -0,0 +1,7 @@ +module.exports = { + multipass: true, + js2svg: { + indent: 2, + pretty: true, + }, +}; diff --git a/storage.bs b/storage.bs index a7c39e3..9249b0d 100644 --- a/storage.bs +++ b/storage.bs @@ -129,6 +129,8 @@ either the obtain a local storage bottle map or the

If you are defining a standard for such an API, consider filing an issue against this standard for assistance and review. +

Storage model diagram (described in the next paragraph). +

To isolate this data this standard defines a storage shed which segments storage shelves by a storage key. A storage shelf in turn consists of a storage bucket and will likely consist of multiple storage buckets in the future to