refactor(dashboard): adopt src app router layout (#667)

This commit is contained in:
shenlan 2025-11-11 10:45:37 +08:00 committed by GitHub
parent 44f59293cb
commit d9a1e2b7ac
327 changed files with 118 additions and 123 deletions

View File

@ -1 +0,0 @@
export { default } from '../../../src/extensions/builtin/user-center/account/ThemePreferenceCard'

View File

@ -1 +0,0 @@
export { default } from '../../../src/extensions/builtin/user-center/components/Card'

View File

@ -1,2 +0,0 @@
export { default } from '../../../src/templates/default'
export { defaultHomeLayoutConfig } from './config'

View File

@ -85,14 +85,16 @@ const nextConfig = {
config.resolve.alias = {
...(config.resolve.alias ?? {}),
'@cms': path.join(__dirname, 'cms'),
'@components': path.join(__dirname, 'components'),
'@i18n': path.join(__dirname, 'i18n'),
'@lib': path.join(__dirname, 'lib'),
'@cms': path.join(__dirname, 'src', 'lib', 'cms'),
'@components': path.join(__dirname, 'src', 'components'),
'@i18n': path.join(__dirname, 'src', 'i18n'),
'@lib': path.join(__dirname, 'src', 'lib'),
'@types': path.join(__dirname, 'types'),
'@server': path.join(__dirname, 'server'),
'@theme': path.join(__dirname, 'src', 'theme'),
'@templates': path.join(__dirname, 'src', 'templates'),
'@server': path.join(__dirname, 'src', 'server'),
'@modules': path.join(__dirname, 'src', 'modules'),
'@extensions': path.join(__dirname, 'src', 'modules', 'extensions'),
'@theme': path.join(__dirname, 'src', 'components', 'theme'),
'@templates': path.join(__dirname, 'src', 'modules', 'templates'),
'@src': path.join(__dirname, 'src'),
}
return config

View File

@ -33,14 +33,16 @@ const nextConfig = {
// 显式 alias,保证 Turbopack 也能解析
config.resolve.alias = {
...(config.resolve.alias ?? {}),
"@cms": path.join(__dirname, "cms"),
"@components": path.join(__dirname, "components"),
"@i18n": path.join(__dirname, "i18n"),
"@lib": path.join(__dirname, "lib"),
"@cms": path.join(__dirname, "src", "lib", "cms"),
"@components": path.join(__dirname, "src", "components"),
"@i18n": path.join(__dirname, "src", "i18n"),
"@lib": path.join(__dirname, "src", "lib"),
"@types": path.join(__dirname, "types"),
"@server": path.join(__dirname, "server"),
"@theme": path.join(__dirname, "src", "theme"),
"@templates": path.join(__dirname, "src", "templates"),
"@server": path.join(__dirname, "src", "server"),
"@modules": path.join(__dirname, "src", "modules"),
"@extensions": path.join(__dirname, "src", "modules", "extensions"),
"@theme": path.join(__dirname, "src", "components", "theme"),
"@templates": path.join(__dirname, "src", "modules", "templates"),
"@src": path.join(__dirname, "src"),
};

View File

@ -15,9 +15,9 @@
"typecheck": "tsc --noEmit",
"format": "prettier --write .",
"preview": "next build && next start",
"test": "vitest run",
"test:unit": "vitest run",
"test:e2e": "playwright test"
"test": "vitest run --config tests/unit/vitest.config.ts",
"test:unit": "vitest run --config tests/unit/vitest.config.ts",
"test:e2e": "playwright test --config tests/e2e/playwright.config.ts"
},
"dependencies": {
"dompurify": "^3.2.6",

View File

@ -1,14 +0,0 @@
'use client'
import type { AppProps } from 'next/app'
import '../app/globals.css'
import { AppProviders } from '../app/AppProviders'
export default function HomepageApp({ Component, pageProps }: AppProps) {
return (
<AppProviders>
<Component {...pageProps} />
</AppProviders>
)
}

View File

@ -2,7 +2,7 @@
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
CONFIG_DIR="${ROOT_DIR}/config"
CONFIG_DIR="${ROOT_DIR}/src/config"
BASE_FILE="${CONFIG_DIR}/runtime-service-config.base.yaml"
SIT_FILE="${CONFIG_DIR}/runtime-service-config.sit.yaml"
PROD_FILE="${CONFIG_DIR}/runtime-service-config.prod.yaml"
@ -18,7 +18,7 @@ Usage: scripts/gen-runtime-config.sh [--hostname <hostname>] [--env <env>] [--ou
Options:
--hostname Override the hostname used for environment detection.
--env Explicitly set the environment (prod|sit). Overrides hostname detection.
--output Output path for the merged runtime configuration. Defaults to config/runtime-service-config.yaml.
--output Output path for the merged runtime configuration. Defaults to src/config/runtime-service-config.yaml.
-h, --help Show this help message.
USAGE
}

View File

@ -3,7 +3,7 @@ set -euo pipefail
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
REPO_ROOT=$(cd "${SCRIPT_DIR}/.." && pwd)
CONTENT_DIR="${REPO_ROOT}/content"
CONTENT_DIR="${REPO_ROOT}/src/content"
REMOTE_REPO="${CONTENT_REMOTE_REPO:-}"
REMOTE_BRANCH="${CONTENT_REMOTE_BRANCH:-main}"
REMOTE_SUBDIR="${CONTENT_REMOTE_SUBDIR:-content}"

View File

@ -5,7 +5,7 @@ import type { ReactNode } from 'react'
import { collectExtensionProviders } from '@cms/client'
import { LanguageProvider } from '@i18n/LanguageProvider'
import { UserProvider } from '@lib/userStore'
import { ThemeProvider } from '../src/theme'
import { ThemeProvider } from '@components/theme'
const extensionProviders = collectExtensionProviders()

View File

@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from 'next/server'
import { ContentNotFoundError, getContentCommitMeta } from '../../../api/content-meta'
import { ContentNotFoundError, getContentCommitMeta } from '@server/content-meta'
export const runtime = 'nodejs'

View File

@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from 'next/server'
import { ContentNotFoundError, renderMarkdownFile } from '../../../api/render-markdown'
import { ContentNotFoundError, renderMarkdownFile } from '@server/render-markdown'
export const runtime = 'nodejs'

Some files were not shown because too many files have changed in this diff Show More