refactor: ♻️ Rewrite build system to fit the monorepo architecture
Some checks failed
Mirror to Codeberg / Mirror (push) Failing after 0s
Test Publish / build (client) (push) Failing after 1s
Test Publish / build (sdk) (push) Failing after 0s

This commit is contained in:
Jesse Wierzbinski 2025-07-04 06:29:43 +02:00
parent 7de4b573e3
commit 90b6399407
No known key found for this signature in database
217 changed files with 2143 additions and 1858 deletions

View file

@ -9,6 +9,7 @@ import {
qsQuery,
} from "@versia-server/kit/api";
import { User } from "@versia-server/kit/db";
import { searchManager } from "@versia-server/kit/search";
import { Users } from "@versia-server/kit/tables";
import { and, eq, isNull } from "drizzle-orm";
import { describeRoute } from "hono-openapi";
@ -419,11 +420,14 @@ export default apiRoute((app) => {
);
}
await User.register(username, {
const user = await User.register(username, {
password,
email,
});
// Add to search index
await searchManager.addUser(user);
return context.text("", 200);
},
);

View file

@ -39,7 +39,7 @@ export default apiRoute((app) =>
const { user } = context.get("auth");
const note = context.get("note");
await user.like(note);
await note.like(user);
await note.reload(user.id);

View file

@ -110,7 +110,7 @@ export default apiRoute((app) => {
emoji = unicodeEmoji;
}
await user.react(note, emoji);
await note.react(user, emoji);
// Reload note to get updated reactions
await note.reload(user.id);
@ -204,7 +204,7 @@ export default apiRoute((app) => {
emoji = unicodeEmoji;
}
await user.unreact(note, emoji);
await note.unreact(user, emoji);
// Reload note to get updated reactions
await note.reload(user.id);

View file

@ -55,7 +55,7 @@ export default apiRoute((app) =>
const { user } = context.get("auth");
const note = context.get("note");
const reblog = await user.reblog(note, visibility);
const reblog = await note.reblog(user, visibility);
return context.json(await reblog.toApi(user), 200);
},

View file

@ -40,7 +40,7 @@ export default apiRoute((app) =>
const { user } = context.get("auth");
const note = context.get("note");
await user.unlike(note);
await note.unlike(user);
await note.reload(user.id);

View file

@ -40,7 +40,7 @@ export default apiRoute((app) =>
const { user } = context.get("auth");
const note = context.get("note");
await user.unreblog(note);
await note.unreblog(user);
const newNote = await Note.fromId(note.data.id, user.id);

View file

@ -11,12 +11,12 @@ import { ApiError } from "@versia-server/kit";
import { apiRoute, auth, handleZodError } from "@versia-server/kit/api";
import { db, Note, User } from "@versia-server/kit/db";
import { parseUserAddress } from "@versia-server/kit/parsers";
import { searchManager } from "@versia-server/kit/search";
import { Instances, Notes, Users } from "@versia-server/kit/tables";
import { and, eq, inArray, isNull, sql } from "drizzle-orm";
import { describeRoute } from "hono-openapi";
import { resolver, validator } from "hono-openapi/zod";
import { z } from "zod";
import { searchManager } from "~/classes/search/search-manager";
export default apiRoute((app) =>
app.get(