diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 03a4d58d..00000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = { - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/strict-type-checked", - "plugin:@typescript-eslint/stylistic", - "plugin:prettier/recommended", - ], - parser: "@typescript-eslint/parser", - parserOptions: { - project: "./tsconfig.json", - }, - ignorePatterns: ["node_modules/", "dist/", ".eslintrc.cjs"], - plugins: ["@typescript-eslint"], - root: true, - rules: { - "@typescript-eslint/no-unsafe-assignment": "off", - "@typescript-eslint/no-unsafe-argument": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/consistent-type-exports": "error", - "@typescript-eslint/consistent-type-imports": "error", - }, -}; diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index af7d3b67..00000000 --- a/.prettierrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "tabWidth": 4, - "useTabs": true, - "arrowParens": "avoid", - "bracketSameLine": true, - "bracketSpacing": true, - "jsxSingleQuote": false, - "trailingComma": "es5" -} diff --git a/build.ts b/build.ts index 8a470423..2389ce10 100644 --- a/build.ts +++ b/build.ts @@ -40,7 +40,7 @@ await $`mkdir -p dist/node_modules/@img`; await $`cp -r node_modules/@img/sharp-libvips-linux-* dist/node_modules/@img`; await $`cp -r node_modules/@img/sharp-linux-* dist/node_modules/@img`; -// Copy Vite build output to dist +// Copy Nuxt build output to dist await $`cp -r packages/frontend/.output dist/frontend`; // Copy the Bee Movie script from pages diff --git a/bun.lockb b/bun.lockb index b529c467..2905d7f8 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index f497853c..a03197fa 100644 --- a/package.json +++ b/package.json @@ -57,73 +57,47 @@ ], "devDependencies": { "@biomejs/biome": "1.6.4", - "@img/sharp-wasm32": "^0.33.3", - "@julr/unocss-preset-forms": "^0.1.0", - "@nuxtjs/seo": "^2.0.0-rc.10", - "@nuxtjs/tailwindcss": "^6.11.4", "@types/cli-table": "^0.3.4", "@types/html-to-text": "^9.0.4", "@types/ioredis": "^5.0.0", "@types/jsonld": "^1.5.13", "@types/mime-types": "^2.1.4", "@types/pg": "^8.11.5", - "@typescript-eslint/eslint-plugin": "latest", - "@unocss/cli": "latest", - "@unocss/transformer-directives": "^0.59.0", - "@vitejs/plugin-vue": "latest", - "@vueuse/head": "^2.0.0", - "activitypub-types": "^1.0.3", "bun-types": "latest", "drizzle-kit": "^0.20.14", - "shiki": "^1.2.4", - "typescript": "latest", - "unocss": "latest", - "untyped": "^1.4.2", - "vite": "^5.2.8", - "vite-ssr": "^0.17.1", - "vue": "^3.3.9", - "vue-router": "^4.2.5", - "vue-tsc": "latest" + "typescript": "latest" }, "peerDependencies": { "typescript": "^5.3.2" }, "dependencies": { - "@aws-sdk/client-s3": "^3.461.0", - "@iarna/toml": "^2.2.5", "@json2csv/plainjs": "^7.0.6", "blurhash": "^2.0.5", - "bullmq": "latest", + "bullmq": "^5.7.1", "chalk": "^5.3.0", "cli-parser": "workspace:*", "cli-table": "^0.3.11", "config-manager": "workspace:*", "drizzle-orm": "^0.30.7", - "eventemitter3": "^5.0.1", "extract-zip": "^2.0.1", "html-to-text": "^9.0.5", "ioredis": "^5.3.2", "ip-matching": "^2.1.2", "iso-639-1": "^3.1.0", "isomorphic-dompurify": "latest", - "jsonld": "^8.3.1", "linkify-html": "^4.1.3", "linkify-string": "^4.1.3", "linkifyjs": "^4.1.3", "log-manager": "workspace:*", "magic-regexp": "^0.8.0", - "marked": "latest", + "marked": "^12.0.1", "media-manager": "workspace:*", "megalodon": "^10.0.0", - "meilisearch": "latest", - "merge-deep-ts": "^1.2.6", + "meilisearch": "^0.38.0", "mime-types": "^2.1.35", - "next-route-matcher": "^1.0.1", "oauth4webapi": "^2.4.0", "pg": "^8.11.5", "request-parser": "workspace:*", - "semver": "^7.5.4", - "sharp": "^0.33.3", - "strip-ansi": "^7.1.0" + "sharp": "^0.33.3" } } diff --git a/packages/cli-parser/index.ts b/packages/cli-parser/index.ts index be0aabea..bb78107f 100644 --- a/packages/cli-parser/index.ts +++ b/packages/cli-parser/index.ts @@ -1,5 +1,4 @@ import chalk from "chalk"; -import strip from "strip-ansi"; import { type CliParameter, CliParameterType } from "./cli-builder.type"; export function startsWithArray(fullArray: string[], startArray: string[]) { diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 5c571c37..815aeb67 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -13,10 +13,13 @@ "c12": "^1.10.0", "nuxt": "^3.11.2", "vue": "^3.4.21", - "vue-router": "^4.3.0" + "vue-router": "^4.3.0", + "shiki": "^1.2.4" }, "devDependencies": { "@tailwindcss/forms": "^0.5.7", - "@vue-email/nuxt": "^0.8.19" + "@vue-email/nuxt": "^0.8.19", + "@nuxtjs/seo": "^2.0.0-rc.10", + "@nuxtjs/tailwindcss": "^6.11.4" } } diff --git a/plugins/test.plugin.ts b/plugins/test.plugin.ts deleted file mode 100644 index 1fee5f10..00000000 --- a/plugins/test.plugin.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Server } from "./types"; -import { HookTypes } from "./types"; - -const registerPlugin = (server: Server) => { - server.on(HookTypes.OnPostCreate, (req, newPost, author) => { - console.log("New post created!"); - console.log(`Post details: ${newPost.content} (${newPost.id})`); - console.log(`Made by ${author.username} (${author.id})`); - }); -}; - -export default registerPlugin; diff --git a/plugins/types.ts b/plugins/types.ts deleted file mode 100644 index 9cac4956..00000000 --- a/plugins/types.ts +++ /dev/null @@ -1,155 +0,0 @@ -import EventEmitter from "eventemitter3"; -import type { StatusWithRelations } from "~database/entities/Status"; -import type { UserWithRelations } from "~database/entities/User"; -import type { LysandObjectType } from "~types/lysand/Object"; - -export enum HookTypes { - /** - * Called before the server starts listening - */ - PreServe = "preServe", - /** - * Called after the server stops listening - */ - PostServe = "postServe", - /** - * Called on every HTTP request (before anything else is done) - */ - OnRequestReceive = "onRequestReceive", - /** - * Called on every HTTP request (after it is processed) - */ - OnRequestProcessed = "onRequestProcessed", - /** - * Called on every object received (before it is parsed and added to the database) - */ - OnObjectReceive = "onObjectReceive", - /** - * Called on every object processed (after it is parsed and added to the database) - */ - OnObjectProcessed = "onObjectProcessed", - /** - * Called when signature verification fails on an object - */ - OnCryptoFail = "onCryptoFail", - /** - * Called when signature verification succeeds on an object - */ - OnCryptoSuccess = "onCryptoSuccess", - /** - * Called when a user is banned by another user - */ - OnBan = "onBan", - /** - * Called when a user is suspended by another user - */ - OnSuspend = "onSuspend", - /** - * Called when a user is blocked by another user - */ - OnUserBlock = "onUserBlock", - /** - * Called when a user is muted by another user - */ - OnUserMute = "onUserMute", - /** - * Called when a user is followed by another user - */ - OnUserFollow = "onUserFollow", - /** - * Called when a user registers (before completing email verification) - */ - OnRegister = "onRegister", - /** - * Called when a user finishes registering (after completing email verification) - */ - OnRegisterFinish = "onRegisterFinish", - /** - * Called when a user deletes their account - */ - OnDeleteAccount = "onDeleteAccount", - /** - * Called when a post is created - */ - OnPostCreate = "onPostCreate", - /** - * Called when a post is deleted - */ - OnPostDelete = "onPostDelete", - /** - * Called when a post is updated - */ - OnPostUpdate = "onPostUpdate", -} - -export interface ServerStats { - postCount: number; -} - -interface ServerEvents { - [HookTypes.PreServe]: () => void; - [HookTypes.PostServe]: (stats: ServerStats) => void; - [HookTypes.OnRequestReceive]: (req: Request) => void; - [HookTypes.OnRequestProcessed]: (req: Request) => void; - [HookTypes.OnObjectReceive]: (obj: LysandObjectType) => void; - [HookTypes.OnObjectProcessed]: (obj: LysandObjectType) => void; - [HookTypes.OnCryptoFail]: ( - req: Request, - obj: LysandObjectType, - author: UserWithRelations, - publicKey: string, - ) => void; - [HookTypes.OnCryptoSuccess]: ( - req: Request, - obj: LysandObjectType, - author: UserWithRelations, - publicKey: string, - ) => void; - [HookTypes.OnBan]: ( - req: Request, - bannedUser: UserWithRelations, - banner: UserWithRelations, - ) => void; - [HookTypes.OnSuspend]: ( - req: Request, - suspendedUser: UserWithRelations, - suspender: UserWithRelations, - ) => void; - [HookTypes.OnUserBlock]: ( - req: Request, - blockedUser: UserWithRelations, - blocker: UserWithRelations, - ) => void; - [HookTypes.OnUserMute]: ( - req: Request, - mutedUser: UserWithRelations, - muter: UserWithRelations, - ) => void; - [HookTypes.OnUserFollow]: ( - req: Request, - followedUser: UserWithRelations, - follower: UserWithRelations, - ) => void; - [HookTypes.OnRegister]: (req: Request, newUser: UserWithRelations) => void; - [HookTypes.OnDeleteAccount]: ( - req: Request, - deletedUser: UserWithRelations, - ) => void; - [HookTypes.OnPostCreate]: ( - req: Request, - newPost: StatusWithRelations, - author: UserWithRelations, - ) => void; - [HookTypes.OnPostDelete]: ( - req: Request, - deletedPost: StatusWithRelations, - deleter: UserWithRelations, - ) => void; - [HookTypes.OnPostUpdate]: ( - req: Request, - updatedPost: StatusWithRelations, - updater: UserWithRelations, - ) => void; -} - -export class Server extends EventEmitter {} diff --git a/test.ts b/test.ts deleted file mode 100644 index 34ff1a95..00000000 --- a/test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { - anyOf, - char, - charIn, - charNotIn, - createRegExp, - digit, - exactly, - global, - letter, - maybe, - not, - oneOrMore, - whitespace, -} from "magic-regexp/further-magic"; - -const regexp = createRegExp( - exactly("@jesse") - .notBefore(anyOf(letter, digit, charIn("@"))) - .notAfter(anyOf(letter, digit, charIn("@"))), - [global], -); - -console.log(regexp); -console.log("@jessew@game cheese @jesse2 @jesse s".match(regexp)); diff --git a/uno.config.ts b/uno.config.ts deleted file mode 100644 index 18f92167..00000000 --- a/uno.config.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { presetForms } from "@julr/unocss-preset-forms"; -import transformerDirectives from "@unocss/transformer-directives"; - -import { - defineConfig, - presetTypography, - presetUno, - presetWebFonts, -} from "unocss"; - -export default defineConfig({ - presets: [ - presetUno(), - presetTypography({ - cssExtend: { - "h1,h2,h3,h4,h5.h6": { - "font-family": "'Poppins'", - }, - }, - }), - presetWebFonts(), - presetForms(), - ], - transformers: [transformerDirectives()], -}); diff --git a/utils/response.ts b/utils/response.ts index 10943bdd..c07d6457 100644 --- a/utils/response.ts +++ b/utils/response.ts @@ -1,6 +1,3 @@ -import type { APActivity, APObject } from "activitypub-types"; -import type { NodeObject } from "jsonld"; - export const response = ( data: BodyInit | null = null, status = 200, @@ -55,15 +52,6 @@ export const xmlResponse = (data: string, status = 200) => { }); }; -export const jsonLdResponse = ( - data: NodeObject | APActivity | APObject, - status = 200, -) => { - return response(JSON.stringify(data), status, { - "Content-Type": "application/activity+json", - }); -}; - export const errorResponse = (error: string, status = 500) => { return jsonResponse( {