chore: migrate to biomejs
This commit is contained in:
@@ -122,7 +122,7 @@ export function DeploymentDisplay({
|
||||
<a
|
||||
href="https://github.com/BennyKok/comfyui-deploy-next-example/blob/main/src/lib/comfy-deploy.ts"
|
||||
className="text-blue-500 hover:underline"
|
||||
target="_blank"
|
||||
target="_blank" rel="noreferrer"
|
||||
>
|
||||
here
|
||||
</a>
|
||||
|
||||
@@ -223,7 +223,7 @@ export const columns: ColumnDef<Machine>[] = [
|
||||
href={machine.endpoint.replace(
|
||||
"comfyui-api",
|
||||
"comfyui-app"
|
||||
)}
|
||||
)} rel="noreferrer"
|
||||
>
|
||||
Open ComfyUI
|
||||
</a>
|
||||
|
||||
@@ -98,7 +98,7 @@ export function Navbar() {
|
||||
variant="outline"
|
||||
className="rounded-full aspect-square p-2"
|
||||
>
|
||||
<a target="_blank" href="https://github.com/BennyKok/comfyui-deploy">
|
||||
<a target="_blank" href="https://github.com/BennyKok/comfyui-deploy" rel="noreferrer">
|
||||
<Github />
|
||||
</a>
|
||||
</Button>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { LiveStatus } from "./LiveStatus";
|
||||
import { RunInputs } from "@/components/RunInputs";
|
||||
import { RunOutputs } from "@/components/RunOutputs";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
@@ -14,6 +13,7 @@ import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import { getDuration, getRelativeTime } from "@/lib/getRelativeTime";
|
||||
import { type findAllRuns } from "@/server/findAllRuns";
|
||||
import { Suspense } from "react";
|
||||
import { LiveStatus } from "./LiveStatus";
|
||||
|
||||
export async function RunDisplay({
|
||||
run,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import { useServerActionData } from "./useServerActionData";
|
||||
import { ButtonAction } from "@/components/ButtonActionLoader";
|
||||
import { UpdateModal } from "@/components/InsertModal";
|
||||
import { LoadingPageWrapper } from "@/components/LoadingWrapper";
|
||||
@@ -15,6 +14,7 @@ import { ExternalLink } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { useServerActionData } from "./useServerActionData";
|
||||
|
||||
export function SharePageSettings({
|
||||
deployment_id,
|
||||
|
||||
@@ -598,7 +598,7 @@ export function ViewWorkflowDetailsButton({
|
||||
<a
|
||||
href={group.url}
|
||||
target="_blank"
|
||||
className="hover:underline"
|
||||
className="hover:underline" rel="noreferrer"
|
||||
>
|
||||
{key}
|
||||
<ExternalLink
|
||||
|
||||
@@ -69,7 +69,7 @@ const FeedbackThanks = forwardRef<React.ElementRef<'div'>>(
|
||||
)
|
||||
|
||||
export function Feedback() {
|
||||
let [submitted, setSubmitted] = useState(false)
|
||||
const [submitted, setSubmitted] = useState(false)
|
||||
|
||||
function onSubmit(event: React.FormEvent<HTMLFormElement>) {
|
||||
event.preventDefault()
|
||||
|
||||
@@ -8,7 +8,7 @@ export function Prose<T extends React.ElementType = 'div'>({
|
||||
as?: T
|
||||
className?: string
|
||||
}) {
|
||||
let Component = as ?? 'div'
|
||||
const Component = as ?? 'div'
|
||||
|
||||
return (
|
||||
<Component
|
||||
|
||||
@@ -22,9 +22,9 @@ function MoonIcon(props: React.ComponentPropsWithoutRef<'svg'>) {
|
||||
}
|
||||
|
||||
export function ThemeToggle() {
|
||||
let { resolvedTheme, setTheme } = useTheme()
|
||||
let otherTheme = resolvedTheme === 'dark' ? 'light' : 'dark'
|
||||
let [mounted, setMounted] = useState(false)
|
||||
const { resolvedTheme, setTheme } = useTheme()
|
||||
const otherTheme = resolvedTheme === 'dark' ? 'light' : 'dark'
|
||||
const [mounted, setMounted] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true)
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
export function remToPx(remValue: number) {
|
||||
let rootFontSize =
|
||||
typeof window === 'undefined'
|
||||
? 16
|
||||
: parseFloat(window.getComputedStyle(document.documentElement).fontSize)
|
||||
const rootFontSize =
|
||||
typeof window === "undefined"
|
||||
? 16
|
||||
: parseFloat(
|
||||
window.getComputedStyle(document.documentElement).fontSize,
|
||||
);
|
||||
|
||||
return remValue * rootFontSize
|
||||
}
|
||||
|
||||
+10
-10
@@ -27,13 +27,13 @@ function rehypeShiki() {
|
||||
|
||||
visit(tree, "element", (node) => {
|
||||
if (node.tagName === "pre" && node.children[0]?.tagName === "code") {
|
||||
let codeNode = node.children[0];
|
||||
let textNode = codeNode.children[0];
|
||||
const codeNode = node.children[0];
|
||||
const textNode = codeNode.children[0];
|
||||
|
||||
node.properties.code = textNode.value;
|
||||
|
||||
if (node.properties.language) {
|
||||
let tokens = highlighter.codeToThemedTokens(
|
||||
const tokens = highlighter.codeToThemedTokens(
|
||||
textNode.value,
|
||||
node.properties.language
|
||||
);
|
||||
@@ -53,7 +53,7 @@ function rehypeShiki() {
|
||||
|
||||
function rehypeSlugify() {
|
||||
return (tree) => {
|
||||
let slugify = slugifyWithCounter();
|
||||
const slugify = slugifyWithCounter();
|
||||
visit(tree, "element", (node) => {
|
||||
if (node.tagName === "h2" && !node.properties.id) {
|
||||
node.properties.id = slugify(toString(node));
|
||||
@@ -64,10 +64,10 @@ function rehypeSlugify() {
|
||||
|
||||
function rehypeAddMDXExports(getExports) {
|
||||
return (tree) => {
|
||||
let exports = Object.entries(getExports(tree));
|
||||
const exports = Object.entries(getExports(tree));
|
||||
|
||||
for (let [name, value] of exports) {
|
||||
for (let node of tree.children) {
|
||||
for (const [name, value] of exports) {
|
||||
for (const node of tree.children) {
|
||||
if (
|
||||
node.type === "mdxjsEsm" &&
|
||||
new RegExp(`export\\s+const\\s+${name}\\s*=`).test(node.value)
|
||||
@@ -76,7 +76,7 @@ function rehypeAddMDXExports(getExports) {
|
||||
}
|
||||
}
|
||||
|
||||
let exportStr = `export const ${name} = ${value}`;
|
||||
const exportStr = `export const ${name} = ${value}`;
|
||||
|
||||
tree.children.push({
|
||||
type: "mdxjsEsm",
|
||||
@@ -93,9 +93,9 @@ function rehypeAddMDXExports(getExports) {
|
||||
}
|
||||
|
||||
function getSections(node) {
|
||||
let sections = [];
|
||||
const sections = [];
|
||||
|
||||
for (let child of node.children ?? []) {
|
||||
for (const child of node.children ?? []) {
|
||||
if (child.type === "element" && child.tagName === "h2") {
|
||||
sections.push(`{
|
||||
title: ${JSON.stringify(toString(child))},
|
||||
|
||||
@@ -31,9 +31,9 @@ function extractSections() {
|
||||
|
||||
visit(tree, (node) => {
|
||||
if (node.type === "heading" || node.type === "paragraph") {
|
||||
let content = toString(excludeObjectExpressions(node));
|
||||
const content = toString(excludeObjectExpressions(node));
|
||||
if (node.type === "heading" && node.depth <= 2) {
|
||||
let hash = node.depth === 1 ? null : slugify(content);
|
||||
const hash = node.depth === 1 ? null : slugify(content);
|
||||
sections.push([content, hash, []]);
|
||||
} else {
|
||||
sections.at(-1)?.[2].push(content);
|
||||
@@ -45,7 +45,7 @@ function extractSections() {
|
||||
}
|
||||
|
||||
export default function (nextConfig = {}) {
|
||||
let cache = new Map();
|
||||
const cache = new Map();
|
||||
|
||||
return Object.assign({}, nextConfig, {
|
||||
webpack(config, options) {
|
||||
@@ -53,20 +53,20 @@ export default function (nextConfig = {}) {
|
||||
test: __filename,
|
||||
use: [
|
||||
createLoader(function () {
|
||||
let appDir = path.resolve("./src/app/(docs)/docs");
|
||||
const appDir = path.resolve("./src/app/(docs)/docs");
|
||||
this.addContextDependency(appDir);
|
||||
|
||||
let files = glob.sync("**/*.mdx", { cwd: appDir });
|
||||
let data = files.map((file) => {
|
||||
const files = glob.sync("**/*.mdx", { cwd: appDir });
|
||||
const data = files.map((file) => {
|
||||
let url = `/${file.replace(/(^|\/)page\.mdx$/, "")}`;
|
||||
let mdx = fs.readFileSync(path.join(appDir, file), "utf8");
|
||||
const mdx = fs.readFileSync(path.join(appDir, file), "utf8");
|
||||
|
||||
let sections = [];
|
||||
|
||||
if (cache.get(file)?.[0] === mdx) {
|
||||
sections = cache.get(file)[1];
|
||||
} else {
|
||||
let vfile = { value: mdx, sections };
|
||||
const vfile = { value: mdx, sections };
|
||||
processor.runSync(processor.parse(vfile), vfile);
|
||||
cache.set(file, [mdx, sections]);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import type { ResponseConfig } from "@asteasolutions/zod-to-openapi";
|
||||
|
||||
|
||||
import { z } from "@hono/zod-openapi";
|
||||
|
||||
export const authError = {
|
||||
|
||||
Reference in New Issue
Block a user