Add alert kinds, minor tweaks, bump version

This commit is contained in:
Jon Staab
2025-06-30 10:52:03 -07:00
parent 1d6bd887ba
commit c54225380e
18 changed files with 42 additions and 31 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@welshman",
"private": true,
"version": "0.3.7",
"version": "0.3.8",
"workspaces": [
"packages/*"
],
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/app",
"version": "0.3.7",
"version": "0.3.8",
"author": "hodlbod",
"license": "MIT",
"description": "A collection of svelte stores for use in building nostr client applications.",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/content",
"version": "0.3.7",
"version": "0.3.8",
"author": "hodlbod",
"license": "MIT",
"description": "A collection of utilities for parsing nostr note content.",
+2 -4
View File
@@ -55,12 +55,10 @@ export type RenderOptions = {
createElement: (tag: string) => any
}
const createElement = (tag: string) => document.createElement(tag) as any
export const textRenderOptions = {
newline: "\n",
entityBase: "",
createElement,
createElement: (tag: string) => document.createElement(tag) as any,
renderLink: (href: string, display: string) => href,
renderEntity: (entity: string) => entity.slice(0, 16) + "…",
}
@@ -68,7 +66,7 @@ export const textRenderOptions = {
export const htmlRenderOptions = {
newline: "\n",
entityBase: "https://njump.me/",
createElement,
createElement: (tag: string) => document.createElement(tag) as any,
renderLink(href: string, display: string) {
const element = this.createElement("a")
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/editor",
"version": "0.3.7",
"version": "0.3.8",
"author": "hodlbod",
"license": "MIT",
"description": "A batteries-included nostr editor.",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/feeds",
"version": "0.3.7",
"version": "0.3.8",
"author": "hodlbod",
"license": "MIT",
"description": "Utilities for building dynamic nostr feeds.",
+10 -6
View File
@@ -79,7 +79,11 @@ export class FeedController {
}
})
listen = async () => (await this.getListener())()
listen = () => {
const promise = this.getListener().then(call)
return () => promise.then(call)
}
async _getRequestsLoader(requests: RequestItem[]) {
const seen = new Set()
@@ -389,7 +393,7 @@ export class FeedController {
return () => {
const unsubscribers = controllers.map(controller => controller.listen())
return () => unsubscribers.forEach(async p => call(await p))
return () => unsubscribers.forEach(call)
}
}
@@ -414,9 +418,9 @@ export class FeedController {
)
return () => {
const unsubscribers = controllers.map(controller => controller.listen())
const unsubscribers = controllers.map(controller => controller.listen())
return () => unsubscribers.forEach(async p => call(await p))
return () => unsubscribers.forEach(call)
}
}
@@ -438,9 +442,9 @@ export class FeedController {
)
return () => {
const unsubscribers = controllers.map(controller => controller.listen())
const unsubscribers = controllers.map(controller => controller.listen())
return () => unsubscribers.forEach(async p => call(await p))
return () => unsubscribers.forEach(call)
}
}
}
+10 -3
View File
@@ -192,10 +192,17 @@ export const feedsFromFilter = ({since, until, ...filter}: Filter) => {
return feeds
}
export const feedFromFilter = (filter: Filter) => makeIntersectionFeed(...feedsFromFilter(filter))
export const feedFromFilter = (filter: Filter) => {
const feeds = feedsFromFilter(filter)
export const feedFromFilters = (filters: Filter[]) =>
makeUnionFeed(...unionFilters(filters).map(filter => feedFromFilter(filter)))
return feeds.length === 1 ? feeds[0] : makeIntersectionFeed(...feeds)
}
export const feedFromFilters = (filters: Filter[]) => {
const feeds = unionFilters(filters).map(filter => feedFromFilter(filter))
return feeds.length === 1 ? feeds[0] : makeUnionFeed(...feeds)
}
export const walkFeed = (feed: Feed, visit: (feed: Feed) => void) => {
visit(feed)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/lib",
"version": "0.3.7",
"version": "0.3.8",
"author": "hodlbod",
"license": "MIT",
"description": "A collection of utilities.",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/net",
"version": "0.3.7",
"version": "0.3.8",
"author": "hodlbod",
"license": "MIT",
"description": "Utilities for connecting with nostr relays.",
+2 -2
View File
@@ -98,7 +98,7 @@ export const socketPolicyConnectOnSend = (socket: Socket) => {
const isClosed = [SocketStatus.Closed, SocketStatus.Error].includes(socket.status)
// When a new message is sent, make sure the socket is open (unless there was a recent error)
if (isClosed && lastError < ago(10)) {
if (isClosed && lastError < ago(5)) {
socket.open()
}
}),
@@ -157,7 +157,7 @@ export const socketPolicyReopenActive = (socket: Socket) => {
// If the socket closed and we have no error, reopen it but don't flap
if (isClosed && pending.size) {
sleep(Math.max(0, 10_000 - (Date.now() - lastOpen))).then(() => {
sleep(Math.max(0, 5000 - (Date.now() - lastOpen))).then(() => {
for (const message of pending.values()) {
socket.send(message)
}
+2 -2
View File
@@ -169,9 +169,9 @@ export type RequestOptions = BaseRequestOptions & {
export const request = async (options: RequestOptions) => {
const closed = new Set<string>()
const tracker = new Tracker()
const relays = new Set(options.relays)
const ctrl = new AbortController()
const relays = new Set(options.relays)
const tracker = options.tracker || new Tracker()
const signal = options.signal ? AbortSignal.any([options.signal, ctrl.signal]) : ctrl.signal
const threshold = options.threshold || 1
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/relay",
"version": "0.3.7",
"version": "0.3.8",
"author": "hodlbod",
"license": "MIT",
"description": "An in-memory nostr relay implementation.",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/router",
"version": "0.3.7",
"version": "0.3.8",
"author": "hodlbod",
"license": "MIT",
"description": "A collection of utilities for nostr relay selection.",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/signer",
"version": "0.3.7",
"version": "0.3.8",
"author": "hodlbod",
"license": "MIT",
"description": "A nostr signer implemenation supporting several login methods.",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/store",
"version": "0.3.7",
"version": "0.3.8",
"author": "hodlbod",
"license": "MIT",
"description": "A collection of utilities based on svelte/store for use with welshman",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/util",
"version": "0.3.7",
"version": "0.3.8",
"author": "hodlbod",
"license": "MIT",
"description": "A collection of nostr-related utilities.",
+4 -2
View File
@@ -178,9 +178,11 @@ export const EVENT_TIME = 31923
export const EVENT_RSVP = 31925
export const HANDLER_RECOMMENDATION = 31989
export const HANDLER_INFORMATION = 31990
export const ALERT_REQUEST_EMAIL = 32830
export const ALERT_EMAIL = 32830
export const ALERT_STATUS = 32831
export const ALERT_REQUEST_PUSH = 32832
export const ALERT_WEB = 32832
export const ALERT_ANDROID = 32833
export const ALERT_IOS = 32834
export const COMMUNITY = 34550
export const ROOM = 35834
export const ROOM_META = 39000