Adopt refined shared runtime API names

This commit is contained in:
vorotamoroz committed 2026-10-31 06:08:07 +00:00
1 parent bd05dde39c
commit 312cbac933
3 files changed
+14 -14

No files matched your search

@@ -54,10 +54,10 @@ vi.mock("@/common/obsidianCommunityPlugins.ts", () => ({
getObsidianCommunityPluginManager: vi.fn(), getObsidianCommunityPluginManager: vi.fn(),
})); }));
vi.mock("octagonal-wheels/concurrency/scopedIteration", { spy: true }); vi.mock("octagonal-wheels/concurrency/scoped.iteration", { spy: true });
import { LOG_LEVEL_VERBOSE, type FilePath } from "@vrtmrz/livesync-commonlib/compat/common/types"; import { LOG_LEVEL_VERBOSE, type FilePath } from "@vrtmrz/livesync-commonlib/compat/common/types";
import * as iterationModule from "octagonal-wheels/concurrency/scopedIteration"; import * as iterationModule from "octagonal-wheels/concurrency/scoped.iteration";
import { promiseWithResolvers } from "octagonal-wheels/promises"; import { promiseWithResolvers } from "octagonal-wheels/promises";
import { ConfigSync } from "./CmdConfigSync"; import { ConfigSync } from "./CmdConfigSync";
@@ -262,8 +262,8 @@ describe("ConfigSync scoped iteration composition", () => {
it.each(["database", "extra"])("propagates a %s runner failure outside per-item recovery", async (batch) => { it.each(["database", "extra"])("propagates a %s runner failure outside per-item recovery", async (batch) => {
const fixture = setup(["extra"], [row("stale")]); const fixture = setup(["extra"], [row("stale")]);
const error = new Error("iteration"); const error = new Error("iteration");
const actual = await vi.importActual<typeof import("octagonal-wheels/concurrency/scopedIteration")>( const actual = await vi.importActual<typeof import("octagonal-wheels/concurrency/scoped.iteration")>(
"octagonal-wheels/concurrency/scopedIteration" "octagonal-wheels/concurrency/scoped.iteration"
); );
if (batch === "extra") { if (batch === "extra") {
vi.mocked(iterationModule.forEachInScope).mockImplementationOnce(actual.forEachInScope); vi.mocked(iterationModule.forEachInScope).mockImplementationOnce(actual.forEachInScope);
+4 -4
View File
@@ -59,7 +59,7 @@ import { QueueProcessor } from "octagonal-wheels/concurrency/processor";
import { pluginScanningCount } from "@vrtmrz/livesync-commonlib/compat/mock_and_interop/stores"; import { pluginScanningCount } from "@vrtmrz/livesync-commonlib/compat/mock_and_interop/stores";
import { base64ToArrayBuffer, base64ToString } from "octagonal-wheels/binary/base64"; import { base64ToArrayBuffer, base64ToString } from "octagonal-wheels/binary/base64";
import { ConflictResolveModal } from "@/modules/features/InteractiveConflictResolving/ConflictResolveModal.ts"; import { ConflictResolveModal } from "@/modules/features/InteractiveConflictResolving/ConflictResolveModal.ts";
import { forEachInScope } from "octagonal-wheels/concurrency/scopedIteration"; import { forEachInScope } from "octagonal-wheels/concurrency/scoped.iteration";
import { withScope } from "octagonal-wheels/resource/scope"; import { withScope } from "octagonal-wheels/resource/scope";
import { EVENT_REQUEST_OPEN_PLUGIN_SYNC_DIALOG, eventHub } from "@/common/events.ts"; import { EVENT_REQUEST_OPEN_PLUGIN_SYNC_DIALOG, eventHub } from "@/common/events.ts";
import { PluginDialogModal } from "./PluginDialogModal.ts"; import { PluginDialogModal } from "./PluginDialogModal.ts";
@@ -69,7 +69,7 @@ import type { LiveSyncCore } from "@/main.ts";
import { LiveSyncError } from "@vrtmrz/livesync-commonlib/compat/common/LSError"; import { LiveSyncError } from "@vrtmrz/livesync-commonlib/compat/common/LSError";
import type { OptionalSyncFeatureMode } from "@/features/optionalSyncFeatures.ts"; import type { OptionalSyncFeatureMode } from "@/features/optionalSyncFeatures.ts";
import { getObsidianCommunityPluginManager } from "@/common/obsidianCommunityPlugins.ts"; import { getObsidianCommunityPluginManager } from "@/common/obsidianCommunityPlugins.ts";
import { createContentApplier } from "octagonal-wheels/content"; import { createModificationHandler } from "octagonal-wheels/modification";
import type { HandlerOutcome } from "@vrtmrz/livesync-commonlib/compat/services/lib/HandlerUtils"; import type { HandlerOutcome } from "@vrtmrz/livesync-commonlib/compat/services/lib/HandlerUtils";
import type { OptionalFileEventOptions } from "@vrtmrz/livesync-commonlib/compat/services/base/IService"; import type { OptionalFileEventOptions } from "@vrtmrz/livesync-commonlib/compat/services/base/IService";
@@ -1033,7 +1033,7 @@ export class ConfigSync extends LiveSyncCommands {
await this.storeCustomisationFileV2(path, this.services.setting.getDeviceAndVaultName()); await this.storeCustomisationFileV2(path, this.services.setting.getDeviceAndVaultName());
} else { } else {
const files = data.files; const files = data.files;
const applyBinaryContent = createContentApplier< const applyBinaryContent = createModificationHandler<
ConfigFileApplicationTarget, ConfigFileApplicationTarget,
LoadedEntryPluginDataExFile, LoadedEntryPluginDataExFile,
ArrayBuffer, ArrayBuffer,
@@ -1050,7 +1050,7 @@ export class ConfigSync extends LiveSyncCommands {
write: (target, content) => write: (target, content) =>
this.core.storageAccess.writeHiddenFileAuto(target.path, content, target.stat), this.core.storageAccess.writeHiddenFileAuto(target.path, content, target.stat),
}); });
const applyTextContent = createContentApplier< const applyTextContent = createModificationHandler<
ConfigFileApplicationTarget, ConfigFileApplicationTarget,
LoadedEntryPluginDataExFile, LoadedEntryPluginDataExFile,
string, string,
@@ -25,7 +25,7 @@ import {
} from "./settingConstants.ts"; } from "./settingConstants.ts";
import { $msg } from "@/common/translation"; import { $msg } from "@/common/translation";
import type { AutoWireOption, OnUpdateResult } from "./SettingPane.ts"; import type { AutoWireOption, OnUpdateResult } from "./SettingPane.ts";
import { wrapMemo } from "octagonal-wheels/function"; import { onlyWhenChanged } from "octagonal-wheels/function";
import { setButtonDestructiveState } from "./settingComponentStyles.ts"; import { setButtonDestructiveState } from "./settingComponentStyles.ts";
export class LiveSyncSetting extends Setting { export class LiveSyncSetting extends Setting {
@@ -118,7 +118,7 @@ export class LiveSyncSetting extends Setting {
const conf = this.autoWireSetting(key, opt); const conf = this.autoWireSetting(key, opt);
addComponent((text) => { addComponent((text) => {
this.autoWiredComponent = text; this.autoWiredComponent = text;
const setValue = wrapMemo((value: string) => { const setValue = onlyWhenChanged((value: string) => {
text.setValue(value); text.setValue(value);
}); });
this.invalidateValue = () => setValue(`${LiveSyncSetting.env.editingSettings[key]}`); this.invalidateValue = () => setValue(`${LiveSyncSetting.env.editingSettings[key]}`);
@@ -167,7 +167,7 @@ export class LiveSyncSetting extends Setting {
text.inputEl.setAttribute("max", `${opt.clampMax}`); text.inputEl.setAttribute("max", `${opt.clampMax}`);
} }
let lastError = false; let lastError = false;
const setValue = wrapMemo((value: string) => { const setValue = onlyWhenChanged((value: string) => {
text.setValue(value); text.setValue(value);
}); });
this.invalidateValue = () => { this.invalidateValue = () => {
@@ -213,7 +213,7 @@ export class LiveSyncSetting extends Setting {
const conf = this.autoWireSetting(key, opt); const conf = this.autoWireSetting(key, opt);
this.addToggle((toggle) => { this.addToggle((toggle) => {
this.autoWiredComponent = toggle; this.autoWiredComponent = toggle;
const setValue = wrapMemo((value: boolean) => { const setValue = onlyWhenChanged((value: boolean) => {
toggle.setValue(opt?.invert ? !value : value); toggle.setValue(opt?.invert ? !value : value);
}); });
this.invalidateValue = () => this.invalidateValue = () =>
@@ -232,7 +232,7 @@ export class LiveSyncSetting extends Setting {
const conf = this.autoWireSetting(key, opt); const conf = this.autoWireSetting(key, opt);
this.addDropdown((dropdown) => { this.addDropdown((dropdown) => {
this.autoWiredComponent = dropdown; this.autoWiredComponent = dropdown;
const setValue = wrapMemo((value: string) => { const setValue = onlyWhenChanged((value: string) => {
dropdown.setValue(value); dropdown.setValue(value);
}); });
@@ -252,7 +252,7 @@ export class LiveSyncSetting extends Setting {
const conf = this.autoWireSetting(key, opt); const conf = this.autoWireSetting(key, opt);
this.addDropdown((dropdown) => { this.addDropdown((dropdown) => {
this.autoWiredComponent = dropdown; this.autoWiredComponent = dropdown;
const setValue = wrapMemo((value: string) => { const setValue = onlyWhenChanged((value: string) => {
dropdown.setValue(value); dropdown.setValue(value);
}); });