From 39089feea844ef27a7b5a3a93c6dbb5e82651097 Mon Sep 17 00:00:00 2001 From: xfy Date: Mon, 19 May 2025 19:25:34 +0800 Subject: [PATCH] chore: update format script --- app/blog/[page]/page.tsx | 2 +- biome.json | 2 +- components/mdx/link-anchor.tsx | 2 +- components/pages/projects/project-card.tsx | 2 +- .../rua/loading/vercel-loading.module.css | 9 ++--- lib/posts.ts | 2 +- package.json | 3 +- scripts/build-search.mjs | 2 +- scripts/posts/index.mjs | 2 +- styles/globals.css | 37 ++++++++----------- styles/rua.css | 27 +++++--------- 11 files changed, 37 insertions(+), 53 deletions(-) diff --git a/app/blog/[page]/page.tsx b/app/blog/[page]/page.tsx index 60b6db7..f1407d7 100644 --- a/app/blog/[page]/page.tsx +++ b/app/blog/[page]/page.tsx @@ -1,7 +1,7 @@ import PostCard from 'components/pages/blog/post-card'; import PostCardLoading from 'components/pages/blog/post-card-loading'; import Pagination from 'components/rua/rua-pagination'; -import { getPostListPath, postLists, PostPerPage } from 'lib/posts'; +import { PostPerPage, getPostListPath, postLists } from 'lib/posts'; import { notFound } from 'next/navigation'; import { Fragment, Suspense } from 'react'; diff --git a/biome.json b/biome.json index 582d13c..cf0dee3 100644 --- a/biome.json +++ b/biome.json @@ -2,7 +2,7 @@ "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", "vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false }, "files": { - "ignoreUnknown": false, + "ignoreUnknown": true, "ignore": [ "**/node_modules", "**/out", diff --git a/components/mdx/link-anchor.tsx b/components/mdx/link-anchor.tsx index 0ba7b5c..cef73c3 100644 --- a/components/mdx/link-anchor.tsx +++ b/components/mdx/link-anchor.tsx @@ -1,5 +1,5 @@ import clsx from 'clsx'; -import { memo, ReactNode } from 'react'; +import { ReactNode, memo } from 'react'; import { FiExternalLink } from 'react-icons/fi'; interface Props { diff --git a/components/pages/projects/project-card.tsx b/components/pages/projects/project-card.tsx index cf2dff3..c32dd4a 100644 --- a/components/pages/projects/project-card.tsx +++ b/components/pages/projects/project-card.tsx @@ -1,5 +1,5 @@ import clsx from 'clsx'; -import { Children, cloneElement, isValidElement, ReactElement } from 'react'; +import { Children, ReactElement, cloneElement, isValidElement } from 'react'; import { VscGithubInverted } from 'react-icons/vsc'; import { Project } from './content'; diff --git a/components/rua/loading/vercel-loading.module.css b/components/rua/loading/vercel-loading.module.css index 5e15790..f9740e8 100644 --- a/components/rua/loading/vercel-loading.module.css +++ b/components/rua/loading/vercel-loading.module.css @@ -15,15 +15,12 @@ padding: 7px 10px 8px 10px; align-items: center; - box-shadow: - 0 11px 40px 0 rgba(0, 0, 0, 0.25), - 0 2px 10px 0 rgba(0, 0, 0, 0.12); + box-shadow: 0 11px 40px 0 rgba(0, 0, 0, 0.25), 0 2px 10px 0 + rgba(0, 0, 0, 0.12); display: none; opacity: 0; - transition: - opacity 0.1s ease, - bottom 0.1s ease; + transition: opacity 0.1s ease, bottom 0.1s ease; animation: fade-in 0.1s ease-in-out; } diff --git a/lib/posts.ts b/lib/posts.ts index e433394..4f9ddeb 100644 --- a/lib/posts.ts +++ b/lib/posts.ts @@ -1,7 +1,7 @@ +import path from 'path'; import fs from 'fs/promises'; import matter from 'gray-matter'; import { sortByDate } from 'lib/utils'; -import path from 'path'; import { cache } from 'react'; import { MyMatters, Post } from 'types'; diff --git a/package.json b/package.json index a13e922..548e862 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "start": "next start", "lint": "next lint", "check": "biome check", - "fix": "biome format" + "fix": "biome check --fix", + "format": "biome format --write" }, "dependencies": { "@catppuccin/highlightjs": "^1.0.1", diff --git a/scripts/build-search.mjs b/scripts/build-search.mjs index afa0dd1..4ebb412 100644 --- a/scripts/build-search.mjs +++ b/scripts/build-search.mjs @@ -1,3 +1,4 @@ +import { algoliasearch } from 'algoliasearch'; /** * Generate algolia records. * @params -t for test. @@ -5,7 +6,6 @@ */ /* @ts-check */ import { config } from 'dotenv'; -import { algoliasearch } from 'algoliasearch'; // import { liteClient } from 'algoliasearch/lite'; import generateGists from './gists/index.mjs'; import postLists from './posts/index.mjs'; diff --git a/scripts/posts/index.mjs b/scripts/posts/index.mjs index 4ca2094..daefc70 100644 --- a/scripts/posts/index.mjs +++ b/scripts/posts/index.mjs @@ -1,6 +1,6 @@ +import path from 'path'; /* @ts-check */ import fs from 'fs/promises'; -import path from 'path'; const dataPath = 'content/posts'; diff --git a/styles/globals.css b/styles/globals.css index f5d8c82..b6d69b6 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -1,13 +1,13 @@ -@import 'tailwindcss'; -@import './rua.css'; +@import "tailwindcss"; +@import "./rua.css"; @custom-variant dark (&:is(.mocha *)); @theme { --font-Barlow: var(--font-barlow); --font-Poppins: var(--font-poppins); - --font-Mono: - var(--fonts-jetbrains-mono), DejaVu Sans Mono, -apple-system, monospace; + --font-Mono: var(--fonts-jetbrains-mono), DejaVu Sans Mono, -apple-system, + monospace; --font-Lobster: var(--font-lobster); --color-bluish-gray: rgba(245, 247, 250); @@ -21,9 +21,8 @@ --shadow-outline: 0 0 0 3px rgba(83, 220, 246, 0.6); --shadow-underline: inset 0px -2px 0px 0px rgb(85 200 188 / 70%); --shadow-throughline: inset 0px -0.5em 0px 0px rgb(85 200 188 / 70%); - --shadow-card: - 0px 10px 20px rgba(0, 0, 0, 0.04), 0px 2px 6px rgba(0, 0, 0, 0.04), - 0px 0px 1px rgba(0, 0, 0, 0.04); + --shadow-card: 0px 10px 20px rgba(0, 0, 0, 0.04), 0px 2px 6px + rgba(0, 0, 0, 0.04), 0px 0px 1px rgba(0, 0, 0, 0.04); --background-image-underline: linear-gradient( rgb(240 240 240), @@ -86,18 +85,18 @@ font-family: 'Poppins', sans-serif; @apply text-gray-600 bg-bluish-gray dark:bg-rua-gray-900 dark:text-gray-200; /* @apply text bg-linear-to-b from-base to-crust; */ font-family: - 'Poppins', + "Poppins", -apple-system, BlinkMacSystemFont, - 'Helvetica Neue', + "Helvetica Neue", Helvetica, Segoe UI, Arial, Roboto, - 'PingFang SC', + "PingFang SC", miui, - 'Hiragino Sans GB', - 'Microsoft Yahei', + "Hiragino Sans GB", + "Microsoft Yahei", sans-serif; } @@ -141,12 +140,11 @@ html.mocha { --docsearch-hit-shadow: none; --docsearch-hit-background: #090a11; --docsearch-key-gradient: linear-gradient(-26.5deg, #565872, #31355b); - --docsearch-key-shadow: - inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, - 0 2px 2px 0 rgba(3, 4, 9, 0.3); + --docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, 0 + 2px 2px 0 rgba(3, 4, 9, 0.3); --docsearch-footer-background: #1e2136; - --docsearch-footer-shadow: - inset 0 1px 0 0 rgba(73, 76, 106, 0.5), 0 -4px 8px 0 rgba(0, 0, 0, 0.2); + --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5), 0 -4px 8px + 0 rgba(0, 0, 0, 0.2); --docsearch-logo-color: #fff; --docsearch-muted-color: #7f8497; } @@ -192,10 +190,7 @@ code.hljs { } pre, code { - font-family: - var(--font-jetbrains-mono), - -apple-system, - 'DejaVu Sans Mono', + font-family: var(--font-jetbrains-mono), -apple-system, "DejaVu Sans Mono", monospace; } diff --git a/styles/rua.css b/styles/rua.css index 8530803..ea87ac0 100644 --- a/styles/rua.css +++ b/styles/rua.css @@ -132,7 +132,7 @@ h3:hover::before, h4:hover::before, h5:hover::before, h6:hover::before { - content: '#'; + content: "#"; left: -1.7rem; @apply absolute text-gray-400; } @@ -219,14 +219,8 @@ h6:hover::before { #article kbd { display: inline-block; padding: 3px 5px; - font: - 11px ui-monospace, - SFMono-Regular, - SF Mono, - Menlo, - Consolas, - Liberation Mono, - monospace; + font: 11px ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation + Mono, monospace; line-height: 10px; color: var(--color-fg-default); vertical-align: middle; @@ -251,13 +245,13 @@ h6:hover::before { #article hr::before { display: table; - content: ''; + content: ""; } #article hr::after { display: table; clear: both; - content: ''; + content: ""; } #article code, @@ -321,15 +315,15 @@ h6:hover::before { list-style-type: none; } -#article ol[type='1'] { +#article ol[type="1"] { list-style-type: decimal; } -#article ol[type='a'] { +#article ol[type="a"] { list-style-type: lower-alpha; } -#article ol[type='i'] { +#article ol[type="i"] { list-style-type: lower-roman; } @@ -376,8 +370,5 @@ h6:hover::before { #article .cm-editor .cm-line { font-size: 15px; - font-family: - var(--font-jetbrains-mono), - -apple-system, - monospace; + font-family: var(--font-jetbrains-mono), -apple-system, monospace; }