feat: create sync plugin structure

This commit is contained in:
mirivlad 2026-06-20 02:28:15 +08:00
parent 12d491a786
commit 6fb16442cb
3 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,14 @@
{
"name": "verstak-sync-plugin",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "vite build",
"dev": "vite build --watch"
},
"devDependencies": {
"vite": "^5.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"svelte": "^4.0.0"
}
}

View File

@ -0,0 +1,25 @@
import SyncSettings from './SyncSettings.svelte';
import SyncStatusBar from './SyncStatusBar.svelte';
window.VerstakPluginRegister('verstak.sync', {
components: {
SyncSettings: {
mount(container, props, api) {
return new SyncSettings({
target: container,
props: { ...props, api }
});
},
unmount(container) {}
},
SyncStatusBar: {
mount(container, props, api) {
return new SyncStatusBar({
target: container,
props: { ...props, api }
});
},
unmount(container) {}
}
}
});

16
plugins/sync/plugin.json Normal file
View File

@ -0,0 +1,16 @@
{
"schemaVersion": 1,
"id": "verstak.sync",
"name": "Sync",
"version": "0.1.0",
"apiVersion": "0.1.0",
"source": "official",
"provides": ["verstak/sync/v1", "verstak/sync.status/v1"],
"requires": ["verstak/core/files/v1"],
"permissions": ["files.read", "files.write", "network.remote", "settings.read", "settings.write", "ui.register"],
"frontend": { "entry": "frontend/dist/index.js" },
"contributes": {
"settingsPanels": [{ "id": "verstak.sync.settings", "title": "Sync", "component": "SyncSettings" }],
"statusBarItems": [{ "id": "verstak.sync.status", "label": "Sync", "position": "right" }]
}
}