diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 1665315..6588222 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -33,6 +33,15 @@
+ Here lies information that may be of interest to those who wish to modify Blue Marble. + +
+ Running npm run build will compile Blue Marble. The compiled files can be found in the dist/ directory. Running npm run patch will increment the patch version, and compile Blue Marble.
+
+ Use the arrow and zoom buttons to navigate the charts. Use the ↔️ button to go fullscreen. Use the 🔄 button to reset. All buttons can be found on the chart. Use the "two squares" icon to copy the chart. If you need assistance reading the chart, copy the chart into an AI using the "two squares" button on the chart. +
+ + + + +Class diagram of relationships for Blue Marble: +(last updated 0.74.0) +```mermaid +--- + config: + class: + hideEmptyMembersBox: true +--- +classDiagram + class main { + name : string + version : string + +inject() + +observeBlack() + +buildOverlayMain() + } + class utils { + +escapeHTML() + +serverTPtoDisplayTP() + +negativeSafeModulo() + +consoleLog() + +consoleError() + +consoleWarn() + +numberToEncoded() + +uint8ToBase64() + +base64ToUint8() + } + class apiManager { + coordsTilePixel : number[4] + +spontaneousResponseListener() + } + class templateManager { + userID : number + +createJSON() + +createTemplate() + -storeTemplates() + +disableTemplate() + +drawTemplateOnTile() + +importJSON() + +parseBlueMarble() + } + class Template { + +createTemplateTiles() + } + class Overlay { + +setApiManager() + -createElement() + +add...() + +buildElement() + +buildOverlay() + +updateInnerHTML() + +handleDrag() + +handleDisplayStatus() + +handleDisplayError() + } + + main o-- apiManager : creates + main o-- utils : creates + main o-- Overlay : creates main, tabTemplate + main o-- templateManager : creates + apiManager ..> templateManager : calls drawTemplateOnTiles(), sets userID + apiManager ..> utils : calls escapeHTML(), numberToEncoded(), serverTPtoDisplayTP() + Overlay ..> apiManager : uses coordsTilePixel + templateManager *-- Template : manages + templateManager ..> utils : calls base64ToUint8(), numberToEncoded() + Template ..> utils : calls uint8ToBase64() +``` + +Class diagram of relationships for Blue Marble's compiler/builder: +(last updated 0.74.0) +```mermaid +--- + config: + class: + hideEmptyMembersBox: true +--- +classDiagram + + namespace npm_run_patch { + class `patch.js` { + } + + class `docs/README.md` { + } + } + + namespace npm_run_build { + class `build.js` { + mapCSS : JSON Object + } + + class `cssMangler.js` { + importMap : JSON Object + returnMap : JSON Object + +mangleSelectors() + +escapeRegex() + +numberToEncoded() + } + + class `update-version.js` { + } + + class `utils.js` { + +consoleStyle() + } + + class esbuild { + +build() + } + + class terser { + +minify() + } + + class `dist/BlueMarble.user.js` { + } + + class `dist/BlueMarble.user.css` { + } + + class `dist/BlueMarble.user.css.map.json` { + } + + class `src/BlueMarble.meta.js` { + } + + class `src/main.js` { + } + + class `package.json` { + } + } + + note for `patch.js` "calls npm_run_build" + `build.js` ..> terser : requires + `build.js` ..> `utils.js` : calls consoleStyle() + `build.js` ..> `update-version.js` : executes + `build.js` ..> `src/BlueMarble.meta.js` : reads + `build.js` ..> esbuild : calls build() + `build.js` ..> `dist/BlueMarble.user.css` : writes + esbuild ..> `src/main.js` : reads + `build.js` ..> `dist/BlueMarble.user.js` : writes + terser ..> `dist/BlueMarble.user.js` : reads & writes + `build.js` ..> `cssMangler.js` : calls manglerSelectors() + `cssMangler.js` ..> `dist/BlueMarble.user.css.map.json` : reads + `cssMangler.js` ..> `dist/BlueMarble.user.js` : reads & writes + `cssMangler.js` ..> `dist/BlueMarble.user.css` : reads & writes + `build.js` <.. `cssMangler.js` : returns mapCSS + `build.js` ..> `dist/BlueMarble.user.css.map.json` : writes mapCSS + `patch.js` ..> `docs/README.md` : reads & writes + `patch.js` ..> `utils.js` : calls consoleStyle() + `update-version.js` ..> `package.json` : reads + `update-version.js` ..> `src/BlueMarble.meta.js` : reads & writes + `update-version.js` ..> `utils.js` : calls consoleStyle() +``` +This is what SwingTheVine uses to program Blue Marble. You don't have to use the exact same thing. This is provided for reference. diff --git a/docs/README.md b/docs/README.md index 2cfc156..8ddd51d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -53,7 +53,7 @@
- Welcome to Blue Marble! Blue Marble is a userscript for the website wplace.live. If you like this userscript, please ⭐ the repository!
+ Welcome to Blue Marble! Blue Marble is a userscript for the website wplace.live. If you like this userscript, please ⭐ the repository! If you wish to contribute to Blue Marble, check out the CONTRIBUTING.md file in docs/.