mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor: 🚚 Explicitely add extensions to all imports
This commit is contained in:
parent
b5b7014c00
commit
b53307c824
99 changed files with 168 additions and 169 deletions
|
|
@ -2,7 +2,7 @@ import type { LikeExtension } from "@versia/federation/types";
|
|||
import { type InferSelectModel, and, eq } from "drizzle-orm";
|
||||
import { db } from "~/drizzle/db";
|
||||
import { Likes, Notifications } from "~/drizzle/schema";
|
||||
import { config } from "~/packages/config-manager/index";
|
||||
import { config } from "~/packages/config-manager/index.ts";
|
||||
import type { Note } from "~/packages/database-interface/note";
|
||||
import type { User } from "~/packages/database-interface/user";
|
||||
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ import { db } from "~/drizzle/db";
|
|||
import type { Notifications } from "~/drizzle/schema";
|
||||
import { Note } from "~/packages/database-interface/note";
|
||||
import { User } from "~/packages/database-interface/user";
|
||||
import type { StatusWithRelations } from "./status";
|
||||
import type { StatusWithRelations } from "./status.ts";
|
||||
import {
|
||||
type UserWithRelations,
|
||||
transformOutputToUserWithRelations,
|
||||
userExtrasTemplate,
|
||||
userRelations,
|
||||
} from "./user";
|
||||
} from "./user.ts";
|
||||
|
||||
export type Notification = InferSelectModel<typeof Notifications>;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,17 +31,17 @@ import {
|
|||
type Notes,
|
||||
Users,
|
||||
} from "~/drizzle/schema";
|
||||
import { config } from "~/packages/config-manager/index";
|
||||
import { config } from "~/packages/config-manager/index.ts";
|
||||
import type { EmojiWithInstance } from "~/packages/database-interface/emoji";
|
||||
import { User } from "~/packages/database-interface/user";
|
||||
import type { Application } from "./application";
|
||||
import type { Application } from "./application.ts";
|
||||
import {
|
||||
type UserWithInstance,
|
||||
type UserWithRelations,
|
||||
transformOutputToUserWithRelations,
|
||||
userExtrasTemplate,
|
||||
userRelations,
|
||||
} from "./user";
|
||||
} from "./user.ts";
|
||||
|
||||
export type Status = InferSelectModel<typeof Notes>;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ import {
|
|||
} from "~/drizzle/schema";
|
||||
import type { EmojiWithInstance } from "~/packages/database-interface/emoji";
|
||||
import { User } from "~/packages/database-interface/user";
|
||||
import type { Application } from "./application";
|
||||
import type { Token } from "./token";
|
||||
import type { Application } from "./application.ts";
|
||||
import type { Token } from "./token.ts";
|
||||
|
||||
export type UserType = InferSelectModel<typeof Users>;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ import {
|
|||
import { rm } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import type { Config } from "~/packages/config-manager/config.type";
|
||||
import type { getMediaHash } from "../media-hasher";
|
||||
import { DiskMediaDriver } from "./disk";
|
||||
import type { getMediaHash } from "../media-hasher.ts";
|
||||
import { DiskMediaDriver } from "./disk.ts";
|
||||
|
||||
describe("DiskMediaDriver", () => {
|
||||
let diskDriver: DiskMediaDriver;
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@
|
|||
import { rm } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import type { Config } from "~/packages/config-manager/config.type";
|
||||
import { getMediaHash } from "../media-hasher";
|
||||
import type { UploadedFileMetadata } from "../media-manager";
|
||||
import type { MediaDriver } from "./media-driver";
|
||||
import { getMediaHash } from "../media-hasher.ts";
|
||||
import type { UploadedFileMetadata } from "../media-manager.ts";
|
||||
import type { MediaDriver } from "./media-driver.ts";
|
||||
|
||||
/**
|
||||
* Implements the MediaDriver interface for disk storage.
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* @module MediaManager/Drivers
|
||||
*/
|
||||
|
||||
import type { UploadedFileMetadata } from "../media-manager";
|
||||
import type { UploadedFileMetadata } from "../media-manager.ts";
|
||||
|
||||
/**
|
||||
* Represents a media storage driver.
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
import { type Mock, beforeEach, describe, expect, it, mock } from "bun:test";
|
||||
import type { S3Client } from "@bradenmacdonald/s3-lite-client";
|
||||
import type { Config } from "~/packages/config-manager/config.type";
|
||||
import type { getMediaHash } from "../media-hasher";
|
||||
import { S3MediaDriver } from "./s3";
|
||||
import type { getMediaHash } from "../media-hasher.ts";
|
||||
import { S3MediaDriver } from "./s3.ts";
|
||||
|
||||
describe("S3MediaDriver", () => {
|
||||
let s3Driver: S3MediaDriver;
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
|
||||
import { S3Client } from "@bradenmacdonald/s3-lite-client";
|
||||
import type { Config } from "~/packages/config-manager/config.type";
|
||||
import { getMediaHash } from "../media-hasher";
|
||||
import type { UploadedFileMetadata } from "../media-manager";
|
||||
import type { MediaDriver } from "./media-driver";
|
||||
import { getMediaHash } from "../media-hasher.ts";
|
||||
import type { UploadedFileMetadata } from "../media-manager.ts";
|
||||
import type { MediaDriver } from "./media-driver.ts";
|
||||
|
||||
/**
|
||||
* Implements the MediaDriver interface for S3 storage.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@
|
|||
import { beforeEach, describe, expect, it, mock } from "bun:test";
|
||||
import type { Config } from "~/packages/config-manager/config.type";
|
||||
import { MediaBackendType } from "~/packages/config-manager/config.type";
|
||||
import { DiskMediaDriver } from "./drivers/disk";
|
||||
import { S3MediaDriver } from "./drivers/s3";
|
||||
import { MediaManager } from "./media-manager";
|
||||
import type { ImageConversionPreprocessor } from "./preprocessors/image-conversion";
|
||||
import { DiskMediaDriver } from "./drivers/disk.ts";
|
||||
import { S3MediaDriver } from "./drivers/s3.ts";
|
||||
import { MediaManager } from "./media-manager.ts";
|
||||
import type { ImageConversionPreprocessor } from "./preprocessors/image-conversion.ts";
|
||||
|
||||
describe("MediaManager", () => {
|
||||
let mediaManager: MediaManager;
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
*/
|
||||
|
||||
import type { Config } from "~/packages/config-manager/config.type";
|
||||
import { DiskMediaDriver } from "./drivers/disk";
|
||||
import type { MediaDriver } from "./drivers/media-driver";
|
||||
import { S3MediaDriver } from "./drivers/s3";
|
||||
import { BlurhashPreprocessor } from "./preprocessors/blurhash";
|
||||
import { ImageConversionPreprocessor } from "./preprocessors/image-conversion";
|
||||
import type { MediaPreprocessor } from "./preprocessors/media-preprocessor";
|
||||
import { DiskMediaDriver } from "./drivers/disk.ts";
|
||||
import type { MediaDriver } from "./drivers/media-driver.ts";
|
||||
import { S3MediaDriver } from "./drivers/s3.ts";
|
||||
import { BlurhashPreprocessor } from "./preprocessors/blurhash.ts";
|
||||
import { ImageConversionPreprocessor } from "./preprocessors/image-conversion.ts";
|
||||
import type { MediaPreprocessor } from "./preprocessors/media-preprocessor.ts";
|
||||
|
||||
/**
|
||||
* Manages media operations with support for different storage drivers and preprocessing plugins.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { beforeEach, describe, expect, it, mock } from "bun:test";
|
||||
import sharp from "sharp";
|
||||
import { BlurhashPreprocessor } from "./blurhash";
|
||||
import { BlurhashPreprocessor } from "./blurhash.ts";
|
||||
|
||||
describe("BlurhashPreprocessor", () => {
|
||||
let preprocessor: BlurhashPreprocessor;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { encode } from "blurhash";
|
||||
import sharp from "sharp";
|
||||
import type { MediaPreprocessor } from "./media-preprocessor";
|
||||
import type { MediaPreprocessor } from "./media-preprocessor.ts";
|
||||
|
||||
export class BlurhashPreprocessor implements MediaPreprocessor {
|
||||
public async process(
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { beforeEach, describe, expect, it } from "bun:test";
|
||||
import sharp from "sharp";
|
||||
import type { Config } from "~/packages/config-manager/config.type";
|
||||
import { ImageConversionPreprocessor } from "./image-conversion";
|
||||
import { ImageConversionPreprocessor } from "./image-conversion.ts";
|
||||
|
||||
describe("ImageConversionPreprocessor", () => {
|
||||
let preprocessor: ImageConversionPreprocessor;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import sharp from "sharp";
|
||||
import type { Config } from "~/packages/config-manager/config.type";
|
||||
import type { MediaPreprocessor } from "./media-preprocessor";
|
||||
import type { MediaPreprocessor } from "./media-preprocessor.ts";
|
||||
|
||||
/**
|
||||
* Supported input media formats.
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import {
|
|||
import { ZodError, type ZodTypeAny, z } from "zod";
|
||||
import { Plugin } from "~/packages/plugin-kit";
|
||||
import { type Manifest, manifestSchema } from "~/packages/plugin-kit/schema";
|
||||
import { PluginLoader } from "./loader";
|
||||
import { PluginLoader } from "./loader.ts";
|
||||
|
||||
const mockReaddir = jest.fn();
|
||||
const mockGetLogger = jest.fn(() => ({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue