diff --git a/Website/src/native/IsolatedEval/index.ts b/Website/src/native/IsolatedEval/index.ts index 50cb1f0f..d71e8742 100644 --- a/Website/src/native/IsolatedEval/index.ts +++ b/Website/src/native/IsolatedEval/index.ts @@ -62,6 +62,7 @@ class IsolatedEval { DOMParser: IsoDOMParser, XMLSerializer: IsoXMLSerializer, SuFile: SuFile, + SuZip: SuZip, Terminal: Terminal, Chooser: Chooser, Shell: Shell, @@ -121,6 +122,7 @@ class IsolatedEval { this._prototypeWhitelist.set(IsoXMLSerializer, new Set()); this._prototypeWhitelist.set(XMLSerializer, new Set()); this._prototypeWhitelist.set(SuFile, new Set()); + this._prototypeWhitelist.set(SuZip, new Set()); this._prototypeWhitelist.set(ShellClass, new Set()); this._prototypeWhitelist.set(View, new Set()); this._prototypeWhitelist.set(OsClass, new Set()); diff --git a/docs/ModConf/STANDALONE.md b/docs/ModConf/STANDALONE.md new file mode 100644 index 00000000..59f52e87 --- /dev/null +++ b/docs/ModConf/STANDALONE.md @@ -0,0 +1,42 @@ +# ModConf Standalone + +ModConf Standalone nearly supports everything from the normal ModConf. + +## Getting started + +Create `/data/adb/mmrl/modconf//modconf.json` with the following content + +```json +{ + "id": "", + "name": "Your name", + "description": "your description", + "main": "/src/index.jsx", + "cwd": "/src" +} +``` + +### `modconf.json` fields + +| Key | Required | Description | +| ------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `id` | Yes | The `id` should always match the folder name otherwise it won't show up | +| `name` | Optional | Used to display the name | +| `description` | Optional | Use to display the description and that it does | +| `main` | No | Here can you set your own index file. Useful when you have a `src` folder.
ModFS supported
| +| `cwd` | No (yes if `main` is set) | It is required to use `cwd` if `main` is set to ensure the the imports are working
ModFS supported
| + +## Index file + +As above decribed you can set your own index path + +`src/index.jsx` + +```jsx +import React from "react"; +import { Page } from "@mmrl/ui"; + +export default () => { + return Test; +}; +``` diff --git a/docs/ModConf/functions/SuZip.md b/docs/ModConf/functions/SuZip.md new file mode 100644 index 00000000..b43bce32 --- /dev/null +++ b/docs/ModConf/functions/SuZip.md @@ -0,0 +1,48 @@ +# SuZip + +Here will you learn, how `SuZip` works in MMRL. It has the same style as `SuFile` + +> [!NOTE] +> `SuZip` is a global part in ModConf. No need to import it. +> +> Unstable class! + +## Reading files + +```js +const mkprop = new SuZip("file.zip", "path/to/file"); +console.log(mkprop.read()); +``` + +## Check for existing + +```js +const mkprop = new SuZip("file.zip", "path/to/file"); + +if (mkprop.exist()) { + console.log("File exist!"); +} else { + // stops ModConf + throw new Error("File does not exist!"); +} +``` + +## Listing files + +```js +const modules = new SuZip("file.zip", "path/to/file"); + +if (modules.exist()) { + // path is ignored here + console.log(modules.list()); +} else { + throw new Error("Modules folder does not exist"); +} +``` + +## Access native methods + +```js +const native = new SuZip("file.zip", "path/to/file"); +native.interface; +```