A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
refactor: Move the shared types to the shared package
MohamedBassemdeba31ee010f
diff --git a/apps/cli/commands/bookmarks.ts b/apps/cli/commands/bookmarks.tsindex 1727db22..55c87b05 100644--- a/apps/cli/commands/bookmarks.ts+++ b/apps/cli/commands/bookmarks.ts@@ -3,7 +3,7 @@ import { Command } from "@commander-js/extra-typings";import chalk from "chalk";import { getAPIClient } from "lib/trpc";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";export const bookmarkCmd = new Command().name("bookmarks")diff --git a/apps/cli/package.json b/apps/cli/package.jsonindex 44f7e451..05ab0d0f 100644--- a/apps/cli/package.json+++ b/apps/cli/package.json@@ -6,6 +6,7 @@"dependencies": {"@commander-js/extra-typings": "^12.0.1","@hoarder/trpc": "workspace:^0.1.0",+ "@hoarder/shared": "workspace:^0.1.0","@hoarder/tsconfig": "workspace:^0.1.0","@tsconfig/node21": "^21.0.1","tsx": "^4.7.1",diff --git a/apps/mobile/app/sharing.tsx b/apps/mobile/app/sharing.tsxindex bbeaeeee..7624474a 100644--- a/apps/mobile/app/sharing.tsx+++ b/apps/mobile/app/sharing.tsx@@ -7,7 +7,7 @@ import { api } from "@/lib/trpc";import { useUploadAsset } from "@/lib/upload";import { z } from "zod";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";type Mode =| { type: "idle" }diff --git a/apps/mobile/components/bookmarks/BookmarkCard.tsx b/apps/mobile/components/bookmarks/BookmarkCard.tsxindex 9e5febe3..6662e76a 100644--- a/apps/mobile/components/bookmarks/BookmarkCard.tsx+++ b/apps/mobile/components/bookmarks/BookmarkCard.tsx@@ -16,7 +16,7 @@ import { api } from "@/lib/trpc";import { MenuView } from "@react-native-menu/menu";import { Ellipsis, Star } from "lucide-react-native";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";import {useDeleteBookmark,useUpdateBookmark,diff --git a/apps/mobile/components/bookmarks/BookmarkList.tsx b/apps/mobile/components/bookmarks/BookmarkList.tsxindex 3ad23072..f24143a7 100644--- a/apps/mobile/components/bookmarks/BookmarkList.tsx+++ b/apps/mobile/components/bookmarks/BookmarkList.tsx@@ -3,7 +3,7 @@ import { ActivityIndicator, Keyboard, Text, View } from "react-native";import Animated, { LinearTransition } from "react-native-reanimated";import { useScrollToTop } from "@react-navigation/native";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";import BookmarkCard from "./BookmarkCard";diff --git a/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx b/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsxindex efc0d5e7..33ddf5ff 100644--- a/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx+++ b/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx@@ -1,7 +1,7 @@import { Text } from "react-native";import { api } from "@/lib/trpc";-import type { ZGetBookmarksRequest } from "@hoarder/trpc/types/bookmarks";+import type { ZGetBookmarksRequest } from "@hoarder/shared/types/bookmarks";import FullPageSpinner from "../ui/FullPageSpinner";import BookmarkList from "./BookmarkList";diff --git a/apps/mobile/lib/upload.ts b/apps/mobile/lib/upload.tsindex f9d05967..9eb40e01 100644--- a/apps/mobile/lib/upload.ts+++ b/apps/mobile/lib/upload.ts@@ -1,10 +1,10 @@import { useMutation } from "@tanstack/react-query";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";import {zUploadErrorSchema,zUploadResponseSchema,-} from "@hoarder/trpc/types/uploads";+} from "@hoarder/shared/types/uploads";import type { Settings } from "./settings";import { api } from "./trpc";diff --git a/apps/mobile/package.json b/apps/mobile/package.jsonindex 248f1f53..ef19bfbf 100644--- a/apps/mobile/package.json+++ b/apps/mobile/package.json@@ -14,6 +14,7 @@},"dependencies": {"@hoarder/trpc": "workspace:^0.1.0",+ "@hoarder/shared": "workspace:^0.1.0","@hoarder/shared-react": "workspace:^0.1.0","@react-native-menu/menu": "^0.9.1","@tanstack/react-query": "^5.24.8",diff --git a/apps/web/app/api/assets/route.ts b/apps/web/app/api/assets/route.tsindex 5b72033a..c77751d3 100644--- a/apps/web/app/api/assets/route.ts+++ b/apps/web/app/api/assets/route.ts@@ -1,7 +1,7 @@import { createContextFromRequest } from "@/server/api/client";import { TRPCError } from "@trpc/server";-import type { ZUploadResponse } from "@hoarder/trpc/types/uploads";+import type { ZUploadResponse } from "@hoarder/shared/types/uploads";import { saveAsset } from "@hoarder/shared/assetdb";import serverConfig from "@hoarder/shared/config";diff --git a/apps/web/components/dashboard/UploadDropzone.tsx b/apps/web/components/dashboard/UploadDropzone.tsxindex f6243885..be30a77f 100644--- a/apps/web/components/dashboard/UploadDropzone.tsx+++ b/apps/web/components/dashboard/UploadDropzone.tsx@@ -10,7 +10,7 @@ import { useCreateBookmarkWithPostHook } from "@hoarder/shared-react/hooks/bookmimport {zUploadErrorSchema,zUploadResponseSchema,-} from "@hoarder/trpc/types/uploads";+} from "@hoarder/shared/types/uploads";import LoadingSpinner from "../ui/spinner";import { toast } from "../ui/use-toast";diff --git a/apps/web/components/dashboard/bookmarks/AssetCard.tsx b/apps/web/components/dashboard/bookmarks/AssetCard.tsxindex ea0317aa..c9a43575 100644--- a/apps/web/components/dashboard/bookmarks/AssetCard.tsx+++ b/apps/web/components/dashboard/bookmarks/AssetCard.tsx@@ -7,7 +7,7 @@ import { api } from "@/lib/trpc";import type {ZBookmark,ZBookmarkTypeAsset,-} from "@hoarder/trpc/types/bookmarks";+} from "@hoarder/shared/types/bookmarks";import { BookmarkLayoutAdaptingCard } from "./BookmarkLayoutAdaptingCard";diff --git a/apps/web/components/dashboard/bookmarks/BookmarkActionBar.tsx b/apps/web/components/dashboard/bookmarks/BookmarkActionBar.tsxindex 420fed84..d4e8dfca 100644--- a/apps/web/components/dashboard/bookmarks/BookmarkActionBar.tsx+++ b/apps/web/components/dashboard/bookmarks/BookmarkActionBar.tsx@@ -3,7 +3,7 @@ import { Button } from "@/components/ui/button";import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";import { Maximize2 } from "lucide-react";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";import BookmarkOptions from "./BookmarkOptions";import { FavouritedActionIcon } from "./icons";diff --git a/apps/web/components/dashboard/bookmarks/BookmarkLayoutAdaptingCard.tsx b/apps/web/components/dashboard/bookmarks/BookmarkLayoutAdaptingCard.tsxindex 3d7b93f3..42c4db21 100644--- a/apps/web/components/dashboard/bookmarks/BookmarkLayoutAdaptingCard.tsx+++ b/apps/web/components/dashboard/bookmarks/BookmarkLayoutAdaptingCard.tsx@@ -9,7 +9,7 @@ import {import { cn } from "@/lib/utils";import dayjs from "dayjs";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";import BookmarkActionBar from "./BookmarkActionBar";import TagList from "./TagList";diff --git a/apps/web/components/dashboard/bookmarks/BookmarkOptions.tsx b/apps/web/components/dashboard/bookmarks/BookmarkOptions.tsxindex a8ec1ab5..6f07107b 100644--- a/apps/web/components/dashboard/bookmarks/BookmarkOptions.tsx+++ b/apps/web/components/dashboard/bookmarks/BookmarkOptions.tsx@@ -21,7 +21,10 @@ import {Trash2,} from "lucide-react";-import type { ZBookmark, ZBookmarkedLink } from "@hoarder/trpc/types/bookmarks";+import type {+ ZBookmark,+ ZBookmarkedLink,+} from "@hoarder/shared/types/bookmarks";import {useDeleteBookmark,useRecrawlBookmark,diff --git a/apps/web/components/dashboard/bookmarks/BookmarkedTextEditor.tsx b/apps/web/components/dashboard/bookmarks/BookmarkedTextEditor.tsxindex 294f2b5a..db69e1a3 100644--- a/apps/web/components/dashboard/bookmarks/BookmarkedTextEditor.tsx+++ b/apps/web/components/dashboard/bookmarks/BookmarkedTextEditor.tsx@@ -14,7 +14,7 @@ import { Textarea } from "@/components/ui/textarea";import { toast } from "@/components/ui/use-toast";import { api } from "@/lib/trpc";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";export function BookmarkedTextEditor({bookmark,diff --git a/apps/web/components/dashboard/bookmarks/Bookmarks.tsx b/apps/web/components/dashboard/bookmarks/Bookmarks.tsxindex 8aa723e9..6a9266b9 100644--- a/apps/web/components/dashboard/bookmarks/Bookmarks.tsx+++ b/apps/web/components/dashboard/bookmarks/Bookmarks.tsx@@ -3,7 +3,7 @@ import { Separator } from "@/components/ui/separator";import { api } from "@/server/api/client";import { getServerAuthSession } from "@/server/auth";-import type { ZGetBookmarksRequest } from "@hoarder/trpc/types/bookmarks";+import type { ZGetBookmarksRequest } from "@hoarder/shared/types/bookmarks";import UpdatableBookmarksGrid from "./UpdatableBookmarksGrid";diff --git a/apps/web/components/dashboard/bookmarks/BookmarksGrid.tsx b/apps/web/components/dashboard/bookmarks/BookmarksGrid.tsxindex 01f18815..b44dea33 100644--- a/apps/web/components/dashboard/bookmarks/BookmarksGrid.tsx+++ b/apps/web/components/dashboard/bookmarks/BookmarksGrid.tsx@@ -9,7 +9,7 @@ import { Slot } from "@radix-ui/react-slot";import Masonry from "react-masonry-css";import resolveConfig from "tailwindcss/resolveConfig";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";import AssetCard from "./AssetCard";import EditorCard from "./EditorCard";diff --git a/apps/web/components/dashboard/bookmarks/LinkCard.tsx b/apps/web/components/dashboard/bookmarks/LinkCard.tsxindex 6d51695d..ef0ae6f2 100644--- a/apps/web/components/dashboard/bookmarks/LinkCard.tsx+++ b/apps/web/components/dashboard/bookmarks/LinkCard.tsx@@ -7,7 +7,7 @@ import {} from "@/lib/bookmarkUtils";import { api } from "@/lib/trpc";-import type { ZBookmarkTypeLink } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmarkTypeLink } from "@hoarder/shared/types/bookmarks";import { BookmarkLayoutAdaptingCard } from "./BookmarkLayoutAdaptingCard";diff --git a/apps/web/components/dashboard/bookmarks/TagList.tsx b/apps/web/components/dashboard/bookmarks/TagList.tsxindex e0387bd2..ff63d110 100644--- a/apps/web/components/dashboard/bookmarks/TagList.tsx+++ b/apps/web/components/dashboard/bookmarks/TagList.tsx@@ -3,7 +3,7 @@ import { badgeVariants } from "@/components/ui/badge";import { Skeleton } from "@/components/ui/skeleton";import { cn } from "@/lib/utils";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";export default function TagList({bookmark,diff --git a/apps/web/components/dashboard/bookmarks/TagModal.tsx b/apps/web/components/dashboard/bookmarks/TagModal.tsxindex 6bc16a89..00cc40fc 100644--- a/apps/web/components/dashboard/bookmarks/TagModal.tsx+++ b/apps/web/components/dashboard/bookmarks/TagModal.tsx@@ -9,7 +9,7 @@ import {DialogTitle,} from "@/components/ui/dialog";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";import { TagsEditor } from "./TagsEditor";diff --git a/apps/web/components/dashboard/bookmarks/TagsEditor.tsx b/apps/web/components/dashboard/bookmarks/TagsEditor.tsxindex ab7dd754..ec1c3bfa 100644--- a/apps/web/components/dashboard/bookmarks/TagsEditor.tsx+++ b/apps/web/components/dashboard/bookmarks/TagsEditor.tsx@@ -6,8 +6,8 @@ import { cn } from "@/lib/utils";import { Sparkles } from "lucide-react";import CreateableSelect from "react-select/creatable";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";-import type { ZAttachedByEnum } from "@hoarder/trpc/types/tags";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";+import type { ZAttachedByEnum } from "@hoarder/shared/types/tags";import { useUpdateBookmarkTags } from "@hoarder/shared-react/hooks/bookmarks";interface EditableTag {diff --git a/apps/web/components/dashboard/bookmarks/TextCard.tsx b/apps/web/components/dashboard/bookmarks/TextCard.tsxindex e24108d2..9d5c8d8b 100644--- a/apps/web/components/dashboard/bookmarks/TextCard.tsx+++ b/apps/web/components/dashboard/bookmarks/TextCard.tsx@@ -7,7 +7,7 @@ import { bookmarkLayoutSwitch } from "@/lib/userLocalSettings/bookmarksLayout";import { cn } from "@/lib/utils";import Markdown from "react-markdown";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";import { BookmarkedTextViewer } from "./BookmarkedTextViewer";import { BookmarkLayoutAdaptingCard } from "./BookmarkLayoutAdaptingCard";diff --git a/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx b/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsxindex fe69201c..53524490 100644--- a/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx+++ b/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx@@ -6,7 +6,7 @@ import { api } from "@/lib/trpc";import type {ZGetBookmarksRequest,ZGetBookmarksResponse,-} from "@hoarder/trpc/types/bookmarks";+} from "@hoarder/shared/types/bookmarks";import { BookmarkGridContextProvider } from "@hoarder/shared-react/hooks/bookmark-grid-context";import BookmarksGrid from "./BookmarksGrid";diff --git a/apps/web/components/dashboard/lists/AllListsView.tsx b/apps/web/components/dashboard/lists/AllListsView.tsxindex 4159bc14..00e76a23 100644--- a/apps/web/components/dashboard/lists/AllListsView.tsx+++ b/apps/web/components/dashboard/lists/AllListsView.tsx@@ -7,7 +7,7 @@ import { api } from "@/lib/trpc";import { keepPreviousData } from "@tanstack/react-query";import { Plus } from "lucide-react";-import type { ZBookmarkList } from "@hoarder/trpc/types/lists";+import type { ZBookmarkList } from "@hoarder/shared/types/lists";function ListItem({name,diff --git a/apps/web/components/dashboard/lists/DeleteListButton.tsx b/apps/web/components/dashboard/lists/DeleteListButton.tsxindex ee2a9ec7..774b79ac 100644--- a/apps/web/components/dashboard/lists/DeleteListButton.tsx+++ b/apps/web/components/dashboard/lists/DeleteListButton.tsx@@ -8,7 +8,7 @@ import { toast } from "@/components/ui/use-toast";import { api } from "@/lib/trpc";import { Trash2 } from "lucide-react";-import type { ZBookmarkList } from "@hoarder/trpc/types/lists";+import type { ZBookmarkList } from "@hoarder/shared/types/lists";export default function DeleteListButton({ list }: { list: ZBookmarkList }) {const router = useRouter();diff --git a/apps/web/components/dashboard/preview/ActionBar.tsx b/apps/web/components/dashboard/preview/ActionBar.tsxindex d2048cad..ec659e35 100644--- a/apps/web/components/dashboard/preview/ActionBar.tsx+++ b/apps/web/components/dashboard/preview/ActionBar.tsx@@ -7,7 +7,7 @@ import {import { toast } from "@/components/ui/use-toast";import { Trash2 } from "lucide-react";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";import {useDeleteBookmark,useUpdateBookmark,diff --git a/apps/web/components/dashboard/preview/AssetContentSection.tsx b/apps/web/components/dashboard/preview/AssetContentSection.tsxindex 4a025f9d..94bd16ce 100644--- a/apps/web/components/dashboard/preview/AssetContentSection.tsx+++ b/apps/web/components/dashboard/preview/AssetContentSection.tsx@@ -1,6 +1,6 @@import Image from "next/image";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";export function AssetContentSection({ bookmark }: { bookmark: ZBookmark }) {if (bookmark.content.type != "asset") {diff --git a/apps/web/components/dashboard/preview/BookmarkPreview.tsx b/apps/web/components/dashboard/preview/BookmarkPreview.tsxindex 93f14c64..29e8e39a 100644--- a/apps/web/components/dashboard/preview/BookmarkPreview.tsx+++ b/apps/web/components/dashboard/preview/BookmarkPreview.tsx@@ -20,7 +20,7 @@ import dayjs from "dayjs";import relativeTime from "dayjs/plugin/relativeTime";import { CalendarDays, ExternalLink } from "lucide-react";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";import ActionBar from "./ActionBar";import { AssetContentSection } from "./AssetContentSection";diff --git a/apps/web/components/dashboard/preview/EditableTitle.tsx b/apps/web/components/dashboard/preview/EditableTitle.tsxindex 1500212d..071b3ca3 100644--- a/apps/web/components/dashboard/preview/EditableTitle.tsx+++ b/apps/web/components/dashboard/preview/EditableTitle.tsx@@ -11,7 +11,7 @@ import { toast } from "@/components/ui/use-toast";import { Check, Pencil, X } from "lucide-react";import { useUpdateBookmark } from "@hoarder/shared-react/hooks/bookmarks";-import { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import { ZBookmark } from "@hoarder/shared/types/bookmarks";interface Props {bookmarkId: string;diff --git a/apps/web/components/dashboard/preview/NoteEditor.tsx b/apps/web/components/dashboard/preview/NoteEditor.tsxindex 6011e89d..67da40cc 100644--- a/apps/web/components/dashboard/preview/NoteEditor.tsx+++ b/apps/web/components/dashboard/preview/NoteEditor.tsx@@ -2,7 +2,7 @@ import { Textarea } from "@/components/ui/textarea";import { toast } from "@/components/ui/use-toast";import { useClientConfig } from "@/lib/clientConfig";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";import { useUpdateBookmark } from "@hoarder/shared-react/hooks/bookmarks";export function NoteEditor({ bookmark }: { bookmark: ZBookmark }) {diff --git a/apps/web/components/dashboard/preview/TextContentSection.tsx b/apps/web/components/dashboard/preview/TextContentSection.tsxindex 35ee1b33..a73ad722 100644--- a/apps/web/components/dashboard/preview/TextContentSection.tsx+++ b/apps/web/components/dashboard/preview/TextContentSection.tsx@@ -1,7 +1,7 @@import { ScrollArea } from "@radix-ui/react-scroll-area";import Markdown from "react-markdown";-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";export function TextContentSection({ bookmark }: { bookmark: ZBookmark }) {let content;diff --git a/apps/web/components/dashboard/settings/ChangePassword.tsx b/apps/web/components/dashboard/settings/ChangePassword.tsxindex 5d9324e6..070caee8 100644--- a/apps/web/components/dashboard/settings/ChangePassword.tsx+++ b/apps/web/components/dashboard/settings/ChangePassword.tsx@@ -17,7 +17,7 @@ import { api } from "@/lib/trpc";import { zodResolver } from "@hookform/resolvers/zod";import { useForm } from "react-hook-form";-import { zChangePasswordSchema } from "@hoarder/trpc/types/users";+import { zChangePasswordSchema } from "@hoarder/shared/types/users";export function ChangePassword() {const form = useForm<z.infer<typeof zChangePasswordSchema>>({diff --git a/apps/web/components/dashboard/sidebar/AllLists.tsx b/apps/web/components/dashboard/sidebar/AllLists.tsxindex 2b38ed46..6ab42851 100644--- a/apps/web/components/dashboard/sidebar/AllLists.tsx+++ b/apps/web/components/dashboard/sidebar/AllLists.tsx@@ -4,7 +4,7 @@ import Link from "next/link";import { api } from "@/lib/trpc";import { Plus } from "lucide-react";-import type { ZBookmarkList } from "@hoarder/trpc/types/lists";+import type { ZBookmarkList } from "@hoarder/shared/types/lists";import NewListModal, { useNewListModal } from "./NewListModal";import SidebarItem from "./SidebarItem";diff --git a/apps/web/components/dashboard/tags/AllTagsView.tsx b/apps/web/components/dashboard/tags/AllTagsView.tsxindex 0f9ee823..73bfb7e6 100644--- a/apps/web/components/dashboard/tags/AllTagsView.tsx+++ b/apps/web/components/dashboard/tags/AllTagsView.tsx@@ -5,7 +5,7 @@ import InfoTooltip from "@/components/ui/info-tooltip";import { Separator } from "@/components/ui/separator";import { api } from "@/lib/trpc";-import type { ZGetTagResponse } from "@hoarder/trpc/types/tags";+import type { ZGetTagResponse } from "@hoarder/shared/types/tags";function TagPill({ name, count }: { name: string; count: number }) {return (diff --git a/apps/web/components/signin/CredentialsForm.tsx b/apps/web/components/signin/CredentialsForm.tsxindex 8d7136cb..07e08fae 100644--- a/apps/web/components/signin/CredentialsForm.tsx+++ b/apps/web/components/signin/CredentialsForm.tsx@@ -21,7 +21,7 @@ import { signIn } from "next-auth/react";import { useForm } from "react-hook-form";import { z } from "zod";-import { zSignUpSchema } from "@hoarder/trpc/types/users";+import { zSignUpSchema } from "@hoarder/shared/types/users";const signInSchema = z.object({email: z.string().email(),diff --git a/apps/web/lib/bookmarkUtils.tsx b/apps/web/lib/bookmarkUtils.tsxindex fbb7c7df..475ba383 100644--- a/apps/web/lib/bookmarkUtils.tsx+++ b/apps/web/lib/bookmarkUtils.tsx@@ -1,4 +1,4 @@-import type { ZBookmark } from "@hoarder/trpc/types/bookmarks";+import type { ZBookmark } from "@hoarder/shared/types/bookmarks";const MAX_LOADING_MSEC = 30 * 1000;diff --git a/packages/shared-react/hooks/bookmark-grid-context.tsx b/packages/shared-react/hooks/bookmark-grid-context.tsxindex 5814da12..7d71d28c 100644--- a/packages/shared-react/hooks/bookmark-grid-context.tsx+++ b/packages/shared-react/hooks/bookmark-grid-context.tsx@@ -2,7 +2,7 @@import { createContext, useContext } from "react";-import type { ZGetBookmarksRequest } from "@hoarder/trpc/types/bookmarks";+import type { ZGetBookmarksRequest } from "@hoarder/shared/types/bookmarks";export const BookmarkGridContext = createContext<ZGetBookmarksRequest | undefineddiff --git a/packages/shared-react/package.json b/packages/shared-react/package.jsonindex 5e0a1d23..1c8f4a51 100644--- a/packages/shared-react/package.json+++ b/packages/shared-react/package.json@@ -5,6 +5,7 @@"private": true,"dependencies": {"@hoarder/trpc": "workspace:^0.1.0",+ "@hoarder/shared": "workspace:^0.1.0","@tanstack/react-query": "^5.24.8","superjson": "^2.2.1","@trpc/client": "11.0.0-next-beta.308"diff --git a/packages/trpc/types/bookmarks.ts b/packages/shared/types/bookmarks.tssimilarity index 100%rename from packages/trpc/types/bookmarks.tsrename to packages/shared/types/bookmarks.tsdiff --git a/packages/trpc/types/lists.ts b/packages/shared/types/lists.tssimilarity index 92%rename from packages/trpc/types/lists.tsrename to packages/shared/types/lists.tsindex 4b0ccaca..e9d7eca0 100644--- a/packages/trpc/types/lists.ts+++ b/packages/shared/types/lists.ts@@ -4,6 +4,7 @@ export const zBookmarkListSchema = z.object({id: z.string(),name: z.string(),icon: z.string(),+ parentId: z.string().nullable(),});export const zBookmarkListWithBookmarksSchema = zBookmarkListSchema.merge(diff --git a/packages/trpc/types/tags.ts b/packages/shared/types/tags.tssimilarity index 100%rename from packages/trpc/types/tags.tsrename to packages/shared/types/tags.tsdiff --git a/packages/trpc/types/uploads.ts b/packages/shared/types/uploads.tssimilarity index 100%rename from packages/trpc/types/uploads.tsrename to packages/shared/types/uploads.tsdiff --git a/packages/trpc/types/users.ts b/packages/shared/types/users.tssimilarity index 100%rename from packages/trpc/types/users.tsrename to packages/shared/types/users.tsdiff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.tsindex a447235b..0383d3f2 100644--- a/packages/trpc/routers/bookmarks.ts+++ b/packages/trpc/routers/bookmarks.ts@@ -3,6 +3,11 @@ import { and, desc, eq, exists, inArray, lte, or } from "drizzle-orm";import invariant from "tiny-invariant";import { z } from "zod";+import type {+ ZBookmark,+ ZBookmarkContent,+} from "@hoarder/shared/types/bookmarks";+import type { ZBookmarkTags } from "@hoarder/shared/types/tags";import { db as DONT_USE_db } from "@hoarder/db";import {bookmarkAssets,@@ -20,11 +25,6 @@ import {SearchIndexingQueue,} from "@hoarder/shared/queues";import { getSearchIdxClient } from "@hoarder/shared/search";--import type { Context } from "../index";-import type { ZBookmark, ZBookmarkContent } from "../types/bookmarks";-import type { ZBookmarkTags } from "../types/tags";-import { authedProcedure, router } from "../index";import {DEFAULT_NUM_BOOKMARKS_PER_PAGE,zBareBookmarkSchema,@@ -33,7 +33,10 @@ import {zGetBookmarksResponseSchema,zNewBookmarkRequestSchema,zUpdateBookmarksRequestSchema,-} from "../types/bookmarks";+} from "@hoarder/shared/types/bookmarks";++import type { Context } from "../index";+import { authedProcedure, router } from "../index";export const ensureBookmarkOwnership = experimental_trpcMiddleware<{ctx: Context;diff --git a/packages/trpc/routers/lists.ts b/packages/trpc/routers/lists.tsindex fb6d8637..74b4f737 100644--- a/packages/trpc/routers/lists.ts+++ b/packages/trpc/routers/lists.ts@@ -4,10 +4,10 @@ import { z } from "zod";import { SqliteError } from "@hoarder/db";import { bookmarkLists, bookmarksInLists } from "@hoarder/db/schema";+import { zBookmarkListSchema } from "@hoarder/shared/types/lists";import type { Context } from "../index";import { authedProcedure, router } from "../index";-import { zBookmarkListSchema } from "../types/lists";import { ensureBookmarkOwnership } from "./bookmarks";export const ensureListOwnership = experimental_trpcMiddleware<{diff --git a/packages/trpc/routers/tags.ts b/packages/trpc/routers/tags.tsindex 53b72a23..ed4ac7d2 100644--- a/packages/trpc/routers/tags.ts+++ b/packages/trpc/routers/tags.ts@@ -2,12 +2,12 @@ import { experimental_trpcMiddleware, TRPCError } from "@trpc/server";import { and, count, eq } from "drizzle-orm";import { z } from "zod";+import type { ZAttachedByEnum } from "@hoarder/shared/types/tags";import { bookmarkTags, tagsOnBookmarks } from "@hoarder/db/schema";+import { zGetTagResponseSchema } from "@hoarder/shared/types/tags";import type { Context } from "../index";-import type { ZAttachedByEnum } from "../types/tags";import { authedProcedure, router } from "../index";-import { zGetTagResponseSchema } from "../types/tags";function conditionFromInput(input: { tagName: string } | { tagId: string },diff --git a/packages/trpc/routers/users.ts b/packages/trpc/routers/users.tsindex e7f0a59d..51f9429e 100644--- a/packages/trpc/routers/users.ts+++ b/packages/trpc/routers/users.ts@@ -7,6 +7,7 @@ import { SqliteError } from "@hoarder/db";import { users } from "@hoarder/db/schema";import { deleteUserAssets } from "@hoarder/shared/assetdb";import serverConfig from "@hoarder/shared/config";+import { zSignUpSchema } from "@hoarder/shared/types/users";import { hashPassword, validatePassword } from "../auth";import {@@ -15,7 +16,6 @@ import {publicProcedure,router,} from "../index";-import { zSignUpSchema } from "../types/users";export const usersAppRouter = router({create: publicProcedurediff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 49d2edde..d5c4915c 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -143,6 +143,9 @@ importers:'@commander-js/extra-typings':specifier: ^12.0.1version: 12.0.1([email protected])+ '@hoarder/shared':+ specifier: workspace:^0.1.0+ version: link:../../packages/shared'@hoarder/trpc':specifier: workspace:^0.1.0version: link:../../packages/trpc@@ -250,6 +253,9 @@ importers:apps/mobile:dependencies:+ '@hoarder/shared':+ specifier: workspace:^0.1.0+ version: link:../../packages/shared'@hoarder/shared-react':specifier: workspace:^0.1.0version: link:../../packages/shared-react@@ -796,6 +802,9 @@ importers:packages/shared-react:dependencies:+ '@hoarder/shared':+ specifier: workspace:^0.1.0+ version: link:../shared'@hoarder/trpc':specifier: workspace:^0.1.0version: link:../trpc