Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): support existing passkeys in the preview browser #13957

Closedsethwebster(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/13957/headopened View on GitHub

Showing 24 changed files with 124 additions and 1 deletion (loading 20).

x
0 of 24 viewed, 24 left
54 additions and 0 deletionsapps/desktop/scripts/build-preview-passkeys.mjsAdded
View file
@@ -0,0 +1,54 @@
+import * as NodeChildProcess from "node:child_process";
+import * as NodeFS from "node:fs";
+import * as NodePath from "node:path";
+import * as NodeURL from "node:url";
+import * as NodeUtil from "node:util";
+​
+// oxlint-disable-next-line t3code/no-global-process-runtime -- Standalone compiler script targets the host.
+const hostArch = process.arch;
+// oxlint-disable-next-line t3code/no-global-process-runtime -- Standalone compiler script has no Effect runtime.
+const hostPlatform = process.platform;
+​
+const { values } = NodeUtil.parseArgs({
+ options: {
+ output: { type: "string" },
+ arch: { type: "string", default: hostArch },
+ },
+});
+if (hostPlatform === "darwin") {
+ const output =
+ values.output ??
+ NodeURL.fileURLToPath(new URL("../resources/preview-passkeys.dylib", import.meta.url));
+ const architectures = { arm64: ["arm64"], x64: ["x86_64"], universal: ["arm64", "x86_64"] }[
+ values.arch
+ ];
+ if (!architectures) throw new Error(`Unsupported Mac architecture: ${values.arch}`);
+ NodeFS.mkdirSync(NodePath.dirname(output), { recursive: true });
+ NodeChildProcess.execFileSync(
+ "xcrun",
+ [
+ "clang",