Files
metabuilder/packages/package_validator/seed/scripts/component_schema.lua
JohnDoe6345789 9d27207fbc Refactor package validation and quick guide modules
- Simplified structure validation by re-exporting functions from structure_config and validate_structure modules for better maintainability.
- Consolidated validation logic in validate.lua, delegating to validate_package module for clearer orchestration.
- Introduced new quick guide functionalities including step management (add, remove, update, reset ordering) and media handling (thumbnail and video URL validation).
- Added utility functions for URL validation and step creation, enhancing the quick guide's usability.
- Established type definitions for steps and media states to improve code clarity and type safety.
- Enhanced schema editor with new field and relation definitions, providing a more robust structure for database schema management.
2025-12-30 11:17:40 +00:00

31 lines
1.1 KiB
Lua

--- Component JSON schema validation facade
--- Re-exports component validation functions for backward compatibility
---@module component_schema
local validate_component = require("validate_component")
local validate_layout = require("validate_layout")
local validate_components = require("validate_components")
---@class ComponentSchema
local M = {}
--- Validate a single component structure
---@param component Component The component to validate
---@param index? number Optional component index for error messages
---@return string[] errors List of validation errors
M.validate_component = validate_component
--- Validate layout structure recursively
---@param layout ComponentLayout The layout to validate
---@param path string The current path for error messages
---@return string[] errors List of validation errors
M.validate_layout = validate_layout
--- Validate components.json (array of components)
---@param components Component[] Array of component definitions
---@return boolean valid Whether all components are valid
---@return string[] errors List of validation errors
M.validate_components = validate_components
return M