🚚 (split): 从 moon-source 拆出独立仓库,更新只管本插件

书源插件自成仓库、独立发版;update.lua 改为只检查并更新本插件(仓库 GarfieldMoon/moonsource-qidian),
打包、测试脚本与发布流程改为单插件,跨书源的测试按插件拆开。公共文件见 moonsource-template。

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
GarfieldandCopilot committed 2026-11-18 14:28:56 +08:00
1 parent 8c839dc99d
commit ebbe2df9fc
11 files changed
+1009 -122

No files matched your search

+12 -3
View File
@@ -2,7 +2,7 @@
阅文三源的设备扫码入口:各用自己的应用参数,先校验再保存。
起点真 csrf 由 loginCheck 合并书架 Set-Cookie,扫码回调不再造假。
@module tests.moonsource_qidian.yuewen_qr_setting_spec
@module tests.yuewen_qr_setting_spec(qidian / qqreader / xiaoxiang 仓库各一份,只测本仓库存在的书源)
--]]
local Assert = require("support.assert")
@@ -59,11 +59,16 @@ for _idx, name in ipairs({ "qqreader", "qidian", "xiaoxiang" }) do
end
end
-- 每个书源一个仓库:只测本仓库里存在的那几家
local SOURCES = {}
for _idx, source in ipairs({
{ id = "qqreader", app_id = "1450000220", area_id = "1" },
{ id = "qidian", app_id = "13", area_id = "31" },
{ id = "xiaoxiang", app_id = "57", area_id = "5" },
}) do
if package.searchpath("moonsource_" .. source.id .. ".setting", package.path) then SOURCES[#SOURCES + 1] = source end
end
for _idx, source in ipairs(SOURCES) do
local Setting = require("moonsource_" .. source.id .. ".setting")
started, checked, saved_id, authorized = nil, nil, nil, nil
local rows = Setting.rows()
@@ -88,7 +93,11 @@ for _idx, source in ipairs({
started = nil
Setting.login()
Assert.is_true(started, "登录失效的直达入口也走设备扫码")
if source.id ~= "qqreader" then
if source.id == "qqreader" then
Assert.eq(Setting.browser.domain, "book.qq.com")
Assert.eq(Setting.browser.login, "https://book.qq.com/book-shelf")
Assert.eq(Setting.browser.check, "https://book.qq.com/book-shelf")
else
local paste
for _idx, factory in ipairs(Setting.rows()) do
local row = factory(400)
@@ -99,4 +108,4 @@ for _idx, source in ipairs({
Assert.eq(Themed.last("input").title, source.id == "qidian" and "起点登录 Cookie" or "潇湘登录 Cookie")
end
end
Assert.eq(reloads, 3)
Assert.eq(reloads, #SOURCES)