refactor(desktop): classify app exports (#10267)

This commit is contained in:
Julius Marminge authored and GitHub committed 2026-09-07 15:00:37 -07:00
1 parent 5a853a4b45
commit 89dd9ab32b
16 files changed
+18 -4

No files matched your search

@@ -213,6 +213,7 @@ export class DesktopAppActivation extends Context.Service<
const { logWarning } = makeComponentLogger("desktop-app-activation");
/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const desktopEnvironment = yield* DesktopEnvironment.DesktopEnvironment;
const desktopWindow = yield* DesktopWindow.DesktopWindow;
@@ -66,6 +66,7 @@ export const resolveUserDataPath = Effect.gen(function* () {
: environment.path.join(environment.appDataDirectory, environment.userDataDirName);
}).pipe(Effect.withSpan("desktop.appIdentity.resolveUserDataPath"));
/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const assets = yield* DesktopAssets.DesktopAssets;
const electronApp = yield* ElectronApp.ElectronApp;
+1
View File
@@ -119,6 +119,7 @@ const resolveIconPath = Effect.fn("desktop.assets.resolveIconPath")(function* (
return yield* resolveResourcePath(`icon.${ext}`);
});
/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const context = yield* Effect.context<
FileSystem.FileSystem | DesktopEnvironment.DesktopEnvironment
+1
View File
@@ -83,6 +83,7 @@ function createDesktopClerkBridge(stateDir: string, isDevelopment: boolean) {
});
}
/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const environment = yield* DesktopEnvironment.DesktopEnvironment;
const electronApp = yield* ElectronApp.ElectronApp;
@@ -375,6 +375,7 @@ const migrateSavedEnvironmentRecords = Effect.fn(
};
});
/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const environment = yield* DesktopEnvironment.DesktopEnvironment;
const fileSystem = yield* FileSystem.FileSystem;
+1
View File
@@ -159,6 +159,7 @@ function quitFromSignal(
);
}
/** @public Service construction is part of the canonical Effect module API. */
export const make = DesktopLifecycle.of({
relaunch: Effect.fn("desktop.lifecycle.relaunch")(function* (reason) {
const electronApp = yield* ElectronApp.ElectronApp;
@@ -20,7 +20,7 @@ import { makeComponentLogger } from "./DesktopObservability.ts";
// our own handler entry pointing at the current AppImage and claim the
// scheme default via xdg-mime, exactly what the file manager's "set as
// default" checkbox would record in mimeapps.list.
export const URL_HANDLER_DESKTOP_ENTRY_NAME = "t3code-url-handler.desktop";
const URL_HANDLER_DESKTOP_ENTRY_NAME = "t3code-url-handler.desktop";
const { logInfo, logWarning } = makeComponentLogger("desktop-linux-url-handler");
@@ -92,6 +92,7 @@ export class DesktopLinuxUrlHandler extends Context.Service<
}
>()("@t3tools/desktop/app/DesktopLinuxUrlHandler") {}
/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const environment = yield* DesktopEnvironment.DesktopEnvironment;
const fileSystem = yield* FileSystem.FileSystem;
@@ -46,6 +46,7 @@ export class DesktopPreReadyElectronOptions extends Context.Service<
}
>()("@t3tools/desktop/app/DesktopPreReadyPlatform/DesktopPreReadyElectronOptions") {}
/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const platform = yield* HostProcessPlatform;
return yield* Effect.sync((): DesktopPreReadyElectronOptions["Service"] => {
@@ -533,6 +533,7 @@ const installShellEnvironment = (
return Effect.void;
};
/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const environment = yield* DesktopEnvironment.DesktopEnvironment;
const fileSystem = yield* FileSystem.FileSystem;
@@ -128,6 +128,7 @@ const makePasswordPrompt = (
prompts.request(request).pipe(Effect.mapError(toSshPasswordPromptError)),
});
/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const manager = yield* SshTunnel.SshEnvironmentManager;
const prompts = yield* DesktopSshPasswordPrompts.DesktopSshPasswordPrompts;
@@ -222,6 +222,7 @@ const failPending = (
error: DesktopSshPasswordPromptRequestError,
) => Deferred.fail(pending.deferred, error).pipe(Effect.asVoid);
/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.fn("desktop.sshPasswordPrompts.make")(function* (
options: DesktopSshPasswordPromptsOptions = {},
) {
@@ -271,6 +271,7 @@ function isArm64HostRunningIntelBuild(runtimeInfo: DesktopRuntimeInfo): boolean
return runtimeInfo.hostArch === "arm64" && runtimeInfo.appArch === "x64";
}
/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const config = yield* DesktopConfig.DesktopConfig;
const pool = yield* DesktopBackendPool.DesktopBackendPool;
+1 -1
View File
@@ -31,7 +31,7 @@ export const MAX_REMOTE_UPDATE_CHECKS = 2;
export const MAX_REMOTE_UPDATE_DOWNLOADS = 3;
/** Same predicate DesktopUpdates.installDownloadedUpdate uses for admission. */
export function isInstallableDesktopUpdateState(state: DesktopUpdateState): boolean {
function isInstallableDesktopUpdateState(state: DesktopUpdateState): boolean {
return (
state.downloadedVersion !== null &&
(state.status === "downloaded" ||
+2 -2
View File
@@ -5,13 +5,13 @@ import type {
DesktopUpdateState,
} from "@t3tools/contracts";
export function nextStatusAfterDownloadFailure(
function nextStatusAfterDownloadFailure(
currentState: DesktopUpdateState,
): DesktopUpdateState["status"] {
return currentState.availableVersion ? "available" : "error";
}
export function getCanRetryAfterDownloadFailure(currentState: DesktopUpdateState): boolean {
function getCanRetryAfterDownloadFailure(currentState: DesktopUpdateState): boolean {
return currentState.availableVersion !== null;
}
@@ -103,6 +103,7 @@ const handleCheckForUpdatesMenuClick = Effect.gen(function* () {
yield* checkForUpdatesFromMenu;
}).pipe(Effect.withSpan("desktop.menu.handleCheckForUpdatesClick"));
/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const electronApp = yield* ElectronApp.ElectronApp;
const electronMenu = yield* ElectronMenu.ElectronMenu;
+1
View File
@@ -278,6 +278,7 @@ function bindFirstRevealTrigger(
}
}
/** @public Service construction is part of the canonical Effect module API. */
export const make = Effect.gen(function* () {
const environment = yield* DesktopEnvironment.DesktopEnvironment;
const assets = yield* DesktopAssets.DesktopAssets;