Small improvements

This commit is contained in:
Andras Schmelczer 2026-09-19 15:23:24 +01:00
commit 5624e51f52
9 changed files with 82 additions and 225 deletions

View file

@ -42,7 +42,7 @@ function testUsesPauseServer(test: TestDefinition): boolean {
*/
function findProjectRoot(): string {
let dir = path.dirname(__filename);
const root = path.parse(dir).root;
const {root} = path.parse(dir);
while (dir !== root) {
if (
fs.existsSync(path.join(dir, "sync-server")) &&

View file

@ -304,7 +304,7 @@ export class DeterministicAgent extends debugging.InMemoryFileSystem {
});
}
const nextWriteRename = this.nextWriteRename;
const { nextWriteRename } = this;
if (
nextWriteRename !== undefined &&
nextWriteRename.oldPath === path

View file

@ -239,8 +239,7 @@ export class ServerControl {
public isRunning(): boolean {
const proc = this.process;
return (
proc !== null &&
proc.pid !== undefined &&
proc?.pid !== undefined &&
proc.exitCode === null &&
proc.signalCode === null
);

View file

@ -190,7 +190,7 @@ export class TestRunner {
(entry) =>
entry.details.type === step.syncType &&
entry.details.relativePath === step.path,
() => this.serverControl.pause()
() => { this.serverControl.pause(); }
);
this.serverControl.resume();
await historySeen;

View file

@ -1,11 +1,11 @@
import * as path from "path";
import * as fs from "fs/promises";
import * as fsSync from "fs";
import type { NetworkConnectionStatus } from "sync-client";
import type { NetworkConnectionStatus ,
Logger} from "sync-client";
import {
SyncClient,
DEFAULT_SETTINGS,
Logger,
LogLevel,
LogLine,
type SyncSettings,
@ -41,7 +41,7 @@ const LOG_LEVEL_ORDER = {
function createLogHandler(minLevel: LogLevel): (logLine: LogLine) => void {
return (logLine: LogLine): void => {
if (LOG_LEVEL_ORDER[logLine.level] >= LOG_LEVEL_ORDER[minLevel]) {
// eslint-disable-next-line no-console
console.log(formatLogLine(logLine));
}
};
@ -279,7 +279,7 @@ async function main(): Promise<void> {
}
main().catch((error: unknown) => {
// eslint-disable-next-line no-console
console.error(
`Unexpected error: ${error instanceof Error ? error.message : String(error)}`
);

View file

@ -1,5 +1,5 @@
#!/usr/bin/env node
/* eslint-disable no-console */
/**
* Healthcheck script for Docker container

View file

@ -5,7 +5,7 @@ import type { RelativePath } from "../../persistence/database";
import { Locks } from "./locks";
import { awaitAll } from "../await-all";
import { sleep } from "../sleep";
import { SyncResetError } from "../../services/sync-reset-error";
import { SyncResetError } from "../../errors/errors";
describe("withLock", () => {
const testPath: RelativePath = "test/document/path";

View file

@ -1,4 +1,4 @@
import { SyncResetError } from "../../services/sync-reset-error";
import { SyncResetError } from "../../errors/errors";
import type { Logger } from "../../tracing/logger";
import { awaitAll } from "../await-all";

View file

@ -9,7 +9,12 @@ const common = {
rules: [
{
test: /\.ts$/,
use: ["ts-loader"]
use: [
{
loader: "ts-loader",
options: { onlyCompileBundledFiles: true }
}
]
},
{
test: /\.wasm$/,