History

fix(desktop): bump Clerk Electron SDK to 0.0.24 and register t3code:// scheme on Linux (#5015)

Julius Marminge committed 3 months ago

Commit fbecb731 parent 4029b8513 files · +210 −95Browse files

Showing the changes to scripts (2 of 13 files). Show all

Unified · Split

2 files
  1. scripts/build-desktop-artifact.test.ts +5 −0
  2. scripts/build-desktop-artifact.ts +9 −0
scripts/build-desktop-artifact.test.ts+5−0
@@ -349,6 +349,11 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => { · 348 unmodified lines
349349 assert.notProperty(mac, "asarUnpack");
350350 assert.notProperty(linux, "asarUnpack");
351351 assert.deepStrictEqual(win.asarUnpack, WINDOWS_ASAR_UNPACK);
352+ // Linux must register the renderer schemes so the generated .desktop
353+ // entry advertises MimeType=x-scheme-handler/t3code; for OAuth deep links.
354+ assert.deepStrictEqual((linux.linux as Record<string, unknown>).protocols, [
355+ { name: "T3 Code", schemes: ["t3code", "t3code-dev"] },
356+ ]);
352357 for (const config of [mac, linux, win]) {
353358 assert.deepStrictEqual(config.electronLanguages, DESKTOP_ELECTRON_LANGUAGES);
354359 assert.deepStrictEqual(config.files, DESKTOP_FILE_EXCLUSIONS);
scripts/build-desktop-artifact.ts+9−0
@@ -1589,6 +1589,15 @@ export const createBuildConfig = Effect.fn("createBuildConfig")(function* ( · 1588 unmodified lines
15891589 executableName: "t3code",
15901590 icon: "icons",
15911591 category: "Development",
1592+ // electron-builder turns these into MimeType=x-scheme-handler/<scheme>;
1593+ // in the .desktop entry (Exec already gets %U), so browsers can hand
1594+ // t3code:// OAuth callbacks to the app.
1595+ protocols: [
1596+ {
1597+ name: "T3 Code",
1598+ schemes: ["t3code", "t3code-dev"],
1599+ },
1600+ ],
15921601 desktop: {
15931602 entry: {
15941603 StartupWMClass: "t3code",