mirror of
https://github.com/EthanShoeDev/fressh.git
synced 2026-01-11 06:12:51 +00:00
good commit
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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"
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -147,13 +147,18 @@ export type SshShell = {
|
||||
type RusshApi = {
|
||||
uniffiInitAsync: () => Promise<void>;
|
||||
connect: (opts: ConnectOptions) => Promise<SshConnection>;
|
||||
generateKeyPair: (type: 'rsa' | 'ecdsa' | 'ed25519',
|
||||
generateKeyPair: (
|
||||
type: 'rsa' | 'ecdsa' | 'ed25519'
|
||||
// TODO: Add these
|
||||
// passphrase?: string;
|
||||
// keySize?: number;
|
||||
// comment?: string;
|
||||
) => Promise<string>;
|
||||
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<GeneratedRussh.StreamKind, StreamKind>;
|
||||
|
||||
|
||||
|
||||
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 };
|
||||
|
||||
@@ -14,10 +14,9 @@ export type BridgeOutboundMessage =
|
||||
| { type: 'resize'; cols: number; rows: number }
|
||||
| { type: 'fit' }
|
||||
| {
|
||||
type: 'setOptions'; opts: Partial<
|
||||
Omit<ITerminalOptions, keyof ITerminalInitOnlyOptions>
|
||||
>
|
||||
}
|
||||
type: 'setOptions';
|
||||
opts: Partial<Omit<ITerminalOptions, keyof ITerminalInitOnlyOptions>>;
|
||||
}
|
||||
| { type: 'clear' }
|
||||
| { type: 'focus' };
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user