Skip to content

TP-03 — Add QueryaThemeManifest model #98

Description

@ZhuchkaTriplesix

Epic: A
Depends on: TP-02

Source: docs/theme-parser-github-issues.md

Goal

Create an immutable model for Querya custom theme manifests without converting colors to Flutter Color yet.

Files

  • lib/core/theme/parser/querya_theme_manifest.dart
  • test/core/theme/parser/querya_theme_manifest_test.dart

Implementation

Add:

enum QueryaThemeType { dark, light }

class QueryaThemeManifest {
  const QueryaThemeManifest({
    required this.schema,
    required this.id,
    required this.name,
    required this.type,
    required this.shadcnColors,
    required this.editorColors,
    this.tokenColors = const [],
    this.description,
    this.author,
    this.version,
  });
}

class QueryaThemeManifestParseException implements Exception {
  const QueryaThemeManifestParseException(this.message);
  final String message;
}

Fields:

  • schema: String
  • id: String
  • name: String
  • type: QueryaThemeType
  • shadcnColors: Map<String, String>
  • editorColors: Map<String, String>
  • tokenColors: List<TokenColorRule>
  • optional metadata fields.

Add QueryaThemeManifest.fromJsonString(String raw).

Use existing:

  • stripJsonc
  • TokenColorRule / existing token color parser path where possible.

Performance Notes

  • Do not create Color, QueryaTheme, or ThemeData here.
  • Keep maps unmodifiable.
  • Parsing should be pure and synchronous for a single file; async belongs in services.

Acceptance Criteria

  • Valid dark/light fixtures parse.
  • JSONC fixture parses.
  • Missing required fields throw QueryaThemeManifestParseException.
  • Unknown fields are ignored.
  • Returned maps are immutable or safely copied.

Tests

Cover:

  • valid full dark;
  • valid full light;
  • minimal manifest;
  • JSONC comments/trailing commas;
  • missing id;
  • invalid type;
  • empty shadcn_colors / editor_colors behavior according to docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    parserTheme parser epic label: parserthemeTheming, colors, VS Code themes

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions