0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-10-31 17:02:38 +00:00

refactor: Add TPPL

TPPL is how vuetube now manages third party plugins (Third Party Plugin Loader)
This commit is contained in:
Front 2022-04-04 17:49:24 -04:00
parent 697ce5f997
commit 7d9d1bc96a
4 changed files with 29 additions and 2 deletions

View file

@ -15,6 +15,7 @@ export default {
{ src: "~/plugins/youtube", mode: "client" },
{ src: "~/plugins/vuetube", mode: "client" },
{ src: "~/plugins/ryd", mode: "client" },
{ src: "~/plugins/thirdPartyPluginLoader", mode: "client" },
],
generate: {
dir: "../dist",

View file

@ -52,8 +52,7 @@ export default {
};
},
async mounted() {
const temp = require("~/plugins/demoPlugin.js");
this.plugins = [temp];
this.plugins = await this.$tppl.list;
},
};
</script>

View file

@ -1,6 +1,7 @@
module.exports = {
manifest: {
name: "Test plugin",
vuetube: "*",
version: "1.0",
author: "Frontesque",
description: "A plugin to test how vuetube handles plugins // Add 'Hello, World!' to the home page.",

View file

@ -0,0 +1,26 @@
//--- Modules/Imports ---//
const module = {
//--- Get Plugins ---//
list: new Promise((resolve, reject) => {
let plugins = new Array();
// Temp Plugin List
plugins.push(require("~/plugins/tempPlugins/demoPlugin"))
// End Temp Plugin List
resolve(plugins);
})
//--- End Get Plugins ---//
};
//--- Start ---//
export default ({ app }, inject) => {
inject("tppl", module);
};