From d1fc79a5b468c0c1ba5fcf10d98ecd8fc294af03 Mon Sep 17 00:00:00 2001 From: BlowaterNostr Date: Thu, 28 Mar 2024 17:50:39 +0800 Subject: [PATCH] use submodule --- main.tsx | 10 +++------- resolvers/event.ts | 7 ++----- resolvers/policy.ts | 5 +---- resolvers/pubkey.ts | 2 +- ws.ts | 8 ++++---- 5 files changed, 11 insertions(+), 21 deletions(-) diff --git a/main.tsx b/main.tsx index b46b967..0f47396 100644 --- a/main.tsx +++ b/main.tsx @@ -4,13 +4,9 @@ import Error404 from "./routes/_404.tsx"; import { render } from "https://esm.sh/preact-render-to-string@6.4.1"; import { Mutation, RootResolver } from "./resolvers/root.ts"; import * as gql from "https://esm.sh/graphql@16.8.1"; -import { - NostrEvent, - NostrFilters, - verifyEvent, -} from "https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/nostr.ts"; -import { parseJSON } from "https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/_helper.ts"; -import { PublicKey } from "https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/key.ts"; +import { parseJSON } from "./nostr.ts/_helper.ts"; +import { PublicKey } from "./nostr.ts/key.ts"; +import { NostrEvent, NostrFilters, verifyEvent } from "./nostr.ts/nostr.ts"; const schema = gql.buildSchema(gql.print(typeDefs)); diff --git a/resolvers/event.ts b/resolvers/event.ts index 2c9c7aa..403a309 100644 --- a/resolvers/event.ts +++ b/resolvers/event.ts @@ -1,9 +1,6 @@ -import { - NostrEvent, - NostrKind, -} from "https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/nostr.ts"; import { kv } from "../main.tsx"; -import { PublicKey } from "https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/key.ts"; +import { PublicKey } from "../nostr.ts/key.ts"; +import { NostrEvent, NostrKind } from "../nostr.ts/nostr.ts"; import { pubkey_resolver } from "./pubkey.ts"; export type Actor = { diff --git a/resolvers/policy.ts b/resolvers/policy.ts index c5db7b8..c46fe5d 100644 --- a/resolvers/policy.ts +++ b/resolvers/policy.ts @@ -1,8 +1,5 @@ -import { - NostrEvent, - NostrKind, -} from "https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/nostr.ts"; import { kv } from "../main.tsx"; +import { NostrEvent, NostrKind } from "../nostr.ts/nostr.ts"; export async function Policies() { const list = kv.list({ prefix: ["policy"] }); diff --git a/resolvers/pubkey.ts b/resolvers/pubkey.ts index 69785fd..fdd5769 100644 --- a/resolvers/pubkey.ts +++ b/resolvers/pubkey.ts @@ -1,4 +1,4 @@ -import { PublicKey } from "https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/key.ts"; +import { PublicKey } from "../nostr.ts/key.ts"; import { EventsResolver } from "./event.ts"; export const pubkey_resolver = async (pubkey: PublicKey) => { diff --git a/ws.ts b/ws.ts index 68a8371..f4f6ef9 100644 --- a/ws.ts +++ b/ws.ts @@ -1,4 +1,6 @@ -import { PublicKey } from "https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/key.ts"; +import { PolicyResolver } from "./resolvers/policy.ts"; +import { EventResolver } from "./resolvers/event.ts"; +import { PublicKey } from "./nostr.ts/key.ts"; import { _RelayResponse_EOSE, _RelayResponse_Event, @@ -9,9 +11,7 @@ import { NostrEvent, NostrFilters, verifyEvent, -} from "https://raw.githubusercontent.com/BlowaterNostr/nostr.ts/main/nostr.ts"; -import { PolicyResolver } from "./resolvers/policy.ts"; -import { EventResolver } from "./resolvers/event.ts"; +} from "./nostr.ts/nostr.ts"; export const ws_handler = (connections: Map>) => (req: Request) => { if (req.headers.get("upgrade") != "websocket") {