refactor(core): consolidate core files under src/core directory
Move breakpoints, fonts, and app_constants into the core directory for better organization: - Move src/lib/breakpoints.ts to src/core/breakpoints.ts - Move src/lib/fonts.ts to src/core/fonts.ts - Move src/core/constants/app_constants.ts to src/core/app_constants.ts and clean up outdated comments
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* 响应式断点常量
|
||||
*
|
||||
* 原始 Dart: lib/ui/core/responsive.dart
|
||||
*
|
||||
* 与 `src/design/breakpoints.css` 中的 CSS 变量保持一致:
|
||||
* - 客户端运行时检查(matchMedia)通过 `useBreakpoint` hook
|
||||
* - 服务端 / 客户端 CSS 通过 `src/design/breakpoints.css` 的 media query
|
||||
*/
|
||||
export const Breakpoints = {
|
||||
/** 手机设备最大宽度 */
|
||||
mobileMaxWidth: 500,
|
||||
/** 平板设备最小宽度 */
|
||||
tabletMinWidth: 600,
|
||||
/** 平板设备最大宽度 */
|
||||
tabletMaxWidth: 1023,
|
||||
/** 桌面设备最小宽度 */
|
||||
desktopMinWidth: 1024,
|
||||
} as const;
|
||||
|
||||
export type DeviceSize = "mobile" | "tablet" | "desktop";
|
||||
@@ -1,56 +0,0 @@
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import localFont from "next/font/local";
|
||||
|
||||
/**
|
||||
* 全局字体配置(仅供服务端组件使用,例如 `src/app/layout.tsx`)。
|
||||
*
|
||||
* - `next/font/google` 与 `next/font/local` 在构建期完成 self-host、preload、
|
||||
* subset、inline,浏览器不会向 Google 发送请求,也不会产生 layout shift。
|
||||
* - 产出的 CSS 变量由 `globals.css` 桥接到 Tailwind(如 `font-sans`、`font-athelas`)。
|
||||
*
|
||||
* 注意:本文件**不**通过 `src/lib/index.ts` 桶导出,避免被误打进客户端 bundle。
|
||||
* 引用方式:`import { geistSans, geistMono, athelas } from "@/lib/fonts";`
|
||||
*/
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: "--font-geist-sans",
|
||||
subsets: ["latin"],
|
||||
});
|
||||
|
||||
const geistMono = Geist_Mono({
|
||||
variable: "--font-geist-mono",
|
||||
subsets: ["latin"],
|
||||
});
|
||||
|
||||
/**
|
||||
* Athelas 本地字体。
|
||||
*
|
||||
* 原始资源:/Users/chase/Documents/cozsweet/fonts/Athelas-*.ttf
|
||||
* 放置位置:/public/fonts/Athelas-*.ttf
|
||||
*
|
||||
* 路径计算(`next/font/local` 要求相对路径从**调用文件**出发):
|
||||
* src/lib/fonts.ts → ../../public/fonts/...
|
||||
*/
|
||||
const athelas = localFont({
|
||||
src: [
|
||||
{
|
||||
path: "../../public/fonts/Athelas-Regular.ttf",
|
||||
weight: "400",
|
||||
style: "normal",
|
||||
},
|
||||
{
|
||||
path: "../../public/fonts/Athelas-Bold.ttf",
|
||||
weight: "700",
|
||||
style: "normal",
|
||||
},
|
||||
{
|
||||
path: "../../public/fonts/Athelas-BoldItalic.ttf",
|
||||
weight: "700",
|
||||
style: "italic",
|
||||
},
|
||||
],
|
||||
variable: "--font-athelas",
|
||||
display: "swap",
|
||||
});
|
||||
|
||||
export { geistSans, geistMono, athelas };
|
||||
@@ -1,12 +0,0 @@
|
||||
/**
|
||||
* `src/lib/` 手写 barrel
|
||||
*
|
||||
* 注意:故意**不**把 `src/lib/auth/nextauth.ts`(Client-only 类)放进来,
|
||||
* 避免 Server bundle 误把 React 客户端代码拉进去。
|
||||
* 如需导入,请直接 `import { ... } from "@/lib/auth/nextauth"` 或各 class 文件路径。
|
||||
*
|
||||
* 注:路由相关常量已迁移至 `@/router`(`src/router/routes.ts`)。
|
||||
* 路由守卫已迁移至 `@/router/proxy`(`src/router/proxy.ts`)。
|
||||
*/
|
||||
|
||||
export * from "./breakpoints";
|
||||
Reference in New Issue
Block a user