node-karin 1.10.5 → 1.10.7
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 +14 -0
- package/dist/index.mjs +14 -0
- package/dist/start/index.mjs +13 -11
- package/dist/web/assets/css/index-Bq0kgume.css.br +0 -0
- package/dist/web/assets/js/components-C8mD5H9u.js.br +0 -0
- package/dist/web/assets/js/entry-B3jpAEDK.js.br +0 -0
- package/dist/web/assets/js/hooks-CrFgaybL.js.br +0 -0
- package/dist/web/assets/js/page-404.tsx-Dbb54KqG.js +1 -0
- package/dist/web/assets/js/page-dashboard-DNNUfIJO.js.br +0 -0
- package/dist/web/assets/js/page-loading.tsx-BUSG9gGO.js.br +0 -0
- package/dist/web/assets/js/page-login.tsx-CotDRIUl.js.br +0 -0
- package/dist/web/assets/js/{utils-Csan4HCy.js → utils-DV3Ugabq.js} +1 -1
- package/dist/web/assets/js/vendor-heroui-DqoPVa63.js.br +0 -0
- package/dist/web/assets/js/vendor-others-DGUjmv7c.js.br +0 -0
- package/dist/web/assets/js/vendor-react-ZA9Ag8xC.js.br +0 -0
- package/dist/web/assets/js/vendor-visual-CTuViOkk.js.br +0 -0
- package/dist/web/index.html +10 -10
- package/package.json +1 -1
- package/dist/web/assets/css/index-UGP8LfJg.css.br +0 -0
- package/dist/web/assets/js/components-BLnh3G72.js.br +0 -0
- package/dist/web/assets/js/entry-Bu34wpVH.js.br +0 -0
- package/dist/web/assets/js/hooks-Ct7PuBJz.js.br +0 -0
- package/dist/web/assets/js/page-404.tsx-DHK3529E.js +0 -1
- package/dist/web/assets/js/page-dashboard-CWURXXkN.js.br +0 -0
- package/dist/web/assets/js/page-loading.tsx-BSjer5Lr.js.br +0 -0
- package/dist/web/assets/js/page-login.tsx-CfIsjuoq.js.br +0 -0
- package/dist/web/assets/js/vendor-heroui-BHUSASI0.js.br +0 -0
- package/dist/web/assets/js/vendor-others-CBBlg8Fy.js.br +0 -0
- package/dist/web/assets/js/vendor-react-DODmErXx.js.br +0 -0
- package/dist/web/assets/js/vendor-visual-C2oODoBB.js.br +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## [1.10.7](https://github.com/KarinJS/Karin/compare/core-v1.10.6...core-v1.10.7) (2025-06-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### 🐛 Bug Fixes
|
|
7
|
+
|
|
8
|
+
* 优化重启功能逻辑和UI引导 ([7746c21](https://github.com/KarinJS/Karin/commit/7746c21834ea8f010dbb713e66a3ee0d87d1e206))
|
|
9
|
+
|
|
10
|
+
## [1.10.6](https://github.com/KarinJS/Karin/compare/core-v1.10.5...core-v1.10.6) (2025-06-13)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### 🐛 Bug Fixes
|
|
14
|
+
|
|
15
|
+
* close [#477](https://github.com/KarinJS/Karin/issues/477) [#460](https://github.com/KarinJS/Karin/issues/460) ([74d2e08](https://github.com/KarinJS/Karin/commit/74d2e08e5cde67b9a17acb857c2691cce33a6d9c))
|
|
16
|
+
|
|
3
17
|
## [1.10.5](https://github.com/KarinJS/Karin/compare/core-v1.10.4...core-v1.10.5) (2025-06-12)
|
|
4
18
|
|
|
5
19
|
|
package/dist/index.mjs
CHANGED
|
@@ -11255,6 +11255,7 @@ var restart, restartDirect;
|
|
|
11255
11255
|
var init_restart = __esm({
|
|
11256
11256
|
"src/utils/system/restart.ts"() {
|
|
11257
11257
|
init_exec();
|
|
11258
|
+
init_config();
|
|
11258
11259
|
restart = async (selfId, contact3, messageId, isFront = true, reloadDeps = false) => {
|
|
11259
11260
|
const options = {
|
|
11260
11261
|
selfId,
|
|
@@ -11283,6 +11284,19 @@ var init_restart = __esm({
|
|
|
11283
11284
|
restartDirect = async (options) => {
|
|
11284
11285
|
const { isPm2 = false, reloadDeps = false } = options || {};
|
|
11285
11286
|
logger.mark("\u6536\u5230\u91CD\u542F\u8BF7\u6C42\uFF0C\u6B63\u5728\u91CD\u542F...");
|
|
11287
|
+
const envCfg = env();
|
|
11288
|
+
if (isPm2 && envCfg.RUNTIME === "node") {
|
|
11289
|
+
const envCfg2 = env();
|
|
11290
|
+
if (envCfg2.RUNTIME === "node") {
|
|
11291
|
+
envCfg2.RUNTIME = "pm2";
|
|
11292
|
+
const envData = Object.entries(envCfg2).map(([key, value]) => ({
|
|
11293
|
+
key,
|
|
11294
|
+
value,
|
|
11295
|
+
comment: value.comment
|
|
11296
|
+
}));
|
|
11297
|
+
writeEnv(envData, void 0, true);
|
|
11298
|
+
}
|
|
11299
|
+
}
|
|
11286
11300
|
if (!isPm2 && process?.send) {
|
|
11287
11301
|
process.send(JSON.stringify({ type: "restart", reloadDeps }));
|
|
11288
11302
|
logger.debug("\u6B63\u5728\u901A\u77E5\u7236\u8FDB\u7A0B\u91CD\u542F...");
|
package/dist/start/index.mjs
CHANGED
|
@@ -329,8 +329,6 @@ var dotenv_default = app;
|
|
|
329
329
|
var ProcessManager = class {
|
|
330
330
|
/** 是否已经启动 */
|
|
331
331
|
isStarted = false;
|
|
332
|
-
/** 是否正在重启 */
|
|
333
|
-
isRestarting = false;
|
|
334
332
|
/** 子进程实例 */
|
|
335
333
|
childProcess = null;
|
|
336
334
|
/** 重启延迟时间 */
|
|
@@ -359,6 +357,8 @@ var ProcessManager = class {
|
|
|
359
357
|
gray: "\x1B[90m",
|
|
360
358
|
reset: "\x1B[0m"
|
|
361
359
|
};
|
|
360
|
+
/** exit 事件监听器引用 */
|
|
361
|
+
exitListenerRef = null;
|
|
362
362
|
constructor() {
|
|
363
363
|
process.on("exit", this.stop.bind(this));
|
|
364
364
|
this.logSystemInfo();
|
|
@@ -389,7 +389,6 @@ var ProcessManager = class {
|
|
|
389
389
|
return this.start({ reloadDeps });
|
|
390
390
|
}
|
|
391
391
|
const oldPid = this.childProcess.pid;
|
|
392
|
-
this.isRestarting = true;
|
|
393
392
|
this.processStats.restartCount++;
|
|
394
393
|
this.processStats.lastRestartTime = Date.now();
|
|
395
394
|
this.log(`\u51C6\u5907\u91CD\u542F\u5B50\u8FDB\u7A0B | \u5F53\u524DPID: ${oldPid} | \u91CD\u8F7D\u4F9D\u8D56: ${reloadDeps ? "\u662F" : "\u5426"} | \u91CD\u542F\u6B21\u6570: ${this.processStats.restartCount}`);
|
|
@@ -408,8 +407,6 @@ var ProcessManager = class {
|
|
|
408
407
|
}
|
|
409
408
|
this.logError(`\u91CD\u542F\u5931\u8D25 | \u9519\u8BEF: ${error.message} | \u4EE3\u7801: ${error.code || "\u672A\u77E5"}`);
|
|
410
409
|
return null;
|
|
411
|
-
} finally {
|
|
412
|
-
this.isRestarting = false;
|
|
413
410
|
}
|
|
414
411
|
}
|
|
415
412
|
/**
|
|
@@ -423,7 +420,6 @@ var ProcessManager = class {
|
|
|
423
420
|
this.terminateChildProcess();
|
|
424
421
|
this.childProcess = null;
|
|
425
422
|
this.isStarted = false;
|
|
426
|
-
this.isRestarting = false;
|
|
427
423
|
}
|
|
428
424
|
const totalUptime = this.getTotalUptime();
|
|
429
425
|
this.log(`\u7236\u8FDB\u7A0B\u9000\u51FA | \u603B\u8FD0\u884C\u65F6\u95F4: ${totalUptime} | \u91CD\u542F\u6B21\u6570: ${this.processStats.restartCount}`);
|
|
@@ -441,7 +437,11 @@ var ProcessManager = class {
|
|
|
441
437
|
setupEventListeners() {
|
|
442
438
|
if (!this.childProcess) return;
|
|
443
439
|
this.childProcess.on("message", this.handleChildMessage.bind(this));
|
|
444
|
-
|
|
440
|
+
if (this.exitListenerRef) {
|
|
441
|
+
this.childProcess.off("exit", this.exitListenerRef);
|
|
442
|
+
}
|
|
443
|
+
this.exitListenerRef = this.handleChildExit.bind(this);
|
|
444
|
+
this.childProcess.once("exit", this.exitListenerRef);
|
|
445
445
|
}
|
|
446
446
|
/**
|
|
447
447
|
* 处理子进程发送的消息
|
|
@@ -450,7 +450,7 @@ var ProcessManager = class {
|
|
|
450
450
|
if (typeof message !== "string") return;
|
|
451
451
|
try {
|
|
452
452
|
const { type, reloadDeps } = JSON.parse(message);
|
|
453
|
-
if (type === "restart") {
|
|
453
|
+
if (type === "restart" || type === "rs") {
|
|
454
454
|
this.log(`\u6536\u5230\u6D88\u606F | \u7C7B\u578B: restart | \u91CD\u8F7D\u4F9D\u8D56: ${reloadDeps ? "\u662F" : "\u5426"}`);
|
|
455
455
|
const child = await this.restart(reloadDeps);
|
|
456
456
|
if (!child) {
|
|
@@ -477,9 +477,7 @@ var ProcessManager = class {
|
|
|
477
477
|
const exitType = signal ? `\u4FE1\u53F7: ${signal}` : `\u9000\u51FA\u7801: ${code ?? "\u672A\u77E5"}`;
|
|
478
478
|
const uptime = this.getProcessUptime();
|
|
479
479
|
this.log(`\u5B50\u8FDB\u7A0B\u9000\u51FA | ${exitType} | \u8FD0\u884C\u65F6\u95F4: ${uptime}`);
|
|
480
|
-
|
|
481
|
-
this.stop();
|
|
482
|
-
}
|
|
480
|
+
this.stop();
|
|
483
481
|
}
|
|
484
482
|
/**
|
|
485
483
|
* 等待端口释放
|
|
@@ -564,6 +562,10 @@ var ProcessManager = class {
|
|
|
564
562
|
*/
|
|
565
563
|
async terminateChildProcess() {
|
|
566
564
|
if (!this.childProcess) return;
|
|
565
|
+
if (this.exitListenerRef) {
|
|
566
|
+
this.childProcess.off("exit", this.exitListenerRef);
|
|
567
|
+
this.exitListenerRef = null;
|
|
568
|
+
}
|
|
567
569
|
try {
|
|
568
570
|
const pid = this.childProcess.pid;
|
|
569
571
|
this.log(`\u53D1\u9001\u7EC8\u6B62\u4FE1\u53F7 | PID: ${pid} | \u4FE1\u53F7: SIGTERM`);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./vendor-react-ZA9Ag8xC.js";import{P as r}from"./components-C8mD5H9u.js";import"./vendor-others-DGUjmv7c.js";import"./vendor-editor-B8hjWfkw.js";import"./vendor-ui-utils-Bb93SeY3.js";import"./vendor-heroui-DqoPVa63.js";import"./page-dashboard-DNNUfIJO.js";import"./utils-DV3Ugabq.js";import"./hooks-CrFgaybL.js";import"./vendor-visual-CTuViOkk.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
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as p}from"./vendor-react-
|
|
1
|
+
import{V as p}from"./vendor-react-ZA9Ag8xC.js";import{a4 as g}from"./components-C8mD5H9u.js";const u=async(e,a,n,t)=>{const{setIsLogModalOpen:c,setTaskId:i,setTaskLogs:o,setTaskName:f}=a;f("更新插件");const r=["开始创建更新任务...",`options: ${JSON.stringify(e)}`];o(r);try{const s=await g(e);if(s.success&&s.taskId)i(s.taskId),o([...r,`
|
|
2
2
|
任务创建成功!`,`任务ID: ${s.taskId}`,"正在连接任务执行日志..."]),c(!0),typeof t=="function"&&t();else throw new Error(s.message||"未知错误")}catch(s){console.error("更新失败:",s),p.error(`更新失败: ${s.message}`)}};export{u as c};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
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-B3jpAEDK.js"></script>
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-editor-B8hjWfkw.js">
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-others-
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-others-DGUjmv7c.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-ui-utils-Bb93SeY3.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-react-
|
|
22
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-heroui-
|
|
23
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/hooks-
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-visual-
|
|
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-
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-react-ZA9Ag8xC.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-heroui-DqoPVa63.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/hooks-CrFgaybL.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-visual-CTuViOkk.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/components-C8mD5H9u.js">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/utils-DV3Ugabq.js">
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/page-dashboard-DNNUfIJO.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-Bq0kgume.css">
|
|
32
32
|
</head>
|
|
33
33
|
|
|
34
34
|
<body>
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./vendor-react-DODmErXx.js";import{P as r}from"./components-BLnh3G72.js";import"./vendor-others-CBBlg8Fy.js";import"./vendor-editor-B8hjWfkw.js";import"./vendor-ui-utils-Bb93SeY3.js";import"./vendor-heroui-BHUSASI0.js";import"./page-dashboard-CWURXXkN.js";import"./hooks-Ct7PuBJz.js";import"./utils-Csan4HCy.js";import"./vendor-visual-C2oODoBB.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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|