chore: ran prettier

This commit is contained in:
vorotamoroz
2026-05-13 11:12:40 +00:00
parent de2397dc3f
commit 6a9bba702c
12 changed files with 73 additions and 49 deletions

View File

@@ -25,7 +25,7 @@ export function initialiseServiceModulesCLI(
core: LiveSyncBaseCore<ServiceContext, any>,
services: InjectableServiceHub<ServiceContext>,
ignoreRules?: IgnoreRules,
watchEnabled: boolean = false,
watchEnabled: boolean = false
): ServiceModules {
const storageAccessManager = new StorageAccessManager();
@@ -39,13 +39,19 @@ export function initialiseServiceModulesCLI(
});
// CLI-specific storage event manager
const storageEventManager = new StorageEventManagerCLI(basePath, core, {
fileProcessing: services.fileProcessing,
setting: services.setting,
vaultService: services.vault,
storageAccessManager: storageAccessManager,
APIService: services.API,
}, ignoreRules, watchEnabled);
const storageEventManager = new StorageEventManagerCLI(
basePath,
core,
{
fileProcessing: services.fileProcessing,
setting: services.setting,
vaultService: services.vault,
storageAccessManager: storageAccessManager,
APIService: services.API,
},
ignoreRules,
watchEnabled
);
// Close the file watcher during graceful shutdown so the process can exit cleanly.
services.appLifecycle.onUnload.addHandler(async () => {

View File

@@ -55,7 +55,9 @@ export class IgnoreRules {
continue;
}
if (trimmed.startsWith("import:")) {
console.error(`[IgnoreRules] Warning: unrecognised directive '${trimmed}' — only 'import: .gitignore' is supported`);
console.error(
`[IgnoreRules] Warning: unrecognised directive '${trimmed}' — only 'import: .gitignore' is supported`
);
continue;
}
this._addPattern(trimmed);
@@ -105,7 +107,7 @@ export class IgnoreRules {
if (raw.startsWith("!")) {
throw new Error(
`[IgnoreRules] Negation pattern '${raw}' is not supported. ` +
`Remove it from .livesync/ignore or use a separate include/exclude file.`
`Remove it from .livesync/ignore or use a separate include/exclude file.`
);
}
this.patterns.push(this._normalisePattern(raw));

View File

@@ -122,10 +122,7 @@ describe("IgnoreRules", () => {
describe("load() with comments and blank lines", () => {
it("skips # comment lines and blank lines", async () => {
const vaultPath = await createVault();
await writeIgnoreFile(
vaultPath,
"# This is a comment\n\n \n*.tmp\n# another comment\nbuild/\n"
);
await writeIgnoreFile(vaultPath, "# This is a comment\n\n \n*.tmp\n# another comment\nbuild/\n");
const rules = new IgnoreRules(vaultPath);
await rules.load();
expect(rules.shouldIgnore("scratch.tmp")).toBe(true);