From 069e6fe000cef992d4248e2a9dd120fcb34ce107 Mon Sep 17 00:00:00 2001 From: lihan Date: Mon, 25 Mar 2024 12:33:03 +0800 Subject: [PATCH] fix: manifest url --- internal/interfaces.go | 1 + internal/plugin_test.go | 4 ++-- internal/printer/select_test.go | 2 +- .../plugins/java_with_metadata/metadata.lua | 15 +++------------ 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/internal/interfaces.go b/internal/interfaces.go index b05c8150..6a07c1e0 100644 --- a/internal/interfaces.go +++ b/internal/interfaces.go @@ -165,6 +165,7 @@ type LuaPluginInfo struct { Version string `luai:"version"` Description string `luai:"description"` UpdateUrl string `luai:"updateUrl"` // TODO Will be deprecated in future versions + ManifestUrl string `luai:"manifestUrl"` Homepage string `luai:"homepage"` License string `luai:"license"` MinRuntimeVersion string `luai:"minRuntimeVersion"` diff --git a/internal/plugin_test.go b/internal/plugin_test.go index 911dbeda..caff860a 100644 --- a/internal/plugin_test.go +++ b/internal/plugin_test.go @@ -109,8 +109,8 @@ func TestNewLuaPluginWithMetadataAndHooks(t *testing.T) { t.Errorf("expected description 'xxx', got '%s'", plugin.Description) } - if plugin.UpdateUrl != "{URL}/sdk.lua" { - t.Errorf("expected update url '{URL}/sdk.lua', got '%s'", plugin.UpdateUrl) + if plugin.ManifestUrl != "manifest.json" { + t.Errorf("expected manifest url 'manifest.json', got '%s'", plugin.ManifestUrl) } if plugin.MinRuntimeVersion != "0.2.2" { diff --git a/internal/printer/select_test.go b/internal/printer/select_test.go index d7256029..9aff2725 100644 --- a/internal/printer/select_test.go +++ b/internal/printer/select_test.go @@ -46,7 +46,7 @@ func TestSelect_Show(t *testing.T) { } s := &PageKVSelect{ index: 0, - SourceFunc: func(page, size int) ([]*KV, error) { + SourceFunc: func(page, size int, options []*KV) ([]*KV, error) { // 计算开始和结束索引 start := page * size end := start + size diff --git a/internal/testdata/plugins/java_with_metadata/metadata.lua b/internal/testdata/plugins/java_with_metadata/metadata.lua index 38af69e9..7b0a4f44 100644 --- a/internal/testdata/plugins/java_with_metadata/metadata.lua +++ b/internal/testdata/plugins/java_with_metadata/metadata.lua @@ -6,22 +6,11 @@ PLUGIN = {} PLUGIN.name = "java" --- Plugin version PLUGIN.version = "0.0.1" --- Update URL, will deprecated in the future ----@deprecated -PLUGIN.updateUrl = "{URL}/sdk.lua" -- Repository URL PLUGIN.repository = "https://github.com/version-fox/vfox-plugin-template" PLUGIN.notes = { - "some notes", - "some notes", -} - --- Some preset configurations -PLUGIN.presets = { - "nodejs", - "tinghua", - "npmmirror" + "", } --- !!! OPTIONAL !!! @@ -29,3 +18,5 @@ PLUGIN.presets = { PLUGIN.description = "xxx" -- minimum compatible vfox version PLUGIN.minRuntimeVersion = "0.2.2" + +PLUGIN.manifestUrl = "manifest.json" \ No newline at end of file