Skip to content

Commit 16b74ad

Browse files
Merge branch 'main' into fix/writing-style-sparse-encode
2 parents 4a79301 + b5a0696 commit 16b74ad

274 files changed

Lines changed: 22385 additions & 5451 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Batch files need CRLF for cmd.exe to parse them reliably.
44
*.cmd text eol=crlf
55
*.bat text eol=crlf
6-
# GitHub's GraphQL schema and the operations graphqlgen writes from it.
6+
# GitHub's and Expo's GraphQL schemas and the operations graphqlgen writes from them.
77
packages/source-control-github/schema/** linguist-generated
8+
apps/server/schema/** linguist-generated
89
**/*.graphql.ts linguist-generated

‎.github/scripts/thread-transfer-report.cjs‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,26 @@ async function resolve({ github, context, core }) {
244244

245245
let pullNumber = source.pull_requests?.[0]?.number;
246246
if (!pullNumber) {
247-
const associated = await github.paginate(
248-
github.rest.repos.listPullRequestsAssociatedWithCommit,
249-
{ owner, repo, commit_sha: source.head_sha, per_page: 100 },
250-
);
247+
let associated;
248+
try {
249+
associated = await github.paginate(github.rest.repos.listPullRequestsAssociatedWithCommit, {
250+
owner,
251+
repo,
252+
commit_sha: source.head_sha,
253+
per_page: 100,
254+
});
255+
} catch (error) {
256+
// A force-pushed or deleted PR head can disappear before this workflow runs.
257+
if (
258+
error.status === 422 &&
259+
error.response?.data?.message === `No commit found for SHA: ${source.head_sha}`
260+
) {
261+
core.info(`Skipping CI result for unavailable commit ${source.head_sha}.`);
262+
core.setOutput("publish", "false");
263+
return;
264+
}
265+
throw error;
266+
}
251267
const matchingPulls = associated.filter(
252268
(pull) =>
253269
pull.state === "open" &&

‎.github/scripts/thread-transfer-report.test.cjs‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,47 @@ test("does not guess when a fallback commit belongs to multiple PRs", async () =
216216
assert.equal(fetchedPull, false);
217217
});
218218

219+
test("skips a missing PR commit but preserves other lookup failures", async () => {
220+
for (const [status, message, shouldSkip] of [
221+
[422, "No commit found for SHA: old-head", true],
222+
[422, "Validation Failed", false],
223+
[403, "API rate limit exceeded", false],
224+
]) {
225+
const outputs = {};
226+
const error = Object.assign(new Error(message), {
227+
status,
228+
response: { data: { message } },
229+
});
230+
const run = resolve({
231+
github: {
232+
paginate: async () => {
233+
throw error;
234+
},
235+
rest: { repos: { listPullRequestsAssociatedWithCommit: () => {} } },
236+
},
237+
context: {
238+
repo: { owner: "pingdotgg", repo: "t3code" },
239+
payload: {
240+
workflow_run: { event: "pull_request", head_sha: "old-head", pull_requests: [] },
241+
},
242+
},
243+
core: {
244+
info: () => {},
245+
setOutput: (key, value) => {
246+
outputs[key] = value;
247+
},
248+
},
249+
});
250+
if (shouldSkip) {
251+
await run;
252+
assert.equal(outputs.publish, "false");
253+
} else {
254+
await assert.rejects(run, (caught) => caught === error);
255+
assert.deepEqual(outputs, {});
256+
}
257+
}
258+
});
259+
219260
test("does not report a passing run that skipped the server tests", async () => {
220261
const outputs = {};
221262
const listWorkflowRunArtifacts = () => {};

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ jobs:
9393
- name: Check generated GitHub GraphQL operations
9494
run: vp run --filter @t3tools/source-control-github generate --check
9595

96+
- name: Check generated Expo GraphQL operations
97+
run: vp run --filter t3 generate --check
98+
9699
- name: Check
97100
run: vp check
98101

‎.github/workflows/release.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ jobs:
551551
clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
552552
relay_url: ${{ needs.relay_public_config.outputs.relay_url }}
553553
label: macOS arm64
554-
runner: blacksmith-12vcpu-macos-26
554+
runner: macos-26-xlarge
555555
platform: mac
556556
target: dmg
557557
arch: arm64
@@ -574,7 +574,7 @@ jobs:
574574
clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
575575
relay_url: ${{ needs.relay_public_config.outputs.relay_url }}
576576
label: macOS x64
577-
runner: blacksmith-12vcpu-macos-26
577+
runner: macos-26-xlarge
578578
platform: mac
579579
target: dmg
580580
arch: x64

‎apps/desktop/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@types/node": "catalog:",
3939
"acorn": "8.16.0",
4040
"cross-env": "^10.1.0",
41-
"electron-builder": "26.15.6",
41+
"electron-builder": "26.16.1",
4242
"tailwindcss": "^4.0.0",
4343
"vite-plus": "catalog:"
4444
},

‎apps/desktop/scripts/ensure-electron-runtime.mjs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ function installElectronRuntime(electronDir, version) {
123123
try {
124124
runChecked("curl", [
125125
"-fsSL",
126+
"--retry",
127+
"3",
128+
"--retry-all-errors",
129+
"--connect-timeout",
130+
"30",
131+
"--max-time",
132+
"300",
126133
`https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-${hostPlatform}-${hostArch}.zip`,
127134
"-o",
128135
zipPath,

‎apps/desktop/src/app/DesktopApp.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ export const stopAllPoolInstances = Effect.fn("desktop.app.stopAllPoolInstances"
153153
const instances = yield* pool.list;
154154
yield* Effect.forEach(
155155
instances,
156-
// Exceeds the backend's 30s graceful termination and output drain budget.
157-
(instance) => instance.stop({ timeout: Duration.seconds(45) }),
156+
(instance) => instance.stop({ timeout: Duration.seconds(5) }),
158157
{ concurrency: "unbounded" },
159158
);
160159
},
@@ -240,7 +239,9 @@ const bootstrap = Effect.gen(function* () {
240239
}
241240

242241
if (!(yield* Ref.get(state.quitting))) {
243-
yield* desktopWindow.showConnectingSplash;
242+
if (settings.wslOnly === true && settings.wslBackendEnabled === true) {
243+
yield* desktopWindow.showConnectingSplash;
244+
}
244245
yield* primaryBackend.start;
245246
yield* logBootstrapInfo("bootstrap backend start requested");
246247
yield* appActivation.start.pipe(

‎apps/desktop/src/app/DesktopClerk.test.ts‎

Lines changed: 2 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// @effect-diagnostics nodeBuiltinImport:off globalFetchInEffect:off - Hosted handoff test uses a real localhost listener without an OpenAI account.
22
import * as NodeHttp from "node:http";
3-
import * as NodePath from "node:path";
4-
import * as PlatformNodePath from "@effect/platform-node/NodePath";
3+
import * as NodePath from "@effect/platform-node/NodePath";
54
import { codexAuthHandoffUrl, readCodexAuthDelivery } from "@t3tools/shared/codexAuthHandoff";
65
import { EnvironmentId, ProviderInstanceId } from "@t3tools/contracts";
76
import * as HostProcess from "@t3tools/shared/HostProcess";
@@ -60,15 +59,11 @@ const layerDesktopClerk = (
6059
copyText: () => Effect.void,
6160
},
6261
listeners = new Map<string, (...args: unknown[]) => void>(),
63-
isPackaged = false,
6462
) => {
6563
const environment = DesktopEnvironment.DesktopEnvironment.of({
6664
stateDir: "/tmp/t3-state",
6765
isDevelopment,
6866
appDataDirectory: "/tmp/app-data",
69-
isPackaged,
70-
dirname: platform === "win32" ? String.raw`C:\T3 Code\dist-electron` : "/tmp/dist-electron",
71-
path: platform === "win32" ? NodePath.win32 : NodePath.posix,
7267
platform,
7368
} as unknown as DesktopEnvironment.DesktopEnvironment["Service"]);
7469

@@ -100,7 +95,7 @@ const layerDesktopClerk = (
10095
return DesktopClerk.layer.pipe(
10196
Layer.provide(
10297
Layer.mergeAll(
103-
PlatformNodePath.layerPosix,
98+
NodePath.layerPosix,
10499
Layer.succeed(DesktopEnvironment.DesktopEnvironment, environment),
105100
Layer.succeed(ElectronApp.ElectronApp, electronApp),
106101
Layer.succeed(ElectronShell.ElectronShell, shell),
@@ -117,67 +112,6 @@ describe("DesktopClerk", () => {
117112
storageMock.mockReset();
118113
});
119114

120-
it.effect.each([
121-
{ platform: "win32", isPackaged: false, isDevelopment: false, registers: true },
122-
{ platform: "win32", isPackaged: false, isDevelopment: true, registers: false },
123-
{ platform: "win32", isPackaged: true, isDevelopment: false, registers: false },
124-
{ platform: "darwin", isPackaged: false, isDevelopment: false, registers: false },
125-
{ platform: "linux", isPackaged: false, isDevelopment: false, registers: false },
126-
] as const)(
127-
"registers an entry point only for unpackaged non-development Windows ($platform, packaged=$isPackaged, development=$isDevelopment)",
128-
({ platform, isPackaged, isDevelopment, registers }) => {
129-
const events: string[] = [];
130-
storageMock.mockReturnValue(storageAdapter);
131-
createClerkBridgeMock.mockImplementation(() => {
132-
events.push("bridge");
133-
return { cleanup: vi.fn() };
134-
});
135-
const setAsDefaultProtocolClient = vi.fn(() =>
136-
Effect.sync(() => {
137-
events.push("register");
138-
return true;
139-
}),
140-
);
141-
const electronApp = {
142-
on: () => Effect.void,
143-
setAsDefaultProtocolClient,
144-
} as unknown as ElectronApp.ElectronApp["Service"];
145-
146-
return Effect.gen(function* () {
147-
const clerk = yield* DesktopClerk.DesktopClerk;
148-
yield* clerk.configure;
149-
150-
assert.deepEqual(
151-
setAsDefaultProtocolClient.mock.calls,
152-
registers
153-
? [["t3code", process.execPath, [String.raw`C:\T3 Code\dist-electron\main.cjs`]]]
154-
: [],
155-
);
156-
assert.deepEqual(events, registers ? ["bridge", "register"] : ["bridge"]);
157-
}).pipe(
158-
Effect.scoped,
159-
Effect.provide(
160-
layerDesktopClerk(
161-
isDevelopment,
162-
[],
163-
platform,
164-
undefined,
165-
undefined,
166-
undefined,
167-
isPackaged,
168-
),
169-
),
170-
Effect.provideService(ElectronApp.ElectronApp, electronApp),
171-
Effect.provideService(
172-
ElectronWindow.ElectronWindow,
173-
{} as ElectronWindow.ElectronWindow["Service"],
174-
),
175-
Effect.provideService(DesktopWebLinks.DesktopWebLinks, ignoreWebLinks),
176-
Effect.provideService(HostProcess.Arguments, ["electron"]),
177-
);
178-
},
179-
);
180-
181115
it.effect("acquires and releases the SDK bridge with the layer", () => {
182116
const cleanup = vi.fn();
183117
const events: string[] = [];

‎apps/desktop/src/app/DesktopClerk.ts‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -151,20 +151,6 @@ export const make = Effect.gen(function* () {
151151
const context = yield* Effect.context<ElectronWindow.ElectronWindow>();
152152
const runPromise = Effect.runPromiseWith(context);
153153

154-
// Clerk's bare scheme registration omits the app entry on unpackaged Windows.
155-
// Development callbacks also need dev server environment this command cannot restore.
156-
if (
157-
!environment.isPackaged &&
158-
!environment.isDevelopment &&
159-
environment.platform === "win32"
160-
) {
161-
yield* electronApp.setAsDefaultProtocolClient(
162-
ElectronProtocol.getDesktopScheme(environment.isDevelopment),
163-
process.execPath,
164-
[environment.path.join(environment.dirname, "main.cjs")],
165-
);
166-
}
167-
168154
const startProviderAuthHandoff = (value: string | undefined) => {
169155
if (!value) return false;
170156
const request = readCodexAuthHandoff(value, environment.isDevelopment);

0 commit comments

Comments
 (0)