mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor: 🚚 Organize code into sub-packages, instead of a single large package
This commit is contained in:
parent
79742f47dc
commit
a6d3ebbeef
366 changed files with 942 additions and 833 deletions
|
|
@ -3,9 +3,9 @@ import { friendlyErrorPlugin } from "@clerc/plugin-friendly-error";
|
|||
import { helpPlugin } from "@clerc/plugin-help";
|
||||
import { notFoundPlugin } from "@clerc/plugin-not-found";
|
||||
import { versionPlugin } from "@clerc/plugin-version";
|
||||
import { setupDatabase } from "@versia/kit/db";
|
||||
import { Clerc } from "clerc";
|
||||
import { searchManager } from "~/classes/search/search-manager.ts";
|
||||
import { setupDatabase } from "~/drizzle/db.ts";
|
||||
import pkg from "~/package.json" with { type: "json" };
|
||||
import { rebuildIndexCommand } from "./index/rebuild.ts";
|
||||
import { refetchInstanceCommand } from "./instance/refetch.ts";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { config } from "@versia-server/config";
|
||||
// @ts-expect-error - Root import is required or the Clec type definitions won't work
|
||||
// biome-ignore lint/correctness/noUnusedImports: Root import is required or the Clec type definitions won't work
|
||||
import { defineCommand, type Root } from "clerc";
|
||||
|
|
@ -6,7 +7,6 @@ import {
|
|||
SonicIndexType,
|
||||
searchManager,
|
||||
} from "~/classes/search/search-manager.ts";
|
||||
import { config } from "~/config.ts";
|
||||
|
||||
export const rebuildIndexCommand = defineCommand(
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { Instance } from "@versia/kit/db";
|
||||
import { Instances } from "@versia/kit/tables";
|
||||
import chalk from "chalk";
|
||||
// @ts-expect-error - Root import is required or the Clec type definitions won't work
|
||||
// biome-ignore lint/correctness/noUnusedImports: Root import is required or the Clec type definitions won't work
|
||||
import { defineCommand, type Root } from "clerc";
|
||||
import { eq } from "drizzle-orm";
|
||||
import { Instance } from "~/classes/database/instance.ts";
|
||||
import { FetchJobType, fetchQueue } from "~/classes/queues/fetch.ts";
|
||||
import { Instances } from "~/drizzle/schema.ts";
|
||||
|
||||
export const refetchInstanceCommand = defineCommand(
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { User } from "@versia/kit/db";
|
||||
import { Users } from "@versia/kit/tables";
|
||||
import { config } from "@versia-server/config";
|
||||
import chalk from "chalk";
|
||||
// @ts-expect-error - Root import is required or the Clec type definitions won't work
|
||||
// biome-ignore lint/correctness/noUnusedImports: Root import is required or the Clec type definitions won't work
|
||||
import { defineCommand, type Root } from "clerc";
|
||||
import { and, eq, isNull } from "drizzle-orm";
|
||||
import { renderUnicodeCompact } from "uqr";
|
||||
import { User } from "~/classes/database/user";
|
||||
import { config } from "~/config";
|
||||
import { Users } from "~/drizzle/schema";
|
||||
|
||||
export const createUserCommand = defineCommand(
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { User } from "@versia/kit/db";
|
||||
import chalk from "chalk";
|
||||
// @ts-expect-error - Root import is required or the Clec type definitions won't work
|
||||
// biome-ignore lint/correctness/noUnusedImports: Root import is required or the Clec type definitions won't work
|
||||
import { defineCommand, type Root } from "clerc";
|
||||
import ora from "ora";
|
||||
import { User } from "~/classes/database/user.ts";
|
||||
import { retrieveUser } from "../utils.ts";
|
||||
|
||||
export const refetchUserCommand = defineCommand(
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { Token } from "@versia/kit/db";
|
||||
import { randomUUIDv7 } from "bun";
|
||||
import chalk from "chalk";
|
||||
// @ts-expect-error - Root import is required or the Clec type definitions won't work
|
||||
// biome-ignore lint/correctness/noUnusedImports: Root import is required or the Clec type definitions won't work
|
||||
import { defineCommand, type Root } from "clerc";
|
||||
import { randomString } from "@/math.ts";
|
||||
import { Token } from "~/classes/database/token.ts";
|
||||
import { retrieveUser } from "../utils.ts";
|
||||
|
||||
export const generateTokenCommand = defineCommand(
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import { Instance, User } from "@versia/kit/db";
|
||||
import { Users } from "@versia/kit/tables";
|
||||
import { and, eq, isNull } from "drizzle-orm";
|
||||
import { parseUserAddress } from "@/api";
|
||||
import { Instance } from "~/classes/database/instance";
|
||||
import { User } from "~/classes/database/user";
|
||||
import { Users } from "~/drizzle/schema";
|
||||
|
||||
export const retrieveUser = async (
|
||||
usernameOrHandle: string,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue