Compare commits

..

No commits in common. "92d233a191fa674e6a12473b82099d6f0f8f1f5b" and "77329562ec2b7cebfe7009f6985af7122e696008" have entirely different histories.

2 changed files with 4 additions and 15 deletions

View File

@ -79,7 +79,7 @@ async function isProcessRunning(pid: number): Promise<boolean> {
async function isServerResponsive(port: number): Promise<boolean> { async function isServerResponsive(port: number): Promise<boolean> {
try { try {
const response = await fetch(`http://localhost:${port}/`, { const response = await fetch(`http://localhost:${port}/`, {
signal: AbortSignal.timeout(50), signal: AbortSignal.timeout(2000),
}); });
return response.ok || response.status === 404; // Server is up if it responds at all return response.ok || response.status === 404; // Server is up if it responds at all
} catch { } catch {
@ -109,8 +109,8 @@ async function startServer(): Promise<number> {
const proc = Bun.spawn( const proc = Bun.spawn(
["dotnet", "csharpier", "server", "--server-port", String(SERVER_PORT)], ["dotnet", "csharpier", "server", "--server-port", String(SERVER_PORT)],
{ {
stdout: null, stdout: "inherit",
stderr: null, stderr: "inherit",
}, },
); );
@ -244,7 +244,6 @@ function showHelp(): void {
Usage: Usage:
csharpierd <filename> < input.cs Format C# code from stdin csharpierd <filename> < input.cs Format C# code from stdin
csharpierd --start Start and prewarm the server
csharpierd --status Show server status csharpierd --status Show server status
csharpierd --stop Stop the background server csharpierd --stop Stop the background server
csharpierd --help Show this help message csharpierd --help Show this help message
@ -255,9 +254,6 @@ Description:
automatically shuts down after 1 hour of inactivity. automatically shuts down after 1 hour of inactivity.
Examples: Examples:
# Start and prewarm the server
csharpierd --start
# Format a C# file # Format a C# file
csharpierd Program.cs < Program.cs csharpierd Program.cs < Program.cs
@ -383,13 +379,6 @@ async function main() {
process.exit(0); process.exit(0);
} }
// Handle --start flag
if (arg === "--start") {
await ensureServer();
console.error("CSharpier server is ready");
process.exit(0);
}
// Normal formatting mode // Normal formatting mode
const fileName = arg; const fileName = arg;
if (!fileName) { if (!fileName) {

View File

@ -1,6 +1,6 @@
{ {
"name": "csharpierd", "name": "csharpierd",
"version": "1.0.5", "version": "1.0.2",
"description": "A persistent CSharpier formatting daemon with automatic server management and idle timeout", "description": "A persistent CSharpier formatting daemon with automatic server management and idle timeout",
"module": "index.ts", "module": "index.ts",
"type": "module", "type": "module",