accounts/dashboard/cms/config.ts
Haitao Pan f3d0a7f931 fix(dashboard): resolve npm run build errors
- Fix module path in prebuild script (../../scripts → ../scripts)
- Update API routes to use Promise-based params for Next.js 16
- Install @types/sanitize-html and @types/js-yaml
- Fix component prop naming (loading → isLoading, saving → isSaving, etc.)
- Update VLESS config type definition with missing 'id' property
- Fix TypeScript type conflicts and export declarations

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-11-06 11:07:30 +08:00

54 lines
1.4 KiB
TypeScript

export type TemplateName = 'default' | (string & {})
export type ThemeName = 'default'
export type ExtensionName = 'app-shell' | 'markdown-sync'
export interface ContentSourceConfig {
type: 'filesystem' | 'git'
/**
* Absolute path to the root directory that stores markdown content.
* When `type` is `git`, the directory is expected to be hydrated by a
* GitOps workflow ahead of time.
*/
root: string
/** Remote git repository used for GitOps synchronisation. */
repository?: string
/** Branch or tag to fetch when GitOps is enabled. */
ref?: string
}
export interface CmsConfig {
template: TemplateName
theme: ThemeName
extensions: ExtensionName[]
content: {
/** Default namespace used when a section does not override its source. */
defaultNamespace: string
sources: Record<string, ContentSourceConfig>
}
}
export const cmsConfig: CmsConfig = {
template: 'default',
theme: 'default',
extensions: ['app-shell', 'markdown-sync'],
content: {
defaultNamespace: 'homepage',
sources: {
homepage: {
type: 'filesystem',
root: 'cms/content/homepage',
},
docs: {
type: 'filesystem',
root: 'cms/content/docs',
},
marketing: {
type: 'git',
root: 'cms/content/marketing',
repository: 'git@github.com:example/xcontrol-marketing.git',
ref: 'main',
},
},
},
}