@paleo/workspace 0.15.0 → 0.15.1
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/dist/cli.js +0 -1
- package/dist/dev-server.js +6 -3
- package/dist/helpers.js +2 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -288,7 +288,6 @@ export function printDevHelp() {
|
|
|
288
288
|
"Commands:",
|
|
289
289
|
" dev Start in the foreground, streaming logs from startup; CTRL+C stops it.",
|
|
290
290
|
" If one is already running here, attach to its logs instead",
|
|
291
|
-
" (CTRL+C then detaches, leaving it running).",
|
|
292
291
|
" dev up Start in the background and return once ready.",
|
|
293
292
|
" dev restart Stop this worktree's dev-server if running, then start in the background.",
|
|
294
293
|
" dev down [--all] Stop this worktree's dev-server, or every dev-server with --all.",
|
package/dist/dev-server.js
CHANGED
|
@@ -269,14 +269,17 @@ function tailLogs(config, spawnPids, mode) {
|
|
|
269
269
|
followLogFile(path, prefix, offset);
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
+
// Prints the last `lines` of the log, then returns the byte offset where `followLogFile` resumes
|
|
273
|
+
// (the file's current size). Reads raw bytes so the offset matches the file even if it holds
|
|
274
|
+
// invalid UTF-8, which a decoded string's byte length would not.
|
|
272
275
|
function replayTail(path, prefix, lines) {
|
|
273
276
|
if (!existsSync(path))
|
|
274
277
|
return 0;
|
|
275
|
-
const
|
|
276
|
-
const tail = lastLines(
|
|
278
|
+
const buffer = readFileSync(path);
|
|
279
|
+
const tail = lastLines(buffer.toString("utf8"), lines);
|
|
277
280
|
if (tail.length > 0)
|
|
278
281
|
writeWithPrefix(tail.endsWith("\n") ? tail : `${tail}\n`, prefix);
|
|
279
|
-
return
|
|
282
|
+
return buffer.length;
|
|
280
283
|
}
|
|
281
284
|
function writeWithPrefix(text, prefix) {
|
|
282
285
|
process.stdout.write(prefix === "" ? text : text.replace(/^(?=.)/gm, prefix));
|
package/dist/helpers.js
CHANGED