Skip to content

Commit fcfecc7

Browse files
juliusmarmingecodex
andcommitted
Resolve TSGo diagnostics in relay stack
Co-authored-by: codex <codex@users.noreply.github.com>
1 parent 093dabb commit fcfecc7

8 files changed

Lines changed: 16 additions & 22 deletions

File tree

apps/desktop/src/app/DesktopCloudAuth.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ function makeHarness(input: { readonly isDevelopment: boolean }): CloudAuthHarne
9696
const environment = DesktopEnvironment.DesktopEnvironment.of({
9797
isDevelopment: input.isDevelopment,
9898
} as DesktopEnvironment.DesktopEnvironmentShape);
99+
const environmentLayer = Layer.succeed(DesktopEnvironment.DesktopEnvironment, environment);
99100

100101
return {
101102
app,
@@ -105,8 +106,10 @@ function makeHarness(input: { readonly isDevelopment: boolean }): CloudAuthHarne
105106
sends,
106107
reveals,
107108
layer: Layer.mergeAll(
108-
DesktopCloudAuth.layer.pipe(Layer.provide(NodeServices.layer)),
109-
Layer.succeed(DesktopEnvironment.DesktopEnvironment, environment),
109+
DesktopCloudAuth.layer.pipe(
110+
Layer.provideMerge(environmentLayer),
111+
Layer.provide(NodeServices.layer),
112+
),
110113
Layer.succeed(ElectronApp.ElectronApp, app),
111114
Layer.succeed(ElectronWindow.ElectronWindow, window),
112115
),

apps/desktop/src/app/DesktopCloudAuth.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,16 @@ interface PendingCloudAuthRequest {
3939
}
4040

4141
export interface DesktopCloudAuthShape {
42-
readonly createRequest: Effect.Effect<
43-
string,
44-
DesktopCloudAuthCallbackServerError,
45-
DesktopEnvironment.DesktopEnvironment
46-
>;
42+
readonly createRequest: Effect.Effect<string, DesktopCloudAuthCallbackServerError>;
4743
readonly configure: Effect.Effect<
4844
void,
4945
never,
50-
| DesktopEnvironment.DesktopEnvironment
51-
| ElectronApp.ElectronApp
52-
| ElectronWindow.ElectronWindow
53-
| Scope.Scope
46+
ElectronApp.ElectronApp | ElectronWindow.ElectronWindow | Scope.Scope
5447
>;
5548
}
5649

5750
export class DesktopCloudAuth extends Context.Service<DesktopCloudAuth, DesktopCloudAuthShape>()(
58-
"t3/desktop/CloudAuth",
51+
"@t3tools/desktop/app/DesktopCloudAuth",
5952
) {}
6053

6154
export function resolveCloudAuthCallbackScheme(input: { readonly isDevelopment: boolean }): string {
@@ -196,6 +189,7 @@ function startProtocolCallbackForwardServer(
196189

197190
const make = Effect.gen(function* () {
198191
const crypto = yield* Crypto.Crypto;
192+
const environment = yield* DesktopEnvironment.DesktopEnvironment;
199193
let pendingAuthRequest: PendingCloudAuthRequest | null = null;
200194
let dispatchCloudAuthCallback: (rawUrl: string) => void = ignoreCloudAuthCallback;
201195
const makeCloudAuthRequestState = Effect.gen(function* () {
@@ -205,7 +199,6 @@ const make = Effect.gen(function* () {
205199

206200
return DesktopCloudAuth.of({
207201
createRequest: Effect.gen(function* () {
208-
const environment = yield* DesktopEnvironment.DesktopEnvironment;
209202
const scheme = resolveCloudAuthCallbackScheme({
210203
isDevelopment: environment.isDevelopment,
211204
});
@@ -227,7 +220,6 @@ const make = Effect.gen(function* () {
227220
return redirectUrl;
228221
}),
229222
configure: Effect.gen(function* () {
230-
const environment = yield* DesktopEnvironment.DesktopEnvironment;
231223
const electronApp = yield* ElectronApp.ElectronApp;
232224
const electronWindow = yield* ElectronWindow.ElectronWindow;
233225
const scope = yield* Scope.Scope;

apps/desktop/src/app/DesktopCloudAuthTokenStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export interface DesktopCloudAuthTokenStoreShape {
6969
export class DesktopCloudAuthTokenStore extends Context.Service<
7070
DesktopCloudAuthTokenStore,
7171
DesktopCloudAuthTokenStoreShape
72-
>()("t3/desktop/CloudAuthTokenStore") {}
72+
>()("@t3tools/desktop/app/DesktopCloudAuthTokenStore") {}
7373

7474
function decodeSecretBytes(
7575
encoded: string,

apps/mobile/src/state/use-remote-environment-registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export function connectSavedEnvironment(
264264
httpBaseUrl: connection.httpBaseUrl,
265265
bearerToken: connection.bearerToken ?? "",
266266
}),
267-
),
267+
),
268268
{
269269
onAttempt: () => {
270270
if (!isCurrentAttempt()) {

apps/server/src/auth/Layers/SessionCredentialService.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ export const makeSessionCredentialService = Effect.gen(function* () {
9696
const serverConfig = yield* ServerConfig;
9797
const secretStore = yield* ServerSecretStore;
9898
const authSessions = yield* AuthSessionRepository;
99-
const crypto = yield* Crypto.Crypto;
10099
const signingSecret = yield* secretStore.getOrCreateRandom(SIGNING_SECRET_NAME, 32);
101100
const connectedSessionsRef = yield* Ref.make(new Map<string, number>());
102101
const changesPubSub = yield* PubSub.unbounded<SessionCredentialChange>();

apps/server/src/cloud/ManagedEndpointRuntime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface CloudManagedEndpointRuntimeShape {
3333
export class CloudManagedEndpointRuntime extends Context.Service<
3434
CloudManagedEndpointRuntime,
3535
CloudManagedEndpointRuntimeShape
36-
>()("t3/cloud/ManagedEndpointRuntime") {}
36+
>()("t3/cloud/ManagedEndpointRuntime/CloudManagedEndpointRuntime") {}
3737

3838
export type CloudManagedEndpointRuntimeStatus =
3939
| {

packages/client-runtime/src/managedRelay.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export interface ManagedRelayDpopSignerShape {
5656
export class ManagedRelayDpopSigner extends Context.Service<
5757
ManagedRelayDpopSigner,
5858
ManagedRelayDpopSignerShape
59-
>()("t3/client-runtime/ManagedRelayDpopSigner") {}
59+
>()("@t3tools/client-runtime/managedRelay/ManagedRelayDpopSigner") {}
6060

6161
export class ManagedRelayClientError extends Data.TaggedError("ManagedRelayClientError")<{
6262
readonly message: string;
@@ -130,7 +130,7 @@ export interface ManagedRelayClientShape {
130130
export class ManagedRelayClient extends Context.Service<
131131
ManagedRelayClient,
132132
ManagedRelayClientShape
133-
>()("t3/client-runtime/ManagedRelayClient") {}
133+
>()("@t3tools/client-runtime/managedRelay/ManagedRelayClient") {}
134134

135135
function relayClientError(message: string, cause?: unknown): ManagedRelayClientError {
136136
return new ManagedRelayClientError({ message, ...(cause === undefined ? {} : { cause }) });

packages/contracts/src/relay.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ export interface RelayClientPrincipalShape {
458458
export class RelayClientPrincipal extends Context.Service<
459459
RelayClientPrincipal,
460460
RelayClientPrincipalShape
461-
>()("RelayClientPrincipal") {}
461+
>()("@t3tools/contracts/relay/RelayClientPrincipal") {}
462462

463463
export interface RelayEnvironmentPrincipalShape {
464464
readonly environmentId: string;
@@ -468,7 +468,7 @@ export interface RelayEnvironmentPrincipalShape {
468468
export class RelayEnvironmentPrincipal extends Context.Service<
469469
RelayEnvironmentPrincipal,
470470
RelayEnvironmentPrincipalShape
471-
>()("RelayEnvironmentPrincipal") {}
471+
>()("@t3tools/contracts/relay/RelayEnvironmentPrincipal") {}
472472

473473
export class RelayClientAuth extends HttpApiMiddleware.Service<
474474
RelayClientAuth,

0 commit comments

Comments
 (0)