@windrun-huaiin/diaomao 31.0.0 → 31.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windrun-huaiin/diaomao",
3
- "version": "31.0.0",
3
+ "version": "31.0.1",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -6,7 +6,7 @@ import { LLMCopyButton } from '@windrun-huaiin/third-ui/fuma/mdx';
6
6
  const sourceKey = 'blog';
7
7
  const { Page, generateStaticParams, generateMetadata } = createFumaPage({
8
8
  sourceKey: sourceKey,
9
- mdxContentSource: () => siteDocs.getContentSource('blog'),
9
+ mdxContentSource: () => siteDocs.getContentSource(sourceKey),
10
10
  getMDXComponents: siteDocs.getMDXComponents,
11
11
  mdxSourceDir: appConfig.mdxSourceDir[sourceKey],
12
12
  githubBaseUrl: appConfig.githubBaseUrl,
@@ -5,7 +5,7 @@ import { createFumaPage } from '@windrun-huaiin/third-ui/fuma/server/page-genera
5
5
  const sourceKey = 'legal';
6
6
  const { Page, generateStaticParams, generateMetadata } = createFumaPage({
7
7
  sourceKey: sourceKey,
8
- mdxContentSource: () => siteDocs.getContentSource('legal'),
8
+ mdxContentSource: () => siteDocs.getContentSource(sourceKey),
9
9
  getMDXComponents: siteDocs.getMDXComponents,
10
10
  mdxSourceDir: appConfig.mdxSourceDir[sourceKey],
11
11
  githubBaseUrl: appConfig.githubBaseUrl,
@@ -67,7 +67,7 @@ export async function levelNavLinks(locale: string): Promise<SiteNavItemConfig[]
67
67
  const blogsLinks: SiteMenuLeafConfig[] = [
68
68
  {
69
69
  text: 'async-architecture',
70
- description: '异步架构处理方案',
70
+ description: 'Async handler',
71
71
  path: '/blog/async-architecture',
72
72
  prefetch: false,
73
73
  icon: <T3PIcon />,
@@ -75,7 +75,7 @@ export async function levelNavLinks(locale: string): Promise<SiteNavItemConfig[]
75
75
  },
76
76
  {
77
77
  text: 'Config Sheet',
78
- description: '配置速查',
78
+ description: 'Quickstart config',
79
79
  path: '/blog/cheatsheet',
80
80
  prefetch: false,
81
81
  icon: <SettingsIcon />,
@@ -83,7 +83,7 @@ export async function levelNavLinks(locale: string): Promise<SiteNavItemConfig[]
83
83
  },
84
84
  {
85
85
  text: 'IOC',
86
- description: 'IOC统计',
86
+ description: 'IOC Analysis',
87
87
  path: '/blog/ioc',
88
88
  prefetch: false,
89
89
  icon: <ChartColumnStackedIcon />,
@@ -13,7 +13,6 @@ import React from 'react';
13
13
 
14
14
  export const dynamic = 'force-dynamic'
15
15
 
16
- // 网站元数据
17
16
  export async function generateMetadata({
18
17
  params: paramsPromise
19
18
  }: {
@@ -31,12 +30,12 @@ export async function generateMetadata({
31
30
 
32
31
  export default async function RootLayout({
33
32
  children,
34
- params: paramsPromise // 重命名参数
33
+ params: paramsPromise
35
34
  }: {
36
35
  children: React.ReactNode
37
36
  params: Promise<{ locale: string }>
38
37
  }) {
39
- const { locale } = await paramsPromise; // 使用新名称
38
+ const { locale } = await paramsPromise;
40
39
  setRequestLocale(locale);
41
40
  const messages = await getMessages();
42
41
  const fumaTranslations = await getFumaTranslations(locale);
package/src/lib/fonts.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import localFont from 'next/font/local';
2
2
 
3
- // 固定使用本地字体,不再依赖环境变量/远程 Google
3
+ // Just use local font,no more remote Google-font
4
4
  export const montserrat = localFont({
5
5
  src: [
6
6
  { path: '../../public/asserts/Montserrat-Regular.otf', weight: '400', style: 'normal' },
package/src/proxy.ts CHANGED
@@ -12,7 +12,7 @@ const intlMiddleware = createMiddleware({
12
12
  localeDetection: false
13
13
  });
14
14
 
15
- // 需要身份认证的路由(页面路由)
15
+ // Page routes that require authentication.
16
16
  const protectedPageRoutes = createRouteMatcher(
17
17
  buildProtectedPageRoutePatterns(
18
18
  ['/dashboard', '/settings', '/profile', '/billing'],
@@ -20,25 +20,25 @@ const protectedPageRoutes = createRouteMatcher(
20
20
  )
21
21
  );
22
22
 
23
- // 需要身份认证的API路由
23
+ // API routes that require authentication.
24
24
  const protectedApiRoutes = createRouteMatcher([
25
- // Stripe支付相关API
25
+ // Stripe payment APIs.
26
26
  '/api/stripe(.*)',
27
- // 积分相关API
27
+ // Credit APIs.
28
28
  '/api/credit(.*)',
29
- // 交易记录API
29
+ // Transaction APIs.
30
30
  '/api/transaction(.*)'
31
31
  ]);
32
32
 
33
- // 免认证的API路由(webhook、匿名用户初始化等)
33
+ // Public API routes such as webhooks and anonymous user initialization.
34
34
  const publicApiRoutes = createRouteMatcher([
35
35
  // Stripe webhook
36
36
  '/api/webhook/stripe',
37
37
  // Clerk webhook
38
38
  '/api/webhook/clerk/user',
39
- // 匿名用户初始化
39
+ // Anonymous user initialization.
40
40
  '/api/user/anonymous/init',
41
- // 健康检查等
41
+ // Health checks and public content APIs.
42
42
  '/api/health',
43
43
  '/api/legal',
44
44
  '/api/docs',
@@ -46,8 +46,8 @@ const publicApiRoutes = createRouteMatcher([
46
46
  '/api/blog'
47
47
  ]);
48
48
 
49
- // v6 官方推荐写法:直接 export default clerkMiddleware(handler, options)
50
- // 完全不需要再包一层函数,也不需要手动 (req)
49
+ // Clerk v6 recommended usage: export clerkMiddleware(handler, options) directly.
50
+ // No extra wrapper function or manual request forwarding is needed.
51
51
  export default clerkMiddleware(
52
52
  async (auth, req: NextRequest) => {
53
53
  const { defaultLocale, locales } = appConfig.i18n;
@@ -72,8 +72,8 @@ export default clerkMiddleware(
72
72
  return authResponse;
73
73
  }
74
74
 
75
- // 对于无语言前缀的页面请求,根据配置进行处理
76
- // 避免落不到 [locale] 路由。
75
+ // Handle page requests without locale prefixes according to configuration.
76
+ // This prevents requests from missing the [locale] route.
77
77
  if (!hasLocalePrefix && !pathname.startsWith('/api/')) {
78
78
  const url = req.nextUrl.clone();
79
79
  url.pathname = `/${defaultLocale}${pathname}`;
@@ -85,7 +85,7 @@ export default clerkMiddleware(
85
85
  }
86
86
  }
87
87
 
88
- // 5. 其他路由使用默认的国际化中间件处理
88
+ // Use the default i18n middleware for all other routes.
89
89
 
90
90
  // handle trailing slash redirect
91
91
  if (req.nextUrl.pathname.length > 1 && req.nextUrl.pathname.endsWith("/")) {
@@ -94,12 +94,13 @@ export default clerkMiddleware(
94
94
  301
95
95
  );
96
96
  }
97
- // 默认处理其他路由(公开页面路由)
97
+ // Default handling for other public page routes.
98
98
  return intlMiddleware(req);
99
99
  },
100
100
  { debug: appConfig.clerk.debug }
101
101
  );
102
102
 
103
+
103
104
  export const config = {
104
105
  matcher: [
105
106
  // Skip Next.js internals and all static files, but include API routes