chore: remove biome
This commit is contained in:
parent
b5e8d82bfa
commit
a34e215202
11 changed files with 55 additions and 65 deletions
BIN
bun.lockb
BIN
bun.lockb
Binary file not shown.
10
package.json
10
package.json
|
|
@ -4,12 +4,12 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "bun run --watch src/index.tsx",
|
"dev": "bun run --watch src/index.tsx",
|
||||||
"hot": "bun run --hot src/index.tsx",
|
"hot": "bun run --hot src/index.tsx",
|
||||||
"format": "biome format --write ./src",
|
"format": "eslint --fix ./src",
|
||||||
"build": "postcss ./src/main.css -o ./src/public/generated.css",
|
"build": "postcss ./src/main.css -o ./src/public/generated.css",
|
||||||
"lint": "run-p 'lint:*'",
|
"lint": "run-p 'lint:*'",
|
||||||
"lint:tsc": "tsc --noEmit",
|
"lint:tsc": "tsc --noEmit",
|
||||||
"lint:knip": "knip",
|
"lint:knip": "knip",
|
||||||
"lint:biome": "biome lint --error-on-warnings ./src"
|
"lint:eslint": "eslint ./src",
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@elysiajs/cookie": "^0.8.0",
|
"@elysiajs/cookie": "^0.8.0",
|
||||||
|
|
@ -24,7 +24,6 @@
|
||||||
"start": "bun run src/index.tsx"
|
"start": "bun run src/index.tsx"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "1.9.3",
|
|
||||||
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
||||||
"@eslint/compat": "^1.1.1",
|
"@eslint/compat": "^1.1.1",
|
||||||
"@eslint/js": "^9.11.1",
|
"@eslint/js": "^9.11.1",
|
||||||
|
|
@ -60,8 +59,5 @@
|
||||||
"tailwindcss": "^3.4.13",
|
"tailwindcss": "^3.4.13",
|
||||||
"typescript": "^5.6.2",
|
"typescript": "^5.6.2",
|
||||||
"typescript-eslint": "^8.7.0"
|
"typescript-eslint": "^8.7.0"
|
||||||
},
|
}
|
||||||
"trustedDependencies": [
|
|
||||||
"@biomejs/biome"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
@ -116,8 +116,8 @@ export async function convert(
|
||||||
fileType: string,
|
fileType: string,
|
||||||
convertTo: string,
|
convertTo: string,
|
||||||
targetPath: string,
|
targetPath: string,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
options?: any,
|
options?: unknown,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
// let command = "ffmpeg";
|
// let command = "ffmpeg";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -689,7 +689,6 @@ export async function convert(
|
||||||
fileType: string,
|
fileType: string,
|
||||||
convertTo: string,
|
convertTo: string,
|
||||||
targetPath: string,
|
targetPath: string,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
||||||
options?: any,
|
options?: any,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const command = `ffmpeg -i "${filePath}" "${targetPath}"`;
|
const command = `ffmpeg -i "${filePath}" "${targetPath}"`;
|
||||||
|
|
|
||||||
|
|
@ -313,8 +313,8 @@ export function convert(
|
||||||
fileType: string,
|
fileType: string,
|
||||||
convertTo: string,
|
convertTo: string,
|
||||||
targetPath: string,
|
targetPath: string,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
options?: any,
|
options?: unknown,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
exec(
|
exec(
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,8 @@ export function convert(
|
||||||
fileType: string,
|
fileType: string,
|
||||||
convertTo: string,
|
convertTo: string,
|
||||||
targetPath: string,
|
targetPath: string,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
options?: any,
|
options?: unknown,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
let tool = "";
|
let tool = "";
|
||||||
if (fileType === "jxl") {
|
if (fileType === "jxl") {
|
||||||
|
|
|
||||||
|
|
@ -1,67 +1,65 @@
|
||||||
import {
|
import { normalizeFiletype } from "../helpers/normalizeFiletype";
|
||||||
convert as convertImage,
|
|
||||||
properties as propertiesImage
|
|
||||||
} from "./vips";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
convert as convertPandoc,
|
convert as convertassimp,
|
||||||
properties as propertiesPandoc,
|
properties as propertiesassimp,
|
||||||
} from "./pandoc";
|
} from "./assimp";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
convert as convertFFmpeg,
|
convert as convertFFmpeg,
|
||||||
properties as propertiesFFmpeg,
|
properties as propertiesFFmpeg,
|
||||||
} from "./ffmpeg";
|
} from "./ffmpeg";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
convert as convertGraphicsmagick,
|
convert as convertGraphicsmagick,
|
||||||
properties as propertiesGraphicsmagick,
|
properties as propertiesGraphicsmagick,
|
||||||
} from "./graphicsmagick";
|
} from "./graphicsmagick";
|
||||||
|
import {
|
||||||
|
convert as convertLibjxl,
|
||||||
|
properties as propertiesLibjxl,
|
||||||
|
} from "./libjxl";
|
||||||
|
import {
|
||||||
|
convert as convertPandoc,
|
||||||
|
properties as propertiesPandoc,
|
||||||
|
} from "./pandoc";
|
||||||
|
import {
|
||||||
|
convert as convertresvg,
|
||||||
|
properties as propertiesresvg,
|
||||||
|
} from "./resvg";
|
||||||
|
import { convert as convertImage, properties as propertiesImage } from "./vips";
|
||||||
import {
|
import {
|
||||||
convert as convertxelatex,
|
convert as convertxelatex,
|
||||||
properties as propertiesxelatex,
|
properties as propertiesxelatex,
|
||||||
} from "./xelatex";
|
} from "./xelatex";
|
||||||
|
|
||||||
import {
|
|
||||||
convert as convertLibjxl,
|
|
||||||
properties as propertiesLibjxl,
|
|
||||||
} from "./libjxl";
|
|
||||||
|
|
||||||
import {
|
|
||||||
convert as convertresvg,
|
|
||||||
properties as propertiesresvg,
|
|
||||||
} from "./resvg";
|
|
||||||
|
|
||||||
import {
|
|
||||||
convert as convertassimp,
|
|
||||||
properties as propertiesassimp,
|
|
||||||
} from "./assimp";
|
|
||||||
|
|
||||||
import { normalizeFiletype } from "../helpers/normalizeFiletype";
|
|
||||||
|
|
||||||
// This should probably be reconstructed so that the functions are not imported instead the functions hook into this to make the converters more modular
|
// This should probably be reconstructed so that the functions are not imported instead the functions hook into this to make the converters more modular
|
||||||
|
|
||||||
const properties: Record<string, {
|
const properties: Record<
|
||||||
|
string,
|
||||||
|
{
|
||||||
properties: {
|
properties: {
|
||||||
from: Record<string, string[]>;
|
from: Record<string, string[]>;
|
||||||
to: Record<string, string[]>;
|
to: Record<string, string[]>;
|
||||||
options?: Record<string, Record<string, {
|
options?: Record<
|
||||||
|
string,
|
||||||
|
Record<
|
||||||
|
string,
|
||||||
|
{
|
||||||
description: string;
|
description: string;
|
||||||
type: string;
|
type: string;
|
||||||
default: number;
|
default: number;
|
||||||
}>>;
|
}
|
||||||
|
>
|
||||||
|
>;
|
||||||
};
|
};
|
||||||
converter: (
|
converter: (
|
||||||
filePath: string,
|
filePath: string,
|
||||||
fileType: string,
|
fileType: string,
|
||||||
convertTo: string,
|
convertTo: string,
|
||||||
targetPath: string,
|
targetPath: string,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
options?: any,
|
options?: unknown,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
) => any;
|
) => any;
|
||||||
}> = {
|
}
|
||||||
|
> = {
|
||||||
libjxl: {
|
libjxl: {
|
||||||
properties: propertiesLibjxl,
|
properties: propertiesLibjxl,
|
||||||
converter: convertLibjxl,
|
converter: convertLibjxl,
|
||||||
|
|
@ -99,16 +97,16 @@ const properties: Record<string, {
|
||||||
export async function mainConverter(
|
export async function mainConverter(
|
||||||
inputFilePath: string,
|
inputFilePath: string,
|
||||||
fileTypeOriginal: string,
|
fileTypeOriginal: string,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
convertTo: any,
|
convertTo: any,
|
||||||
targetPath: string,
|
targetPath: string,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
options?: any,
|
options?: unknown,
|
||||||
converterName?: string,
|
converterName?: string,
|
||||||
) {
|
) {
|
||||||
const fileType = normalizeFiletype(fileTypeOriginal);
|
const fileType = normalizeFiletype(fileTypeOriginal);
|
||||||
|
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
let converterFunc: any;
|
let converterFunc: any;
|
||||||
// let converterName = converterName;
|
// let converterName = converterName;
|
||||||
|
|
||||||
|
|
@ -116,7 +114,6 @@ export async function mainConverter(
|
||||||
converterFunc = properties[converterName]?.converter;
|
converterFunc = properties[converterName]?.converter;
|
||||||
} else {
|
} else {
|
||||||
// Iterate over each converter in properties
|
// Iterate over each converter in properties
|
||||||
// biome-ignore lint/style/noParameterAssign: <explanation>
|
|
||||||
for (converterName in properties) {
|
for (converterName in properties) {
|
||||||
const converterObj = properties[converterName];
|
const converterObj = properties[converterName];
|
||||||
|
|
||||||
|
|
@ -190,9 +187,7 @@ for (const converterName in properties) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getPossibleTargets = (
|
export const getPossibleTargets = (from: string): Record<string, string[]> => {
|
||||||
from: string,
|
|
||||||
): Record<string, string[]> => {
|
|
||||||
const fromClean = normalizeFiletype(from);
|
const fromClean = normalizeFiletype(from);
|
||||||
|
|
||||||
return possibleTargets[fromClean] || {};
|
return possibleTargets[fromClean] || {};
|
||||||
|
|
|
||||||
|
|
@ -124,8 +124,8 @@ export function convert(
|
||||||
fileType: string,
|
fileType: string,
|
||||||
convertTo: string,
|
convertTo: string,
|
||||||
targetPath: string,
|
targetPath: string,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
options?: any,
|
options?: unknown,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
// set xelatex here
|
// set xelatex here
|
||||||
const xelatex = ["pdf", "latex"];
|
const xelatex = ["pdf", "latex"];
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ export function convert(
|
||||||
fileType: string,
|
fileType: string,
|
||||||
convertTo: string,
|
convertTo: string,
|
||||||
targetPath: string,
|
targetPath: string,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
options?: any,
|
options?: unknown,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
exec(`resvg "${filePath}" "${targetPath}"`, (error, stdout, stderr) => {
|
exec(`resvg "${filePath}" "${targetPath}"`, (error, stdout, stderr) => {
|
||||||
|
|
|
||||||
|
|
@ -94,8 +94,8 @@ export function convert(
|
||||||
fileType: string,
|
fileType: string,
|
||||||
convertTo: string,
|
convertTo: string,
|
||||||
targetPath: string,
|
targetPath: string,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
options?: any,
|
options?: unknown,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
// if (fileType === "svg") {
|
// if (fileType === "svg") {
|
||||||
// const scale = options.scale || 1;
|
// const scale = options.scale || 1;
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ export function convert(
|
||||||
fileType: string,
|
fileType: string,
|
||||||
convertTo: string,
|
convertTo: string,
|
||||||
targetPath: string,
|
targetPath: string,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
options?: any,
|
options?: unknown,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// const fileName: string = (targetPath.split("/").pop() as string).replace(".pdf", "")
|
// const fileName: string = (targetPath.split("/").pop() as string).replace(".pdf", "")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue