# Files changed · PR \#10265 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/10265/diffs)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

[refactor\(desktop\): classify backend exports](https://git.cafe/pingdotgg/t3code/pull/10265.md)

Version: 3

Head commit: fe8fffac36e33a6872351f261b8d21745b409df2

Base commit: 0d34579d674920cc47fc5c908494f51ed3895204

Comparison base: 0d34579d674920cc47fc5c908494f51ed3895204

Showing up to 20 entries from this revision. If the pull request changes, reopen the first page before continuing.

## apps/desktop/scripts/electron-launcher.mjs

Status: modified; +3; −3

```diff
@@ -15,8 +15,8 @@
 const devBundleIdSuffix = NodePath.basename(repoRoot)
   .toLowerCase()
   .replaceAll(/[^a-z0-9]+/g, "");
-export const APP_DISPLAY_NAME = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)";
+const APP_DISPLAY_NAME = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)";
-export const APP_BUNDLE_ID = isDevelopment
+const APP_BUNDLE_ID = isDevelopment
   ? `com.t3tools.t3code.dev.${devBundleIdSuffix || "local"}`
   : "com.t3tools.t3code";
 const APP_PROTOCOL_SCHEMES = isDevelopment ? ["t3code-dev"] : ["t3code"];
@@ -387,7 +387,7 @@
   return ["--no-sandbox"];
 }
 
+function resolveElectronPath() {
-export function resolveElectronPath() {
   const electronBinaryPath = resolveElectronBinaryPath();
 
   if (hostPlatform !== "darwin") {
```

## apps/desktop/src/backend/DesktopBackendConfiguration.ts

Status: modified; +1; −0

```diff
@@ -737,6 +737,7 @@
   } satisfies DesktopBackendManager.DesktopBackendStartConfig;
 });
 
+/** @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;
```

## apps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts

Status: modified; +1; −0

```diff
@@ -42,6 +42,7 @@
   }
 >()("@t3tools/desktop/backend/DesktopLocalEnvironmentAuth") {}
 
+/** @public Service construction is part of the canonical Effect module API. */
 export const make = Effect.gen(function* () {
   const pool = yield* DesktopBackendPool.DesktopBackendPool;
   const httpClient = yield* HttpClient.HttpClient;
```

## apps/desktop/src/backend/DesktopNetworkInterfaces.ts

Status: modified; +1; −0

```diff
@@ -39,6 +39,7 @@
   }
 >()("@t3tools/desktop/backend/DesktopNetworkInterfaces") {}
 
+/** @public Service construction is part of the canonical Effect module API. */
 export const make = Effect.gen(function* () {
   const platform = yield* HostProcessPlatform;
   return DesktopNetworkInterfaces.of({
```

## apps/desktop/src/backend/DesktopServerExposure.ts

Status: modified; +2; −1

```diff
@@ -27,7 +27,7 @@
 
 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 {
@@ -411,6 +411,7 @@
   previous.bindHost !== next.bindHost ||
   previous.localHttpUrl !== next.localHttpUrl;
 
+/** @public Service construction is part of the canonical Effect module API. */
 export const make = Effect.gen(function* () {
   const config = yield* DesktopConfig.DesktopConfig;
   const networkInterfaces = yield* DesktopNetworkInterfaces.DesktopNetworkInterfaces;
```

## apps/desktop/src/backend/tailscaleEndpointProvider.ts

Status: modified; +1; −1

```diff
@@ -14,7 +14,7 @@
 
 import type { NetworkInterfaces } from "./DesktopNetworkInterfaces.ts";
 
-export { isTailscaleIpv4Address, parseTailscaleMagicDnsName } from "@t3tools/tailscale";
+export { parseTailscaleMagicDnsName } from "@t3tools/tailscale";
 
 const TAILSCALE_ENDPOINT_PROVIDER: AdvertisedEndpointProvider = {
   id: "tailscale",
```

## apps/desktop/src/settings/DesktopAppSettings.ts

Status: modified; +2; −1

```diff
@@ -55,7 +55,7 @@
   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,
@@ -450,6 +450,7 @@
   );
 });
 
+/** @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;
```

## apps/desktop/src/settings/DesktopSavedEnvironments.ts

Status: modified; +1; −53

```diff
@@ -9,7 +9,6 @@
 import * as Option from "effect/Option";
 import * as Path from "effect/Path";
 import * as Schema from "effect/Schema";
-import * as Ref from "effect/Ref";
 
 import * as DesktopEnvironment from "../app/DesktopEnvironment.ts";
 import * as ElectronSafeStorage from "../electron/ElectronSafeStorage.ts";
@@ -365,6 +364,7 @@
   );
 }
 
+/** @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;
@@ -555,55 +555,3 @@
 });
 
 export const layer = Layer.effect(DesktopSavedEnvironments, make);
-
-export const layerTest = (input?: {
-  readonly records?: readonly PersistedSavedEnvironmentRecord[];
-  readonly secrets?: ReadonlyMap<string, string>;
-}) =>
-  Layer.effect(
-    DesktopSavedEnvironments,
-    Effect.gen(function* () {
-      const recordsRef = yield* Ref.make(input?.records ?? []);
-      const secretsRef = yield* Ref.make(new Map(input?.secrets ?? []));
-
-      return DesktopSavedEnvironments.of({
-        getRegistry: Ref.get(recordsRef),
-        setRegistry: (records) => Ref.set(recordsRef, records),
-        removeEnvironment: (environmentId) =>
-          Ref.update(recordsRef, (records) =>
-            records.filter((record) => record.environmentId !== environmentId),
-          ).pipe(
-            Effect.andThen(
-              Ref.update(secretsRef, (secrets) => {
-                const nextSecrets = new Map(secrets);
-                nextSecrets.delete(environmentId);
-                return nextSecrets;
-              }),
-            ),
-          ),
-        getSecret: (environmentId) =>
-          Ref.get(secretsRef).pipe(
-            Effect.map((secrets) => Option.fromNullishOr(secrets.get(environmentId))),
-          ),
-        setSecret: ({ environmentId, secret }) =>
-          Ref.get(recordsRef).pipe(
-            Effect.flatMap((records) => {
-              if (!records.some((record) => record.environmentId === environmentId)) {
-                return Effect.succeed(false);
-              }
-              return Ref.update(secretsRef, (secrets) => {
-                const nextSecrets = new Map(secrets);
-                nextSecrets.set(environmentId, secret);
-                return nextSecrets;
-              }).pipe(Effect.as(true));
-            }),
-          ),
-        removeSecret: (environmentId) =>
-          Ref.update(secretsRef, (secrets) => {
-            const nextSecrets = new Map(secrets);
-            nextSecrets.delete(environmentId);
-            return nextSecrets;
-          }),
-      });
-    }),
-  );
```

## apps/desktop/src/telemetry/DesktopTelemetryPublisher.ts

Status: modified; +1; −0

```diff
@@ -145,6 +145,7 @@
   return LIVE_SAMPLE_INTERVAL;
 }
 
+/** @public Service construction is part of the canonical Effect module API. */
 export const make = Effect.fn("desktop.telemetryPublisher.make")(function* () {
   const electronApp = yield* ElectronApp.ElectronApp;
   const powerMonitor = yield* ElectronPowerMonitor.ElectronPowerMonitor;
```

## apps/desktop/src/wsl/DesktopWslServerTree.ts

Status: modified; +1; −0

```diff
@@ -116,6 +116,7 @@
       }),
   );
 
+/** @public Service construction is part of the canonical Effect module API. */
 export const make = Effect.gen(function* () {
   const environment = yield* DesktopEnvironment.DesktopEnvironment;
   const fs = yield* FileSystem.FileSystem;
```
