diff --git a/.fdignore b/.fdignore index 43d4ba4..dd87e2d 100644 --- a/.fdignore +++ b/.fdignore @@ -1,3 +1,2 @@ node_modules build -docs diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 461dd21..9843296 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -1,18 +1,15 @@ import {defineConfig} from "vitepress" import typeDocSidebar from "../reference/typedoc-sidebar.json" -// https://vitepress.dev/reference/site-config export default defineConfig({ title: "Welshman", description: "The official Welshman documentation", ignoreDeadLinks: true, themeConfig: { - // https://vitepress.dev/reference/default-theme-config nav: [ {text: "Guide", link: "/what-is-welshman"}, {text: "Reference", link: "/reference/"}, ], - sidebar: { "/reference/": [...typeDocSidebar], "/": [ @@ -139,7 +136,6 @@ export default defineConfig({ }, ], }, - socialLinks: [{icon: "github", link: "https://github.com/vuejs/vitepress"}], }, }) diff --git a/docs/getting-started.md b/docs/getting-started.md index 68c2179..4227fc4 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -7,6 +7,9 @@ Welshman is modular - install only what you need: # Core nostr utilities (events, filters, tags) npm i @welshman/util +# In-memory event store and relay adapter +npm i @welshman/relay + # Networking and relay management npm i @welshman/net @@ -18,11 +21,7 @@ npm i @welshman/signer # Dynamic feed compilation npm i @welshman/feeds -``` -For Svelte applications, additional packages provide reactive state management: - -```bash # Svelte stores and state management npm i @welshman/store @@ -35,23 +34,19 @@ npm i @welshman/editor Choose packages based on your needs: -- Building a framework-agnostic client? Start with: +- Building a conventional client? Use the framework: ```bash - npm i @welshman/util @welshman/net @welshman/signer @welshman/feeds + npm i @welshman/app ``` -- Building a Svelte client? Add state management: +- Prefer to put things together yourself? Start with: ```bash - npm i @welshman/store @welshman/app + npm i @welshman/util @welshman/net @welshman/signer ``` -- Need content features? Include: +- Just parsing and rendering content? Include: ```bash npm i @welshman/content ``` -- Want the full Svelte stack used by Coracle.social and Flotilla? - ```bash - npm i @welshman/util @welshman/net @welshman/signer @welshman/feeds @welshman/store @welshman/app @welshman/content @welshman/editor - ``` -Each package is independent but integrates seamlessly. The core packages (`util`, `net`, `signer`, `feeds`, `content`) work with any framework, while `store`, `app` and `editor` are built for Svelte applications. +Each package is independent but integrates seamlessly. All packages are framework-agnostic, but work best with Svelte. diff --git a/docs/index.md b/docs/index.md index b04ba06..8603d79 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,18 +18,9 @@ hero: link: https://github.com/coracle-social/welshman features: - - title: "@welshman/content" - details: Parser and renderer for nostr note with customizable formatting options. - link: "/content" - - title: "@welshman/dvm" - details: Tools for building and interacting with nostr Data Vending Machines (DVMs) - link: "/dvm" - - title: "@welshman/editor" - details: Rich text editor component with support for mentions and embeds. - link: "/editor" - - title: "@welshman/feeds" - details: Dynamic feed compiler and loader with filtering and composition. - link: "/feeds" + - title: "@welshman/app" + details: Batteries-included framework for building nostr clients. + link: "/app" - title: "@welshman/util" details: Core Nostr utilities for events, filters, and data structures. link: "/util" @@ -39,7 +30,25 @@ features: - title: "@welshman/signer" details: Implementations of various nostr signing methods (NIP-01, NIP-07, NIP-46, NIP-55). link: "/signer" + - title: "@welshman/relay" + details: In-memory relay and event store. + link: "/relay" + - title: "@welshman/content" + details: Parser and renderer for nostr notes with customizable formatting options. + link: "/content" + - title: "@welshman/dvm" + details: Tools for building and interacting with nostr Data Vending Machines (DVMs) + link: "/dvm" + - title: "@welshman/editor" + details: Rich text editor with support for mentions and embeds. + link: "/editor" + - title: "@welshman/feeds" + details: Dynamic feed compiler and loader with filtering and composition. + link: "/feeds" - title: "@welshman/store" details: Svelte store utilities optimized for nostr state management. link: "/store" + - title: "@welshman/lib" + details: General-purpose utility functions. + link: "/lib" --- diff --git a/docs/lib/index.md b/docs/lib/index.md index 733c939..df4c281 100644 --- a/docs/lib/index.md +++ b/docs/lib/index.md @@ -4,11 +4,11 @@ A lightweight TypeScript utility library with zero dependencies, providing essen ## What's Included -- **Deferred Promises** - Create promises with exposed resolve/reject methods -- **LRU Cache** - Efficient caching with automatic eviction policies - **Utility Functions** - Helpers for arrays, objects, strings, and more -- **Worker Queue** - Process tasks asynchronously with batching and throttling - +- **LRU Cache** - Efficient caching with automatic eviction policies +- **Task Queue** - Process tasks asynchronously with batching and throttling +- **URL Normalization** - A utility function for normalizing URLs +- **Deferred Promises** - Create promises with exposed resolve/reject methods ## Installation diff --git a/package.json b/package.json index ee3dea8..e4d3d16 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "lint": "eslint .", "test": "vitest", "docs:dev": "vitepress dev docs", - "docs:build": "npx typedoc && vitepress build docs", + "docs:build": "typedoc && vitepress build docs", "docs:preview": "vitepress preview docs" }, "devDependencies": { diff --git a/packages/lib/src/normalize-url/index.ts b/packages/lib/src/normalize-url/index.ts index e17c6ec..f6b6bdb 100644 --- a/packages/lib/src/normalize-url/index.ts +++ b/packages/lib/src/normalize-url/index.ts @@ -1,3 +1,5 @@ +// Copied from https://github.com/sindresorhus/normalize-url + export type Options = { /** @default 'http'