diff --git a/src/core/config-schema.json b/src/core/config-schema.json index d39ba11..85be908 100644 --- a/src/core/config-schema.json +++ b/src/core/config-schema.json @@ -7,7 +7,8 @@ "$schema": { "type": "string", "description": "Reference to the JSON schema", - "format": "uri" + "format": "uri", + "default": "https://raw.githubusercontent.com/persevie/grimoire-css/main/src/core/config-schema.json" }, "variables": { "type": "object", @@ -47,11 +48,13 @@ "items": { "$ref": "#/definitions/GrimoireConfigCriticalJSON" } + }, + "lock": { + "type": "boolean", + "description": "Optional flag indicating whether the GrimoireCSS configuration is locked" } }, - "required": [ - "projects" - ], + "required": ["projects"], "additionalProperties": false, "definitions": { "ScrollJSON": { @@ -77,10 +80,7 @@ } } }, - "required": [ - "name", - "spells" - ], + "required": ["name", "spells"], "additionalProperties": false }, "ProjectJSON": { @@ -101,24 +101,15 @@ } }, "outputDirPath": { - "type": [ - "string", - "null" - ], + "type": ["string", "null"], "description": "Optional output directory path for the project's CSS" }, "singleOutputFileName": { - "type": [ - "string", - "null" - ], + "type": ["string", "null"], "description": "Optional file name for a single output file" } }, - "required": [ - "projectName", - "inputPaths" - ], + "required": ["projectName", "inputPaths"], "additionalProperties": false }, "GrimoireConfigSharedJSON": { @@ -144,9 +135,7 @@ } } }, - "required": [ - "outputPath" - ], + "required": ["outputPath"], "additionalProperties": false }, "GrimoireConfigCriticalJSON": { @@ -176,9 +165,7 @@ } } }, - "required": [ - "fileToInlinePaths" - ], + "required": ["fileToInlinePaths"], "additionalProperties": false }, "CSSCustomPropertiesItemJSON": { @@ -186,10 +173,7 @@ "description": "Represents a custom CSS property item, including associated variables", "properties": { "element": { - "type": [ - "string", - "null" - ], + "type": ["string", "null"], "description": "Optional DOM element associated with the CSS variables (e.g., `tag`, `class`, `id`, `:root`)" }, "dataParam": { @@ -210,11 +194,7 @@ } } }, - "required": [ - "dataParam", - "dataValue", - "cssVariables" - ], + "required": ["dataParam", "dataValue", "cssVariables"], "additionalProperties": false } } diff --git a/src/core/config.rs b/src/core/config.rs index 083f1bf..5fa2bb6 100644 --- a/src/core/config.rs +++ b/src/core/config.rs @@ -422,7 +422,7 @@ impl Config { }); ConfigJSON { - schema: Some("".to_string()), + schema: Some("https://raw.githubusercontent.com/persevie/grimoire-css/main/src/core/config-schema.json".to_string()), variables: variables_hash_map, scrolls: Self::scrolls_to_json(self.scrolls.clone()), projects: Self::projects_to_json(self.projects.clone()),