From e7c740b9c0e6c2fb3086d32a6c85035e6460568d Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Fri, 18 Feb 2022 19:07:23 +0500 Subject: [PATCH 1/5] Update README.md --- README.md | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 681c540..7ced792 100644 --- a/README.md +++ b/README.md @@ -14,30 +14,46 @@ Although this library does not provide game engine facilities, the API is design --- -## Usage + +## APIs + +Totum is composed of two major apis: + +1. `rollp.js` plugin located at `plugins/rollup.js` that provides code transformation, loading and resolution based on the standard rollup format. +2. `setAPI` it exposes a dynamic setAPI routine that can be used to set the methods which can be then used by loaded modules/apps. + + +## Usage `setAPI` ```js - let object; - try { - object = await metaversefileApi.load(url); - } catch (err) { - console.warn(err); - } - return object; + metaversefile.setApi({ + async load = () =>{} + + async import = () =>{} + + useApp = () =>{} + + . + . + . + can be anything + + }) ``` ### Inputs -* url: {URL of the asset that can be downloadable by the screenshot system} **[Required]** +* object with key/value pairs can be anything even an async/Promise based function ### Returns -* Promise: +* Based on the methods set in setAPI -### Output -* Object of application -### Supported Assets +## Rollup.JS + +### Supported Loaders by totum/rollup.js + * `VRM` * `VOX` * `JS` @@ -46,8 +62,10 @@ Although this library does not provide game engine facilities, the API is design * `HTML` * `GLB` * `GIF` +* `Relative/Absolute URL` + -## Motivations +### Motivations for loaders - A system which takes any URL (or token) and manifests it as an object in a 3D MMO - Totum transmutes data on the backend, serving composable little WASM+JS apps your browser can import() From 33f70c6ebd7bc7034355f0dea1547cca625baf01 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Fri, 18 Feb 2022 19:13:28 +0500 Subject: [PATCH 2/5] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7ced792..302b606 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,11 @@ Totum is composed of two major apis: ```js metaversefile.setApi({ - async load = () =>{} + async load() =>{} - async import = () =>{} + async import() =>{} - useApp = () =>{} + useApp() =>{} . . From 67a7f97c9b47454fbcf8b4acf0d4f52a63cd8ec1 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Fri, 18 Feb 2022 20:48:09 +0500 Subject: [PATCH 3/5] Update README.md --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 302b606..6a7af5a 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,14 @@ Although this library does not provide game engine facilities, the API is design --- -## APIs +Totum is composed of two major parts: -Totum is composed of two major apis: -1. `rollp.js` plugin located at `plugins/rollup.js` that provides code transformation, loading and resolution based on the standard rollup format. -2. `setAPI` it exposes a dynamic setAPI routine that can be used to set the methods which can be then used by loaded modules/apps. +## API + + + +API part exposes `setAPI` a dynamic routine that can be used to set the methods which can be then used by loaded modules/apps. API is based on [Singleton Design Pattern](https://en.wikipedia.org/wiki/Singleton_pattern) ## Usage `setAPI` @@ -44,14 +46,16 @@ Totum is composed of two major apis: ``` ### Inputs -* object with key/value pairs can be anything even an async/Promise based function +* object with key/value pairs can be anything even an async/Promise based function. ### Returns -* Based on the methods set in setAPI +* Based on the methods used in setAPI ## Rollup.JS +Totum also provides a [Rollup.JS](https://rollupjs.org/) plugin located under `plugins/rollup.js` that provides transformation, loading and resolution based on the different module/asset loaders registered in totum. + ### Supported Loaders by totum/rollup.js * `VRM` From d15f3358395bb30952496f55c99813db4d1559cd Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Fri, 18 Feb 2022 20:59:06 +0500 Subject: [PATCH 4/5] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6a7af5a..a33e18b 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ API part exposes `setAPI` a dynamic routine that can be used to set the methods ### Returns * Based on the methods used in setAPI +--- ## Rollup.JS From b68d9c5d2210abcb109350a5472f4cf9f4879bb9 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Fri, 18 Feb 2022 21:10:20 +0500 Subject: [PATCH 5/5] Update README.md --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index a33e18b..6b3f962 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,35 @@ API part exposes `setAPI` a dynamic routine that can be used to set the methods ### Returns * Based on the methods used in setAPI +### Example Usage + + +#### Initialisation + +```js + + import metaversefile from 'metaversefile'; + + metaversefile.setApi({ + helloWorld() =>{ + return 'Hello World' + } + }) + +``` + +#### Usage in other modules + + +```js + + import metaversefile from 'metaversefile'; + + metaversefile.helloWorld() + +``` + + --- ## Rollup.JS