diff --git a/backend/version b/backend/version index 71172b4..2774f85 100644 --- a/backend/version +++ b/backend/version @@ -1 +1 @@ -0.10.1 \ No newline at end of file +0.10.0 \ No newline at end of file diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index f04b535..0000000 --- a/docs/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# MicroSDeck Documentation - -You have found the source for the MicroSDeck documetnation. Its all within the *.mdx files in this folder. - -## Mdx? - -[Mdx](https://mdxjs.com) is a superset of the [Md](https://www.markdownguide.org/) language. Both are human readable markup languages that allow styling of content without much hassle. - -If you have used Markdown them MDX is essentially the same just with some JSX support which allows embedding of custom components into markup files. - -If you haven't used markdown, then there is a chance that actually you have. Discord, Reddit, WhatsApp, Discourse & Most Fediverse apps all have markdown support. So if you know how to make text bold in discord, there is a good chance that you know how to make text bold in markdown. - -If you haven't ever used any of those apps or never wrote anything but the most basic of unformatted text. Or even if you just want a reference or quick refresher. You can use the following Cheat Sheet to get up to date quickly: -[https://www.markdownguide.org/cheat-sheet/](https://www.markdownguide.org/cheat-sheet/) - -## JSX? - -If you are familiar with Markdown already you might be interested in learning a bit more about these custom components. Through the magic of [Mdx](https://mdxjs.com) we can import React components into the markdown page. These then get rendered together with the page into JSX components that are bundled into the final bundle. - -Since it all ends up as built JSX we can utilize the same exact logic as the rest of the MicroSDeck codebase to retrieve the MicroSDeck instance and any data it contains. Which all get live updated when the state changes. You can check out an [example here](./components/CurrentCard.tsx). - -This allows us to functionally do exactly the same as in the main ui. We can change the name of cards or update any other data we want. Which in the right hands can create a VERY interactive documentation page that both reacts to the state of the plugin as well as allows the users to change it from within the docs (Think a "Try Me" button). - -## Contributing - -Any and all contributions are welcome. Especially small fixes to correct spelling mistakes, grammer or sentence structure. Nothing is too small and any contributions are welcome. If you do make changes to the docs I ask only that the pullRequest be called `docs: [describe the change]` to keep consistency. - - -## Thank You - -Thank you so much for even reading this far. Now go off & have fun, My rambles surely weren't THAT interesting. \ No newline at end of file diff --git a/docs/components/CurrentCard.tsx b/docs/components/CurrentCard.tsx deleted file mode 100644 index 7fc6d23..0000000 --- a/docs/components/CurrentCard.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { ReactElement } from "react"; -import { useMicroSDeckContext } from "../../lib/src"; -import React from "react"; - -export function CurrentCard(): ReactElement { - const { currentCardAndGames } = useMicroSDeckContext(); - - if (!currentCardAndGames) { - return (<>Unfortunately, This little trick only works while you have a MicroSD card inserted. Try sticking one in); - } - - const [card, games] = currentCardAndGames; - - return ( - <> - You current have card "{card.name}" inserted.
- But did you know it also has a unique ID?
- Here it is: {card.uid} -
-
- { - games.length ? - (<> - For good measure, Here are all the game Id's too:
- { - games.map(v => ( - <> - {v.name}: {v.uid}
- - )) - } - ) : - (<> - There are currently no games installed on this MicroSD card. If there were their Id's would be printed here. - ) - } -
-
- Pretty cool ey? It'll be even more impressive after you remove the MicroSD card you have currently plugged in 😉 - - ) -} \ No newline at end of file diff --git a/docs/index.mdx b/docs/index.mdx index 00ed4ce..25bf4a6 100644 --- a/docs/index.mdx +++ b/docs/index.mdx @@ -1,9 +1,3 @@ -import { CurrentCard } from "./components/CurrentCard"; - # Hello, World! This is the beginning of the docs, Unfortunately they are still under construction ⚠️🚧👷 - -Here is a little demo of why my 20 hour investment into this doc engine was totally worth it: - -> \ No newline at end of file diff --git a/plugin.json b/plugin.json index 375dcd9..27d38e8 100644 --- a/plugin.json +++ b/plugin.json @@ -1,10 +1,10 @@ { "name": "MicroSDeck", "author": "CEbbinghaus", - "flags": ["debug"], + "flags": ["debug", "_root"], "publish": { - "tags": ["microsd", "sdcard", "manager"], + "tags": ["microsd", "root"], "description": "A plugin to manage MicroSD cards.", - "image": "https://raw.githubusercontent.com/CEbbinghaus/MicroSDeck/master/assets/Logo.png" + "image": "https://raw.githubusercontent.com/CEbbinghaus/MicroSDeck/master/Logo.png" } } diff --git a/src/index.tsx b/src/index.tsx index e0408d6..1b06d7f 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -150,13 +150,10 @@ export default definePlugin((serverApi: ServerAPI) => { DeckyAPI.SetApi(serverApi); Logger.Log("Started MicroSDeck"); - + const patch = PatchAppScreen(serverApi); - serverApi.routerHook.addRoute(DOCUMENTATION_PATH, () => ( - {throw "MicroSDeck not initialized";})()}> - - )); + serverApi.routerHook.addRoute(DOCUMENTATION_PATH, Docs); return { title:
MicroSDeck
, @@ -168,7 +165,7 @@ export default definePlugin((serverApi: ServerAPI) => { onDismount() { window.MicroSDeck?.destruct(); window.MicroSDeck = undefined; - + serverApi.routerHook.removeRoute(DOCUMENTATION_PATH); patch && serverApi.routerHook.removePatch('/library/app/:appid', patch); }, diff --git a/src/pages/docs.codegen b/src/pages/docs.codegen index 6a8033f..45dd66b 100644 --- a/src/pages/docs.codegen +++ b/src/pages/docs.codegen @@ -4,7 +4,7 @@ const { parse, join } = require('path'); const docsDir = join(__dirname, '../../docs'); -const docs = readdirSync(docsDir).filter(file => file.endsWith(".mdx")); +const docs = readdirSync(docsDir); const keyedDocs = docs.map(() => `_${Math.random().toString(36).slice(2) }`); diff --git a/tsconfig.json b/tsconfig.json index 91157ef..77e0588 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "outDir": "build/dist", "module": "ESNext", "target": "ES2020", "jsx": "react", @@ -19,6 +20,6 @@ "allowSyntheticDefaultImports": true, "skipLibCheck": true }, - "include": ["src", "lib", "docs"], + "include": ["src", "lib"], "exclude": ["node_modules"] }