node-karin 1.8.13 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +88 -79
- package/dist/web/assets/css/index-CZ_28tSH.css.br +0 -0
- package/dist/web/assets/js/components-AQsFMN7-.js.br +0 -0
- package/dist/web/assets/js/entry-UpjOQl3S.js.br +0 -0
- package/dist/web/assets/js/hooks-C1liScQm.js.br +0 -0
- package/dist/web/assets/js/page-404.tsx-vg2MOg_F.js +1 -0
- package/dist/web/assets/js/page-dashboard-BMR0KJUA.js.br +0 -0
- package/dist/web/assets/js/page-login.tsx-CseiAC-5.js.br +0 -0
- package/dist/web/assets/js/{utils-DqFE1yN-.js → utils-C1_eVtU6.js} +1 -1
- package/dist/web/assets/js/vendor-heroui-BYc15sbq.js.br +0 -0
- package/dist/web/index.html +7 -7
- package/package.json +1 -1
- package/README.md +0 -95
- package/dist/web/assets/css/index-2KMNnJRA.css.br +0 -0
- package/dist/web/assets/js/components-9RKTV4LX.js.br +0 -0
- package/dist/web/assets/js/entry-CzDSdA4M.js.br +0 -0
- package/dist/web/assets/js/hooks-D65eaS4p.js.br +0 -0
- package/dist/web/assets/js/page-404.tsx-BNti6Z2J.js +0 -1
- package/dist/web/assets/js/page-dashboard-BewrlGFW.js.br +0 -0
- package/dist/web/assets/js/page-login.tsx-DkO-XzeU.js.br +0 -0
- package/dist/web/assets/js/vendor-heroui-WfpTlnyv.js.br +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## [1.9.0](https://github.com/KarinJS/Karin/compare/core-v1.8.13...core-v1.9.0) (2025-05-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ✨ Features
|
|
7
|
+
|
|
8
|
+
* 增加Docker安装方式以及Docker构建工作流 ([#424](https://github.com/KarinJS/Karin/issues/424)) ([f58417d](https://github.com/KarinJS/Karin/commit/f58417d4593f74b710a5072f5aacdcc8c3d07fab))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### 🎡 Continuous Integration
|
|
12
|
+
|
|
13
|
+
* 优化ci ([#428](https://github.com/KarinJS/Karin/issues/428)) ([75fe5cb](https://github.com/KarinJS/Karin/commit/75fe5cb5a33b59e0089a39e540602202eb2c675b))
|
|
14
|
+
|
|
3
15
|
## [1.8.13](https://github.com/KarinJS/Karin/compare/core-v1.8.12...core-v1.8.13) (2025-05-09)
|
|
4
16
|
|
|
5
17
|
|
package/dist/index.d.ts
CHANGED
|
@@ -12119,7 +12119,7 @@ declare const getCacheCfg: <T>(cache: Record<string, T>, count: ReturnType<typeo
|
|
|
12119
12119
|
* @param count 计数器
|
|
12120
12120
|
* @param cache 缓存
|
|
12121
12121
|
*/
|
|
12122
|
-
declare const clearCache: <T extends GroupsObjectValue | PrivatesObjectValue>(
|
|
12122
|
+
declare const clearCache: <T extends GroupsObjectValue | PrivatesObjectValue>(count: ReturnType<typeof createCount>, staticCache: Record<string, T>, dynamicCache: Record<string, T>) => void;
|
|
12123
12123
|
|
|
12124
12124
|
/**
|
|
12125
12125
|
* @description 默认配置
|
package/dist/index.mjs
CHANGED
|
@@ -1371,7 +1371,7 @@ var init_file2 = __esm({
|
|
|
1371
1371
|
createPluginDir = async (name, files) => {
|
|
1372
1372
|
if (!Array.isArray(files)) files = ["config", "data", "resources"];
|
|
1373
1373
|
if (files.length === 0) return;
|
|
1374
|
-
const pluginPath = path5.join(
|
|
1374
|
+
const pluginPath = path5.join(karinPathBase, name);
|
|
1375
1375
|
if (!fs6.existsSync(pluginPath)) await fs6.promises.mkdir(pluginPath, { recursive: true });
|
|
1376
1376
|
await Promise.all(files.map((file) => {
|
|
1377
1377
|
const filePath = path5.join(pluginPath, file);
|
|
@@ -1629,19 +1629,22 @@ var init_path = __esm({
|
|
|
1629
1629
|
const files = fs6.readdirSync(filePath, { withFileTypes: true });
|
|
1630
1630
|
const list2 = [];
|
|
1631
1631
|
if (!Array.isArray(ext)) ext = [ext];
|
|
1632
|
-
|
|
1633
|
-
if (
|
|
1634
|
-
|
|
1632
|
+
const allFiles = (dir2, entry) => {
|
|
1633
|
+
if (entry.isDirectory()) {
|
|
1634
|
+
const subFiles = filesByExt(path5.join(dir2, entry.name), ext, returnType);
|
|
1635
|
+
list2.push(...subFiles);
|
|
1636
|
+
} else if (ext.includes(path5.extname(entry.name))) {
|
|
1635
1637
|
if (returnType === "name") {
|
|
1636
|
-
list2.push(
|
|
1638
|
+
list2.push(entry.name);
|
|
1637
1639
|
} else if (returnType === "rel") {
|
|
1638
|
-
const file = path5.resolve(
|
|
1640
|
+
const file = path5.resolve(dir2, entry.name);
|
|
1639
1641
|
list2.push(path5.relative(process.cwd(), file));
|
|
1640
1642
|
} else if (returnType === "abs") {
|
|
1641
|
-
list2.push(formatPath(path5.resolve(
|
|
1643
|
+
list2.push(formatPath(path5.resolve(dir2, entry.name)));
|
|
1642
1644
|
}
|
|
1643
1645
|
}
|
|
1644
|
-
}
|
|
1646
|
+
};
|
|
1647
|
+
files.forEach((entry) => allFiles(filePath, entry));
|
|
1645
1648
|
return list2;
|
|
1646
1649
|
};
|
|
1647
1650
|
splitPath = (filePath) => {
|
|
@@ -3225,38 +3228,41 @@ var init_tools = __esm({
|
|
|
3225
3228
|
createCount = () => {
|
|
3226
3229
|
return {};
|
|
3227
3230
|
};
|
|
3228
|
-
getCacheCfg = (
|
|
3231
|
+
getCacheCfg = (cache10, count3, keys) => {
|
|
3229
3232
|
const key = keys[0];
|
|
3230
|
-
if (
|
|
3233
|
+
if (cache10[key]) {
|
|
3231
3234
|
initCount(count3, key);
|
|
3232
|
-
return
|
|
3235
|
+
return cache10[key];
|
|
3233
3236
|
}
|
|
3234
|
-
keys.
|
|
3235
|
-
|
|
3236
|
-
if (
|
|
3237
|
+
for (let i = 0; i < keys.length; i++) {
|
|
3238
|
+
const v = keys[i];
|
|
3239
|
+
if (!cache10[v]) {
|
|
3240
|
+
continue;
|
|
3241
|
+
}
|
|
3242
|
+
if (i === 0 && v === key) {
|
|
3237
3243
|
initCount(count3, v);
|
|
3238
|
-
return
|
|
3244
|
+
return cache10[v];
|
|
3239
3245
|
}
|
|
3240
3246
|
if (v === key) {
|
|
3241
3247
|
initCount(count3, v);
|
|
3242
|
-
return
|
|
3248
|
+
return cache10[v];
|
|
3243
3249
|
}
|
|
3244
|
-
|
|
3250
|
+
cache10[key] = cache10[v];
|
|
3245
3251
|
initCount(count3, key);
|
|
3246
|
-
return
|
|
3247
|
-
}
|
|
3248
|
-
return
|
|
3252
|
+
return cache10[key];
|
|
3253
|
+
}
|
|
3254
|
+
return cache10.default;
|
|
3249
3255
|
};
|
|
3250
|
-
clearCache = (
|
|
3256
|
+
clearCache = (count3, staticCache3, dynamicCache3) => {
|
|
3251
3257
|
setInterval(() => {
|
|
3252
3258
|
Object.keys(count3).forEach((key) => {
|
|
3253
3259
|
if (count3[key].count - count3[key].start < 10) {
|
|
3254
|
-
if (
|
|
3260
|
+
if (staticCache3[key]) {
|
|
3255
3261
|
delete count3[key];
|
|
3256
3262
|
return;
|
|
3257
3263
|
}
|
|
3258
3264
|
delete count3[key];
|
|
3259
|
-
delete
|
|
3265
|
+
delete dynamicCache3[key];
|
|
3260
3266
|
} else {
|
|
3261
3267
|
count3[key].start = count3[key].count;
|
|
3262
3268
|
}
|
|
@@ -10201,12 +10207,12 @@ var init_list = __esm({
|
|
|
10201
10207
|
list2.map(async (v) => {
|
|
10202
10208
|
const [type, name] = v.split(":");
|
|
10203
10209
|
if (type === "app") {
|
|
10204
|
-
const file = path5.join(
|
|
10210
|
+
const file = path5.join(karinPathPlugins, name);
|
|
10205
10211
|
await getAppInfo(info, file, name, ext, isForce);
|
|
10206
10212
|
return;
|
|
10207
10213
|
}
|
|
10208
10214
|
if (type === "git" || type === "root") {
|
|
10209
|
-
const file = type === "root" ? process.cwd() : path5.join(
|
|
10215
|
+
const file = type === "root" ? process.cwd() : path5.join(karinPathPlugins, name);
|
|
10210
10216
|
await getGitInfo(info, file, name, ext, isForce, env3);
|
|
10211
10217
|
return;
|
|
10212
10218
|
}
|
|
@@ -10229,7 +10235,7 @@ var init_list = __esm({
|
|
|
10229
10235
|
files.map(async (v) => {
|
|
10230
10236
|
if (!v.isDirectory()) return;
|
|
10231
10237
|
if (!v.name.startsWith("karin-plugin-")) return;
|
|
10232
|
-
if (fs6.existsSync(`${
|
|
10238
|
+
if (fs6.existsSync(`${karinPathPlugins}/${v.name}/package.json`)) return;
|
|
10233
10239
|
list2.push(`app:${v.name}`);
|
|
10234
10240
|
})
|
|
10235
10241
|
);
|
|
@@ -10239,8 +10245,8 @@ var init_list = __esm({
|
|
|
10239
10245
|
files.map(async (v) => {
|
|
10240
10246
|
if (!v.isDirectory()) return;
|
|
10241
10247
|
if (!v.name.startsWith("karin-plugin-")) return;
|
|
10242
|
-
if (!fs6.existsSync(path5.join(
|
|
10243
|
-
const pkg2 = await requireFile(path5.join(
|
|
10248
|
+
if (!fs6.existsSync(path5.join(karinPathPlugins, v.name, "package.json"))) return;
|
|
10249
|
+
const pkg2 = await requireFile(path5.join(karinPathPlugins, v.name, "package.json"));
|
|
10244
10250
|
if (pkg2?.karin?.engines?.karin && !satisfies(pkg2.karin.engines.karin, process.env.KARIN_VERSION)) {
|
|
10245
10251
|
const msg = `[getPlugins][git] ${v.name} \u8981\u6C42 node-karin \u7248\u672C\u4E3A ${pkg2.karin.engines.karin}\uFF0C\u5F53\u524D\u4E0D\u7B26\u5408\u8981\u6C42\uFF0C\u8DF3\u8FC7\u52A0\u8F7D\u63D2\u4EF6`;
|
|
10246
10252
|
isInit && setTimeout(() => logger.error(msg), 1e3);
|
|
@@ -10278,6 +10284,7 @@ var init_list = __esm({
|
|
|
10278
10284
|
"sqlite3"
|
|
10279
10285
|
];
|
|
10280
10286
|
collectNpmPlugins = async (list2) => {
|
|
10287
|
+
logger.debug("[collectNpmPlugins] \u5F00\u59CB\u6536\u96C6NPM\u63D2\u4EF6");
|
|
10281
10288
|
const pkg2 = await requireFile("./package.json", { force: true });
|
|
10282
10289
|
const dependencies = [
|
|
10283
10290
|
...Object.keys(pkg2.dependencies || {}),
|
|
@@ -10318,7 +10325,7 @@ var init_list = __esm({
|
|
|
10318
10325
|
initCache();
|
|
10319
10326
|
if (!["npm", "all", "git", "app"].includes(type)) return [];
|
|
10320
10327
|
const list2 = [];
|
|
10321
|
-
const files = type === "npm" ? [] : fs6.existsSync(
|
|
10328
|
+
const files = type === "npm" ? [] : fs6.existsSync(karinPathPlugins) ? await fs6.promises.readdir(karinPathPlugins, { withFileTypes: true }) : [];
|
|
10322
10329
|
switch (type) {
|
|
10323
10330
|
case "app":
|
|
10324
10331
|
await collectAppPlugins(files, list2);
|
|
@@ -13845,7 +13852,7 @@ function requireRange() {
|
|
|
13845
13852
|
parseRange(range22) {
|
|
13846
13853
|
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
13847
13854
|
const memoKey = memoOpts + ":" + range22;
|
|
13848
|
-
const cached =
|
|
13855
|
+
const cached = cache10.get(memoKey);
|
|
13849
13856
|
if (cached) {
|
|
13850
13857
|
return cached;
|
|
13851
13858
|
}
|
|
@@ -13879,7 +13886,7 @@ function requireRange() {
|
|
|
13879
13886
|
rangeMap.delete("");
|
|
13880
13887
|
}
|
|
13881
13888
|
const result = [...rangeMap.values()];
|
|
13882
|
-
|
|
13889
|
+
cache10.set(memoKey, result);
|
|
13883
13890
|
return result;
|
|
13884
13891
|
}
|
|
13885
13892
|
intersects(range22, options) {
|
|
@@ -13918,7 +13925,7 @@ function requireRange() {
|
|
|
13918
13925
|
}
|
|
13919
13926
|
range2 = Range;
|
|
13920
13927
|
const LRU = requireLrucache();
|
|
13921
|
-
const
|
|
13928
|
+
const cache10 = new LRU();
|
|
13922
13929
|
const parseOptions = requireParseOptions();
|
|
13923
13930
|
const Comparator = requireComparator();
|
|
13924
13931
|
const debug3 = requireDebug();
|
|
@@ -16673,7 +16680,7 @@ var init_config2 = __esm({
|
|
|
16673
16680
|
config_default = initConfig;
|
|
16674
16681
|
}
|
|
16675
16682
|
});
|
|
16676
|
-
var count,
|
|
16683
|
+
var count, staticCache, dynamicCache, getCfg, isOld, migrate, format2, initGroups, groups, getGroupCfg, getGuildCfg, getGroupsFileData, groups_default;
|
|
16677
16684
|
var init_groups4 = __esm({
|
|
16678
16685
|
"src/utils/config/file/groups.ts"() {
|
|
16679
16686
|
init_watch();
|
|
@@ -16683,7 +16690,7 @@ var init_groups4 = __esm({
|
|
|
16683
16690
|
init_default();
|
|
16684
16691
|
init_tools();
|
|
16685
16692
|
count = createCount();
|
|
16686
|
-
getCfg = (keys) => getCacheCfg(
|
|
16693
|
+
getCfg = (keys) => getCacheCfg(dynamicCache, count, keys);
|
|
16687
16694
|
isOld = (obj) => {
|
|
16688
16695
|
if (Array.isArray(obj)) return false;
|
|
16689
16696
|
return Object.keys(obj).every((key) => typeof obj[key] === "object");
|
|
@@ -16710,19 +16717,20 @@ var init_groups4 = __esm({
|
|
|
16710
16717
|
const name = "groups.json";
|
|
16711
16718
|
const file = `${dir2}/${name}`;
|
|
16712
16719
|
const data = requireFileSync(file, { type: "json" });
|
|
16713
|
-
|
|
16714
|
-
|
|
16720
|
+
staticCache = isOld(data) ? migrate(file, data) : format2(data);
|
|
16721
|
+
dynamicCache = format2(data);
|
|
16715
16722
|
watch(file, async (old, data2) => {
|
|
16716
|
-
|
|
16717
|
-
|
|
16723
|
+
staticCache = isOld(data2) ? migrate(file, data2) : format2(data2);
|
|
16724
|
+
dynamicCache = staticCache;
|
|
16725
|
+
const options = { file: name, old, data: dynamicCache };
|
|
16718
16726
|
listeners.emit(FILE_CHANGE, options);
|
|
16719
16727
|
listeners.emit(`${FILE_CHANGE}:${name}`, options);
|
|
16720
16728
|
}, { type: "json" });
|
|
16721
|
-
clearCache(
|
|
16729
|
+
clearCache(count, staticCache, dynamicCache);
|
|
16722
16730
|
};
|
|
16723
16731
|
groups = () => {
|
|
16724
16732
|
return {
|
|
16725
|
-
get: () =>
|
|
16733
|
+
get: () => dynamicCache
|
|
16726
16734
|
};
|
|
16727
16735
|
};
|
|
16728
16736
|
getGroupCfg = (groupId, selfId) => {
|
|
@@ -16754,7 +16762,7 @@ var init_groups4 = __esm({
|
|
|
16754
16762
|
groups_default = initGroups;
|
|
16755
16763
|
}
|
|
16756
16764
|
});
|
|
16757
|
-
var count2,
|
|
16765
|
+
var count2, staticCache2, dynamicCache2, getCfg2, isOld2, migrate2, format3, initPrivates, privates, getFriendCfg, getDirectCfg, getPrivatesFileData, privates_default;
|
|
16758
16766
|
var init_privates = __esm({
|
|
16759
16767
|
"src/utils/config/file/privates.ts"() {
|
|
16760
16768
|
init_watch();
|
|
@@ -16764,7 +16772,7 @@ var init_privates = __esm({
|
|
|
16764
16772
|
init_default();
|
|
16765
16773
|
init_tools();
|
|
16766
16774
|
count2 = createCount();
|
|
16767
|
-
getCfg2 = (keys) => getCacheCfg(
|
|
16775
|
+
getCfg2 = (keys) => getCacheCfg(dynamicCache2, count2, keys);
|
|
16768
16776
|
isOld2 = (obj) => {
|
|
16769
16777
|
if (Array.isArray(obj)) return false;
|
|
16770
16778
|
return Object.keys(obj).every((key) => typeof obj[key] === "object");
|
|
@@ -16791,17 +16799,18 @@ var init_privates = __esm({
|
|
|
16791
16799
|
const name = "privates.json";
|
|
16792
16800
|
const file = `${dir2}/${name}`;
|
|
16793
16801
|
const data = requireFileSync(file, { type: "json" });
|
|
16794
|
-
|
|
16795
|
-
|
|
16802
|
+
staticCache2 = isOld2(data) ? migrate2(file, data) : format3(data);
|
|
16803
|
+
dynamicCache2 = format3(data);
|
|
16796
16804
|
watch(file, async (old, data2) => {
|
|
16797
|
-
|
|
16798
|
-
|
|
16805
|
+
staticCache2 = isOld2(data2) ? migrate2(file, data2) : format3(data2);
|
|
16806
|
+
dynamicCache2 = staticCache2;
|
|
16807
|
+
const options = { file: name, old, data: dynamicCache2 };
|
|
16799
16808
|
listeners.emit(FILE_CHANGE, options);
|
|
16800
16809
|
listeners.emit(`${FILE_CHANGE}:${name}`, options);
|
|
16801
16810
|
}, { type: "json" });
|
|
16802
|
-
clearCache(
|
|
16811
|
+
clearCache(count2, staticCache2, dynamicCache2);
|
|
16803
16812
|
};
|
|
16804
|
-
privates = () =>
|
|
16813
|
+
privates = () => dynamicCache2;
|
|
16805
16814
|
getFriendCfg = (userId, selfId) => {
|
|
16806
16815
|
const keys = [`Bot:${selfId}:${userId}`, `Bot:${selfId}`, userId, "default"];
|
|
16807
16816
|
return getCfg2(keys);
|
|
@@ -17022,39 +17031,39 @@ var init_template = __esm({
|
|
|
17022
17031
|
});
|
|
17023
17032
|
|
|
17024
17033
|
// src/adapter/render/admin/cache.ts
|
|
17025
|
-
var index4,
|
|
17034
|
+
var index4, cache8, registerRender, unregisterRender, getRender, callRender, getRenderCount, getRenderList, renderHtml, renderMultiHtml, RenderCache, render, Renderer;
|
|
17026
17035
|
var init_cache3 = __esm({
|
|
17027
17036
|
"src/adapter/render/admin/cache.ts"() {
|
|
17028
17037
|
index4 = 0;
|
|
17029
|
-
|
|
17038
|
+
cache8 = [];
|
|
17030
17039
|
registerRender = (id, render4) => {
|
|
17031
17040
|
const i = ++index4;
|
|
17032
|
-
|
|
17041
|
+
cache8.push({ index: i, id, render: render4 });
|
|
17033
17042
|
logger.mark(`[render:${index4}] ${logger.green("\u6CE8\u518C\u6210\u529F")}: ${id}`);
|
|
17034
17043
|
return i;
|
|
17035
17044
|
};
|
|
17036
17045
|
unregisterRender = (index6) => {
|
|
17037
|
-
const app4 =
|
|
17046
|
+
const app4 = cache8.find((app5) => app5.index === index6);
|
|
17038
17047
|
if (!app4) {
|
|
17039
17048
|
logger.error(`[render] \u5378\u8F7D\u5931\u8D25: \u4E0D\u5B58\u5728\u7D22\u5F15 ${index6}`);
|
|
17040
17049
|
return false;
|
|
17041
17050
|
}
|
|
17042
|
-
|
|
17051
|
+
cache8.splice(cache8.findIndex((app5) => app5.index === index6), 1);
|
|
17043
17052
|
logger.mark(`[render] ${logger.yellow("\u5378\u8F7D\u6210\u529F")}: ${app4.id}`);
|
|
17044
17053
|
return true;
|
|
17045
17054
|
};
|
|
17046
17055
|
getRender = (id) => {
|
|
17047
|
-
if (
|
|
17056
|
+
if (cache8.length === 0) throw new Error("[\u8C03\u7528\u6E32\u67D3\u5668\u5931\u8D25] \u6E32\u67D3\u5668\u5217\u8868\u4E3A\u7A7A");
|
|
17048
17057
|
if (!id) {
|
|
17049
|
-
const app5 =
|
|
17058
|
+
const app5 = cache8[Math.floor(Math.random() * cache8.length)];
|
|
17050
17059
|
return app5;
|
|
17051
17060
|
}
|
|
17052
17061
|
if (typeof id === "number") {
|
|
17053
|
-
const app5 =
|
|
17062
|
+
const app5 = cache8.find((app6) => app6.index === id);
|
|
17054
17063
|
if (!app5) throw new Error(`[\u8C03\u7528\u6E32\u67D3\u5668\u5931\u8D25] \u672A\u627E\u5230\u6E32\u67D3\u5668\uFF1A${id}`);
|
|
17055
17064
|
return app5;
|
|
17056
17065
|
}
|
|
17057
|
-
const app4 =
|
|
17066
|
+
const app4 = cache8.find((app5) => app5.id === id);
|
|
17058
17067
|
if (!app4) throw new Error(`[\u8C03\u7528\u6E32\u67D3\u5668\u5931\u8D25] \u672A\u627E\u5230\u6E32\u67D3\u5668\uFF1A${id}`);
|
|
17059
17068
|
return app4;
|
|
17060
17069
|
};
|
|
@@ -17063,9 +17072,9 @@ var init_cache3 = __esm({
|
|
|
17063
17072
|
const result = await res.render(Object.assign(options, { encoding: "base64" }));
|
|
17064
17073
|
return result;
|
|
17065
17074
|
};
|
|
17066
|
-
getRenderCount = () =>
|
|
17075
|
+
getRenderCount = () => cache8.length;
|
|
17067
17076
|
getRenderList = () => {
|
|
17068
|
-
const list2 =
|
|
17077
|
+
const list2 = cache8.map((app4) => app4);
|
|
17069
17078
|
return list2;
|
|
17070
17079
|
};
|
|
17071
17080
|
renderHtml = (data) => {
|
|
@@ -17278,9 +17287,9 @@ var init_client2 = __esm({
|
|
|
17278
17287
|
});
|
|
17279
17288
|
};
|
|
17280
17289
|
disconnectSnapkaClient = (url) => {
|
|
17281
|
-
const
|
|
17282
|
-
if (!
|
|
17283
|
-
|
|
17290
|
+
const cache10 = snapkaMap.get(url);
|
|
17291
|
+
if (!cache10) return;
|
|
17292
|
+
cache10.close();
|
|
17284
17293
|
snapkaMap.delete(url);
|
|
17285
17294
|
};
|
|
17286
17295
|
addSnapkaClient = (clientOptions) => {
|
|
@@ -17461,7 +17470,7 @@ var init_snapka = __esm({
|
|
|
17461
17470
|
});
|
|
17462
17471
|
|
|
17463
17472
|
// src/utils/config/file/render.ts
|
|
17464
|
-
var
|
|
17473
|
+
var cache9, format4, initRender, render2, getRenderCfg, render_default;
|
|
17465
17474
|
var init_render = __esm({
|
|
17466
17475
|
"src/utils/config/file/render.ts"() {
|
|
17467
17476
|
init_watch();
|
|
@@ -17487,9 +17496,9 @@ var init_render = __esm({
|
|
|
17487
17496
|
const name = "render.json";
|
|
17488
17497
|
const file = `${dir2}/${name}`;
|
|
17489
17498
|
const data = requireFileSync(file, { type: "json" });
|
|
17490
|
-
|
|
17499
|
+
cache9 = format4(data);
|
|
17491
17500
|
watch(file, async (old, data2) => {
|
|
17492
|
-
|
|
17501
|
+
cache9 = format4(data2);
|
|
17493
17502
|
const wsClient = diffArray(
|
|
17494
17503
|
Array.isArray(old?.ws_client) ? old?.ws_client : [],
|
|
17495
17504
|
Array.isArray(data2?.ws_client) ? data2?.ws_client : []
|
|
@@ -17508,13 +17517,13 @@ var init_render = __esm({
|
|
|
17508
17517
|
);
|
|
17509
17518
|
httpServer.removed.forEach((v) => disconnectSnapkaHttp2(v.url));
|
|
17510
17519
|
httpServer.added.forEach((v) => createSnapkaHttp2(v));
|
|
17511
|
-
const options = { file: name, old, data:
|
|
17520
|
+
const options = { file: name, old, data: cache9 };
|
|
17512
17521
|
listeners.emit(FILE_CHANGE, options);
|
|
17513
17522
|
listeners.emit(`${FILE_CHANGE}:${name}`, options);
|
|
17514
17523
|
}, { type: "json" });
|
|
17515
17524
|
};
|
|
17516
|
-
render2 = () =>
|
|
17517
|
-
getRenderCfg = () =>
|
|
17525
|
+
render2 = () => cache9;
|
|
17526
|
+
getRenderCfg = () => cache9;
|
|
17518
17527
|
render_default = initRender;
|
|
17519
17528
|
}
|
|
17520
17529
|
});
|
|
@@ -22614,9 +22623,9 @@ var init_list2 = __esm({
|
|
|
22614
22623
|
init_redis();
|
|
22615
22624
|
getDependenciesListRouter = async (req, res) => {
|
|
22616
22625
|
try {
|
|
22617
|
-
const
|
|
22618
|
-
if (
|
|
22619
|
-
return createSuccessResponse(res,
|
|
22626
|
+
const cache10 = await getCache(req, res);
|
|
22627
|
+
if (cache10) {
|
|
22628
|
+
return createSuccessResponse(res, cache10);
|
|
22620
22629
|
}
|
|
22621
22630
|
const { stdout, error } = await exec("pnpm list --depth=0 --json");
|
|
22622
22631
|
if (error) {
|
|
@@ -22725,9 +22734,9 @@ var init_list2 = __esm({
|
|
|
22725
22734
|
return null;
|
|
22726
22735
|
}
|
|
22727
22736
|
const { redis: redis3 } = await Promise.resolve().then(() => (init_redis3(), redis_exports));
|
|
22728
|
-
const
|
|
22729
|
-
if (
|
|
22730
|
-
const data = JSON.parse(
|
|
22737
|
+
const cache10 = await redis3.get(REDIS_DEPENDENCIES_LIST_CACHE_KEY);
|
|
22738
|
+
if (cache10) {
|
|
22739
|
+
const data = JSON.parse(cache10);
|
|
22731
22740
|
if (!Array.isArray(data)) {
|
|
22732
22741
|
await redis3.del(REDIS_DEPENDENCIES_LIST_CACHE_KEY);
|
|
22733
22742
|
return null;
|
|
@@ -23300,9 +23309,9 @@ var init_market2 = __esm({
|
|
|
23300
23309
|
const list2 = [];
|
|
23301
23310
|
const isForce = Boolean(req.body.refresh ?? false);
|
|
23302
23311
|
if (!isForce) {
|
|
23303
|
-
const
|
|
23304
|
-
if (
|
|
23305
|
-
return createSuccessResponse(res, JSON.parse(
|
|
23312
|
+
const cache10 = await getCache2();
|
|
23313
|
+
if (cache10) {
|
|
23314
|
+
return createSuccessResponse(res, JSON.parse(cache10));
|
|
23306
23315
|
}
|
|
23307
23316
|
}
|
|
23308
23317
|
const [
|
|
@@ -23321,8 +23330,8 @@ var init_market2 = __esm({
|
|
|
23321
23330
|
};
|
|
23322
23331
|
getCache2 = async () => {
|
|
23323
23332
|
const { redis: redis3 } = await Promise.resolve().then(() => (init_redis3(), redis_exports));
|
|
23324
|
-
const
|
|
23325
|
-
return
|
|
23333
|
+
const cache10 = await redis3.get(REDIS_PLUGIN_MARKET_LIST_CACHE_KEY);
|
|
23334
|
+
return cache10;
|
|
23326
23335
|
};
|
|
23327
23336
|
setCache2 = async (data) => {
|
|
23328
23337
|
const { redis: redis3 } = await Promise.resolve().then(() => (init_redis3(), redis_exports));
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./vendor-react-Hg1DVPZt.js";import{P as r}from"./components-AQsFMN7-.js";import"./vendor-others-B6NXaB-r.js";import"./vendor-editor-B8hjWfkw.js";import"./vendor-ui-utils-5rYIvRjL.js";import"./vendor-heroui-BYc15sbq.js";import"./page-dashboard-BMR0KJUA.js";import"./hooks-C1liScQm.js";import"./utils-C1_eVtU6.js";import"./vendor-visual-mzxhMYK3.js";const x=()=>t.jsx("div",{className:"min-h-screen flex items-center justify-center",children:t.jsx(r,{})});export{x as default};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as p}from"./vendor-react-Hg1DVPZt.js";import{a5 as g}from"./components-
|
|
1
|
+
import{V as p}from"./vendor-react-Hg1DVPZt.js";import{a5 as g}from"./components-AQsFMN7-.js";const k=async(t,n,e,r)=>{const{setIsLogModalOpen:i,setTaskId:c,setTaskLogs:o,setTaskName:f}=n;f("更新插件");const a=["开始创建更新任务...",`options: ${JSON.stringify(t)}`];o(a);try{const s=await g(t);if(s.success&&s.taskId)c(s.taskId),o([...a,`
|
|
2
2
|
任务创建成功!`,`任务ID: ${s.taskId}`,"正在连接任务执行日志..."]),i(!0),typeof e=="function"&&e(),typeof r=="function"&&r();else throw new Error(s.message||"未知错误")}catch(s){console.error("更新失败:",s),p.error(`更新失败: ${s.message}`)}};export{k as c};
|
|
Binary file
|
package/dist/web/index.html
CHANGED
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
content="viewport-fit=cover, width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
|
|
15
15
|
name="viewport" />
|
|
16
16
|
<link href="/web/assets/ico/favicon-BoqZd694.ico" rel="icon" />
|
|
17
|
-
<script type="module" crossorigin src="/web/assets/js/entry-
|
|
17
|
+
<script type="module" crossorigin src="/web/assets/js/entry-UpjOQl3S.js"></script>
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-editor-B8hjWfkw.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-others-B6NXaB-r.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-ui-utils-5rYIvRjL.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-react-Hg1DVPZt.js">
|
|
22
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-heroui-
|
|
23
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/hooks-
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-heroui-BYc15sbq.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/hooks-C1liScQm.js">
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-visual-mzxhMYK3.js">
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/components-
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/utils-
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/page-dashboard-
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/components-AQsFMN7-.js">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/utils-C1_eVtU6.js">
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/page-dashboard-BMR0KJUA.js">
|
|
28
28
|
<link rel="stylesheet" crossorigin href="/web/assets/css/vendor-editor-CFbL2ovg.css">
|
|
29
29
|
<link rel="stylesheet" crossorigin href="/web/assets/css/vendor-others-ZgkIHsf0.css">
|
|
30
30
|
<link rel="stylesheet" crossorigin href="/web/assets/css/components-ep7vm38G.css">
|
|
31
|
-
<link rel="stylesheet" crossorigin href="/web/assets/css/index-
|
|
31
|
+
<link rel="stylesheet" crossorigin href="/web/assets/css/index-CZ_28tSH.css">
|
|
32
32
|
</head>
|
|
33
33
|
|
|
34
34
|
<body>
|
package/package.json
CHANGED
package/README.md
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-

|
|
2
|
-
|
|
3
|
-
## 项目介绍
|
|
4
|
-
|
|
5
|
-
`karin`(卡琳)是一款灵活、现代、极易扩展的 Node.js 插件化应用框架,专为开发者打造,助你轻松构建属于自己的高效工具链和自动化服务。
|
|
6
|
-
|
|
7
|
-
✨ **主要特性**:
|
|
8
|
-
- 插件化架构,支持热插拔,生态丰富
|
|
9
|
-
- 一行命令即可初始化项目,快速上手
|
|
10
|
-
- 丰富的 Web UI(基于 React + HeroUI),颜值与功能并存
|
|
11
|
-
- 支持多种自动化场景、任务调度、依赖管理
|
|
12
|
-
- 轻松集成第三方服务,打造属于你的"数字助理"
|
|
13
|
-
- 社区活跃,持续更新,文档完善
|
|
14
|
-
|
|
15
|
-
> 🦄 让开发变得像魔法一样有趣!
|
|
16
|
-
|
|
17
|
-
## 🚀 稳定长期维护
|
|
18
|
-
|
|
19
|
-
自 `1.8.0` 版本起,Karin 已进入**稳定长期维护阶段**。我们承诺持续修复 bug、优化体验,并欢迎社区力量共同完善生态。
|
|
20
|
-
|
|
21
|
-
## 快速开始
|
|
22
|
-
|
|
23
|
-
[📚 查看最新文档](https://karin.fun/)
|
|
24
|
-
|
|
25
|
-
一键初始化:`pnpm create karin`
|
|
26
|
-
|
|
27
|
-
> 当前文档可能存在滞后性,欢迎加入交流群(967068507)一起玩耍、提建议!
|
|
28
|
-
|
|
29
|
-
## 温馨提示
|
|
30
|
-
|
|
31
|
-
> Karin 现已稳定,放心食用!遇到问题欢迎提 Issue 或加群讨论,我们会持续优化。
|
|
32
|
-
|
|
33
|
-
## 文档站说明
|
|
34
|
-
|
|
35
|
-
我们提供多个文档站点供您访问,解决可能出现的访问困难:
|
|
36
|
-
|
|
37
|
-
- **主文档站**: [https://karin.fun](https://karin.fun) (基于 GitHub Pages)
|
|
38
|
-
- **镜像站点**:
|
|
39
|
-
- 憨憨镜像: [https://karin.hanhanz.top](https://karin.hanhanz.top) (**推荐访问**)
|
|
40
|
-
- Vercel 镜像: [https://docs.karin.fun](https://docs.karin.fun) (**推荐访问**)
|
|
41
|
-
- Deno 镜像: [https://karin.deno.dev](https://karin.deno.dev) (**推荐访问**)
|
|
42
|
-
|
|
43
|
-
> 💡 主文档站托管在 GitHub 上,如访问不畅,推荐使用 Deno 镜像站
|
|
44
|
-
|
|
45
|
-
## 鸣谢
|
|
46
|
-
|
|
47
|
-
- webui: [bietiaop](https://github.com/bietiaop)
|
|
48
|
-
- docs: [ikenxuan](https://github.com/ikenxuan)
|
|
49
|
-
- name: [fuqiuluo](https://github.com/fuqiuluo)
|
|
50
|
-
|
|
51
|
-
> 🧙♂️ 感谢三位大佬的魔法加持!
|
|
52
|
-
|
|
53
|
-
### 贡献者
|
|
54
|
-
|
|
55
|
-
> 🌟 星光闪烁,你们的智慧如同璀璨的夜空。感谢所有为 **Karin** 做出贡献的人!
|
|
56
|
-
|
|
57
|
-
[](https://github.com/KarinJS/Karin/graphs/contributors)
|
|
58
|
-
|
|
59
|
-

|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
🎉 **加入我们,让 Karin 成为你开发路上的贴心伙伴!**
|
|
64
|
-
|
|
65
|
-
## 常见问题
|
|
66
|
-
|
|
67
|
-
- 文档没看懂?[点我提问](https://github.com/KarinJS/Karin/issues) 或加群 967068507
|
|
68
|
-
- 插件不会写?欢迎参考[插件开发文档](https://karin.fun/plugins/)
|
|
69
|
-
- 遇到 bug?大胆提 Issue,我们超快响应!
|
|
70
|
-
|
|
71
|
-
## 如何参与贡献(PR)
|
|
72
|
-
|
|
73
|
-
1. Fork 本仓库,创建你的分支
|
|
74
|
-
2. 提交你的更改,附上简要说明
|
|
75
|
-
3. 发起 Pull Request,耐心等待 Review
|
|
76
|
-
4. 你的名字将出现在贡献者列表,收获一份开源荣誉!
|
|
77
|
-
|
|
78
|
-
> 💡 欢迎任何形式的贡献,无论是代码、文档、建议还是灵感!
|
|
79
|
-
|
|
80
|
-
## Issue 指南
|
|
81
|
-
|
|
82
|
-
- 提交前请先搜索是否有类似问题
|
|
83
|
-
- 尽量提供详细的复现步骤、环境信息和截图
|
|
84
|
-
- 标题简明扼要,正文描述清晰
|
|
85
|
-
- 遇到安全相关问题请私信维护者
|
|
86
|
-
|
|
87
|
-
## 开源协议
|
|
88
|
-
|
|
89
|
-
本项目基于 [MIT License](./LICENSE) 开源,欢迎自由使用、修改和分发。
|
|
90
|
-
|
|
91
|
-
> 📢 记得给个 Star 支持我们,你的支持是我们最大的动力!
|
|
92
|
-
|
|
93
|
-
## 更新日志
|
|
94
|
-
|
|
95
|
-
我们定期发布更新,查看 [CHANGELOG](https://github.com/KarinJS/Karin/releases) 了解最新变化。
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./vendor-react-Hg1DVPZt.js";import{P as r}from"./components-9RKTV4LX.js";import"./vendor-others-B6NXaB-r.js";import"./vendor-editor-B8hjWfkw.js";import"./vendor-ui-utils-5rYIvRjL.js";import"./vendor-heroui-WfpTlnyv.js";import"./page-dashboard-BewrlGFW.js";import"./hooks-D65eaS4p.js";import"./utils-DqFE1yN-.js";import"./vendor-visual-mzxhMYK3.js";const x=()=>t.jsx("div",{className:"min-h-screen flex items-center justify-center",children:t.jsx(r,{})});export{x as default};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|