fix: avoid deep imports for Vercel compatibility

- Define APP_DATA_KIND constant inline (30078 for NIP-78)
- Implement getAppDataContent helper inline to parse JSON
- Import AppDataBlueprint from 'applesauce-factory/blueprints' main export
- Fixes Vercel build errors with deep package imports
This commit is contained in:
Gigi
2025-10-07 05:39:41 +01:00
parent 303d5a0ac7
commit 21545fc76a
2 changed files with 13 additions and 3 deletions

2
dist/index.html vendored
View File

@@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Boris - Nostr Bookmarks</title>
<script type="module" crossorigin src="/assets/index-D55Gme04.js"></script>
<script type="module" crossorigin src="/assets/index-B2pQs-Td.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Bqz-n1DY.css">
</head>
<body>

View File

@@ -1,12 +1,22 @@
import { IEventStore, mapEventsToStore } from 'applesauce-core'
import { APP_DATA_KIND, getAppDataContent } from 'applesauce-core/helpers/app-data'
import { AppDataBlueprint } from 'applesauce-factory/blueprints/app-data'
import { EventFactory } from 'applesauce-factory'
import { AppDataBlueprint } from 'applesauce-factory/blueprints'
import { RelayPool, onlyEvents } from 'applesauce-relay'
import { NostrEvent } from 'nostr-tools'
import { firstValueFrom } from 'rxjs'
const SETTINGS_IDENTIFIER = 'com.dergigi.boris.user-settings'
const APP_DATA_KIND = 30078 // NIP-78 Application Data
// Helper to extract and parse app data content from an event
function getAppDataContent<R>(event: NostrEvent): R | undefined {
if (!event.content || event.content.length === 0) return undefined
try {
return JSON.parse(event.content) as R
} catch {
return undefined
}
}
export interface UserSettings {
collapseOnArticleOpen?: boolean