Merge pull request #815 from PR0M3TH3AN/codex/refactor-nip-utilities-and-update-documentation

Refactor nostr barrel exports to rely on canonical index
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2025-10-22 22:04:26 -04:00
commit a1d053b21a
3 files changed
+13 -58

No files matched your search

+5 -2
View File
@@ -99,8 +99,11 @@ timestamps.
`nostrClient` instance, registers it with the runtime via
`registerNostrClient`, and exposes helpers like
`requestDefaultExtensionPermissions`. Import the singleton or permission helper
from this module (or from the `js/nostr.js` barrel) whenever you need to run a
NIP-07 handshake. New NIP features should reuse this bootstrapper instead of
from this module or from the canonical export barrel at
[`js/nostr/index.js`](../js/nostr/index.js) whenever you need to run a NIP-07
handshake. `js/nostr.js` re-exports the default client alongside the
singleton-aware bindings for view counters and watch history so legacy imports
continue to resolve. New NIP features should reuse this bootstrapper instead of
creating bespoke clients so permission caching and relay wiring stay
consistent.【F:js/nostr/defaultClient.js†L1-L25】
+7 -56
View File
@@ -4,68 +4,19 @@ import {
nostrClient,
requestDefaultExtensionPermissions,
} from "./nostr/defaultClient.js";
import {
export { nostrClient, requestDefaultExtensionPermissions };
export {
recordVideoView,
listVideoViewEvents,
subscribeVideoViewEvents,
countVideoViewEvents,
} from "./nostr/viewEventBindings.js";
import {
export {
updateWatchHistoryList,
removeWatchHistoryItem,
} from "./nostr/watchHistoryBindings.js";
export { nostrClient, requestDefaultExtensionPermissions };
export { updateWatchHistoryList, removeWatchHistoryItem };
export {
recordVideoView,
listVideoViewEvents,
subscribeVideoViewEvents,
countVideoViewEvents,
};
export {
__testExports,
NostrClient,
getActiveSigner,
setActiveSigner,
clearActiveSigner,
resolveActiveSigner,
shouldRequestExtensionPermissions,
} from "./nostr/client.js";
export {
DEFAULT_NIP07_ENCRYPTION_METHODS,
DEFAULT_NIP07_PERMISSION_METHODS,
} from "./nostr/nip07Permissions.js";
export {
buildNip71MetadataTags,
buildNip71VideoEvent,
collectNip71PointerRequests,
extractNip71MetadataFromTags,
getDTagValueFromTags,
mergeNip71MetadataIntoVideo,
populateNip71MetadataForVideos,
processNip71Events,
buildVideoPointerValue,
stringFromInput,
} from "./nostr/nip71.js";
export {
normalizePointerInput,
pointerKey,
chunkWatchHistoryPayloadItems,
normalizeActorKey,
parseWatchHistoryContentWithFallback,
isNip04EncryptedWatchHistoryEvent,
watchHistoryHelpers,
} from "./nostr/watchHistory.js";
export {
deriveViewEventBucketIndex,
deriveViewEventPointerScope,
hasRecentViewPublish,
rememberViewPublish,
createVideoViewEventFilters,
getViewEventGuardWindowMs,
} from "./nostr/viewEvents.js";
export { convertEventToVideo } from "./nostr/nip71.js";
export * from "./nostr/index.js";
+1
View File
@@ -1,4 +1,5 @@
export {
__testExports,
NostrClient,
getActiveSigner,
setActiveSigner,