{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://metabuilder.dev/schemas/package-metadata.schema.json", "title": "Package Metadata", "description": "MetaBuilder package metadata definition", "type": "object", "required": ["packageId", "name", "version", "description"], "properties": { "packageId": { "type": "string", "description": "Unique package identifier (snake_case)", "pattern": "^[a-z][a-z0-9_]*$" }, "name": { "type": "string", "description": "Human-readable package name" }, "version": { "type": "string", "description": "Package version (semver)", "pattern": "^\\d+\\.\\d+\\.\\d+$" }, "description": { "type": "string", "description": "Package description" }, "author": { "type": "string", "description": "Package author" }, "category": { "type": "string", "description": "Package category", "enum": ["ui", "data", "examples", "tools", "admin", "auth", "social", "media", "dev"] }, "icon": { "type": "string", "description": "Path to package icon" }, "minLevel": { "type": "integer", "description": "Minimum permission level required (0-6)", "minimum": 0, "maximum": 6, "default": 0 }, "primary": { "type": "boolean", "description": "Whether this is a primary/featured package", "default": false }, "dependencies": { "type": "array", "description": "Required package dependencies", "items": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$" } }, "devDependencies": { "type": "array", "description": "Development-only dependencies", "items": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$" } }, "exports": { "type": "object", "description": "Exported items from this package", "properties": { "scripts": { "type": "array", "description": "Exported script/function names", "items": { "type": "string" } }, "types": { "type": "array", "description": "Exported type definitions", "items": { "type": "string" } }, "components": { "type": "array", "description": "Exported UI components", "items": { "type": "string" } }, "constants": { "type": "array", "description": "Exported constants", "items": { "type": "string" } } } }, "tests": { "type": "object", "description": "Test configuration", "properties": { "scripts": { "type": "array", "description": "Test script files", "items": { "type": "string" } }, "cases": { "type": "array", "description": "Test case files", "items": { "type": "string" } }, "parameterized": { "type": "array", "description": "Parameterized test definitions", "items": { "$ref": "#/definitions/parameterizedTest" } } } }, "permissions": { "type": "object", "description": "Permission definitions", "additionalProperties": { "$ref": "#/definitions/permission" } }, "seed": { "type": "object", "description": "Seed data file references", "properties": { "styles": { "type": "string", "description": "Path to styles JSON file" }, "types": { "type": "string", "description": "Path to types JSON file" }, "schema": { "type": "string", "description": "Path to entity schema file" } } }, "storybook": { "type": "object", "description": "Storybook configuration", "properties": { "stories": { "type": "array", "description": "Story definitions", "items": { "$ref": "#/definitions/story" } } } }, "runtime": { "type": "object", "description": "Runtime configuration", "properties": { "scripts": { "type": "array", "description": "Script files to load", "items": { "type": "string" } }, "main": { "type": "string", "description": "Main entry script file" }, "executor": { "type": "object", "description": "Script executor paths", "properties": { "lua": { "type": "string" }, "javascript": { "type": "string" } } }, "description": { "type": "string" } } } }, "definitions": { "permission": { "type": "object", "required": ["minLevel", "description"], "properties": { "minLevel": { "type": "integer", "description": "Minimum level required", "minimum": 0, "maximum": 6 }, "description": { "type": "string", "description": "Permission description" }, "storybook": { "type": "object", "properties": { "stories": { "type": "array", "items": { "type": "object" } } } } } }, "parameterizedTest": { "type": "object", "required": ["logic", "parameters"], "properties": { "logic": { "type": "string", "description": "Path to test logic file" }, "parameters": { "type": "string", "description": "Path to test parameters file" } } }, "story": { "type": "object", "required": ["name", "type"], "properties": { "name": { "type": "string", "description": "Story display name" }, "type": { "type": "string", "description": "Story type", "enum": ["function", "component"] }, "function": { "type": "string", "description": "Function name (for function stories)" }, "component": { "type": "string", "description": "Component name (for component stories)" }, "args": { "type": "array", "description": "Function arguments" }, "props": { "type": "object", "description": "Component props" }, "argControls": { "type": "object", "description": "Storybook controls for arguments", "additionalProperties": { "$ref": "#/definitions/control" } }, "propControls": { "type": "object", "description": "Storybook controls for props", "additionalProperties": { "$ref": "#/definitions/control" } } } }, "control": { "type": "object", "required": ["type"], "properties": { "type": { "type": "string", "enum": ["number", "string", "boolean", "select", "object", "array"] }, "default": { "description": "Default value" }, "min": { "type": "number", "description": "Minimum value (for number)" }, "max": { "type": "number", "description": "Maximum value (for number)" }, "step": { "type": "number", "description": "Step value (for number)" }, "options": { "type": "array", "description": "Options (for select)" } } } } }