Skip to content

Commit

Permalink
update nostr-tools and use fine-grained imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Aug 19, 2024
1 parent 0aac58c commit 6946714
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"debounce": "^1.2.1",
"idb-keyval": "^6.2.1",
"mnemonist": "^0.39.8",
"nostr-tools": "^2.5.2",
"nostr-tools": "^2.7.2",
"svelte-asciidoc": "^0.0.2"
}
}
2 changes: 1 addition & 1 deletion src/cards/Article.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { onDestroy, onMount } from 'svelte';
import type { Event, EventTemplate, NostrEvent } from 'nostr-tools';
import type { Event, EventTemplate, NostrEvent } from 'nostr-tools/pure';
import { naddrEncode } from 'nostr-tools/nip19';
import { account, reactionKind, _pool, wikiKind, signer } from '$lib/nostr';
Expand Down
7 changes: 4 additions & 3 deletions src/cards/Editor.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<script lang="ts">
import type { EventTemplate } from 'nostr-tools/pure';
import { onMount } from 'svelte';
import SvelteAsciidoc from 'svelte-asciidoc';
import ArticleContent from '$components/ArticleContent.svelte';
import WikilinkComponent from '$components/WikilinkComponent.svelte';
import { DEFAULT_WIKI_RELAYS } from '$lib/defaults';
Expand All @@ -13,9 +17,6 @@
unique,
urlWithoutScheme
} from '$lib/utils';
import type { EventTemplate } from 'nostr-tools';
import { onMount } from 'svelte';
import SvelteAsciidoc from 'svelte-asciidoc';
export let replaceSelf: (card: Card) => void;
export let card: Card;
Expand Down
2 changes: 1 addition & 1 deletion src/cards/Relay.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { onMount } from 'svelte';
import { debounce } from 'debounce';
import type { NostrEvent } from 'nostr-tools';
import type { NostrEvent } from 'nostr-tools/pure';
import type { ArticleCard, Card } from '$lib/types';
import { addUniqueTaggedReplaceable, getTagOr, next, urlWithoutScheme } from '$lib/utils';
Expand Down
3 changes: 2 additions & 1 deletion src/cards/Search.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<script lang="ts">
import { onDestroy, onMount } from 'svelte';
import { debounce } from 'debounce';
import type { AbstractRelay, Event, NostrEvent, SubCloser } from 'nostr-tools';
import type { NostrEvent, Event } from 'nostr-tools/pure';
import type { AbstractRelay, NostrEvent, SubCloser } from 'nostr-tools/abstract-relay';
import { _pool, wot, wikiKind, userWikiRelays } from '$lib/nostr';
import type { ArticleCard, SearchCard, Card } from '$lib/types';
Expand Down
2 changes: 1 addition & 1 deletion src/cards/User.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { onMount } from 'svelte';
import { debounce } from 'debounce';
import type { NostrEvent } from 'nostr-tools';
import type { NostrEvent } from 'nostr-tools/pure';
import type { ArticleCard, Card } from '$lib/types';
import { addUniqueTaggedReplaceable, getTagOr, next } from '$lib/utils';
Expand Down
2 changes: 1 addition & 1 deletion src/cards/Welcome.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { debounce } from 'debounce';
import { onDestroy } from 'svelte';
import type { SubCloser } from 'nostr-tools/abstract-pool';
import type { AbstractRelay } from 'nostr-tools/abstract-relay';
import type { Event, NostrEvent } from 'nostr-tools/pure';
import {
Expand All @@ -18,7 +19,6 @@
import { subscribeAllOutbox } from '$lib/outbox';
import ArticleListItem from '$components/ArticleListItem.svelte';
import RelayItem from '$components/RelayItem.svelte';
import type { AbstractRelay } from 'nostr-tools';
import { DEFAULT_WIKI_RELAYS } from '$lib/defaults';
export let createChild: (card: Card) => void;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ArticleContent.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { NostrEvent } from 'nostr-tools';
import type { NostrEvent } from 'nostr-tools/pure';
import SvelteAsciidoc from 'svelte-asciidoc';
import WikilinkComponent from './WikilinkComponent.svelte';
import type { Card } from '$lib/types';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ArticleListItem.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { NostrEvent } from 'nostr-tools';
import type { NostrEvent } from 'nostr-tools/pure';
import UserLabel from './UserLabel.svelte';
import { formatDate } from '$lib/utils';
Expand Down
3 changes: 2 additions & 1 deletion src/lib/outbox.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Filter, SubCloser, SubscribeManyParams } from 'nostr-tools';
import type { Filter } from 'nostr-tools/filter';
import type { SubCloser, SubscribeManyParams } from 'nostr-tools/pool';
import { loadRelayList } from './lists';
import { _pool } from './nostr';
import { normalizeURL } from 'nostr-tools/utils';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NostrEvent } from 'nostr-tools';
import type { NostrEvent } from 'nostr-tools/pure';

export type EditorData = {
title: string;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NostrEvent } from 'nostr-tools';
import type { NostrEvent } from 'nostr-tools/pure';
import LRUCache from 'mnemonist/lru-cache';
import type { CacheMap } from 'dataloader';

Expand Down

0 comments on commit 6946714

Please sign in to comment.