local-diff-reviewer 3.0.1 → 3.0.4
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/README.md +1 -1
- package/dist/cli/start.js +38 -7
- package/dist/web/assets/{arc-BCRWWOYF.js → arc-WJEBDefe.js} +1 -1
- package/dist/web/assets/{architectureDiagram-3BPJPVTR-DHYav7x-.js → architectureDiagram-3BPJPVTR-DY-WAePz.js} +1 -1
- package/dist/web/assets/{blockDiagram-GPEHLZMM-BBTDvfqa.js → blockDiagram-GPEHLZMM-q6EsoY7t.js} +1 -1
- package/dist/web/assets/{c4Diagram-AAUBKEIU-BSsCCONC.js → c4Diagram-AAUBKEIU-CcwSuu8D.js} +1 -1
- package/dist/web/assets/channel-0JUdeik3.js +1 -0
- package/dist/web/assets/{chunk-2J33WTMH-gxgSxUp0.js → chunk-2J33WTMH-DgABt0X-.js} +1 -1
- package/dist/web/assets/{chunk-3OPIFGDE-CvdnyK6N.js → chunk-3OPIFGDE-DD8Yo5Zk.js} +1 -1
- package/dist/web/assets/{chunk-4BX2VUAB-Drw-i2nM.js → chunk-4BX2VUAB-C5Vjxm5z.js} +1 -1
- package/dist/web/assets/{chunk-55IACEB6-DV6wcPr8.js → chunk-55IACEB6-Dzf6UQA5.js} +1 -1
- package/dist/web/assets/{chunk-5ZQYHXKU-BtkqI0hy.js → chunk-5ZQYHXKU-DVBghRsc.js} +1 -1
- package/dist/web/assets/{chunk-727SXJPM-DyK5L1lx.js → chunk-727SXJPM-k6tSfIgv.js} +1 -1
- package/dist/web/assets/{chunk-AQP2D5EJ-DjyFoYVP.js → chunk-AQP2D5EJ-B5HS_CCW.js} +1 -1
- package/dist/web/assets/{chunk-BSJP7CBP-Bv-B6WhM.js → chunk-BSJP7CBP-Bs7YmZJ4.js} +1 -1
- package/dist/web/assets/{chunk-CSCIHK7Q-B44e1JBV.js → chunk-CSCIHK7Q-BdJSZ0PC.js} +1 -1
- package/dist/web/assets/{chunk-FMBD7UC4-DO7GRO5x.js → chunk-FMBD7UC4-BMCHJsIw.js} +1 -1
- package/dist/web/assets/{chunk-KSCS5N6A-qazKtUbg.js → chunk-KSCS5N6A-N3Y6rMHp.js} +1 -1
- package/dist/web/assets/{chunk-L5ZTLDWV-CL2Wbg0I.js → chunk-L5ZTLDWV-eZKsbLU4.js} +1 -1
- package/dist/web/assets/{chunk-LZXEDZCA-k37XY6Xa.js → chunk-LZXEDZCA-9I8j_tlm.js} +2 -2
- package/dist/web/assets/{chunk-ND2GUHAM-BA2wFWbx.js → chunk-ND2GUHAM-CQoTFYcg.js} +1 -1
- package/dist/web/assets/{chunk-NZK2D7GU-BucWKMX_.js → chunk-NZK2D7GU-B3sXrFzC.js} +1 -1
- package/dist/web/assets/{chunk-O5CBEL6O-Cgf-jrUe.js → chunk-O5CBEL6O-CVEsADhZ.js} +1 -1
- package/dist/web/assets/chunk-QZHKN3VN-C3hU6Orb.js +1 -0
- package/dist/web/assets/chunk-WU5MYG2G-C3oKuesF.js +1 -0
- package/dist/web/assets/{chunk-XPW4576I-D9MYSFVJ.js → chunk-XPW4576I-CKpf-mif.js} +1 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-ChO4uO9F.js +1 -0
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-vP8VQ5zT.js +1 -0
- package/dist/web/assets/{cose-bilkent-S5V4N54A-1_Y7VE-T.js → cose-bilkent-S5V4N54A-Ce43Rdcb.js} +1 -1
- package/dist/web/assets/{dagre-BM42HDAG-xi-12y5l.js → dagre-BM42HDAG-B8ECOTho.js} +1 -1
- package/dist/web/assets/{diagram-2AECGRRQ-B3Z1pwqm.js → diagram-2AECGRRQ-OWPa6fGG.js} +1 -1
- package/dist/web/assets/{diagram-5GNKFQAL-Dw4cOkhG.js → diagram-5GNKFQAL-exPsOjom.js} +1 -1
- package/dist/web/assets/{diagram-KO2AKTUF-D2u6bia1.js → diagram-KO2AKTUF-BzuJAgId.js} +1 -1
- package/dist/web/assets/{diagram-LMA3HP47-DOLa6Wa9.js → diagram-LMA3HP47-C44bFrVB.js} +1 -1
- package/dist/web/assets/{diagram-OG6HWLK6-ITRaY92p.js → diagram-OG6HWLK6-DBhpvgH0.js} +1 -1
- package/dist/web/assets/{dist-f1ZvJ0ZX.js → dist-BDEn5_mc.js} +1 -1
- package/dist/web/assets/{erDiagram-TEJ5UH35-DcSS5Ih9.js → erDiagram-TEJ5UH35--Zouga0M.js} +1 -1
- package/dist/web/assets/{flowDiagram-I6XJVG4X-C_LclUbz.js → flowDiagram-I6XJVG4X-CYvGq5dd.js} +1 -1
- package/dist/web/assets/{ganttDiagram-6RSMTGT7-D_ibFFLf.js → ganttDiagram-6RSMTGT7-BSYT2dr_.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-PVQCEYII-JBBG2xqG.js → gitGraphDiagram-PVQCEYII-Dnu9DFKR.js} +1 -1
- package/dist/web/assets/{index-DDhTur_z.css → index-CYvWM5-r.css} +1 -1
- package/dist/web/assets/index-Nd0rp7cQ.js +289 -0
- package/dist/web/assets/{infoDiagram-5YYISTIA-ye8o5cn0.js → infoDiagram-5YYISTIA-DrTRGgZy.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-BoivB3K7.js → ishikawaDiagram-YF4QCWOH-BoEeA6Mc.js} +1 -1
- package/dist/web/assets/{journeyDiagram-JHISSGLW-DoiT2btg.js → journeyDiagram-JHISSGLW-mLhd_jjy.js} +1 -1
- package/dist/web/assets/{kanban-definition-UN3LZRKU-rPLxmwVs.js → kanban-definition-UN3LZRKU-Db5QJRV7.js} +1 -1
- package/dist/web/assets/{line-BPbMyUR_.js → line-CXokehww.js} +1 -1
- package/dist/web/assets/{linear-D2y_hUES.js → linear-CQRmYSPD.js} +1 -1
- package/dist/web/assets/{mermaid-parser.core-BkcqBOzJ.js → mermaid-parser.core-BEfPixoL.js} +1 -1
- package/dist/web/assets/{mermaid.core-Dcb_H2og.js → mermaid.core-CBDynC6T.js} +3 -3
- package/dist/web/assets/{mindmap-definition-RKZ34NQL-BmQ6AtW3.js → mindmap-definition-RKZ34NQL-BNyXpVCA.js} +1 -1
- package/dist/web/assets/{pieDiagram-4H26LBE5-YiBeVKvu.js → pieDiagram-4H26LBE5-Bf5hzZ3P.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-W4KKPZXB-DMx-0K_c.js → quadrantDiagram-W4KKPZXB-Rv6QIsiT.js} +1 -1
- package/dist/web/assets/{requirementDiagram-4Y6WPE33-B91ulROJ.js → requirementDiagram-4Y6WPE33-B4fVZI_l.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-5OEKKPKP-D7Tbgr4t.js → sankeyDiagram-5OEKKPKP-BA9Medf9.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-3UESZ5HK-u7O9kAXb.js → sequenceDiagram-3UESZ5HK-DGJj7Cze.js} +1 -1
- package/dist/web/assets/{src-Z-w_Bw8O.js → src-YxDNaL8-.js} +1 -1
- package/dist/web/assets/{stateDiagram-AJRCARHV-DBQZPg7N.js → stateDiagram-AJRCARHV-CSk7jizR.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-D5t387Sh.js +1 -0
- package/dist/web/assets/{timeline-definition-PNZ67QCA-SAlYtznA.js → timeline-definition-PNZ67QCA-BSxIAVFh.js} +1 -1
- package/dist/web/assets/{vennDiagram-CIIHVFJN-7VCkpay-.js → vennDiagram-CIIHVFJN-BwPbR8zD.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-YWT4CUSO-D5c0N7zD.js → wardleyDiagram-YWT4CUSO-D017eq5V.js} +1 -1
- package/dist/web/assets/{xychartDiagram-2RQKCTM6-A8A2NFsw.js → xychartDiagram-2RQKCTM6-Bc2nA4Z5.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +4 -2
- package/dist/web/assets/channel-DfaOkitd.js +0 -1
- package/dist/web/assets/chunk-QZHKN3VN-jXTijF5B.js +0 -1
- package/dist/web/assets/chunk-WU5MYG2G-CtQkD8HB.js +0 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-DLy1WqRU.js +0 -1
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-BsZ-aUoD.js +0 -1
- package/dist/web/assets/index-CjqBr-4l.js +0 -288
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-CkRknB63.js +0 -1
package/README.md
CHANGED
|
@@ -87,7 +87,7 @@ local-diff-reviewer --repo /path/to/project staged
|
|
|
87
87
|
评论、快照、代码行之间的绑定关系及页面更新判断详见
|
|
88
88
|
[`docs/comment-snapshot-binding.md`](docs/comment-snapshot-binding.md)。
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
本地开发的 `--dev` 模式会同时为 API 服务和 Vite dev server 选择可用端口,并把 Vite proxy 绑定到本次启动的 API 地址。其他项目已经占用 `4966` 或 `5173` 时,当前项目会自动换用空闲端口。
|
|
91
91
|
|
|
92
92
|
## Skill 使用方式
|
|
93
93
|
|
package/dist/cli/start.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// src/cli/start.ts
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
5
|
import { existsSync as existsSync2 } from "node:fs";
|
|
6
|
+
import { createServer as createNetServer } from "node:net";
|
|
6
7
|
import { basename as basename3, dirname as dirname3, join as join5, resolve as resolve2 } from "node:path";
|
|
7
8
|
import { fileURLToPath } from "node:url";
|
|
8
9
|
|
|
@@ -649,7 +650,7 @@ async function writeRuntime(path, store) {
|
|
|
649
650
|
function isRuntimeEntry(value) {
|
|
650
651
|
if (!value || typeof value !== "object") return false;
|
|
651
652
|
const entry = value;
|
|
652
|
-
return typeof entry.pid === "number" && (typeof entry.vitePid === "undefined" || typeof entry.vitePid === "number") && typeof entry.repoRoot === "string" && typeof entry.repoName === "string" && typeof entry.startedAt === "string" && typeof entry.apiPort === "number" && typeof entry.usesVite === "boolean";
|
|
653
|
+
return typeof entry.pid === "number" && (typeof entry.vitePid === "undefined" || typeof entry.vitePid === "number") && (typeof entry.vitePort === "undefined" || typeof entry.vitePort === "number") && typeof entry.repoRoot === "string" && typeof entry.repoName === "string" && typeof entry.startedAt === "string" && typeof entry.apiPort === "number" && typeof entry.usesVite === "boolean";
|
|
653
654
|
}
|
|
654
655
|
function isPidAlive(pid) {
|
|
655
656
|
if (!Number.isInteger(pid) || pid <= 0) return false;
|
|
@@ -1185,11 +1186,13 @@ async function main() {
|
|
|
1185
1186
|
const hasBuiltWeb = existsSync2(join5(builtWebDist, "index.html"));
|
|
1186
1187
|
const apiUrl = await startServer({ session, diffFiles, webDist: hasBuiltWeb ? builtWebDist : void 0 });
|
|
1187
1188
|
const useVite = dev || !hasBuiltWeb;
|
|
1188
|
-
const
|
|
1189
|
-
const
|
|
1189
|
+
const vitePort = useVite ? await findAvailablePort(5173) : void 0;
|
|
1190
|
+
const uiUrl = useVite ? `http://127.0.0.1:${vitePort}` : apiUrl;
|
|
1191
|
+
const vitePid = useVite && vitePort ? startVite(apiUrl, vitePort) : void 0;
|
|
1190
1192
|
await recordRuntime({
|
|
1191
1193
|
pid: process.pid,
|
|
1192
1194
|
vitePid,
|
|
1195
|
+
vitePort,
|
|
1193
1196
|
repoRoot,
|
|
1194
1197
|
repoName: session.repoName,
|
|
1195
1198
|
startedAt: session.createdAt,
|
|
@@ -1272,7 +1275,7 @@ async function refreshRunningReview(session, diffFiles) {
|
|
|
1272
1275
|
body: JSON.stringify({ session, diffFiles })
|
|
1273
1276
|
});
|
|
1274
1277
|
if (!response.ok) continue;
|
|
1275
|
-
return runtime.usesVite ?
|
|
1278
|
+
return runtime.usesVite ? `http://127.0.0.1:${runtime.vitePort ?? 5173}` : apiUrl;
|
|
1276
1279
|
} catch {
|
|
1277
1280
|
}
|
|
1278
1281
|
}
|
|
@@ -1301,7 +1304,7 @@ async function stopCommand(repo) {
|
|
|
1301
1304
|
console.log(`Stopped review runtimes: ${stopped.length}`);
|
|
1302
1305
|
for (const entry of stopped) {
|
|
1303
1306
|
console.log(
|
|
1304
|
-
`- pid=${entry.pid} vitePid=${entry.vitePid ?? "-"} apiPort=${entry.apiPort} vite=${entry.usesVite ? "yes" : "no"} startedAt=${entry.startedAt}`
|
|
1307
|
+
`- pid=${entry.pid} vitePid=${entry.vitePid ?? "-"} apiPort=${entry.apiPort} vitePort=${entry.vitePort ?? "-"} vite=${entry.usesVite ? "yes" : "no"} startedAt=${entry.startedAt}`
|
|
1305
1308
|
);
|
|
1306
1309
|
}
|
|
1307
1310
|
if (stale.length > 0) {
|
|
@@ -1317,12 +1320,40 @@ function modeLabel(mode) {
|
|
|
1317
1320
|
if (mode.kind === "revision") return `${mode.base}..${mode.target}`;
|
|
1318
1321
|
return mode.kind;
|
|
1319
1322
|
}
|
|
1320
|
-
function
|
|
1323
|
+
function findAvailablePort(preferredPort) {
|
|
1324
|
+
return new Promise((resolve3, reject) => {
|
|
1325
|
+
const server = createNetServer();
|
|
1326
|
+
server.once("error", (error) => {
|
|
1327
|
+
if (error.code === "EADDRINUSE") {
|
|
1328
|
+
findAvailablePort(0).then(resolve3, reject);
|
|
1329
|
+
return;
|
|
1330
|
+
}
|
|
1331
|
+
reject(error);
|
|
1332
|
+
});
|
|
1333
|
+
server.listen(preferredPort, "127.0.0.1", () => {
|
|
1334
|
+
const address = server.address();
|
|
1335
|
+
const port = typeof address === "object" && address ? address.port : preferredPort;
|
|
1336
|
+
server.close((error) => {
|
|
1337
|
+
if (error) {
|
|
1338
|
+
reject(error);
|
|
1339
|
+
return;
|
|
1340
|
+
}
|
|
1341
|
+
resolve3(port);
|
|
1342
|
+
});
|
|
1343
|
+
});
|
|
1344
|
+
});
|
|
1345
|
+
}
|
|
1346
|
+
function startVite(apiUrl, port) {
|
|
1321
1347
|
const child = spawn("npm", ["run", "web:dev"], {
|
|
1322
1348
|
cwd: packageRoot,
|
|
1323
1349
|
stdio: "inherit",
|
|
1324
1350
|
shell: process.platform === "win32",
|
|
1325
|
-
env: {
|
|
1351
|
+
env: {
|
|
1352
|
+
...process.env,
|
|
1353
|
+
BROWSER: "none",
|
|
1354
|
+
DIFF_REVIEW_API_URL: apiUrl,
|
|
1355
|
+
DIFF_REVIEW_VITE_PORT: String(port)
|
|
1356
|
+
}
|
|
1326
1357
|
});
|
|
1327
1358
|
process.on("SIGINT", () => child.kill("SIGINT"));
|
|
1328
1359
|
process.on("SIGTERM", () => child.kill("SIGTERM"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./path-BJQEcSo7.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-
|
|
1
|
+
import{n as e,t}from"./path-BJQEcSo7.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-BDEn5_mc.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,t,n,r,i,a,o){var c=e-n,l=t-r,u=(o?a:-a)/d(c*c+l*l),f=u*l,p=-u*c,m=e+f,h=t+p,g=n+f,_=r+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=i-a,w=m*_-g*h,T=(x<0?-1:1)*d(s(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(i/C-1),y11:D*(i/C-1)}}function x(){var s=m,x=h,S=e(0),C=null,w=g,T=_,E=v,D=null,O=t(k);function k(){var e,t,m=+s.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-r,_=T.apply(this,arguments)-r,v=l(_-g),k=_>g;if(D||=e=O(),h<m&&(t=h,h=m,m=t),!(h>1e-12))D.moveTo(0,0);else if(v>c-1e-12)D.moveTo(h*u(g),h*a(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*u(_),m*a(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):d(m*m+h*h)),R=p(l(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=o(L/m*a(I)),W=o(L/h*a(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*u(A),K=h*a(A),q=m*u(N),J=m*a(N);if(R>1e-12){var Y=h*u(j),X=h*a(j),Z=m*u(M),Q=m*a(M),$;if(v<i)if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/a(f((ee*ne+te*re)/(d(ee*ee+te*te)*d(ne*ne+re*re)))/2),ae=d($[0]*$[0]+$[1]*$[1]);z=p(R,(m-ae)/(ie-1)),B=p(R,(h-ae)/(ie+1))}else z=B=0}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,h,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,n(H.y11,H.x11),n(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,m,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,n(H.y11,H.x11),n(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),e)return D=null,e+``||null}return k.centroid=function(){var e=(+s.apply(this,arguments)+ +x.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-i/2;return[u(t)*e,a(t)*e]},k.innerRadius=function(t){return arguments.length?(s=typeof t==`function`?t:e(+t),k):s},k.outerRadius=function(t){return arguments.length?(x=typeof t==`function`?t:e(+t),k):x},k.cornerRadius=function(t){return arguments.length?(S=typeof t==`function`?t:e(+t),k):S},k.padRadius=function(t){return arguments.length?(C=t==null?null:typeof t==`function`?t:e(+t),k):C},k.startAngle=function(t){return arguments.length?(w=typeof t==`function`?t:e(+t),k):w},k.endAngle=function(t){return arguments.length?(T=typeof t==`function`?t:e(+t),k):T},k.padAngle=function(t){return arguments.length?(E=typeof t==`function`?t:e(+t),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
|