Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/desktop/scripts/electron-launcher.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const repoRoot = NodePath.resolve(desktopDir, "..", "..");
const devBundleIdSuffix = NodePath.basename(repoRoot)
.toLowerCase()
.replaceAll(/[^a-z0-9]+/g, "");
export const APP_DISPLAY_NAME = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)";
export const APP_BUNDLE_ID = isDevelopment
const APP_DISPLAY_NAME = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)";
const APP_BUNDLE_ID = isDevelopment
? `com.t3tools.t3code.dev.${devBundleIdSuffix || "local"}`
: "com.t3tools.t3code";
const APP_PROTOCOL_SCHEMES = isDevelopment ? ["t3code-dev"] : ["t3code"];
Expand Down Expand Up @@ -387,7 +387,7 @@ function resolveLinuxSandboxArgs(electronBinaryPath) {
return ["--no-sandbox"];
}

export function resolveElectronPath() {
function resolveElectronPath() {
const electronBinaryPath = resolveElectronBinaryPath();

if (hostPlatform !== "darwin") {
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/DesktopAppActivation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export class DesktopAppActivation extends Context.Service<

const { logWarning } = makeComponentLogger("desktop-app-activation");

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const desktopEnvironment = yield* DesktopEnvironment.DesktopEnvironment;
const desktopWindow = yield* DesktopWindow.DesktopWindow;
const electronWindow = yield* ElectronWindow.ElectronWindow;
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/DesktopAppIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const resolveUserDataPath = Effect.gen(function* () {
: environment.path.join(environment.appDataDirectory, environment.userDataDirName);
}).pipe(Effect.withSpan("desktop.appIdentity.resolveUserDataPath"));

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const assets = yield* DesktopAssets.DesktopAssets;
const electronApp = yield* ElectronApp.ElectronApp;
const environment = yield* DesktopEnvironment.DesktopEnvironment;
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/DesktopAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const resolveIconPath = Effect.fn("desktop.assets.resolveIconPath")(function* (
return yield* resolveResourcePath(`icon.${ext}`);
});

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const context = yield* Effect.context<
FileSystem.FileSystem | DesktopEnvironment.DesktopEnvironment
>();
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/DesktopClerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function createDesktopClerkBridge(stateDir: string, isDevelopment: boolean) {
});
}

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const environment = yield* DesktopEnvironment.DesktopEnvironment;
const electronApp = yield* ElectronApp.ElectronApp;

Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/DesktopConnectionCatalogStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ const migrateSavedEnvironmentRecords = Effect.fn(
};
});

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const environment = yield* DesktopEnvironment.DesktopEnvironment;
const fileSystem = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/DesktopLifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function quitFromSignal(
);
}

export const make = DesktopLifecycle.of({
const make = DesktopLifecycle.of({
relaunch: Effect.fn("desktop.lifecycle.relaunch")(function* (reason) {
const electronApp = yield* ElectronApp.ElectronApp;
const environment = yield* DesktopEnvironment.DesktopEnvironment;
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/app/DesktopLinuxUrlHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -92,7 +92,7 @@ export class DesktopLinuxUrlHandler extends Context.Service<
}
>()("@t3tools/desktop/app/DesktopLinuxUrlHandler") {}

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const environment = yield* DesktopEnvironment.DesktopEnvironment;
const fileSystem = yield* FileSystem.FileSystem;
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/DesktopPreReadyPlatform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class DesktopPreReadyElectronOptions extends Context.Service<
}
>()("@t3tools/desktop/app/DesktopPreReadyPlatform/DesktopPreReadyElectronOptions") {}

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const platform = yield* HostProcessPlatform;
return yield* Effect.sync((): DesktopPreReadyElectronOptions["Service"] => {
const linuxPasswordStoreCommandLine =
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/backend/DesktopBackendConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ const resolveWslStartConfig = Effect.fn("desktop.backendConfiguration.resolveWsl
} satisfies DesktopBackendManager.DesktopBackendStartConfig;
});

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const environment = yield* DesktopEnvironment.DesktopEnvironment;
const fileSystem = yield* FileSystem.FileSystem;
const serverExposure = yield* DesktopServerExposure.DesktopServerExposure;
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class DesktopLocalEnvironmentAuth extends Context.Service<
}
>()("@t3tools/desktop/backend/DesktopLocalEnvironmentAuth") {}

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const pool = yield* DesktopBackendPool.DesktopBackendPool;
const httpClient = yield* HttpClient.HttpClient;
const tokenRef = yield* Ref.make(Option.none<string>());
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/backend/DesktopNetworkInterfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class DesktopNetworkInterfaces extends Context.Service<
}
>()("@t3tools/desktop/backend/DesktopNetworkInterfaces") {}

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const platform = yield* HostProcessPlatform;
return DesktopNetworkInterfaces.of({
read: Effect.try({
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/backend/DesktopServerExposure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { resolveTailscaleAdvertisedEndpoints } from "./tailscaleEndpointProvider

const TAILSCALE_STATUS_CACHE_TTL = Duration.seconds(60);

export const DESKTOP_LOOPBACK_HOST = "127.0.0.1";
const DESKTOP_LOOPBACK_HOST = "127.0.0.1";
const DESKTOP_LAN_BIND_HOST = "0.0.0.0";

interface ResolvedDesktopServerExposure {
Expand Down Expand Up @@ -411,7 +411,7 @@ const requiresBackendRelaunch = (previous: RuntimeState, next: RuntimeState): bo
previous.bindHost !== next.bindHost ||
previous.localHttpUrl !== next.localHttpUrl;

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const config = yield* DesktopConfig.DesktopConfig;
const networkInterfaces = yield* DesktopNetworkInterfaces.DesktopNetworkInterfaces;
const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/backend/tailscaleEndpointProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import * as ChildProcessSpawner from "effect/unstable/process/ChildProcessSpawne

import type { NetworkInterfaces } from "./DesktopNetworkInterfaces.ts";

export { isTailscaleIpv4Address, parseTailscaleMagicDnsName } from "@t3tools/tailscale";
export { parseTailscaleMagicDnsName } from "@t3tools/tailscale";

const TAILSCALE_ENDPOINT_PROVIDER: AdvertisedEndpointProvider = {
id: "tailscale",
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const addScopedAppListener = <Args extends ReadonlyArray<unknown>>(
}),
).pipe(Effect.asVoid);

export const make = ElectronApp.of({
const make = ElectronApp.of({
metadata: Effect.gen(function* () {
const appVersion = yield* Effect.try({
try: () => Electron.app.getVersion(),
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class ElectronDialog extends Context.Service<
}
>()("@t3tools/desktop/electron/ElectronDialog") {}

export const make = ElectronDialog.of({
const make = ElectronDialog.of({
pickFolder: Effect.fn("desktop.electron.dialog.pickFolder")(function* (input) {
const ownerWindowId = Option.match(input.owner, {
onNone: () => null,
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const normalizePosition = (
Option.map(({ x, y }) => ({ x: Math.floor(x * zoomFactor), y: Math.floor(y * zoomFactor) })),
);

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const platform = yield* HostProcessPlatform;
let destructiveMenuIconCache: Option.Option<Electron.NativeImage> | undefined;

Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronPowerMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const onSpeedLimitChange: ElectronPowerMonitor["Service"]["onSpeedLimitChange"]
).pipe(Effect.asVoid);
};

export const make = ElectronPowerMonitor.of({
const make = ElectronPowerMonitor.of({
isOnBatteryPower: Effect.sync(() => Electron.powerMonitor.isOnBatteryPower()),
getSystemIdleTime: Effect.sync(() => Electron.powerMonitor.getSystemIdleTime()),
getSystemIdleState: (idleThresholdSeconds) =>
Expand Down
10 changes: 5 additions & 5 deletions apps/desktop/src/electron/ElectronProtocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import * as Scope from "effect/Scope";
import * as Electron from "electron";

export const DESKTOP_HOST = "app";
export const DESKTOP_PRODUCTION_SCHEME = "t3code";
export const DESKTOP_DEVELOPMENT_SCHEME = "t3code-dev";
const DESKTOP_PRODUCTION_SCHEME = "t3code";
const DESKTOP_DEVELOPMENT_SCHEME = "t3code-dev";

export function getDesktopScheme(isDevelopment: boolean): string {
return isDevelopment ? DESKTOP_DEVELOPMENT_SCHEME : DESKTOP_PRODUCTION_SCHEME;
}

export function getDesktopOrigin(isDevelopment: boolean): string {
function getDesktopOrigin(isDevelopment: boolean): string {
return `${getDesktopScheme(isDevelopment)}://${DESKTOP_HOST}`;
}

Expand Down Expand Up @@ -109,7 +109,7 @@ function withContentSecurityPolicy(response: Response, policy: string): Response
/**
* Must run synchronously during process bootstrap, before Electron emits `ready`.
*/
export function registerDesktopSchemePrivilegesSync(): void {
function registerDesktopSchemePrivilegesSync(): void {
Electron.protocol.registerSchemesAsPrivileged([
{
scheme: DESKTOP_PRODUCTION_SCHEME,
Expand Down Expand Up @@ -205,7 +205,7 @@ async function fetchWithTransientRetry(url: string, init: RequestInit): Promise<
throw lastError;
}

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const registered = yield* Ref.make(false);

const registerDesktopProtocol = Effect.fn("desktop.electron.protocol.registerDesktopProtocol")(
Expand Down
3 changes: 1 addition & 2 deletions apps/desktop/src/electron/ElectronSafeStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const ElectronSafeStorageError = Schema.Union([
ElectronSafeStorageDecryptError,
]);
export type ElectronSafeStorageError = typeof ElectronSafeStorageError.Type;
export const isElectronSafeStorageError = Schema.is(ElectronSafeStorageError);

export class ElectronSafeStorage extends Context.Service<
ElectronSafeStorage,
Expand All @@ -66,7 +65,7 @@ export class ElectronSafeStorage extends Context.Service<
}
>()("@t3tools/desktop/electron/ElectronSafeStorage") {}

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const platform = yield* HostProcessPlatform;

return ElectronSafeStorage.of({
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronShell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class ElectronShell extends Context.Service<
}
>()("@t3tools/desktop/electron/ElectronShell") {}

export const make = ElectronShell.of({
const make = ElectronShell.of({
openExternal: (rawUrl) =>
Option.match(parseSafeExternalUrl(rawUrl), {
onNone: () => Effect.succeed(false),
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class ElectronTheme extends Context.Service<
}
>()("@t3tools/desktop/electron/ElectronTheme") {}

export const make = ElectronTheme.of({
const make = ElectronTheme.of({
shouldUseDarkColors: Effect.sync(() => Electron.nativeTheme.shouldUseDarkColors),
setSource: (theme) =>
Effect.try({
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class ElectronUpdater extends Context.Service<
}
>()("@t3tools/desktop/electron/ElectronUpdater") {}

export const make = ElectronUpdater.of({
const make = ElectronUpdater.of({
setFeedURL: (options) =>
Effect.suspend(() => {
autoUpdater.setFeedURL(options);
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class ElectronWindow extends Context.Service<
}
>()("@t3tools/desktop/electron/ElectronWindow") {}

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const platform = yield* HostProcessPlatform;
const mainWindowRef = yield* Ref.make<Option.Option<Electron.BrowserWindow>>(Option.none());

Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/preview/BrowserImport/BrowserImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const writeCookies = Effect.fn("BrowserImport.writeCookies")(function* (
return { imported, skipped, skippedDomains: [...skippedDomains].slice(0, 20) };
});

export const make = Effect.gen(function* BrowserImportMake() {
const make = Effect.gen(function* BrowserImportMake() {
const browserSession = yield* BrowserSession.BrowserSession;
const platform = yield* HostProcessPlatform;
const executablePath = yield* HostProcessExecutablePath;
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/preview/BrowserSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const encodeScopeForDigest = (scope: string): Uint8Array =>
),
);

export const make = Effect.gen(function* BrowserSessionMake() {
const make = Effect.gen(function* BrowserSessionMake() {
const crypto = yield* Crypto.Crypto;
const sessionsRef = yield* SynchronizedRef.make<ReadonlyMap<string, Session>>(new Map());

Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/preview/FaviconCapture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FAVICON_DATA_URL_MAX_LENGTH } from "@t3tools/contracts";

export const MAX_FAVICON_RESPONSE_BYTES = 100_000;
export const MAX_FAVICON_CANDIDATES = 8;
export const MAX_FAVICON_HTTP_URL_LENGTH = 2_048;
const MAX_FAVICON_HTTP_URL_LENGTH = 2_048;

const MAX_FAVICON_CANDIDATE_INPUT_UNITS = 262_144;
const MIN_FAVICON_CANDIDATE_INPUT_UNITS = 256;
Expand Down
15 changes: 6 additions & 9 deletions apps/desktop/src/preview/Manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const DEFAULT_ANNOTATION_THEME: DesktopPreviewAnnotationTheme = {
fontMono: "ui-monospace, monospace",
};

export const buildPreviewPictureInPictureDataUrl = (): string => {
const buildPreviewPictureInPictureDataUrl = (): string => {
const html = `<!doctype html>
<html>
<head>
Expand Down Expand Up @@ -4271,7 +4271,7 @@ export class PreviewOperationError extends Schema.TaggedErrorClass<PreviewOperat
}
}

export const isPreviewOperationError = Schema.is(PreviewOperationError);
const isPreviewOperationError = Schema.is(PreviewOperationError);

export class PreviewArtifactPathOutsideDirectoryError extends Schema.TaggedErrorClass<PreviewArtifactPathOutsideDirectoryError>()(
"PreviewArtifactPathOutsideDirectoryError",
Expand Down Expand Up @@ -4472,14 +4472,11 @@ export const PreviewManagerError = Schema.Union([
]);
export type PreviewManagerError = typeof PreviewManagerError.Type;

export const isPreviewManagerError = Schema.is(PreviewManagerError);
export const isPreviewAutomationControlInterruptedError = Schema.is(
const isPreviewAutomationControlInterruptedError = Schema.is(
PreviewAutomationControlInterruptedError,
);
export const isPreviewAutomationEvaluationError = Schema.is(PreviewAutomationEvaluationError);
export const isPreviewAutomationInvalidSelectorError = Schema.is(
PreviewAutomationInvalidSelectorError,
);
const isPreviewAutomationEvaluationError = Schema.is(PreviewAutomationEvaluationError);
const isPreviewAutomationInvalidSelectorError = Schema.is(PreviewAutomationInvalidSelectorError);

export class PreviewManager extends Context.Service<
PreviewManager,
Expand Down Expand Up @@ -4592,7 +4589,7 @@ export class PreviewManager extends Context.Service<
}
>()("@t3tools/desktop/preview/Manager/PreviewManager") {}

export const make = Effect.gen(function* PreviewManagerMake() {
const make = Effect.gen(function* PreviewManagerMake() {
const environment = yield* DesktopEnvironment.DesktopEnvironment;
const browserSession = yield* BrowserSession.BrowserSession;
const operations = yield* makeNativeOperations(
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/settings/DesktopAppSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export interface DesktopSettingsChange {
readonly changed: boolean;
}

export const DEFAULT_TAILSCALE_SERVE_PORT = 443;
const DEFAULT_TAILSCALE_SERVE_PORT = 443;
const MIN_MAIN_WINDOW_SIZE = {
width: 840,
height: 620,
Expand Down Expand Up @@ -450,7 +450,7 @@ const writeSettings = Effect.fn("desktop.settings.writeSettings")(function* (inp
);
});

export const make = Effect.gen(function* () {
const make = Effect.gen(function* () {
const environment = yield* DesktopEnvironment.DesktopEnvironment;
const fileSystem = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
Expand Down
Loading
Loading