From b885beb262a8903746440d39fa021edb0d491550 Mon Sep 17 00:00:00 2001 From: EthanShoeDev <13422990+EthanShoeDev@users.noreply.github.com> Date: Sun, 21 Sep 2025 20:58:44 -0400 Subject: [PATCH] good commit --- apps/mobile/src/lib/secrets-manager.ts | 6 ++--- .../react-native-uniffi-russh/package.json | 1 + .../rust/uniffi-russh/justfile | 4 ++++ packages/react-native-uniffi-russh/src/api.ts | 23 ++++++++++++------- .../src/bridge.ts | 7 +++--- .../vite.config.ts | 4 +--- 6 files changed, 27 insertions(+), 18 deletions(-) diff --git a/apps/mobile/src/lib/secrets-manager.ts b/apps/mobile/src/lib/secrets-manager.ts index 7ad8bf5..0337c42 100644 --- a/apps/mobile/src/lib/secrets-manager.ts +++ b/apps/mobile/src/lib/secrets-manager.ts @@ -82,9 +82,9 @@ function makeBetterSecureStore< const unsafedRootManifest: unknown = rawRootManifestString ? JSON.parse(rawRootManifestString) : { - manifestVersion: rootManifestVersion, - manifestChunksIds: [], - }; + manifestVersion: rootManifestVersion, + manifestChunksIds: [], + }; const rootManifest = rootManifestSchema.parse(unsafedRootManifest); const manifestChunks = await Promise.all( rootManifest.manifestChunksIds.map(async (manifestChunkId) => { diff --git a/packages/react-native-uniffi-russh/package.json b/packages/react-native-uniffi-russh/package.json index b57b386..8c3a67b 100644 --- a/packages/react-native-uniffi-russh/package.json +++ b/packages/react-native-uniffi-russh/package.json @@ -42,6 +42,7 @@ "build:native": "tsx scripts/native-build.ts", "build:bob": "bob build", "lint:rust": "cd rust/uniffi-russh && just lint", + "update-rust": "cd rust/uniffi-russh && just update-deps", "test": "jest", "release": "release-it --only-version" }, diff --git a/packages/react-native-uniffi-russh/rust/uniffi-russh/justfile b/packages/react-native-uniffi-russh/rust/uniffi-russh/justfile index d2874df..da0e4f4 100644 --- a/packages/react-native-uniffi-russh/rust/uniffi-russh/justfile +++ b/packages/react-native-uniffi-russh/rust/uniffi-russh/justfile @@ -6,6 +6,10 @@ default: lint: cargo clippy --all-targets --all-features -- -D warnings +# Update all Cargo dependencies to the latest allowed by Cargo.toml +update-deps: + cargo update + # Run crate tests test: cargo test diff --git a/packages/react-native-uniffi-russh/src/api.ts b/packages/react-native-uniffi-russh/src/api.ts index 583d081..9b09ee8 100644 --- a/packages/react-native-uniffi-russh/src/api.ts +++ b/packages/react-native-uniffi-russh/src/api.ts @@ -147,13 +147,18 @@ export type SshShell = { type RusshApi = { uniffiInitAsync: () => Promise; connect: (opts: ConnectOptions) => Promise; - generateKeyPair: (type: 'rsa' | 'ecdsa' | 'ed25519', + generateKeyPair: ( + type: 'rsa' | 'ecdsa' | 'ed25519' // TODO: Add these // passphrase?: string; // keySize?: number; // comment?: string; ) => Promise; - validatePrivateKey: (key: string) => { valid: true; error?: never } | { valid: false; error: GeneratedRussh.SshError }; + validatePrivateKey: ( + key: string + ) => + | { valid: true; error?: never } + | { valid: false; error: GeneratedRussh.SshError }; }; // #endregion @@ -196,8 +201,6 @@ const streamEnumToLiteral = { [GeneratedRussh.StreamKind.Stderr]: 'stderr', } as const satisfies Record; - - function generatedConnDetailsToIdeal( details: GeneratedRussh.ConnectionDetails ): ConnectionDetails { @@ -314,13 +317,13 @@ function wrapConnection( tcpEstablishedAtMs: info.progressTimings.tcpEstablishedAtMs, sshHandshakeAtMs: info.progressTimings.sshHandshakeAtMs, }, - startShell: async (params) => { + startShell: async ({ onClosed, ...params }) => { const shell = await conn.startShell( { term: terminalTypeLiteralToEnum[params.term], - onClosedCallback: params.onClosed + onClosedCallback: onClosed ? { - onChange: (channelId) => params.onClosed!(channelId), + onChange: (channelId) => onClosed(channelId), } : undefined, terminalMode: params.terminalMode, @@ -381,7 +384,11 @@ async function generateKeyPair(type: 'rsa' | 'ecdsa' | 'ed25519') { return GeneratedRussh.generateKeyPair(map[type]); } -function validatePrivateKey(key: string): { valid: true; error?: never } | { valid: false; error: GeneratedRussh.SshError } { +function validatePrivateKey( + key: string +): + | { valid: true; error?: never } + | { valid: false; error: GeneratedRussh.SshError } { try { GeneratedRussh.validatePrivateKey(key); return { valid: true }; diff --git a/packages/react-native-xtermjs-webview/src/bridge.ts b/packages/react-native-xtermjs-webview/src/bridge.ts index ad16b80..3265dfd 100644 --- a/packages/react-native-xtermjs-webview/src/bridge.ts +++ b/packages/react-native-xtermjs-webview/src/bridge.ts @@ -14,10 +14,9 @@ export type BridgeOutboundMessage = | { type: 'resize'; cols: number; rows: number } | { type: 'fit' } | { - type: 'setOptions'; opts: Partial< - Omit - > - } + type: 'setOptions'; + opts: Partial>; + } | { type: 'clear' } | { type: 'focus' }; diff --git a/packages/react-native-xtermjs-webview/vite.config.ts b/packages/react-native-xtermjs-webview/vite.config.ts index 0731de0..6ccf696 100644 --- a/packages/react-native-xtermjs-webview/vite.config.ts +++ b/packages/react-native-xtermjs-webview/vite.config.ts @@ -8,9 +8,7 @@ const logExternal: boolean = false; export default defineConfig({ plugins: [ - react({ - - }), + react({}), dts({ tsconfigPath: './tsconfig.app.json', // This makes dist/ look nice but breaks Cmd + Click