(feat): migrate bun to pnpm
(feat): some mtp stuff (wip): electron app tray
This commit is contained in:
parent
69149b73bd
commit
82a483d7ab
39 changed files with 10109 additions and 2429 deletions
|
|
@ -11,7 +11,7 @@
|
|||
"./popout": "./src/components/popout.tsx"
|
||||
},
|
||||
"scripts": {
|
||||
"format": "bunx prettier --write .",
|
||||
"format": "pnpm exec prettier --write .",
|
||||
"lint": "eslint src",
|
||||
"build": "tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
"./behaviour-community": "./src/behaviour/community.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"format": "bunx prettier --write .",
|
||||
"format": "pnpm exec prettier --write .",
|
||||
"lint": "eslint src",
|
||||
"build": "tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@
|
|||
"./worker": "./src/worker.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"format": "bunx prettier --write .",
|
||||
"format": "pnpm exec prettier --write .",
|
||||
"lint": "eslint src",
|
||||
"test": "bun test",
|
||||
"build": "bun run test && tsc -p tsconfig.json --noEmit"
|
||||
"test": "vitest run",
|
||||
"build": "pnpm run test && tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@noble/curves": "^2.0.1",
|
||||
|
|
|
|||
11
packages/crypto/src/bun-test.d.ts
vendored
11
packages/crypto/src/bun-test.d.ts
vendored
|
|
@ -1,11 +0,0 @@
|
|||
declare module "bun:test" {
|
||||
export const describe: (...args: unknown[]) => unknown;
|
||||
export const test: (...args: unknown[]) => unknown;
|
||||
export const it: (...args: unknown[]) => unknown;
|
||||
export const expect: (value: unknown) => {
|
||||
toBe: (expected: unknown) => void;
|
||||
toEqual: (expected: unknown) => void;
|
||||
toContain: (expected: unknown) => void;
|
||||
toThrow: (expected?: unknown) => void;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { describe, expect, test } from "bun:test";
|
||||
import { describe, expect, test } from "vitest";
|
||||
import { createCryptoActions } from "./context";
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { describe, expect, test } from "bun:test";
|
||||
import { describe, expect, test } from "vitest";
|
||||
import { x448 } from "@noble/curves/ed448.js";
|
||||
import {
|
||||
decrypt,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
"./input": "./src/input.tsx"
|
||||
},
|
||||
"scripts": {
|
||||
"format": "bunx prettier --write .",
|
||||
"format": "pnpm exec prettier --write .",
|
||||
"lint": "eslint src",
|
||||
"build": "tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
".": "./src/index.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"format": "bunx prettier --write .",
|
||||
"format": "pnpm exec prettier --write .",
|
||||
"lint": "eslint src --ext .ts,.tsx",
|
||||
"build": "tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -331,9 +331,16 @@ export function Provider(props: {
|
|||
setIdentifying(false);
|
||||
|
||||
await MTPClient.init();
|
||||
const rawOmikronData = await fetch(mtpUrl ?? "").then((res) =>
|
||||
codec.decode(res.arrayBuffer()),
|
||||
|
||||
log(2, "mtp", "purple", "Fetching Omikron data.");
|
||||
const omikronData = await fetch(
|
||||
`${mtpUrl}api/get/omikron/${await load("user_id")}`,
|
||||
).then(async (res) =>
|
||||
codec.decode(new Uint8Array(await res.arrayBuffer())),
|
||||
);
|
||||
|
||||
console.log(omikronData);
|
||||
|
||||
const client = await MTPClient.create({
|
||||
url: mtpUrl ?? "",
|
||||
descriptor: "client",
|
||||
|
|
@ -391,9 +398,7 @@ export function Provider(props: {
|
|||
await client.auth();
|
||||
const finalResponse = await authPayload;
|
||||
|
||||
if (disposed || clientRef.current !== client) {
|
||||
return;
|
||||
}
|
||||
if (disposed || clientRef.current !== client) return;
|
||||
|
||||
setFreshContacts(finalResponse.data.contacts);
|
||||
setFreshCommunities(finalResponse.data.communities ?? []);
|
||||
|
|
@ -456,7 +461,7 @@ export function Provider(props: {
|
|||
setIdentified(false);
|
||||
setIdentifying(false);
|
||||
};
|
||||
}, [mtpUrl, props.blockConnection]);
|
||||
}, [mtpUrl, props.blockConnection, load]);
|
||||
|
||||
// Async queue
|
||||
const loadingDescription = useMemo(() => {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
"./context": "./src/context.tsx"
|
||||
},
|
||||
"scripts": {
|
||||
"format": "bunx prettier --write .",
|
||||
"format": "pnpm exec prettier --write .",
|
||||
"lint": "eslint src",
|
||||
"build": "tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
"./features/conversation/schema": "./src/features/conversation/schema.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"format": "bunx prettier --write .",
|
||||
"format": "pnpm exec prettier --write .",
|
||||
"lint": "eslint src",
|
||||
"build": "tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ export const storageDefaults: Storage = {
|
|||
},
|
||||
cached_contacts: [],
|
||||
cached_communities: [],
|
||||
mtp_url: "https://tensamin.net:959",
|
||||
mtp_url: "https://omega.tensamin.net",
|
||||
call_mute_range_start: -55,
|
||||
call_mute_range_end: -45,
|
||||
theme_color: "",
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
"./indexed-db": "./src/indexed-db.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"format": "bunx prettier --write .",
|
||||
"format": "pnpm exec prettier --write .",
|
||||
"lint": "eslint src",
|
||||
"build": "tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
"./context": "./src/context.tsx"
|
||||
},
|
||||
"scripts": {
|
||||
"format": "bunx prettier --write .",
|
||||
"format": "pnpm exec prettier --write .",
|
||||
"lint": "eslint src",
|
||||
"build": "tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
"./values": "./src/values.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"format": "bunx prettier --write .",
|
||||
"format": "pnpm exec prettier --write .",
|
||||
"lint": "eslint src",
|
||||
"build": "tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue