Bump versions, move getAdapter to context

This commit is contained in:
Jon Staab
2025-04-01 14:24:32 -07:00
parent 540726531f
commit 1cbcb0ae4a
15 changed files with 91 additions and 126 deletions
+41 -76
View File
@@ -7600,6 +7600,7 @@
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz",
"integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">=10.0.0"
},
@@ -7672,18 +7673,18 @@
},
"packages/app": {
"name": "@welshman/app",
"version": "0.0.44",
"version": "0.1.1",
"license": "MIT",
"dependencies": {
"@types/throttle-debounce": "^5.0.2",
"@welshman/dvm": "^0.0.15",
"@welshman/feeds": "^0.1.0",
"@welshman/lib": "^0.1.0",
"@welshman/net": "^0.0.49",
"@welshman/relay": "^0.1.0",
"@welshman/signer": "^0.1.1",
"@welshman/store": "^0.1.0",
"@welshman/util": "^0.1.0",
"@welshman/dvm": "^0.1.1",
"@welshman/feeds": "^0.1.1",
"@welshman/lib": "^0.1.1",
"@welshman/net": "^0.1.1",
"@welshman/relay": "^0.1.1",
"@welshman/signer": "^0.1.3",
"@welshman/store": "^0.1.2",
"@welshman/util": "^0.1.2",
"fuse.js": "^7.0.0",
"idb": "^8.0.0",
"svelte": "^4.2.18",
@@ -7702,18 +7703,6 @@
"events": "^3.3.0"
}
},
"packages/app/node_modules/@welshman/net": {
"version": "0.0.49",
"resolved": "https://registry.npmjs.org/@welshman/net/-/net-0.0.49.tgz",
"integrity": "sha512-DvsBh+MGIZtRd08itpxM8H40tNB2CuEx1ayydnIjk/bX9J2SgfjoFcMhr0mJ8PdSYvwmfRV95T4gF19ni8ANeQ==",
"license": "MIT",
"dependencies": {
"@welshman/lib": "^0.1.0",
"@welshman/util": "^0.1.0",
"isomorphic-ws": "^5.0.0",
"ws": "^8.16.0"
}
},
"packages/app/node_modules/@welshman/signer/node_modules/@welshman/lib": {
"version": "0.0.41",
"resolved": "https://registry.npmjs.org/@welshman/lib/-/lib-0.0.41.tgz",
@@ -7752,11 +7741,11 @@
},
"packages/content": {
"name": "@welshman/content",
"version": "0.1.1",
"version": "0.1.2",
"license": "MIT",
"dependencies": {
"@braintree/sanitize-url": "^7.0.2",
"@welshman/lib": "^0.1.0",
"@welshman/lib": "^0.1.1",
"nostr-tools": "^2.7.2"
},
"engines": {
@@ -7765,14 +7754,14 @@
},
"packages/dvm": {
"name": "@welshman/dvm",
"version": "0.0.15",
"version": "0.1.1",
"license": "MIT",
"dependencies": {
"@noble/hashes": "^1.6.1",
"@welshman/lib": "^0.1.0",
"@welshman/net": "^0.0.49",
"@welshman/signer": "^0.1.1",
"@welshman/util": "^0.1.0"
"@welshman/lib": "^0.1.1",
"@welshman/net": "^0.1.1",
"@welshman/signer": "^0.1.3",
"@welshman/util": "^0.1.2"
}
},
"packages/dvm/node_modules/@noble/hashes": {
@@ -7785,21 +7774,9 @@
"url": "https://paulmillr.com/funding/"
}
},
"packages/dvm/node_modules/@welshman/net": {
"version": "0.0.49",
"resolved": "https://registry.npmjs.org/@welshman/net/-/net-0.0.49.tgz",
"integrity": "sha512-DvsBh+MGIZtRd08itpxM8H40tNB2CuEx1ayydnIjk/bX9J2SgfjoFcMhr0mJ8PdSYvwmfRV95T4gF19ni8ANeQ==",
"license": "MIT",
"dependencies": {
"@welshman/lib": "^0.1.0",
"@welshman/util": "^0.1.0",
"isomorphic-ws": "^5.0.0",
"ws": "^8.16.0"
}
},
"packages/editor": {
"name": "@welshman/editor",
"version": "0.1.0",
"version": "0.1.1",
"license": "MIT",
"dependencies": {
"@tiptap/core": "^2.11.5",
@@ -7815,8 +7792,8 @@
"@tiptap/extension-text": "^2.11.5",
"@tiptap/pm": "^2.11.5",
"@tiptap/suggestion": "^2.11.5",
"@welshman/lib": "^0.1.0",
"@welshman/util": "^0.1.0",
"@welshman/lib": "^0.1.1",
"@welshman/util": "^0.1.2",
"nostr-editor": "^0.0.4-pre.13",
"nostr-tools": "^2.10.4",
"tippy.js": "^6.3.7"
@@ -7824,16 +7801,16 @@
},
"packages/feeds": {
"name": "@welshman/feeds",
"version": "0.1.0",
"version": "0.1.1",
"license": "MIT",
"dependencies": {
"@welshman/lib": "^0.1.0",
"@welshman/util": "^0.1.0"
"@welshman/lib": "^0.1.1",
"@welshman/util": "^0.1.2"
}
},
"packages/lib": {
"name": "@welshman/lib",
"version": "0.1.0",
"version": "0.1.1",
"license": "MIT",
"dependencies": {
"@scure/base": "^1.1.6",
@@ -7853,12 +7830,12 @@
},
"packages/net": {
"name": "@welshman/net",
"version": "0.0.49",
"version": "0.1.1",
"license": "MIT",
"dependencies": {
"@welshman/lib": "^0.1.0",
"@welshman/relay": "^0.1.0",
"@welshman/util": "^0.1.0",
"@welshman/lib": "^0.1.1",
"@welshman/relay": "^0.1.1",
"@welshman/util": "^0.1.2",
"isomorphic-ws": "^5.0.0",
"typed-emitter": "^2.1.0"
}
@@ -7877,23 +7854,23 @@
},
"packages/relay": {
"name": "@welshman/relay",
"version": "0.1.0",
"version": "0.1.1",
"license": "MIT",
"dependencies": {
"@welshman/lib": "^0.1.0",
"@welshman/util": "^0.1.0"
"@welshman/lib": "^0.1.1",
"@welshman/util": "^0.1.2"
}
},
"packages/signer": {
"name": "@welshman/signer",
"version": "0.1.1",
"version": "0.1.3",
"license": "MIT",
"dependencies": {
"@noble/curves": "^1.7.0",
"@noble/hashes": "^1.6.1",
"@welshman/lib": "^0.1.0",
"@welshman/net": "^0.0.49",
"@welshman/util": "^0.1.0",
"@welshman/lib": "^0.1.1",
"@welshman/net": "^0.1.1",
"@welshman/util": "^0.1.2",
"nostr-tools": "^2.7.2"
},
"engines": {
@@ -7936,36 +7913,24 @@
"url": "https://paulmillr.com/funding/"
}
},
"packages/signer/node_modules/@welshman/net": {
"version": "0.0.49",
"resolved": "https://registry.npmjs.org/@welshman/net/-/net-0.0.49.tgz",
"integrity": "sha512-DvsBh+MGIZtRd08itpxM8H40tNB2CuEx1ayydnIjk/bX9J2SgfjoFcMhr0mJ8PdSYvwmfRV95T4gF19ni8ANeQ==",
"license": "MIT",
"dependencies": {
"@welshman/lib": "^0.1.0",
"@welshman/util": "^0.1.0",
"isomorphic-ws": "^5.0.0",
"ws": "^8.16.0"
}
},
"packages/store": {
"name": "@welshman/store",
"version": "0.1.0",
"version": "0.1.2",
"license": "MIT",
"dependencies": {
"@welshman/lib": "^0.1.0",
"@welshman/relay": "^0.1.0",
"@welshman/util": "^0.1.0",
"@welshman/lib": "^0.1.1",
"@welshman/relay": "^0.1.1",
"@welshman/util": "^0.1.2",
"svelte": "^4.2.18"
}
},
"packages/util": {
"name": "@welshman/util",
"version": "0.1.0",
"version": "0.1.2",
"license": "MIT",
"dependencies": {
"@types/ws": "^8.5.13",
"@welshman/lib": "^0.1.0",
"@welshman/lib": "^0.1.1",
"nostr-tools": "^2.7.2",
"nostr-wasm": "^0.1.0"
},
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/app",
"version": "0.1.0",
"version": "0.1.1",
"author": "hodlbod",
"license": "MIT",
"description": "A collection of svelte stores for use in building nostr client applications.",
@@ -27,14 +27,14 @@
},
"dependencies": {
"@types/throttle-debounce": "^5.0.2",
"@welshman/dvm": "^0.0.15",
"@welshman/feeds": "^0.1.0",
"@welshman/lib": "^0.1.0",
"@welshman/relay": "^0.1.0",
"@welshman/net": "^0.0.49",
"@welshman/signer": "^0.1.1",
"@welshman/store": "^0.1.0",
"@welshman/util": "^0.1.0",
"@welshman/dvm": "^0.1.1",
"@welshman/feeds": "^0.1.1",
"@welshman/lib": "^0.1.1",
"@welshman/relay": "^0.1.1",
"@welshman/net": "^0.1.1",
"@welshman/signer": "^0.1.3",
"@welshman/store": "^0.1.2",
"@welshman/util": "^0.1.2",
"fuse.js": "^7.0.0",
"idb": "^8.0.0",
"svelte": "^4.2.18",
+6 -6
View File
@@ -175,7 +175,7 @@ export const getPubkeyRelays = (pubkey: string, mode?: string) => {
}
}
export const globalRouterOptions: RouterOptions = {
export const routerContext: RouterOptions = {
getRelayQuality,
getPubkeyRelays,
getFallbackRelays: () => ["wss://relay.damus.io/", "wss://nos.lol/"],
@@ -191,15 +191,15 @@ export class Router {
readonly options: RouterOptions
static configure(options: RouterOptions) {
Object.assign(globalRouterOptions, options)
Object.assign(routerContext, options)
}
static get() {
return new Router(globalRouterOptions)
return new Router(routerContext)
}
constructor(options: RouterOptions) {
this.options = mergeLeft(options, globalRouterOptions)
this.options = mergeLeft(options, routerContext)
}
// Utilities derived from options
@@ -420,7 +420,7 @@ type FilterSelectionRule = (filter: Filter) => FilterScenario[]
export const getFilterSelectionsForSearch = (filter: Filter) => {
if (!filter.search) return []
const relays = globalRouterOptions.getSearchRelays?.() || []
const relays = routerContext.getSearchRelays?.() || []
return [{filter, scenario: Router.get().FromRelays(relays).weight(10)}]
}
@@ -441,7 +441,7 @@ export const getFilterSelectionsForIndexedKinds = (filter: Filter) => {
if (kinds.length === 0) return []
const relays = globalRouterOptions.getIndexerRelays?.() || []
const relays = routerContext.getIndexerRelays?.() || []
return [
{
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/content",
"version": "0.1.1",
"version": "0.1.2",
"author": "hodlbod",
"license": "MIT",
"description": "A collection of utilities for parsing nostr note content.",
@@ -30,7 +30,7 @@
},
"dependencies": {
"@braintree/sanitize-url": "^7.0.2",
"@welshman/lib": "^0.1.0",
"@welshman/lib": "^0.1.1",
"nostr-tools": "^2.7.2"
}
}
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/dvm",
"version": "0.1.0",
"version": "0.1.1",
"author": "hodlbod",
"license": "MIT",
"description": "A collection of utilities for building nostr DVMs.",
@@ -27,9 +27,9 @@
},
"dependencies": {
"@noble/hashes": "^1.6.1",
"@welshman/lib": "^0.1.0",
"@welshman/net": "^0.0.49",
"@welshman/util": "^0.1.0",
"@welshman/signer": "^0.1.1"
"@welshman/lib": "^0.1.1",
"@welshman/net": "^0.1.1",
"@welshman/util": "^0.1.2",
"@welshman/signer": "^0.1.3"
}
}
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/editor",
"version": "0.1.0",
"version": "0.1.1",
"author": "hodlbod",
"license": "MIT",
"description": "A batteries-included nostr editor.",
@@ -40,8 +40,8 @@
"@tiptap/extension-text": "^2.11.5",
"@tiptap/pm": "^2.11.5",
"@tiptap/suggestion": "^2.11.5",
"@welshman/lib": "^0.1.0",
"@welshman/util": "^0.1.0",
"@welshman/lib": "^0.1.1",
"@welshman/util": "^0.1.2",
"nostr-editor": "^0.0.4-pre.13",
"nostr-tools": "^2.10.4",
"tippy.js": "^6.3.7"
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/feeds",
"version": "0.1.0",
"version": "0.1.1",
"author": "hodlbod",
"license": "MIT",
"description": "Utilities for building dynamic nostr feeds.",
@@ -26,7 +26,7 @@
"fix": "gts fix"
},
"dependencies": {
"@welshman/lib": "^0.1.0",
"@welshman/util": "^0.1.0"
"@welshman/lib": "^0.1.1",
"@welshman/util": "^0.1.2"
}
}
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/net",
"version": "0.1.0",
"version": "0.1.1",
"author": "hodlbod",
"license": "MIT",
"description": "Utilities for connecting with nostr relays.",
@@ -26,9 +26,9 @@
"fix": "gts fix"
},
"dependencies": {
"@welshman/lib": "^0.1.0",
"@welshman/util": "^0.1.0",
"@welshman/relay": "^0.1.0",
"@welshman/lib": "^0.1.1",
"@welshman/util": "^0.1.2",
"@welshman/relay": "^0.1.1",
"isomorphic-ws": "^5.0.0",
"typed-emitter": "^2.1.0"
}
+1 -3
View File
@@ -99,9 +99,7 @@ export class MockAdapter extends AbstractAdapter {
}
}
export type AdapterContext = Partial<NetContext> & {
getAdapter?: (url: string, context: AdapterContext) => AbstractAdapter
}
export type AdapterContext = Partial<NetContext>
export const getAdapter = (url: string, adapterContext: AdapterContext = {}) => {
const context = mergeRight(netContext, adapterContext as any)
+2
View File
@@ -1,5 +1,6 @@
import {Repository} from "@welshman/relay"
import {verifyEvent, TrustedEvent, SignedEvent} from "@welshman/util"
import {AbstractAdapter} from "./adapter.js"
import {Pool} from "./pool.js"
export type NetContext = {
@@ -7,6 +8,7 @@ export type NetContext = {
repository: Repository
isEventValid: (event: TrustedEvent, url: string) => boolean
isEventDeleted: (event: TrustedEvent, url: string) => boolean
getAdapter?: (url: string, context: NetContext) => AbstractAdapter
}
export const netContext: NetContext = {
+2 -2
View File
@@ -124,8 +124,8 @@ export class SingleRequest extends (EventEmitter as new () => TypedEmitter<Singl
}
// Timeout our subscription
if (this.options.timeout) {
setTimeout(() => this.close(), this.options.timeout)
if (this.options.timeout || this.options.autoClose) {
setTimeout(() => this.close(), this.options.timeout || 10000)
}
// Start asynchronously so the caller can set up listeners
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/relay",
"version": "0.1.0",
"version": "0.1.1",
"author": "hodlbod",
"license": "MIT",
"description": "An in-memory nostr relay implementation.",
@@ -26,7 +26,7 @@
"fix": "gts fix"
},
"dependencies": {
"@welshman/lib": "^0.1.0",
"@welshman/util": "^0.1.0"
"@welshman/lib": "^0.1.1",
"@welshman/util": "^0.1.2"
}
}
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/signer",
"version": "0.1.2",
"version": "0.1.3",
"author": "hodlbod",
"license": "MIT",
"description": "A nostr signer implemenation supporting several login methods.",
@@ -31,9 +31,9 @@
"dependencies": {
"@noble/curves": "^1.7.0",
"@noble/hashes": "^1.6.1",
"@welshman/lib": "^0.1.0",
"@welshman/net": "^0.0.49",
"@welshman/util": "^0.1.0",
"@welshman/lib": "^0.1.1",
"@welshman/net": "^0.1.1",
"@welshman/util": "^0.1.2",
"nostr-tools": "^2.7.2"
},
"peerDependencies": {
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/store",
"version": "0.1.1",
"version": "0.1.2",
"author": "hodlbod",
"license": "MIT",
"description": "A collection of utilities based on svelte/store for use with welshman",
@@ -26,9 +26,9 @@
"fix": "gts fix"
},
"dependencies": {
"@welshman/lib": "^0.1.0",
"@welshman/util": "^0.1.0",
"@welshman/relay": "^0.1.0",
"@welshman/lib": "^0.1.1",
"@welshman/util": "^0.1.2",
"@welshman/relay": "^0.1.1",
"svelte": "^4.2.18"
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/util",
"version": "0.1.1",
"version": "0.1.2",
"author": "hodlbod",
"license": "MIT",
"description": "A collection of nostr-related utilities.",
@@ -30,7 +30,7 @@
},
"dependencies": {
"@types/ws": "^8.5.13",
"@welshman/lib": "^0.1.0",
"@welshman/lib": "^0.1.1",
"nostr-tools": "^2.7.2",
"nostr-wasm": "^0.1.0"
}