History

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

Julius Marminge committed 2 months ago

Commit 89dd9ab1 parent 5a853a416 files · +18 −4Browse files

Unified · Split

16 files
  1. apps/desktop/src/app/DesktopAppActivation.ts +1 −0
  2. apps/desktop/src/app/DesktopAppIdentity.ts +1 −0
  3. apps/desktop/src/app/DesktopAssets.ts +1 −0
  4. apps/desktop/src/app/DesktopClerk.ts +1 −0
  5. apps/desktop/src/app/DesktopConnectionCatalogStore.ts +1 −0
  6. apps/desktop/src/app/DesktopLifecycle.ts +1 −0
  7. apps/desktop/src/app/DesktopLinuxUrlHandler.ts +2 −1
  8. apps/desktop/src/app/DesktopPreReadyPlatform.ts +1 −0
  9. apps/desktop/src/shell/DesktopShellEnvironment.ts +1 −0
  10. apps/desktop/src/ssh/DesktopSshEnvironment.ts +1 −0
  11. apps/desktop/src/ssh/DesktopSshPasswordPrompts.ts +1 −0
  12. apps/desktop/src/updates/DesktopUpdates.ts +1 −0
  13. apps/desktop/src/updates/remoteUpdateFlow.ts +1 −1
  14. apps/desktop/src/updates/updateMachine.ts +2 −2
  15. apps/desktop/src/window/DesktopApplicationMenu.ts +1 −0
  16. apps/desktop/src/window/DesktopWindow.ts +1 −0
apps/desktop/src/app/DesktopAppActivation.ts+1−0
@@ -213,6 +213,7 @@ export class DesktopAppActivation extends Context.Service< · 212 unmodified lines
213 213
214const { logWarning } = makeComponentLogger("desktop-app-activation");214const { logWarning } = makeComponentLogger("desktop-app-activation");
215 215
216/** @public Service construction is part of the canonical Effect module API. */
216export const make = Effect.gen(function* () {217export const make = Effect.gen(function* () {
217 const desktopEnvironment = yield* DesktopEnvironment.DesktopEnvironment;218 const desktopEnvironment = yield* DesktopEnvironment.DesktopEnvironment;
218 const desktopWindow = yield* DesktopWindow.DesktopWindow;219 const desktopWindow = yield* DesktopWindow.DesktopWindow;
apps/desktop/src/app/DesktopAppIdentity.ts+1−0
@@ -66,6 +66,7 @@ export const resolveUserDataPath = Effect.gen(function* () { · 65 unmodified lines
66 : environment.path.join(environment.appDataDirectory, environment.userDataDirName);66 : environment.path.join(environment.appDataDirectory, environment.userDataDirName);
67}).pipe(Effect.withSpan("desktop.appIdentity.resolveUserDataPath"));67}).pipe(Effect.withSpan("desktop.appIdentity.resolveUserDataPath"));
68 68
69/** @public Service construction is part of the canonical Effect module API. */
69export const make = Effect.gen(function* () {70export const make = Effect.gen(function* () {
70 const assets = yield* DesktopAssets.DesktopAssets;71 const assets = yield* DesktopAssets.DesktopAssets;
71 const electronApp = yield* ElectronApp.ElectronApp;72 const electronApp = yield* ElectronApp.ElectronApp;
apps/desktop/src/app/DesktopAssets.ts+1−0
@@ -119,6 +119,7 @@ const resolveIconPath = Effect.fn("desktop.assets.resolveIconPath")(function* ( · 118 unmodified lines
119 return yield* resolveResourcePath(`icon.${ext}`);119 return yield* resolveResourcePath(`icon.${ext}`);
120});120});
121 121
122/** @public Service construction is part of the canonical Effect module API. */
122export const make = Effect.gen(function* () {123export const make = Effect.gen(function* () {
123 const context = yield* Effect.context<124 const context = yield* Effect.context<
124 FileSystem.FileSystem | DesktopEnvironment.DesktopEnvironment125 FileSystem.FileSystem | DesktopEnvironment.DesktopEnvironment
apps/desktop/src/app/DesktopClerk.ts+1−0
@@ -83,6 +83,7 @@ function createDesktopClerkBridge(stateDir: string, isDevelopment: boolean) { · 82 unmodified lines
83 });83 });
84}84}
85 85
86/** @public Service construction is part of the canonical Effect module API. */
86export const make = Effect.gen(function* () {87export const make = Effect.gen(function* () {
87 const environment = yield* DesktopEnvironment.DesktopEnvironment;88 const environment = yield* DesktopEnvironment.DesktopEnvironment;
88 const electronApp = yield* ElectronApp.ElectronApp;89 const electronApp = yield* ElectronApp.ElectronApp;
apps/desktop/src/app/DesktopConnectionCatalogStore.ts+1−0
@@ -375,6 +375,7 @@ const migrateSavedEnvironmentRecords = Effect.fn( · 374 unmodified lines
375 };375 };
376});376});
377 377
378/** @public Service construction is part of the canonical Effect module API. */
378export const make = Effect.gen(function* () {379export const make = Effect.gen(function* () {
379 const environment = yield* DesktopEnvironment.DesktopEnvironment;380 const environment = yield* DesktopEnvironment.DesktopEnvironment;
380 const fileSystem = yield* FileSystem.FileSystem;381 const fileSystem = yield* FileSystem.FileSystem;
apps/desktop/src/app/DesktopLifecycle.ts+1−0
@@ -159,6 +159,7 @@ function quitFromSignal( · 158 unmodified lines
159 );159 );
160}160}
161 161
162/** @public Service construction is part of the canonical Effect module API. */
162export const make = DesktopLifecycle.of({163export const make = DesktopLifecycle.of({
163 relaunch: Effect.fn("desktop.lifecycle.relaunch")(function* (reason) {164 relaunch: Effect.fn("desktop.lifecycle.relaunch")(function* (reason) {
164 const electronApp = yield* ElectronApp.ElectronApp;165 const electronApp = yield* ElectronApp.ElectronApp;
apps/desktop/src/app/DesktopLinuxUrlHandler.ts+2−1
@@ -20,7 +20,7 @@ import { makeComponentLogger } from "./DesktopObservability.ts"; · 19 unmodified lines
20// our own handler entry pointing at the current AppImage and claim the20// our own handler entry pointing at the current AppImage and claim the
21// scheme default via xdg-mime, exactly what the file manager's "set as21// scheme default via xdg-mime, exactly what the file manager's "set as
22// default" checkbox would record in mimeapps.list.22// default" checkbox would record in mimeapps.list.
23export const URL_HANDLER_DESKTOP_ENTRY_NAME = "t3code-url-handler.desktop";23const URL_HANDLER_DESKTOP_ENTRY_NAME = "t3code-url-handler.desktop";
24 24
25const { logInfo, logWarning } = makeComponentLogger("desktop-linux-url-handler");25const { logInfo, logWarning } = makeComponentLogger("desktop-linux-url-handler");
26 26
@@ -92,6 +92,7 @@ export class DesktopLinuxUrlHandler extends Context.Service< · 65 unmodified lines
92 }92 }
93>()("@t3tools/desktop/app/DesktopLinuxUrlHandler") {}93>()("@t3tools/desktop/app/DesktopLinuxUrlHandler") {}
94 94
95/** @public Service construction is part of the canonical Effect module API. */
95export const make = Effect.gen(function* () {96export const make = Effect.gen(function* () {
96 const environment = yield* DesktopEnvironment.DesktopEnvironment;97 const environment = yield* DesktopEnvironment.DesktopEnvironment;
97 const fileSystem = yield* FileSystem.FileSystem;98 const fileSystem = yield* FileSystem.FileSystem;
apps/desktop/src/app/DesktopPreReadyPlatform.ts+1−0
@@ -46,6 +46,7 @@ export class DesktopPreReadyElectronOptions extends Context.Service< · 45 unmodified lines
46 }46 }
47>()("@t3tools/desktop/app/DesktopPreReadyPlatform/DesktopPreReadyElectronOptions") {}47>()("@t3tools/desktop/app/DesktopPreReadyPlatform/DesktopPreReadyElectronOptions") {}
48 48
49/** @public Service construction is part of the canonical Effect module API. */
49export const make = Effect.gen(function* () {50export const make = Effect.gen(function* () {
50 const platform = yield* HostProcessPlatform;51 const platform = yield* HostProcessPlatform;
51 return yield* Effect.sync((): DesktopPreReadyElectronOptions["Service"] => {52 return yield* Effect.sync((): DesktopPreReadyElectronOptions["Service"] => {
apps/desktop/src/shell/DesktopShellEnvironment.ts+1−0
@@ -533,6 +533,7 @@ const installShellEnvironment = ( · 532 unmodified lines
533 return Effect.void;533 return Effect.void;
534};534};
535 535
536/** @public Service construction is part of the canonical Effect module API. */
536export const make = Effect.gen(function* () {537export const make = Effect.gen(function* () {
537 const environment = yield* DesktopEnvironment.DesktopEnvironment;538 const environment = yield* DesktopEnvironment.DesktopEnvironment;
538 const fileSystem = yield* FileSystem.FileSystem;539 const fileSystem = yield* FileSystem.FileSystem;
apps/desktop/src/ssh/DesktopSshEnvironment.ts+1−0
@@ -128,6 +128,7 @@ const makePasswordPrompt = ( · 127 unmodified lines
128 prompts.request(request).pipe(Effect.mapError(toSshPasswordPromptError)),128 prompts.request(request).pipe(Effect.mapError(toSshPasswordPromptError)),
129});129});
130 130
131/** @public Service construction is part of the canonical Effect module API. */
131export const make = Effect.gen(function* () {132export const make = Effect.gen(function* () {
132 const manager = yield* SshTunnel.SshEnvironmentManager;133 const manager = yield* SshTunnel.SshEnvironmentManager;
133 const prompts = yield* DesktopSshPasswordPrompts.DesktopSshPasswordPrompts;134 const prompts = yield* DesktopSshPasswordPrompts.DesktopSshPasswordPrompts;
apps/desktop/src/ssh/DesktopSshPasswordPrompts.ts+1−0
@@ -222,6 +222,7 @@ const failPending = ( · 221 unmodified lines
222 error: DesktopSshPasswordPromptRequestError,222 error: DesktopSshPasswordPromptRequestError,
223) => Deferred.fail(pending.deferred, error).pipe(Effect.asVoid);223) => Deferred.fail(pending.deferred, error).pipe(Effect.asVoid);
224 224
225/** @public Service construction is part of the canonical Effect module API. */
225export const make = Effect.fn("desktop.sshPasswordPrompts.make")(function* (226export const make = Effect.fn("desktop.sshPasswordPrompts.make")(function* (
226 options: DesktopSshPasswordPromptsOptions = {},227 options: DesktopSshPasswordPromptsOptions = {},
227) {228) {
apps/desktop/src/updates/DesktopUpdates.ts+1−0
@@ -271,6 +271,7 @@ function isArm64HostRunningIntelBuild(runtimeInfo: DesktopRuntimeInfo): boolean · 270 unmodified lines
271 return runtimeInfo.hostArch === "arm64" && runtimeInfo.appArch === "x64";271 return runtimeInfo.hostArch === "arm64" && runtimeInfo.appArch === "x64";
272}272}
273 273
274/** @public Service construction is part of the canonical Effect module API. */
274export const make = Effect.gen(function* () {275export const make = Effect.gen(function* () {
275 const config = yield* DesktopConfig.DesktopConfig;276 const config = yield* DesktopConfig.DesktopConfig;
276 const pool = yield* DesktopBackendPool.DesktopBackendPool;277 const pool = yield* DesktopBackendPool.DesktopBackendPool;
apps/desktop/src/updates/remoteUpdateFlow.ts+1−1
@@ -31,7 +31,7 @@ export const MAX_REMOTE_UPDATE_CHECKS = 2; · 30 unmodified lines
31export const MAX_REMOTE_UPDATE_DOWNLOADS = 3;31export const MAX_REMOTE_UPDATE_DOWNLOADS = 3;
32 32
33/** Same predicate DesktopUpdates.installDownloadedUpdate uses for admission. */33/** Same predicate DesktopUpdates.installDownloadedUpdate uses for admission. */
34export function isInstallableDesktopUpdateState(state: DesktopUpdateState): boolean {34function isInstallableDesktopUpdateState(state: DesktopUpdateState): boolean {
35 return (35 return (
36 state.downloadedVersion !== null &&36 state.downloadedVersion !== null &&
37 (state.status === "downloaded" ||37 (state.status === "downloaded" ||
apps/desktop/src/updates/updateMachine.ts+2−2
@@ -5,13 +5,13 @@ import type { · 4 unmodified lines
5 DesktopUpdateState,5 DesktopUpdateState,
6} from "@t3tools/contracts";6} from "@t3tools/contracts";
7 7
8export function nextStatusAfterDownloadFailure(8function nextStatusAfterDownloadFailure(
9 currentState: DesktopUpdateState,9 currentState: DesktopUpdateState,
10): DesktopUpdateState["status"] {10): DesktopUpdateState["status"] {
11 return currentState.availableVersion ? "available" : "error";11 return currentState.availableVersion ? "available" : "error";
12}12}
13 13
14export function getCanRetryAfterDownloadFailure(currentState: DesktopUpdateState): boolean {14function getCanRetryAfterDownloadFailure(currentState: DesktopUpdateState): boolean {
15 return currentState.availableVersion !== null;15 return currentState.availableVersion !== null;
16}16}
17 17
apps/desktop/src/window/DesktopApplicationMenu.ts+1−0
@@ -103,6 +103,7 @@ const handleCheckForUpdatesMenuClick = Effect.gen(function* () { · 102 unmodified lines
103 yield* checkForUpdatesFromMenu;103 yield* checkForUpdatesFromMenu;
104}).pipe(Effect.withSpan("desktop.menu.handleCheckForUpdatesClick"));104}).pipe(Effect.withSpan("desktop.menu.handleCheckForUpdatesClick"));
105 105
106/** @public Service construction is part of the canonical Effect module API. */
106export const make = Effect.gen(function* () {107export const make = Effect.gen(function* () {
107 const electronApp = yield* ElectronApp.ElectronApp;108 const electronApp = yield* ElectronApp.ElectronApp;
108 const electronMenu = yield* ElectronMenu.ElectronMenu;109 const electronMenu = yield* ElectronMenu.ElectronMenu;
apps/desktop/src/window/DesktopWindow.ts+1−0
@@ -278,6 +278,7 @@ function bindFirstRevealTrigger( · 277 unmodified lines
278 }278 }
279}279}
280 280
281/** @public Service construction is part of the canonical Effect module API. */
281export const make = Effect.gen(function* () {282export const make = Effect.gen(function* () {
282 const environment = yield* DesktopEnvironment.DesktopEnvironment;283 const environment = yield* DesktopEnvironment.DesktopEnvironment;
283 const assets = yield* DesktopAssets.DesktopAssets;284 const assets = yield* DesktopAssets.DesktopAssets;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t