@minhpnq1807/contextos 0.5.31 → 0.5.32
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
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.32
|
|
4
|
+
|
|
5
|
+
- **Fix Windows terminal hang during skillshare/ruler install:** `execSync` with `stdio: "pipe"` creates a stdin pipe whose write-end is held by Node while it blocks on `waitpid`. If the child process (PowerShell installer, npm, etc.) reads from stdin, it blocks waiting for data/EOF that never comes — classic deadlock. Fixed by normalizing `stdio: "pipe"` to `["ignore", "pipe", "pipe"]` in both `runCommand` and `runShell`. This routes stdin to NUL (`/dev/null`) for immediate EOF, while still capturing stdout/stderr through pipes for `◇`/`│` formatting.
|
|
6
|
+
|
|
3
7
|
## 0.5.31
|
|
4
8
|
|
|
5
9
|
- **Complete stdio audit — eliminate all output leakage:** Changed every remaining `stdio: "inherit"` in `skillshare-sync.js` and `ruler-sync.js` to `stdio: "pipe"`. When subprocess calls use `inherit`, child processes write directly to the parent's fd — bypassing both `console.log` and `process.stderr.write` interception in `captureSetupOutput`. With `pipe`, all subprocess output is captured as return values and re-emitted through `console.log`, ensuring the `◇`/`│` formatting is applied consistently. Also changed `runShell` default from `"inherit"` to `"pipe"` to prevent future regressions.
|
package/package.json
CHANGED
|
@@ -22,9 +22,13 @@ function statusLine(label, value) {
|
|
|
22
22
|
return `[ctx] ${label.padEnd(38)} ${value}`;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
function normalizeStdio(stdio) {
|
|
26
|
+
return stdio === "pipe" ? ["ignore", "pipe", "pipe"] : stdio;
|
|
27
|
+
}
|
|
28
|
+
|
|
25
29
|
function runCommand(command, args, { cwd = process.cwd(), stdio = "pipe", dryRun = false } = {}) {
|
|
26
30
|
if (dryRun) return { stdout: "", skipped: true };
|
|
27
|
-
const stdout = execFileSync(command, args, { cwd, stdio, encoding: "utf8", shell: true });
|
|
31
|
+
const stdout = execFileSync(command, args, { cwd, stdio: normalizeStdio(stdio), encoding: "utf8", shell: true });
|
|
28
32
|
return { stdout: stdout || "" };
|
|
29
33
|
}
|
|
30
34
|
|
|
@@ -19,15 +19,23 @@ function statusLine(label, value) {
|
|
|
19
19
|
return `[ctx] ${label.padEnd(38)} ${value}`;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
function normalizeStdio(stdio) {
|
|
23
|
+
// "pipe" creates a stdin pipe whose write-end is held by Node while
|
|
24
|
+
// execSync/execFileSync blocks on waitpid — if the child reads stdin
|
|
25
|
+
// it deadlocks. Route stdin to NUL (/dev/null) so the child sees
|
|
26
|
+
// immediate EOF, while still piping stdout/stderr for capture.
|
|
27
|
+
return stdio === "pipe" ? ["ignore", "pipe", "pipe"] : stdio;
|
|
28
|
+
}
|
|
29
|
+
|
|
22
30
|
function runCommand(command, args = [], { cwd = process.cwd(), stdio = "pipe", dryRun = false } = {}) {
|
|
23
31
|
if (dryRun) return { stdout: "", skipped: true };
|
|
24
|
-
const stdout = execFileSync(command, args, { cwd, stdio, encoding: "utf8", shell: true });
|
|
32
|
+
const stdout = execFileSync(command, args, { cwd, stdio: normalizeStdio(stdio), encoding: "utf8", shell: true });
|
|
25
33
|
return { stdout: stdout || "" };
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
function runShell(command, { cwd = process.cwd(), stdio = "pipe", dryRun = false } = {}) {
|
|
29
37
|
if (dryRun) return { stdout: "", skipped: true };
|
|
30
|
-
const stdout = execSync(command, { cwd, stdio, encoding: "utf8" });
|
|
38
|
+
const stdout = execSync(command, { cwd, stdio: normalizeStdio(stdio), encoding: "utf8" });
|
|
31
39
|
return { stdout: stdout || "" };
|
|
32
40
|
}
|
|
33
41
|
|