Add comprehensive JSONC support for opencode.jsonc files

- Store raw JSONC content in database, parse on-the-fly for validation
- Return rawContent field in API response for editing with comments preserved
- Update frontend to use rawContent for config editing
- Accept string or object content in create/update requests
- Download configs as .jsonc when they contain comments
- Add strip-json-comments dependency for JSONC parsing
- Add .jsonc MIME type support in backend file service

This preserves comments in opencode.jsonc files when editing through the UI
This commit is contained in:
Chris Scott committed 2025-12-12 15:29:53 -05:00
1 parent 7a647cb316
commit 4eec4e5c27
12 files changed
+138 -66

No files matched your search

+3 -2
View File
@@ -57,6 +57,7 @@ export interface OpenCodeConfig {
id: number
name: string
content: Record<string, unknown>
rawContent?: string
isDefault: boolean
createdAt: number
updatedAt: number
@@ -64,12 +65,12 @@ export interface OpenCodeConfig {
export interface CreateOpenCodeConfigRequest {
name: string
content: Record<string, unknown>
content: Record<string, unknown> | string
isDefault?: boolean
}
export interface UpdateOpenCodeConfigRequest {
content: Record<string, unknown>
content: Record<string, unknown> | string
isDefault?: boolean
}