Skip to content

Commit 53768a2

Browse files
authored
NDK v3.0: Major Architecture Overhaul & Performance Improvements (#354)
* refactor: migrate /components/media-upload to new examples structure - Created examples/button/ with index.svelte and index.txt - Created examples/carousel/ with index.svelte and index.txt - Updated +page.svelte imports to use new examples structure - Deleted old .example files * refactor: migrate /components/relay-input to new examples structure - Created examples/basic/ with index.svelte and index.txt - Created examples/label/ with index.svelte and index.txt - Created examples/error/ with index.svelte and index.txt - Created examples/disabled/ with index.svelte and index.txt - Updated +page.svelte imports to use new examples structure - Deleted old .example files * refactor: migrate /components/follow-pack to new examples structure - Created examples/hero/ with index.svelte and index.txt - Created examples/portrait/ with index.svelte and index.txt - Created examples/compact/ with index.svelte and index.txt - Created examples/list-item/ with index.svelte and index.txt - Updated +page.svelte imports to use new examples structure - Deleted old .example files * refactor: migrate /components/generic-card to new examples structure - Created examples/basic/ with index.svelte and index.txt - Updated +page.svelte imports to use new examples structure - Deleted old .example file * chore: remove 19 orphaned .example files from component pages Removed unreferenced legacy example files that were not migrated: - media-upload: 2 files - reaction: 8 files - relay-input: 4 files - reply: 3 files - zap: 2 files All are confirmed unused by codebase search. * refactor: migrate /docs/subscriptions zapped-feed to new examples structure - Created examples/zapped-feed/index.svelte with TypeScript types - Created examples/zapped-feed/index.txt with simplified version - Updated +page.svelte imports to use new structure - Removed old zapped-feed.example.svelte and zapped-feed.svelte.example This is the only docs example file with a live rendered preview, making it consistent with component examples migration pattern. * chore: apply linter formatting to component and event pages Auto-formatted by user's linter during migration work * fix: resolve CSS compatibility and unused selector warnings - Add standard `mask` property alongside `-webkit-mask` for better browser compatibility - Add standard `line-clamp` property alongside `-webkit-line-clamp` across link preview and embed components - Fix invalid CSS property: change `auto-rows` to `grid-auto-rows` - Remove unused CSS utility class definitions that duplicate Tailwind functionality * chore: bump to beta.45 * fix: resolve ndk imports and goto usage in route examples - Fixed $lib/ndk.svelte imports to use correct $lib/site/ndk.svelte path - Added missing goto imports from $app/navigation - Verified Svelte 5 code with autofixer (no issues found) * fix: add missing apiDocs property to 63 registry.json files - Added "apiDocs": [] to all component registry metadata files - Fixes ComponentCardData type errors across component showcase pages - Reduced error count from 249 to 204 * fix: correct NDKSvelte imports and apply linter formatting - Fixed NDKSvelte imports in 20 route example files - Applied linter formatting to 130+ registry component files - Maintaining progress toward 0 errors (currently at 204) * fix: correct NDKSvelte imports and language prop in 24 files - Fixed NDKSvelte imports from '@nostr-dev-kit/ndk' to '@nostr-dev-kit/svelte' (22 files) - Fixed language prop to lang prop in CodeBlock components (2 files) - Reduced error count from 204 to 198 * fix: split NDKEvent/NDKUser imports to correct packages - Separated NDKEvent imports to '@nostr-dev-kit/ndk' - Kept NDKSvelte imports in '@nostr-dev-kit/svelte' - Fixed 8 files with incorrect type imports - Reduced error count from 180 to 172 * fix: add id property to showcase components in reaction page - Added missing id property to ShowcaseComponent objects - Progress toward fixing all ShowcaseComponent type errors * fix: resolve type import errors and update component pages Fixed multiple TypeScript errors in registry components and showcase pages: - Fixed type imports for HighlightState, UserInputResult, BookmarkedRelayListState to import from local builders instead of @nostr-dev-kit/svelte package - Fixed ContentRenderer import to use correct module path - Fixed NDKUser imports in 8 example files to use @nostr-dev-kit/ndk - Fixed relay-card BookmarkedRelayWithStats import path - Updated article card page to use individual registry.json imports - Fixed variant prop usage in EmbeddedEvent components - Added id properties to ShowcaseComponent objects in component pages - Removed orphaned scripts/replace-shadcn-commands.ts file Reduced total errors from 251 to 126 (50% reduction). * chore: bump registry version to 4.0.0-beta.45-1 Incremented patch version for jsrepo registry to republish with all relative imports properly configured. * fix: add registry imports to card showcase pages Fixed missing registry.json imports in card showcase pages: - events/cards/highlight: Added highlight card registry imports with variants - events/cards/image: Added image card registry imports - events/cards/voice-message: Added voice message card registry imports - events/cards: Added event card classic registry import - events/content/markdown: Added article content registry imports - relay/cards/basic: Fixed bookmarks.svelte import extension (.svelte.ts) Created variant card objects from base registries where multiple variants share a single registry file (highlight feed/elegant/grid, image instagram). Reduced total errors from 126 to 114 (12 errors fixed). * fix: correct bookmarks module import path in relay-card Fixed BookmarkedRelayWithStats import in relay-card.svelte to use correct module path without file extension, allowing TypeScript to properly resolve the interface and its url property. Current status: 108 errors remaining (down from 251, 57% reduction) * fix: split combined NDKUser/NDKSvelte imports and reorganize components Fixed combined type imports in 8 example files by splitting them: - NDKUser now imported from '@nostr-dev-kit/ndk' - NDKSvelte imported from '@nostr-dev-kit/svelte' Files fixed: - components/mute/examples/custom/index.svelte - components/user-card/examples/* (7 files: classic, compact, glass, landscape, list-item, neon, portrait) Component reorganization (from linter): - Moved avatar-group from misc/ to root components/ - Moved content-tab from misc/ to root components/ - Moved emoji-picker from misc/ to root components/ - Updated all import paths and registry.json files - Deleted orphaned events/content/plain-text/+page.ts Reduced errors from 108 to 96 (12 errors fixed, 44% total reduction from starting 251). * fix: correct relay-card BookmarkedRelayWithStats import path Fixed import path for BookmarkedRelayWithStats type in relay-card.svelte. Used correct relative path depth (../../../../ instead of ../../../) to properly resolve the builders/relay/bookmarks.svelte module. This resolves all ExtendedRelayStats.url property access errors since the interface now correctly extends BookmarkedRelayWithStats which has the url property. Reduced errors from 107 to 79 (28 errors fixed, 69% total reduction from 251). * refactor: unify layer visualization into single nested wireframe Replace sequential three-step visualization with unified wireframe showing all layers (Chrome/Content/Embeds) simultaneously. Move info cards to right sidebar, integrate mentions inline with skeleton text, and replace component-specific content with conceptual layer descriptions. Remove all custom CSS in favor of inline Tailwind utilities. * remove: voice message components and clean up example files - Remove all voice message components, UI primitives, and pages - Delete obsolete .example.svelte files across multiple components - Clean up unused Demo.svelte component * refactor: migrate site components to Tailwind utilities - Convert LoginModal, Navbar, and site components from custom CSS to Tailwind classes - Refactor component-api, edit-props, and alert components to use design tokens - Move heartbeat and shimmer animations to global app.css - Add new reaction button basic component with registry.json - Remove unused effect from reply page - Update preview component border styling * fix: replace deleted component imports with existing alternatives Replace references to deleted components (FollowButtonAnimated, ReactionLongpress, ReactionAction) with direct imports to existing components: - Use basic FollowButton instead of deleted animated variant - Use basic ReactionButton instead of deleted longpress/action components - Update all imports to reference component files directly instead of deleted index files * fix: repost count incorrectly showing 1 after user reposts Fixed bug where Array.some() stopped iterating after finding user's repost, causing incomplete count of unique reposters. Now processes all reposts to ensure accurate count regardless of user's repost position in array. * fix: repost button avatars not performing repost action on click Added default repost behavior when no custom onclick handler is provided. Now calls repostAction.repost() to toggle repost state like basic button. * docs: add comprehensive API documentation for repost buttons Added complete apiDocs to registry.json for both repost button variants: - Documented all props with types, defaults, and descriptions - Clarified onclick behavior: toggles repost state when no custom handler provided - Documented avatar-specific props (max, avatarSize, spacing) - Added showcaseTitle and showcaseDescription for better discoverability * refactor: comprehensive component restructuring and build cleanup - Rename registry.json to metadata.json across all components for consistency - Delete old Vercel serverless build output (output/ directory) - Remove animated follow button component (consolidate with basic variant) - Replace reaction component structure with individual button variants (basic, avatars, slack) - Delete legacy reaction longpress and display variants - Add new emoji picker dropdown component - Update component imports and references throughout the codebase - Clean up unused find_broken_items.mjs script - Add .repomixignore and COMPONENT-CREATION-GUIDE.md documentation - Update site navigation and component showcase templates * refactor: update all component imports to use metadata.json Update all component documentation pages and route loaders to import from metadata.json instead of registry.json, completing the component metadata file renaming migration. * chore: bump to beta.46 * refactor: reorganize builders into directory structure Move all builder files from flat structure to directory-based structure where each builder lives in its own directory with an index file. Changes: - emoji-picker.svelte.ts → emoji-picker/index.svelte.ts - follow-action.svelte.ts → follow-action/index.svelte.ts - markdown-nostr-extensions.ts → markdown-nostr-extensions/index.ts - mute-action.svelte.ts → mute-action/index.svelte.ts - reaction-action.svelte.ts → reaction-action/index.svelte.ts - reply-action.svelte.ts → reply-action/index.svelte.ts - repost-action.svelte.ts → repost-action/index.svelte.ts - resolve-ndk.svelte.ts → resolve-ndk/index.svelte.ts Updated all imports throughout codebase, documentation, and scripts to match new structure. * fix: correct importPath in builder metadata to use local registry path Update follow-action metadata.json to use local $lib import path instead of npm package path, consistent with component metadata pattern. Also update COMPONENT-CREATION-GUIDE.md example to reflect correct pattern. * feat: add metadata.json files for all builders Create comprehensive metadata files for all builder functions including: - reaction-action: Emoji reactions with NIP-30 custom emoji support - reply-action: Reply tracking and creation - repost-action: Repost and quote post management - mute-action: User muting functionality - emoji-picker: Emoji aggregation from user preferences and pubkeys - markdown-nostr-extensions: Marked.js extensions for Nostr content - resolve-ndk: NDK resolution utility Each metadata file includes: - Function name, title, and one-liner description - Detailed description of functionality - Import path using local registry structure - jsrepo installation command - Dependencies and related NIPs - Complete parameter and return value documentation - Usage examples with code snippets * chore: bump to beta.47 * refactor: migrate reply page to metadata-driven pattern - Add overview section explaining reply functionality - Add componentsSection with cards and previews - Add buildersSection with reply-action builder - Add apiDoc to reply button metadata files - Use non-grid showcase with orientation: horizontal - Remove inline components snippet pattern * refactor: migrate repost page to metadata-driven pattern - Add overview section explaining repost/quote functionality - Add componentsSection with cards and previews - Add buildersSection with repost-action builder - Update metadata component names (repost-button, repost-button-avatars) - Use non-grid showcase with orientation: horizontal - Remove inline components snippet pattern * refactor: migrate mute page to metadata-driven pattern - Add overview section explaining mute functionality - Add componentsSection with mute button card and preview - Add buildersSection with mute-action builder - Keep {primitives} section (contains Builder API and ndk.$mutes docs) - Remove inline {components} snippet pattern - Remove apiDocs prop - Add muteButtonComponentPreview snippet for Components section - Add orientation: 'horizontal' to showcase - Update mute button metadata name from 'mute-basic' to 'mute-button' * refactor: migrate zap page to metadata-driven pattern - Add overview section explaining Lightning zap functionality - Add componentsSection with zap button cards and previews - Remove inline {components} snippet pattern - Add component preview snippets for Components section - Keep orientation: 'horizontal' in showcase * refactor: migrate zap-send-classic page to metadata-driven pattern - Add overview section explaining classic zap sending interface - Add componentsSection with zap-send-classic card and preview - Remove inline {components} snippet pattern - Add component preview snippet for Components section - Keep orientation: 'horizontal' in showcase * fix: remove duplicate primitives section from mute page The primitives section was showing redundant information that's already properly displayed in the Builders section. Removed: - Entire {primitives} snippet with Custom Compositions, Builder API, and ndk.$mutes API - {primitives} prop from ComponentPageTemplate - Unused imports (Preview, muteCustomCode, UIComposition) * refactor: migrate emoji picker page to metadata-driven pattern - Add showcase section with EmojiPicker.Content component - Add overview section explaining smart emoji aggregation - Add componentsSection with emoji-picker card and preview - Add buildersSection with emoji-picker builder - Move composition examples to recipes section - Add orientation: 'horizontal' to showcase * refactor: migrate content-tab page to metadata-driven pattern - Add overview section explaining smart content type detection - Add componentsSection with content-tab card and preview - Move Builder API and Usage Examples to recipes section - Keep detailed component examples in anatomy section (Tabs-based) - Remove {customSections} snippet (duplicate of recipes) - Remove conditional rendering wrapper - Remove apiDocs prop - Clean up unused imports (PageTitle, SectionTitle) - Add orientation: 'vertical' to showcase * refactor: migrate generic-card page to metadata-driven pattern - Add overview section explaining fallback UI for unknown event kinds - Add componentsSection with generic-card preview - Remove {components} snippet - Remove ComponentCard import * refactor: migrate user-card page to metadata-driven pattern - Add overview section explaining seven card variants and composition - Add componentsSection with all card variants and preview snippets - Move anatomy and primitives sections to {anatomy} snippet - Remove {components} and {customSections} snippets - Remove unused ComponentCard and ScrollArea imports - Keep API drawer for primitives documentation * refactor: migrate avatar-group page to metadata-driven pattern - Add overview section explaining smart ordering and overflow handling - Add showcaseComponents with horizontal orientation - Add componentsSection with avatar-group metadata - Move Builder API and usage examples to recipes section - Remove {components} and {customSections} snippets - Remove ComponentCard import * refactor: migrate relay-card page to metadata-driven pattern - Add overview section explaining NIP-11 relay information display - Add componentsSection with all three card variants - Move UI primitives examples to anatomy section - Move Builder API documentation to recipes section - Remove {components}, {afterComponents}, {customSections}, and apiDocs prop - Remove ComponentCard and SectionTitle imports * refactor: migrate relay-input page to metadata-driven pattern - Add overview section explaining NIP-11 autocomplete and validation - Add componentsSection with all input variants - Add orientation: 'vertical' to showcaseComponents - Move Features section to recipes - Remove {components}, {customSections}, and apiDocs prop - Remove ComponentCard import * refactor: migrate follow-pack page to metadata-driven pattern Updated follow-pack component page to use the new metadata-driven pattern: - Added overview section explaining Follow Packs (NIP-51, kind 39089) - Added componentsSection with all 4 variants (hero, portrait, compact, list-item) - Added showcaseComponents with orientation settings - Converted {customSections} to {anatomy} snippet with ComponentAnatomy visualization - Removed deprecated {components}, {customSections}, and apiDocs props - Removed unused SectionTitle import - Maintained conditional rendering for async data loading * refactor: migrate media-upload page to metadata-driven pattern Updated media-upload component page to use the new metadata-driven pattern: - Added overview section explaining Blossom/NIP-96 media upload functionality - Added componentsSection with upload button and carousel variants - Added showcaseComponents with vertical orientation for both components - Converted {customSections} to {recipes} snippet with createMediaUpload builder API - Removed deprecated {components}, apiDocs props - Removed unused ComponentCard import - Maintained state management for file uploads * refactor: migrate negentropy-sync page to metadata-driven pattern Updated negentropy-sync component page to use the new metadata-driven pattern: - Added overview section explaining Negentropy protocol sync tracking - Added componentsSection with minimal, animated, and detailed variants - Added showcaseComponents with appropriate orientations - Split {customSections} into {recipes} (Builder API + Progress Tracking) and {anatomy} (Primitive Components) - Removed deprecated {components}, apiDocs props - Removed unused ComponentCard and SectionTitle imports - Maintained demo control buttons for interactive sync testing * refactor: migrate notification page to metadata-driven pattern Updated notification component page to use the new metadata-driven pattern: - Added overview section explaining notification feed aggregation system - Converted {customSections} to {recipes} containing Builder Pattern and UI Primitives examples - Removed deprecated {customSections} prop - Preserved unique teaching example structure with interactive Preview components - This page differs from others as it focuses on builder/primitives examples rather than component variants * fix: resolve type errors in reaction-action test file - Fix test-utils import path (../../../ -> ../../../../) - Add explicit type annotations for ndk, alice, bob variables - Add ReturnType type for reactionState with non-null assertions - Fix mockSub events array type (NDKEvent[] instead of never[]) - Cast NDKSvelte to any for test utility functions compatibility * fix: resolve type errors in all remaining test files - Add explicit NDKSvelte type annotations for ndk variables - Add ReturnType types for alice, bob, carol user variables - Fix mockSub events array types (NDKEvent[] instead of never[]) - Cast NDKSvelte to any for test utility functions All test files now pass type checking: - reaction-button-avatars.test.ts - reaction-button.test.ts - reaction-button-slack.test.ts - reaction-display.test.ts * fix: add missing importPath to user card component metadata Added importPath property to apiDoc in all user card metadata.json files: - classic: $lib/registry/components/user/cards/classic - compact: $lib/registry/components/user/cards/compact - glass: $lib/registry/components/user/cards/glass - landscape: $lib/registry/components/user/cards/landscape - neon: $lib/registry/components/user/cards/neon - portrait: $lib/registry/components/user/cards/portrait This fixes type errors in user-card +page.svelte * fix: add missing importPath to user list-item metadata Added importPath: $lib/registry/components/user/displays/list-item * fix: restructure apiDocs in article UI primitive page Changed apiDocs from flat array of props to proper ComponentDoc structure: - Wrapped props in ComponentDoc objects with name, description, importPath - Each primitive now has apiDocs: [{ name, description, importPath, props: [...] }] This fixes type mismatch with UIPrimitiveMetadata interface. * fix: restructure apiDocs in all UI primitive pages Fixed apiDocs structure in 11 UI primitive pages to match ComponentDoc interface: - event-rendering: 4 primitives - event: 1 primitive - follow-pack: 5 primitives - highlight: 3 primitives - media-upload: 5 primitives - notification: 5 primitives - reaction: 1 primitive - relay: 9 primitives - user-input: 4 primitives - user: 8 primitives - zap: 2 primitives Total: 47 primitives transformed Each primitive's apiDocs changed from flat array of props to proper ComponentDoc structure with name, description, importPath, and props array. This fixes all UIPrimitiveMetadata type mismatch errors. * fix: rename customSections to anatomy in event pages Changed {#snippet customSections()} to {#snippet anatomy()} in 6 files: - events/cards/article/+page.svelte - events/cards/highlight/+page.svelte - events/cards/image/+page.svelte - events/content/markdown/+page.svelte - events/content/plain-text/+page.svelte - events/embeds/hashtag/+page.svelte customSections is not a valid property in ComponentPageTemplateProps. anatomy is the correct property name for anatomy sections. * fix: rename apiDocs to apiDoc in helper functions Changed apiDocs (plural) to apiDoc (singular) in: - createCardData function parameter and return statement - extractMetadataFromCardData function return statement ComponentCardData interface uses apiDoc (singular), not apiDocs (plural). * fix: remove duplicate example files and fix follow-pack imports - Delete 10 orphaned .svelte.example duplicate files (Phase 1 + Phase 3.1) - Fix incorrect import paths in follow-pack components (follow/packs -> follow-pack) - Fix relative import paths in all follow-pack component variants - Verified build succeeds after changes * chore: remove duplicate example files from ui/media-upload - Delete 2 orphaned .svelte.example files (basic, carousel) - New directory structure already in place - Build verified successful * chore: remove duplicate example files from ui/zap - Delete 2 orphaned .svelte.example files (basic, styled) - New directory structure already in place - Build verified successful * chore: remove duplicate example files from ui/user-input - Delete 2 orphaned .svelte.example files (basic, custom-item) - New directory structure already in place - Build verified successful * chore: remove duplicate example files from ui/event - Delete 2 orphaned .svelte.example files (basic, with-click) - New directory structure already in place - Build verified successful * chore: remove duplicate example files from ui/follow-pack - Delete 2 orphaned .svelte.example files (basic, with-image) - New directory structure already in place - Build verified successful * chore: remove duplicate example files from ui/event-rendering - Delete 5 orphaned .svelte.example files (basic, custom-renderer, hashtag-custom, link-custom, variants) - New directory structure already in place - Build verified successful - Phase 3 complete: cleaned up all partially migrated UI component directories * chore: remove orphaned example files from events/cards/highlight - Delete 8 unused example files that are not imported anywhere - Page uses inline snippets instead of example file imports - Build verified successful * chore: remove orphaned example files from events/cards/image - Delete 5 unused example files - Build verified successful * chore: remove last orphaned old-style example files - Delete 2 orphaned .svelte.example files from events/content/markdown - All remaining example files use new .example.svelte naming and are imported - Phase 2 complete: all events examples cleaned up - Build verified successful * chore: remove 4 orphaned example files from events/embeds - Delete orphaned .svelte.example files that have been replaced by new directory structure - New versions exist in interactive-demo/ and variant-comparison/ directories - Build verified successful * fix: add type annotations to follow-action test file - Added NDKSvelte type for ndk variable - Added Awaited<ReturnType> types for alice and bob - Added ReturnType types for all followAction variables - Added non-null assertions for followAction usage - Added any casts for bob where needed for type compatibility - Added any type for mockSessions variable * fix: add type annotations to follow-button test file - Added any types for mockFollows, mockSessions, and mockCurrentUser - Added any casts for all bob target assignments * fix: change ComponentAPI components prop to component (singular) Fixed 3 files to use the correct ComponentAPI interface: - events/embeds/mention: Split 2 components into separate ComponentAPI calls - events/embeds/hashtag: Split 2 components into separate ComponentAPI calls - events/content/markdown: Changed components array to single component object Also fixed mention page to remove components snippet and rename customSections to anatomy. * fix: add non-null assertions for user1.pubkey usage Added non-null assertions to 6 instances where user1.pubkey is accessed, since user1 is declared as possibly undefined but is expected to be defined when the component renders. * fix: update follow-pack import paths after directory restructure Updated import paths in 4 example files to reflect the new directory structure: - follow/packs/ → follow-pack/ Files updated: - examples/compact/index.svelte - examples/hero/index.svelte - examples/list-item/index.svelte - examples/portrait/index.svelte * fix: split ComponentAPI components arrays into individual calls Fixed 2 card page files to use singular component prop: - events/cards/highlight: Split 7 components into separate ComponentAPI calls - events/cards/image: Split 3 components into separate ComponentAPI calls This matches the ComponentAPI interface which expects a single component object, not an array. * fix: remove usage of non-existent Event components in examples Fixed 2 mention example files that were using Event.Root, Event.AuthorAvatar, and Event.AuthorName which don't exist in the Event UI primitive export. The Event export only provides ReplyIndicator and Time components. Replaced with direct HTML/styling and kept Event.Time which does exist. Files fixed: - events/embeds/mention/basic.example.svelte - events/embeds/mention/modern.example.svelte * fix: add non-null assertions and conditional rendering for possibly undefined snippets Fixed 4 instances of "Cannot invoke possibly undefined" errors: - session-switcher-compact: Added ! to action.icon() call - session-switcher: Added ! to action.icon() call - UIPrimitivePageTemplate: Added conditional checks for overview and examples snippets * fix: remove unsupported headerIds option from marked.js configuration Removed headerIds option from marked.setOptions in 2 files: - ComponentCard.svelte - BuilderCard.svelte The headerIds option doesn't exist in the current version of marked.js. * fix: use oneLiner instead of description for metadata subtitle Fixed 3 files that were using metadata.description which doesn't exist in component metadata. Changed to metadata.oneLiner which is the correct property for component metadata objects. Files fixed: - routes/(app)/events/+page.svelte - routes/(app)/events/cards/+page.svelte - routes/(app)/events/cards/image/+page.svelte * fix: remove unsupported mangle option from marked configuration * fix: convert JSX arrow function to Svelte 5 snippet syntax in notification example * fix: create proper NDKUser instances for ProcessedZap mock data * fix: remove null from NDKArticle state types to match EditProps.Prop type signature * fix: add number and boolean types to EditProps.Prop value interface * fix: update updatePropValue signature to accept number and boolean types * fix: add missing ndk prop to hashtagComponent and EventCardClassic * fix: use props array from apiDocs and add conditional check for props property * fix: add type assertion for prop in user-card props loop * fix: add children to MediaUpload.Carousel to display upload previews * fix: import Event from ui/event index instead of embedded-event component * fix: remove non-existent Article.PublishedAt component from anatomy preview * fix: add sha256 and mimeType to MediaUploadResult mock data * fix: rename beforeShowcase snippet to overview to match ComponentPageTemplateProps * fix: rename customSections snippet to anatomy to match ComponentPageTemplateProps * fix: pass ndk and pubkey props instead of user to UserCard component * fix: remove invalid props from components and split ComponentAPI components array * fix: use named import for NDKSvelte instead of default import * fix: import ThreadView from local types instead of @nostr-dev-kit/svelte * fix: add missing imports to UserContext code example in primitives guide * fix: create proper NDKArticle instance instead of plain object * fix: create proper NDKFollowPack instance instead of plain object * fix: correct name in relay-card-list metadata for preview mapping The metadata.json had name "relay-basic" which didn't match the preview mapping key "relay-card-list" in the relay-card page, causing the preview to fail with "Preview not defined for relay-basic". * fix: correct name in relay-input metadata for preview mapping The metadata.json had name "relay-basic" which didn't match the preview mapping key "relay-input" in the relay-input page, causing the preview to fail with "Preview not defined for relay-basic". * fix: cast ndk to NDKSvelteWithSession for session-switcher components * fix: update user context import paths in code example to valid module paths * fix: add required NostrEvent fields to NDKEvent, NDKArticle, and NDKFollowPack mock instances * fix: remove unused interactive prop from event-card-classic and update docs Remove the unused interactive prop from event-card-classic component per COMPONENT-CREATION-GUIDE.md guidelines. Fix CSS class from wrap-break-words to break-words in event-card-content. Update event cards documentation to accurately reflect actual component props and add missing ReplyIndicator heading. * chore: remove outdated documentation files - Delete migration tracking docs (work complete): EXAMPLES-REFACTOR, DATA_ATTRIBUTES_* - Delete abandoned versioning system docs: USER_GUIDE, HOW_TO_USE - Delete duplicate content: TESTING_SUMMARY - Keeping: README, TESTING_GUIDE_FOR_LLM, COMPONENT-CREATION-GUIDE - Build verified successful * chore: remove 23 obsolete scripts - Delete versioning system scripts (abandoned): check-updates, create-lockfile, etc - Delete one-time migration scripts (complete): migrate-*, fix-*, update-* - Delete unused utility scripts: fill-api-docs, find-component-paths - Keeping only 3 core registry scripts: create-all-metadata-json, create-metadata-json, update-root-registry - Build verified successful * fix: remove unused customPreview snippet and fix UserContext npub access in code example * docs: update TESTING_GUIDE_FOR_LLM to be timeless reference - Remove 'Current Status (January 2025)' timestamp - Remove specific test failure counts and names - Convert 'Known Issues' to 'Common Testing Challenges' - Make content educational rather than progress-tracking - All patterns and examples remain unchanged * fix: add required id field to showcaseComponents in generic-card page * fix: correct actorCount snippet signature to match NotificationItem.Actors expected type * chore: bump to beta.48 * refactor: remove debug console.logs from production code - Remove 8 debug console.logs from relay-input.svelte (debounce debugging) - Remove 7 debug console.logs from negentropy-sync builder - Remove 4 debug console.logs from media-upload builder - Remove console.log from +layout.svelte - Keep all console.error/warn for legitimate error handling * fix: remove invalid imports and clean up temporary files Removed jsrepo publish temporary files and corrected invalid import statements in login, signup, note-composer, content-tab, and repost components. * refactor: remove demo console.logs from showcase pages - Remove console.log from repost handleQuote function - Remove console.log from signup handleSuccess function - Remove console.logs from note-composer onPublish handlers - Remove console.logs from user-input handleSelect function - Remove console.log from content-tab onTabClick handler - Keep console.logs in code template strings (educational examples) * refactor: remove remaining console.logs from registry components - Remove console.log from app-handlers builder - Remove console.logs from event dropdown components - Keep console.logs in JSDoc comments (educational examples) - Keep all console.error/warn for error handling - Build verified successful * refactor: remove 2 more console.logs from note-composer page - Remove console.log from modal and reply modal handlers - Build verified successful * fix: add required ndk and eventBech32 props to Basic component Fixes type error where Basic component was missing required props * fix: add const assertion to orientation literal type Fixes type error where string wasn't assignable to literal union type * fix: handle number and boolean types in edit-props components - Add number and boolean to preview state types - Convert default values to strings when needed - Fixes type errors in edit-props-dialog and edit-props-prop * fix: add non-null assertion for sampleEvent in zap-send builder Type narrowing doesn't work in derived expressions, so use ! assertion since we already check sampleEvent exists in the ternary condition * fix: add Array.isArray check for data.props iteration Adds runtime check to properly narrow type for props array iteration * fix: use onclick instead of on:click for Svelte 5 Change from Svelte 4 event handler syntax to Svelte 5 prop syntax * fix: add number and boolean to edit-props value types Update onApply callback and EditPropsPreview to accept number and boolean types * fix: remove extra ndk argument from createEventContent call createEventContent only accepts a single config argument * fix: add fallback to get ndk from context in clickable-hashtag If ndk is not provided as prop, fall back to getting it from context * fix: add non-null assertion for selectedEmbed in interactive-demo selectedEmbed is guaranteed to be non-null inside the if block * fix: remove type field from slots definition Slots interface only expects name and description, moved type info to description * refactor: icons restructuring Part of component restructuring for jsrepo individual installation * refactor: simple components restructuring Part of component restructuring for jsrepo individual installation * refactor: multi-file components restructuring Part of component restructuring for jsrepo individual installation * fix: move files from temp directories to final locations * refactor: update all imports for new component structure * refactor: update metadata.json files for new structure * fix: update relative import paths after component restructuring * fix: update thread-view-twitter imports for new component structure * chore: clean up empty directories after migration Remove empty parent directories left over from component restructuring. * chore: bump version to 0.0.17 after directory cleanup * chore: add missing index.ts files and remove empty relay directory * chore: bump version to 0.0.18 * chore: bump version to 0.0.19 with index.ts fixes * feat: add missing index.ts files for all builders and icons * chore: bump version to 0.0.20 * fix: add missing emoji-picker index.ts * chore: bump version to 0.0.21 * chore: bump to beta.44 * chore: bump version to 0.0.22 * fix: update test-utils import paths after component restructuring * Update dependencies and component imports - Update bun.lock with latest dependency changes - Fix import paths in LoginModal, Navbar, and edit-props-dialog components * chore: remove migration scripts after successful restructuring * test: add comprehensive tests for reply-action builder Add 18 test cases covering: - Initialization with valid/invalid/undefined events - Reply counting for kind 1 (Text) and kind 1111 (GenericReply) events - Filtering using NDK's eventIsReply() to exclude non-reply mentions - hasReplied detection for current user - Pubkey tracking including multiple replies from same user - reply() function with error cases (no event, no user) - Reactive config updates when event changes All tests follow Svelte 5 testing patterns: - Use $effect.root() for rune testing - Mock NDK subscriptions with vi.spyOn - Use flushSync() for reactivity synchronization - Proper cleanup in afterEach() * test: add comprehensive tests for repost-action builder Add 24 test cases covering: - Initialization with valid/invalid/undefined events - Repost counting for kind 6 (Repost) and kind 16 (GenericRepost) events - Quote post tracking with #q tags - Unique pubkey counting (not total reposts) - hasReposted detection for current user - Pubkey deduplication for multiple reposts from same user - repost() function with toggle behavior (delete if already reposted) - quote() function creating kind 1 with #q tag - Error cases for both functions (no event, no user) - Reactive config updates when event changes All tests follow Svelte 5 testing patterns with proper mocking and flushSync() for reactivity synchronization. * test: add comprehensive tests for mute-action builder Add 17 test cases covering: - Initialization with muted/unmuted targets - Support for both string pubkey and NDKUser targets - isMuted state detection from $mutes Set - mute() function calling $mutes.toggle() correctly - Error cases (undefined target, user not logged in) - Handling of undefined/null $mutes - Reactive target updates (string to NDKUser, changing targets) Tests use vi.spyOn to properly mock the $mutes getter property. All tests follow Svelte 5 testing patterns with $effect.root() and proper cleanup. * test: add comprehensive tests for zap-send builder Add 13 test cases covering: - Initialization with default values (amount, comment, sending, error) - Bindable state properties (amount, comment getters/setters) - send() function with NDKZapper integration - sending state management during zap operations - Error handling and error state tracking - Error clearing on successful retry - Target validation (undefined target throws error) - Reactive config updates when target changes - Support for both NDKEvent and NDKUser targets - State reset when target becomes undefined Tests focus on the builder's own logic rather than deeply mocking NDKZapper internals, which are tested in NDK itself. All tests follow Svelte 5 patterns with $effect.root() and proper cleanup. * feat: add priority system to ContentRenderer Implement priority-based registration for content rendering components, enabling progressive enhancement and component competition. Components with higher priorities automatically override lower priority ones. Key changes: - Add priority parameter to all ContentRenderer registration methods - Update component registrations with appropriate priorities (1=basic, 5=compact, 10=enhanced) - Add debug methods getInlinePriorities() and getKindPriorities() - Remove $state runes from ContentRenderer class properties - Add comprehensive priority system documentation - Create priority system example demonstrating progressive enhancement This allows apps to register basic components first, then have enhanced versions automatically replace them when loaded, without breaking existing code. * refactor: restructure hashtag embeds page to follow Component Creation Guide - Add metadata.json for hashtag-modern, hashtag-card-compact, and hashtag-card-portrait - Convert examples from .example.svelte to mandatory dual-file format (index.svelte + index.txt) - Rewrite +page.svelte to use ComponentPageTemplate pattern with: - Showcase section with visual previews of all variants - Components section with ComponentCard and code examples - Overview section with descriptive text - Interactive controls with EditProps.Prop - Remove old .example.svelte files - Update +page.ts to remove unused metadata import The page now follows all architectural requirements from the guide and is consistent with other component pages like the reaction page. * refactor: restructure follow-pack page to follow Component Creation Guide - Move anatomy content into primitives section as subsection (architectural requirement) - Fix naming consistency: showcaseComponents IDs now match component names (follow-pack-hero, follow-pack-portrait, follow-pack-compact, follow-pack-list-item) - Remove redundant preview wrapper snippets (heroComponentPreview, etc.) - Use followPackAnatomyLayers object throughout anatomy implementation - Remove unused PageTitle import The page now follows the guide's architecture: - All lower-level content (anatomy, UI primitives) in primitives section - Consistent naming between showcase and components sections - Cleaner code with no redundant wrappers - Proper use of defined data structures Build verified successful. * feat: add EventCardBasic and refactor callbacks to intent pattern Introduces explicit intent callbacks for user actions, giving developers control over interaction flow instead of auto-executing actions. Changes: - Add EventCardBasic component with minimal flat design - Add ReplyIntentCallback, QuoteIntentCallback, ZapIntentCallback types - Change zap buttons from auto-zap to callback-based pattern (onclick now receives zapFn instead of auto-executing) - Update EventCardClassic with all 4 action buttons and intent callbacks - Remove showActions/showDropdown toggle props (always shown now) - All intent callbacks now receive event parameter for context - Export intent callback types from builder index files Breaking Changes: - ZapButton/ZapButtonAvatars: onclick signature changed from () => void to (zapFn: ZapFunction) => void - ZapButton: removed amount prop (now provided by caller via zapFn) - EventCardClassic: removed showActions and showDropdown props - All intent callbacks (onReply, onQuote, onZap) now expect event parameter * fix: remove duplicate description field from metadata to prevent duplicate rendering * feat: add full-screen media lightbox with zoom and navigation Add professional full-screen media viewer for all media components with: - MediaLightbox component using bits-ui Dialog - Click-to-expand functionality for bento grid, carousel, and simple layouts - Zoom controls: mouse wheel, pinch-to-zoom, zoom buttons with pan support - Navigation: arrow buttons, keyboard shortcuts, swipe gestures on mobile - Media counter display (e.g., '3 / 5') - High z-index (9999) to ensure lightbox appears above all navigation elements - Support for images, videos, and YouTube embeds - Custom arrow and zoom icons added to registry All media rendering components now open in lightbox on click with full zoom, pan, and navigation capabilities on both desktop and mobile. * refactor: restructure components and pages to follow Component Creation Guide - Remove legacy link-preview and generic-card components - Add new event card variations (compact, inline) and media render components - Restructure pages to follow standardized examples directory layout - Update component metadata and styling - Add media render carousel, bento grid, and wrapper components - Add link embed and inline components for improved embed handling - Refactor button components with modern patterns - Update avatar group with tests and click handler support * chore: bump to beta.45 * chore: bump to beta.46 * chore: bump to beta.47 * fix: connect onclick handler to button in FollowPackCompact The onclick prop was being passed to FollowPack.Root and stored in context but never attached to the actual button element, making it non-functional. * refactor: migrate button components to tailwind-variants Replace cn() utility with tv() from tailwind-variants across all button components for cleaner, more maintainable styling. Updated variants to match shadcn-svelte patterns with consistent base styles, proper padding, shadows, and hover states. Changes: - follow-button, follow-button-pill: Added structured variant definitions with compoundVariants for following states - reply-button, zap-button, reaction-button, repost-button: Migrated to tv() with active state variants - All buttons now use shadcn-consistent base styles (font-medium, text-sm, outline-none, disabled states) - Centralized variant logic eliminates scattered conditional class strings * refactor: migrate avatar button components to tailwind-variants Replace cn() utility with tv() from tailwind-variants across all avatar button components for cleaner, more maintainable styling. Updated variants to match shadcn-svelte patterns. Changes: - reaction-button-slack: Added containerStyles and buttonStyles with horizontal/vertical variants - reply-button-avatars, zap-button-avatars, repost-button-avatars: Migrated to tv() with shadcn-consistent base styles - reaction-button-avatars: Added both buttonStyles and iconStyles variants for active state and animation All buttons now use structured variant definitions instead of scattered conditional class strings. * refactor: use Event.Time primitive in EventCard.Header Replace manual time formatting logic with the existing Event.Time primitive component. This eliminates code duplication and ensures consistent time display across all event components. * chore: bump to beta.48 * refactor: modernize UserProfile byline and reaction button display - Migrate UserProfile byline prop from string | Component to Snippet - Remove redundant "x reactions" text from reaction-button-avatars when no avatars shown - Update all documentation and examples to use snippet pattern * chore: bump to beta.49 * feat: support pubkey strings in createFollowAction Allow createFollowAction to accept 64-character hex pubkey strings as target. Automatically converts pubkey strings to NDKUser objects for seamless usage. - Detect hex pubkeys via regex pattern - Convert to NDKUser using ndk.getUser({pubkey}) - Maintain backward compatibility with NDKUser and hashtag strings - Update documentation with all three usage examples * fix: correct relay bookmark NIP reference from NIP-65 to NIP-51 * chore: bump to beta.49 * Guard browser-only code for SSR compatibility * Fix ESM imports in blossom package for SSR compatibility * chore: bump to beta.50 * test: add comprehensive tests for event/fetch builder Add 14 test cases covering: - Initialization state (loading=true, null event/error) - Empty bech32 handling (no fetch triggered) - Successful event fetching with different bech32 formats: - note1 (simple event ID) - nevent1 (event with relay hints) - naddr1 (replaceable event address) - Event not found scenarios (null/undefined returns) - Error handling with console.error verification - Invalid bech32 format errors - Reactive bech32 updates: - Fetching new events when bech32 changes - Resetting error state on valid bech32 - Loading state transitions - Handling empty bech32 after valid value Tests verify async fetchEvent() integration, state management, and reactive config updates. All tests pass with proper async handling using setTimeout and flushSync(). * test: add relay/info builder tests (15/19 passing) Add comprehensive tests for relay/info builder covering: - Initialization with null/invalid URLs - NIP-11 fetching from HTTP endpoints - URL normalization (ws→http, wss→https) - Caching with 1-hour TTL - Request deduplication for concurrent requests - Reactive URL updates with proper cleanup - AbortController cleanup on unmount/URL change Export clearRelayInfoCache() function for test cleanup. 15/19 tests passing. 4 error handling tests fail due to browser mode async timing issues with error state propagation. Core functionality (fetching, caching, deduplication, reactive updates) fully tested. Generated with Claude Code * test: add profile builder tests (8/8 passing) Add tests for profile builder covering: - Initialization with null/undefined/empty user values - Reactive user updates (null/undefined transitions) - Read-only state getters (profile, user, loading) Focuses on synchronous state management and reactivity without complex async mocking to avoid test hanging issues. Generated with Claude Code * test: add hashtag/stats builder tests (12/12 passing) Add comprehensive tests for hashtag/stats builder covering: - Initialization and subscription setup with correct filters - Event filtering by hashtag cap (default 6, configurable) - Statistics computation: noteCount, unique pubkeys, topContributor - Daily distribution calculation for past 7 days - Relay URL filtering - Undefined config handling - Reactive subscription with hashtag changes Generated with Claude Code * test(builders): add comprehensive tests for user/stats builder Add tests covering: - Initialization with zero counts and feature flags - followCount computation from kind 3 contact lists - followsYou detection using $follows and $activeUser - inFollowPackCount from kind 39089 follow packs - recentNoteCount with reply exclusion - Correct since timestamp (1 week ago) - Read-only getters verification Result: 15/15 tests passing (100%) Generated with Claude Code * test(builders): add comprehensive tests for highlight builder Add tests covering: - Content extraction from kind 9802 events - Context handling with context tags - Position calculation (before/highlight/after) - Source handling (web URLs, articles, events) - Source priority (a > e > r tags) - URL metadata fetching with hostname extraction - Article fetching with valid pubkeys - Malformed tag handling - Read-only getters Fixed issues: - Added flushSync() after $effect.root() to ensure effects run - Used valid 64-char hex pubkeys to prevent validation errors - Proper async timing for metadata/article fetches Result: 21/21 tests passing (100%) Generated with Claude Code * test(builders): add comprehensive tests for relay/bookmarks builder Add tests covering: - Initialization with/without current user - Current user deduplication in authors list - Relay aggregation from single/multiple authors - Relay URL normalization across authors - Sorting relays by count (popularity) - isBookmarkedByCurrentUser flag - isBookmarked() function with normalization - getRelayStats() function with normalization - toggleBookmark() add/remove operations - Error when toggleBookmark called without current user - Read-only getters Key patterns: - Created helper function to simulate NDKRelayFeedList with relayUrls getter - Mocked NDKRelayFeedList.prototype.publish for toggle operations - Used valid 64-char hex pubkeys throughout Result: 20/20 tests passing (100%) Generated with Claude Code * test(builders): add comprehensive tests for event/thread builder Add tests covering: - Initialization with event object - Configuration options (maxDepth, kinds) - Reactive getters (events, replies, otherReplies, allReplies, focusedEventId) - focusOn method with event object and ID string - Subscription creation on initialization - Subscription cleanup on unmount - Read-only property validation Note: Tests focus on API surface and lifecycle management. The complex thread-building logic (parent chains, continuations, descendant expansion) relies on utility functions that should be tested separately. Result: 14/14 tests passing (100%) Generated with Claude Code * Refactor entity click handling - consolidate event context management - Remove entity-click-context and entity-click-types (merged into content-renderer context) - Refactor components to use ContentRendererContext for entity interactions instead of separate context - Update component exports in content-renderer - Simplify event handling in event components by removing context prop drilling - Update embedded-event and event-content with consolidated context approach - Add missing dependencies to package.json This consolidates the scattered entity click handling into a single, unified context in the content-renderer system, reducing complexity and improving maintainability. * fix: add missing type dependencies for TypeScript builds Add missing @types/debug, @types/node, @types/react, and other dependencies to packages that were failing during type definition generation. Also add missing runtime dependencies (debug, nostr-tools, typescript) where they were being imported but not declared. Affected packages: - blossom: added debug and @types/debug - wot: added @types/debug - wallet: added @types/debug and @types/node - cache-redis: added debug, @types/debug, and nostr-tools - cache-memory: added typescript - cache-dexie: added typescript - cache-sqlite: added @types/node - mobile: added @types/node and @types/react * fix: resolve build errors and duplicate key issues - Update event-card-reply-indicator to use ContentRendererContext after refactor - Remove unused .text-success CSS selector from +page.svelte - Fix Svelte each_key_duplicate errors by using index keys in: - link-inline-basic (duplicate URLs) - session-switcher components (duplicate action labels) - relay-selector components (duplicate relay strings) - generic-card (duplicate platform names) - Configure Vercel adapter for Node.js 22 compatibility * refactor: standardize /ui index page styling Align /ui page with consistent patterns used across other index pages. Replaced 300+ lines of custom CSS with utility classes and the shared PageTitle component to improve maintainability and ensure visual consistency throughout the registry. * improve responsive design across site - Add responsive typography scaling to PageTitle, homepage hero, and blocks page - Convert fixed grid layouts to responsive breakpoints (sm/md/lg) - Fix blocks page grid from 360px minimum to responsive columns - Fix user-card primitives grid with proper breakpoints - Optimize Preview component heights and padding for mobile - Add mobile-specific padding to key components * refactor: replace Preview with CodeBlock in events/basics examples Replace Preview component with CodeBlock for code-only examples that don't need rendered previews. Improves clarity by showing just the code without confusing placeholder preview sections. * test(builders): add comprehensive tests for event-content builder and ContentRenderer Add 188 tests covering: - event-content builder (46 tests): parsing mentions, hashtags, links, media, emojis, grouping - utils (73 tests): all utility functions for content parsing and classification - ContentRenderer (69 tests): registration, priority system, kind handlers, updates Also includes: - Fix isImage/isVideo regex to handle URL fragments (#section) - Remove unused dependencies (lucide, adapter-auto, typography, tw-animate-css, vaul-svelte, vitest-browser-svelte) - Update TESTING_GUIDE_FOR_LLM.md with new testing patterns All tests passing (188/188) * refactor: remove note-card components and consolidate with event-card variants - Remove redundant note-card, note-card-compact, and note-card-inline components - Replace all references with event-card-basic, event-card-compact, and event-card-inline - Update documentation and examples across /events/basics and other pages - Rename event-card-generic to event-card-fallback for clarity - Standardize component registration patterns with metadata.json - Add svelte-sonner dependency and update package manager to bun - Update jsrepo-manifest.json to remove note-card entries * feat: add onclick callbacks to inline content components - Add onclick prop to media components (basic, bento, carousel) - Add onclick prop and click handling to mention component - Update events/basics page with component registration improvements - Add technical debt documentation files for future refactoring * feat: skip lightbox when media onclick handler is provided Update media components to respect onclick callbacks and skip opening the lightbox when a custom click handler is provided. This allows developers to implement custom media click behavior (analytics, routing, etc.) while preserving the default lightbox for normal usage. Also removed media click toast from the interactive demo since media should open lightboxes by default, not show toast notifications. Changes: - media-basic: skip lightbox when onclick provided - media-bento: skip lightbox when onclick provided - media-carousel: skip lightbox when onclick provided - events/basics demo: removed onMediaClick handler * docs: sync registry listings * docs: drop relay selector components * docs: list highlight card inline * docs: fix ui event references * docs: fix event rendering imports * docs: fix embeds fallback link * docs: fix zap send builder links * docs: fix broken component links * docs: rename base image card * docs: fix event content import path * docs: fix content renderer import alias * docs: document full eventcontent props * chore: bump to beta.51 * docs: mention ui primitives and blocks * docs: fix user input primitive labels * docs: fix relay selector description * docs: clarify components nav description * docs: update relay selector snippet * docs: update install guide package name * docs: mention event time primitive * docs: align reaction primitive description * docs: add event time primitive * refactor: move builders/resolve-ndk to utils/ndk with getNDK() - Rename resolveNDK() to getNDK() for better naming convention - Move from builders/ to utils/ (more appropriate location for utility function) - Merge with utils/ndk-context.svelte.ts to create single source of truth - Update 14 builder files and 20 component files to use new import path - Export NDK_CONTEXT_KEY for consumers who need the context key - Regenerate jsrepo manifest with new module location Breaking changes: - Import path changed from 'builders/resolve-ndk' to 'utils/ndk' - Function renamed from resolveNDK() to getNDK() - getNDKFromContext() removed (use getNDK() instead) * Update components and styling - Update button, copy-button, and pm-command components - Update events basics page with improved layout - Update build configuration and dependencies * fix: address technical debt from NDK refactoring 1. Context key consistency: - Change NDK_CONTEXT_KEY from string 'ndk' to Symbol.for('ndk') - Aligns with codebase pattern (all other context keys use Symbol) - Update +layout.svelte to import and use the constant 2. Variable naming standardization: - Replace all 'resolvedNDK' with 'ndk' for consistency - Updated 16 builder files to use clean, direct 'ndk' variable - Removes unnecessary 'resolved' prefix (cleaner code) 3. Relay hints support: - Remove outdated TODO about relay hints - Implement relay hint support (available since NDK 2.13.0) - Use relayUrls option in thread builder subscription 4. Pattern consolidation: - Convert remaining 'ndk || getContext()' patterns to use getNDK() - Updated negentropy-sync and zap-action builders - All builders now use consistent NDK resolution * chore: bump version to 0.0.39 * style: fix parameter shadowing and linting issues - Rename builder parameter from 'ndk' to 'ndkParam' to avoid shadowing - Affects 16 builder files (emoji-picker, event/fetch, event/thread, etc.) - Fix linting issues across components and UI files - Update content-renderer context exports - Clean up button component imports All changes from automated linting to improve code quality. * refactor: clean up ContentRenderer callback architecture Remove duplicate callback properties from ContentRendererContext that were never used. All callbacks now live exclusively on ContentRenderer class, providing a single source of truth. - Remove onEventClick and onUserClick from ContentRendererContext - Update components to access callbacks via renderer.onUserClick instead of context.onUserClick - Clarify type signatures: LinkComponent takes string, MediaComponent takes string[] - Add clickedIndex parameter to MediaClickCallback for better click handling - Fix event-content to properly handle single media URLs and link groups This eliminates redundancy and prevents potential precedence confusion. * fix: wrap single media URLs in arrays for MediaBasic examples Fix type errors in NSFW and unfollowed media examples by wrapping single string URLs in arrays, matching MediaBasic's array-based interface. The ContentRenderer always passes arrays to media components, so direct usage should follow the same pattern. * fix: resolve type safety errors across components Systematically fixed all TypeScript and Svelte errors found by svelte-check: 1. Navbar: Convert User.Handle Component to snippet for byline prop 2. Unpublished-events: Add required 'id' field to ShowcaseComponent 3. Events/basics: Add type annotation to componentRegistry for dynamic indexing 4. Events/basics: Fix boolean comparison (enableGenericFallback !== 'none') 5. Image cards: Change 'image' prop to 'event' to match component interface 6. Image page: Use metadata.description instead of non-existent oneLiner 7. UI/event: Change <label> to <span> for accessibility (no associated control) 8. Manual-setup example: Use getter in setContext for reactive customRenderer Reduced errors from 24 to 9 (all remaining errors are in primitives-guide due to apparent svelte-check parsing issue with that specific file). * chore: update Vitest dependencies to 4.0.9 Updates all Vitest-related packages from 3.2.4 to 4.0.9 to ensure consistency with the main vitest package and gain access to latest features and fixes. * chore: upgrade marked from 16.4.1 to 17.0.0 Update marked to v17.0.0 which includes improved list token handling and simplified listItem renderer. Breaking changes affect list rendering but do not impact our custom inline extensions (Nostr mentions, event references, emoji, hashtags). Tests confirm no regressions in markdown parsing functionality. * refactor: resolve type safety errors across components - Remove unnecessary type assertions and fix type mismatches - Update component props and bindings for stricter type checking - Ensure proper TypeScript compliance throughout codebase 🤖 Generated with Claude Code * refactor: replace metadata.json 'command' with 'registryName' Replace the 'command' field in all metadata.json files with 'registryName' to separate data from presentation. The 'command' field previously stored the full installation command ("npx jsrepo add X"), while 'registryName' now stores only the registry identifier ("X"). Changes: - Update all 92 metadata.json files to use registryName field - Update ComponentCard and BuilderCard to use registryName - Update type definitions in helpers.ts and types.ts - Add PMCommand to interactive config builder to display installation command - Update COMPONENT-CREATION-GUIDE.md documentation * fix: use correct registry names in interactive config builder Fix PMCommand in interactive config builder to display correct component registry names with 'components/' prefix. Previously showed incorrect commands like 'jsrepo add event-card-inline', now correctly shows 'jsrepo add components/event-card-inline'. Also fix registry name in jsrepo-info.example from @nostr-dev-kit/svelte to @ndk/svelte. * refactor: update metadata.json and installation examples with registryName field - Replace 'command' with 'registryName' in all component metadata files - Update installation examples to reflect ne…
1 parent 0de3c74 commit 53768a2

File tree

1,510 files changed

+119933
-58384
lines changed

Some content is hidden

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

1,510 files changed

+119933
-58384
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@nostr-dev-kit/cache-sqlite-wasm": patch
3+
---
4+
5+
Add intelligent postinstall script that detects framework (Vite, Next.js, SvelteKit, Nuxt, Astro) and provides setup instructions for copying worker.js and sql-wasm.wasm files. Script automatically skips in CI environments and can be silenced with SKIP_NDK_CACHE_SETUP=1.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@nostr-dev-kit/ndk": minor
3+
---
4+
5+
Add NIP-A0 voice message support with NDKVoiceMessage (kind 1222) and NDKVoiceReply (kind 1244) event wrappers. Both classes include getters/setters for audio URL, waveform data, and duration from imeta tags.

.changeset/core-nip46-nip44-default.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@nostr-dev-kit/svelte": patch
3+
---
4+
5+
Fix logout to properly clear $currentUser and $currentPubkey. Previously, after calling logout(), the session was cleared but ndk.$currentUser and ndk.$currentPubkey remained set to the logged-out user, even though localStorage showed an empty sessions array.
6+
7+
The issue was caused by logout() and logoutAll() methods manually updating reactive state, which created a race condition with the subscription handler. Fixed by:
8+
1. Adding code to clear ndk.activeUser and ndk.signer in the subscription handler when activePubkey is undefined
9+
2. Removing manual state updates from logout() and logoutAll() methods to let the subscription handler handle all state updates consistently
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@nostr-dev-kit/sessions": patch
3+
---
4+
5+
Fix race condition in removeSession that prevented ndk.activeUser from being cleared on logout. The issue was caused by NDK's async signer setter which queues a promise that sets activeUser after state is cleared. Fixed by clearing NDK state (signer, activeUser) before triggering subscriptions, preventing the async side effect from firing.

.changeset/hungry-games-mix.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/sessions-optional-signer.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/svelte-wallet-api-fix.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/wallet-publish-mint-list.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
bun-version: 1.0.0
3737
- name: Install dependencies
3838
run: bun install
39-
- name: Build app
40-
run: bun run build:libs
39+
- name: Build all packages
40+
run: bun run build
4141
- name: Setup Node.js
4242
uses: actions/setup-node@v4
4343
with:
@@ -71,6 +71,7 @@ jobs:
7171

7272
# Deployment job
7373
deploy:
74+
if: github.ref == 'refs/heads/master'
7475
environment:
7576
name: github-pages
7677
url: ${{ steps.deployment.outputs.page_url }}

0 commit comments

Comments
 (0)