Skip to content

Commit 94f7c94

Browse files
committed
wip applesauce
1 parent 72017ff commit 94f7c94

File tree

118 files changed

+2429
-1287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+2429
-1287
lines changed

custom.d.ts

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,41 @@
11
/// <reference types="vite/client" />
22

3-
declare const CONFIG: {
4-
appName: string
5-
appNameCapitalized: string
6-
appTitle: string
7-
hostname: string
8-
nip05Domain: string
9-
icon: string
10-
navLogo: string
11-
defaultTheme: string
12-
navItems: string[]
13-
aboutText: string
14-
repository: string
15-
features: {
16-
analytics: boolean
17-
showSubscriptionSettings: boolean
3+
// Add any custom type declarations here
4+
5+
// Nostr extension types
6+
declare global {
7+
interface Window {
8+
nostr?: {
9+
getPublicKey(): Promise<string>
10+
signEvent(event: any): Promise<any>
11+
nip04?: {
12+
encrypt(pubkey: string, plaintext: string): Promise<string>
13+
decrypt(pubkey: string, ciphertext: string): Promise<string>
14+
}
15+
nip44?: {
16+
encrypt(pubkey: string, plaintext: string): Promise<string>
17+
decrypt(pubkey: string, ciphertext: string): Promise<string>
18+
}
19+
}
1820
}
19-
defaultSettings: {
20-
notificationServer: string
21-
irisApiUrl: string
21+
}
22+
23+
export {}
24+
25+
// Add missing module declarations
26+
declare module "tseep" {
27+
export class EventEmitter {
28+
emit(event: string, ...args: any[]): boolean
29+
on(event: string, listener: (...args: any[]) => void): this
30+
off(event: string, listener: (...args: any[]) => void): this
2231
}
2332
}
2433

34+
declare const CONFIG: {
35+
appName: string
36+
[key: string]: any
37+
}
38+
2539
interface Performance {
2640
memory?: {
2741
jsHeapSizeLimit: number

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"scripts": {
1818
"dev": "vite",
1919
"start": "vite",
20-
"build": "tsx ./scripts/updateSocialGraph.ts && tsc && vite build --mode production",
21-
"build:dev": "tsx ./scripts/updateSocialGraph.ts && tsc && vite build --mode development",
20+
"build": "tsc && vite build --mode production",
21+
"build:dev": "tsc && vite build --mode development",
2222
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --fix",
2323
"preview": "vite preview",
2424
"pretest": "npx playwright install --with-deps chromium",
@@ -58,9 +58,12 @@
5858
"@emoji-mart/react": "^1.1.1",
5959
"@getalby/bitcoin-connect-react": "^3.9.0",
6060
"@noble/hashes": "^1.8.0",
61-
"@nostr-dev-kit/ndk": "^2.14.32",
62-
"@nostr-dev-kit/ndk-cache-dexie": "^2.6.33",
6361
"@remixicon/react": "^4.6.0",
62+
"add": "^2.0.6",
63+
"applesauce-core": "^2.3.0",
64+
"applesauce-react": "^2.1.0",
65+
"applesauce-relay": "^2.3.0",
66+
"applesauce-signers": "^2.0.0",
6467
"blurhash": "^2.0.5",
6568
"classnames": "^2.5.1",
6669
"dexie": "^4.0.11",
@@ -83,7 +86,9 @@
8386
"react-router": "^7.7.1",
8487
"react-string-replace": "^1.1.1",
8588
"react-swipeable": "^7.0.2",
89+
"tseep": "^1.3.1",
8690
"typescript-lru-cache": "^2.0.0",
91+
"yarn": "^1.22.22",
8792
"zustand": "^5.0.6"
8893
},
8994
"devDependencies": {

src/debug/DebugApp.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ interface SubscriptionData {
5858
}
5959

6060
const DebugApp = () => {
61-
const [session, setSession] = useState<DebugSession | null>(null)
61+
const [session, setSession] = useState<any | null>(null)
6262
const [sessionLink, setSessionLink] = useState<string>("")
6363
const [testValue, setTestValue] = useState<string>("")
6464
const [isConnected, setIsConnected] = useState<boolean>(false)
@@ -112,20 +112,23 @@ const DebugApp = () => {
112112
setSessionLink(linkWithKey)
113113

114114
// Subscribe to test value changes
115-
const unsubscribeTest = debugSession.subscribe("testInput", (value) => {
115+
const unsubscribeTest = debugSession.subscribe("testInput", (value: any) => {
116116
if (typeof value === "string") {
117117
setTestValue(value)
118118
}
119119
})
120120

121121
// Subscribe to subscriptions data
122-
const unsubscribeSubscriptions = debugSession.subscribe("subscriptions", (value) => {
123-
setSubscriptions(value as Record<string, SubscriptionData>)
124-
})
122+
const unsubscribeSubscriptions = debugSession.subscribe(
123+
"subscriptions",
124+
(value: any) => {
125+
setSubscriptions(value as Record<string, SubscriptionData>)
126+
}
127+
)
125128

126129
// Subscribe to heartbeat data to check if Iris browser is online
127-
const unsubscribeData = debugSession.subscribe("data", (value, event) => {
128-
const eventTime = event.created_at // Event timestamp in seconds
130+
const unsubscribeData = debugSession.subscribe("data", (value: any, event: any) => {
131+
const eventTime = event?.created_at // Event timestamp in seconds
129132
if (eventTime) {
130133
lastHeartbeatTime.current = eventTime // Store in seconds
131134
const now = Math.floor(Date.now() / 1000) // Current time in seconds
@@ -157,15 +160,15 @@ const DebugApp = () => {
157160
// Subscribe to MediaFeed debug data
158161
const unsubscribeMediaFeedDebug = debugSession.subscribe(
159162
"mediaFeed_debug",
160-
(value) => {
163+
(value: any) => {
161164
setMediaFeedDebug(value as MediaFeedDebug)
162165
}
163166
)
164167

165168
// Subscribe to MediaFeed performance data
166169
const unsubscribeMediaFeedPerformance = debugSession.subscribe(
167170
"mediaFeed_performance",
168-
(value) => {
171+
(value: any) => {
169172
setMediaFeedPerformance((prev) => {
170173
const newEntry = value as MediaFeedPerformance
171174
// Keep only last 20 performance entries to avoid memory buildup
@@ -178,7 +181,7 @@ const DebugApp = () => {
178181
// Subscribe to MediaFeed memory data
179182
const unsubscribeMediaFeedMemory = debugSession.subscribe(
180183
"mediaFeed_memory",
181-
(value) => {
184+
(value: any) => {
182185
setMediaFeedMemory((prev) => {
183186
const newEntry = value as MediaFeedMemory
184187
// Keep only last 20 memory entries to avoid memory buildup
@@ -190,7 +193,7 @@ const DebugApp = () => {
190193

191194
// Monitor connection status periodically
192195
const checkConnection = () => {
193-
setIsConnected(debugSession.isConnectedToRelay(TEMP_IRIS_RELAY))
196+
setIsConnected(debugSession.isConnectedToRelay())
194197
}
195198

196199
// Check heartbeat freshness periodically

0 commit comments

Comments
 (0)