Skip to content

Commit

Permalink
build(packaging): ci build
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinse12 authored and github-actions[bot] committed May 15, 2024
1 parent 84197ba commit 5abb40f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions dist/cli/commands/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,26 @@ class Daemon extends core_1.Command {
const parsedData = data instanceof Uint8Array ? Buffer.from(data).toString() : data;
return parsedData.replaceAll(/\u001b\[.*?m/g, "");
};
const isLogFileOverLimit = () => logFile.bytesWritten > 20000000; // 20mb
process.stdout.write = (...args) => {
//@ts-expect-error
const res = stdoutWrite(...args);
logFile.write(removeColor(args[0]) + node_os_1.EOL);
if (!isLogFileOverLimit())
logFile.write(removeColor(args[0]) + node_os_1.EOL);
return res;
};
process.stderr.write = (...args) => {
//@ts-expect-error
const res = stderrWrite(...args);
logFile.write(removeColor(args[0]).trimStart() + node_os_1.EOL);
if (!isLogFileOverLimit())
logFile.write(removeColor(args[0]).trimStart() + node_os_1.EOL);
return res;
};
console.log("Will store stderr + stdout log to", logFilePath);
// errors aren't console logged
process.on("uncaughtException", console.error);
process.on("unhandledRejection", console.error);
process.on("exit", () => logFile.close());
}
async run() {
const { flags } = await this.parse(Daemon);
Expand Down
4 changes: 2 additions & 2 deletions dist/cli/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CreateSubplebbitOptions as PlebbitCreateSubplebbitOptions } from "@plebbit/plebbit-js/dist/node/subplebbit/types.js";
export interface CliCreateSubplebbitOptions extends Pick<PlebbitCreateSubplebbitOptions, "address" | "title" | "description" | "pubsubTopic" | "suggested"> {
import type { CreateNewLocalSubplebbitUserOptions as PlebbitCreateSubplebbitOptions } from "@plebbit/plebbit-js/dist/node/subplebbit/types.js";
export interface CliCreateSubplebbitOptions extends Pick<PlebbitCreateSubplebbitOptions, "title" | "description" | "suggested" | "settings" | "features" | "roles" | "rules" | "flairs"> {
privateKeyPath?: string;
}
2 changes: 1 addition & 1 deletion dist/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

0 comments on commit 5abb40f

Please sign in to comment.