reviw 0.10.3 → 0.10.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/cli.cjs +15 -11
- package/package.json +6 -6
package/cli.cjs
CHANGED
|
@@ -4188,7 +4188,7 @@ function shutdownAll() {
|
|
|
4188
4188
|
process.on("SIGINT", shutdownAll);
|
|
4189
4189
|
process.on("SIGTERM", shutdownAll);
|
|
4190
4190
|
|
|
4191
|
-
function createFileServer(filePath) {
|
|
4191
|
+
function createFileServer(filePath, fileIndex = 0) {
|
|
4192
4192
|
return new Promise((resolve) => {
|
|
4193
4193
|
const baseName = path.basename(filePath);
|
|
4194
4194
|
const baseDir = path.dirname(filePath);
|
|
@@ -4403,14 +4403,18 @@ function createFileServer(filePath) {
|
|
|
4403
4403
|
: process.platform === "win32"
|
|
4404
4404
|
? "start"
|
|
4405
4405
|
: "xdg-open";
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4406
|
+
// Add delay for multiple files to avoid browser ignoring rapid open commands
|
|
4407
|
+
const delay = fileIndex * 300;
|
|
4408
|
+
setTimeout(() => {
|
|
4409
|
+
try {
|
|
4410
|
+
spawn(opener, [url], { stdio: "ignore", detached: true });
|
|
4411
|
+
} catch (err) {
|
|
4412
|
+
console.warn(
|
|
4413
|
+
"Failed to open browser automatically. Please open this URL manually:",
|
|
4414
|
+
url,
|
|
4415
|
+
);
|
|
4416
|
+
}
|
|
4417
|
+
}, delay);
|
|
4414
4418
|
}
|
|
4415
4419
|
startWatcher();
|
|
4416
4420
|
resolve(ctx);
|
|
@@ -4619,8 +4623,8 @@ function createDiffServer(diffContent) {
|
|
|
4619
4623
|
// File mode: files specified
|
|
4620
4624
|
console.log(`Starting servers for ${resolvedPaths.length} file(s)...`);
|
|
4621
4625
|
serversRunning = resolvedPaths.length;
|
|
4622
|
-
for (
|
|
4623
|
-
await createFileServer(
|
|
4626
|
+
for (let i = 0; i < resolvedPaths.length; i++) {
|
|
4627
|
+
await createFileServer(resolvedPaths[i], i);
|
|
4624
4628
|
}
|
|
4625
4629
|
console.log("Close all browser tabs or Submit & Exit to finish.");
|
|
4626
4630
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reviw",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "Lightweight file reviewer with in-browser comments for CSV, TSV, Markdown, and Git diffs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,10 +9,6 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"cli.cjs"
|
|
11
11
|
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"test": "vitest run",
|
|
14
|
-
"test:watch": "vitest"
|
|
15
|
-
},
|
|
16
12
|
"license": "MIT",
|
|
17
13
|
"author": "kazuph",
|
|
18
14
|
"publishConfig": {
|
|
@@ -31,5 +27,9 @@
|
|
|
31
27
|
"@playwright/test": "^1.57.0",
|
|
32
28
|
"playwright": "^1.57.0",
|
|
33
29
|
"vitest": "^4.0.14"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"test": "vitest run",
|
|
33
|
+
"test:watch": "vitest"
|
|
34
34
|
}
|
|
35
|
-
}
|
|
35
|
+
}
|