fix: `defineSettingPageData` remove func wrapper
Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
parent
05da9ca7d3
commit
d0d4f05647
|
|
@ -9,7 +9,7 @@ function getSettings() {
|
|||
path: string
|
||||
Component: () => JSX.Element
|
||||
priority: number
|
||||
loader: () => SettingPageConfig
|
||||
loader: SettingPageConfig
|
||||
}[]
|
||||
for (const path in map) {
|
||||
const prefix = "(settings)"
|
||||
|
|
@ -27,12 +27,12 @@ function getSettings() {
|
|||
|
||||
const Module = map[path] as {
|
||||
Component: () => JSX.Element
|
||||
loader: () => SettingPageConfig
|
||||
loader: SettingPageConfig
|
||||
}
|
||||
|
||||
if (!Module.loader) continue
|
||||
settings.push({
|
||||
...Module.loader(),
|
||||
...Module.loader,
|
||||
Component: Module.Component,
|
||||
loader: Module.loader,
|
||||
path: p,
|
||||
|
|
|
|||
|
|
@ -17,6 +17,6 @@ export interface SettingPageConfig {
|
|||
hideIf?: (ctx: SettingPageContext) => boolean
|
||||
disableIf?: (ctx: SettingPageContext) => [boolean, DisableWhy]
|
||||
}
|
||||
export const defineSettingPageData = (config: SettingPageConfig) => () => ({
|
||||
export const defineSettingPageData = (config: SettingPageConfig) => ({
|
||||
...config,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { fileURLToPath } from "node:url"
|
|||
import tsconfigPath from "vite-tsconfig-paths"
|
||||
import { defineProject } from "vitest/config"
|
||||
|
||||
import { astPlugin } from "../../configs/plugins"
|
||||
import { astPlugin } from "../../plugins/vite/ast"
|
||||
|
||||
const pkg = JSON.parse(readFileSync("package.json", "utf8"))
|
||||
const __dirname = fileURLToPath(new URL(".", import.meta.url))
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import { resolve } from "node:path"
|
|||
import react from "@vitejs/plugin-react"
|
||||
import { defineConfig } from "vite"
|
||||
|
||||
import { astPlugin } from "../../configs/plugins"
|
||||
import { viteRenderBaseConfig } from "../../configs/vite.render.config"
|
||||
import { astPlugin } from "../../plugins/vite/ast"
|
||||
|
||||
export default () => {
|
||||
return defineConfig({
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ import react from "@vitejs/plugin-react"
|
|||
import { prerelease } from "semver"
|
||||
import type { UserConfig } from "vite"
|
||||
|
||||
import { astPlugin } from "../plugins/vite/ast"
|
||||
import { circularImportRefreshPlugin } from "../plugins/vite/hmr"
|
||||
import { customI18nHmrPlugin } from "../plugins/vite/i18n-hmr"
|
||||
import { localesPlugin } from "../plugins/vite/locales"
|
||||
import i18nCompleteness from "../plugins/vite/utils/i18n-completeness"
|
||||
import { getGitHash } from "../scripts/lib"
|
||||
import { astPlugin } from "./plugins"
|
||||
|
||||
const pkgDir = resolve(dirname(fileURLToPath(import.meta.url)), "..")
|
||||
const pkg = JSON.parse(readFileSync(resolve(pkgDir, "./package.json"), "utf8"))
|
||||
|
|
|
|||
Loading…
Reference in New Issue