mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 06:14:59 +00:00
- Created a new package for JSON Script Example with comprehensive examples demonstrating the full JSON script specification. - Added permissions for viewing, executing, and modifying examples in the JSON Script Example package. - Implemented functions for various expressions, statements, operators, and control flow in the JSON Script Example. - Developed a Storybook configuration for showcasing JSON Script Examples with interactive components. - Established a styles token file for consistent styling across the JSON Script Example package. - Introduced a new Lua Test Framework package with components for running and displaying test results. - Defined permissions for executing and viewing Lua test results, along with configuration and debugging capabilities. - Implemented a comprehensive set of functions for the Lua testing framework, including assertions and mocks. - Created Storybook stories for the Lua Test Framework to demonstrate the test runner and results display. - Added a styles token file for the Lua Test Framework to ensure a cohesive design.
252 lines
5.8 KiB
JSON
252 lines
5.8 KiB
JSON
{
|
|
"$schema": "https://metabuilder.dev/schemas/package-storybook.schema.json",
|
|
"featured": false,
|
|
"title": "JSON Script Examples",
|
|
"description": "Comprehensive examples demonstrating the full JSON script specification",
|
|
"stories": [
|
|
{
|
|
"name": "All Expressions",
|
|
"render": "all_expressions",
|
|
"description": "Demonstrates all expression types: binary, logical, unary, conditional, template literals",
|
|
"type": "function",
|
|
"args": {
|
|
"a": 10,
|
|
"b": 5
|
|
},
|
|
"argControls": {
|
|
"a": {
|
|
"type": "number",
|
|
"default": 10,
|
|
"min": -100,
|
|
"max": 100,
|
|
"step": 1,
|
|
"description": "First number"
|
|
},
|
|
"b": {
|
|
"type": "number",
|
|
"default": 5,
|
|
"min": -100,
|
|
"max": 100,
|
|
"step": 1,
|
|
"description": "Second number"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "All Statements",
|
|
"render": "all_statements",
|
|
"description": "Demonstrates all statement types: declarations, loops, conditionals, error handling",
|
|
"type": "function",
|
|
"args": {
|
|
"items": [1, 2, 3, 4, 5]
|
|
},
|
|
"argControls": {
|
|
"items": {
|
|
"type": "json",
|
|
"default": [1, 2, 3, 4, 5],
|
|
"description": "Array of numbers to process"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "All Operators",
|
|
"render": "all_operators",
|
|
"description": "Demonstrates all operators: arithmetic, comparison, logical, unary",
|
|
"type": "function",
|
|
"args": {
|
|
"x": 10,
|
|
"y": 5
|
|
},
|
|
"argControls": {
|
|
"x": {
|
|
"type": "number",
|
|
"default": 10,
|
|
"min": -100,
|
|
"max": 100,
|
|
"step": 1,
|
|
"description": "First operand"
|
|
},
|
|
"y": {
|
|
"type": "number",
|
|
"default": 5,
|
|
"min": -100,
|
|
"max": 100,
|
|
"step": 1,
|
|
"description": "Second operand"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Control Flow",
|
|
"render": "control_flow",
|
|
"description": "Demonstrates control flow patterns with nested if/else classification",
|
|
"type": "function",
|
|
"args": {
|
|
"value": 42
|
|
},
|
|
"argControls": {
|
|
"value": {
|
|
"type": "number",
|
|
"default": 42,
|
|
"min": -100,
|
|
"max": 200,
|
|
"step": 1,
|
|
"description": "Number to classify"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Data Structures",
|
|
"render": "data_structures",
|
|
"description": "Demonstrates working with objects and arrays",
|
|
"type": "function",
|
|
"args": {}
|
|
},
|
|
{
|
|
"name": "Expression Demo Component",
|
|
"render": "ExpressionDemo",
|
|
"description": "Interactive expression calculator component",
|
|
"type": "component",
|
|
"args": {
|
|
"initialA": 10,
|
|
"initialB": 5
|
|
},
|
|
"argControls": {
|
|
"initialA": {
|
|
"type": "number",
|
|
"default": 10,
|
|
"min": -100,
|
|
"max": 100,
|
|
"step": 1,
|
|
"description": "Initial value for first number"
|
|
},
|
|
"initialB": {
|
|
"type": "number",
|
|
"default": 5,
|
|
"min": -100,
|
|
"max": 100,
|
|
"step": 1,
|
|
"description": "Initial value for second number"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Operator Demo Component",
|
|
"render": "OperatorDemo",
|
|
"description": "Interactive operator demonstration showing all operator results",
|
|
"type": "component",
|
|
"args": {
|
|
"x": 10,
|
|
"y": 5
|
|
},
|
|
"argControls": {
|
|
"x": {
|
|
"type": "number",
|
|
"default": 10,
|
|
"min": -100,
|
|
"max": 100,
|
|
"step": 1,
|
|
"description": "First operand"
|
|
},
|
|
"y": {
|
|
"type": "number",
|
|
"default": 5,
|
|
"min": -100,
|
|
"max": 100,
|
|
"step": 1,
|
|
"description": "Second operand"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"renders": {
|
|
"all_expressions": {
|
|
"description": "All expression types demo",
|
|
"featured": true
|
|
},
|
|
"all_statements": {
|
|
"description": "All statement types demo"
|
|
},
|
|
"all_operators": {
|
|
"description": "All operators demo",
|
|
"featured": true
|
|
},
|
|
"control_flow": {
|
|
"description": "Control flow patterns demo"
|
|
},
|
|
"data_structures": {
|
|
"description": "Data structures demo"
|
|
},
|
|
"ExpressionDemo": {
|
|
"description": "Interactive expression calculator"
|
|
},
|
|
"OperatorDemo": {
|
|
"description": "Interactive operator demonstration"
|
|
}
|
|
},
|
|
"defaultContext": {
|
|
"user": {
|
|
"id": "demo-user",
|
|
"username": "demo_user",
|
|
"level": 1,
|
|
"email": "demo@example.com"
|
|
},
|
|
"tenant": {
|
|
"id": "demo-tenant",
|
|
"name": "Demo Organization"
|
|
}
|
|
},
|
|
"contextVariants": [
|
|
{
|
|
"name": "Public User",
|
|
"description": "Can view examples",
|
|
"context": {
|
|
"user": {
|
|
"username": "public_user",
|
|
"level": 0
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Standard User",
|
|
"description": "Can view and execute examples",
|
|
"context": {
|
|
"user": {
|
|
"username": "user",
|
|
"level": 1
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Moderator",
|
|
"description": "Can modify examples",
|
|
"context": {
|
|
"user": {
|
|
"username": "moderator",
|
|
"level": 2
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"scripts": {
|
|
"renderFunctions": [
|
|
"all_expressions",
|
|
"all_statements",
|
|
"all_operators",
|
|
"control_flow",
|
|
"data_structures"
|
|
],
|
|
"ignoredScripts": ["tests"]
|
|
},
|
|
"parameters": {
|
|
"layout": "padded",
|
|
"backgrounds": {
|
|
"default": "light",
|
|
"values": [
|
|
{ "name": "light", "value": "#fafafa" },
|
|
{ "name": "dark", "value": "#212121" }
|
|
]
|
|
}
|
|
}
|
|
}
|