mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
feat: add Nerd Mode IDE package with full functionality
- Created package.json for Nerd Mode IDE with dependencies and exports. - Defined access permissions in roles.json for IDE functionalities. - Implemented file system and execution functions in functions.json. - Added SVG icon for the IDE in static_content/icon.svg. - Configured Storybook for the IDE with various components and examples. - Established design tokens in tokens.json for consistent styling. - Developed parameterized test data in metadata.params.json for testing. - Created metadata validation tests in metadata.test.json to ensure package integrity.
This commit is contained in:
727
packages/nerd_mode_ide/components/ui.json
Normal file
727
packages/nerd_mode_ide/components/ui.json
Normal file
@@ -0,0 +1,727 @@
|
||||
{
|
||||
"$schema": "https://metabuilder.dev/schemas/json-script-components.schema.json",
|
||||
"schemaVersion": "2.0.0",
|
||||
"package": "nerd_mode_ide",
|
||||
"description": "Full-featured in-browser IDE components",
|
||||
"components": [
|
||||
{
|
||||
"id": "nerd_mode_ide",
|
||||
"name": "NerdModeIDE",
|
||||
"description": "Main IDE container with file explorer, editor, and panels",
|
||||
"props": [
|
||||
{
|
||||
"name": "tenantId",
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "initialPath",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "Initial file/folder path to open"
|
||||
}
|
||||
],
|
||||
"render": {
|
||||
"type": "element",
|
||||
"template": {
|
||||
"type": "Box",
|
||||
"className": "nerd-mode-ide",
|
||||
"sx": { "height": "100vh", "display": "flex", "flexDirection": "column", "bgcolor": "background.default" },
|
||||
"children": [
|
||||
{
|
||||
"type": "ComponentRef",
|
||||
"ref": "nerd_mode_ide_header",
|
||||
"props": {
|
||||
"currentFile": "{{currentFile}}",
|
||||
"onSave": "{{handleSave}}",
|
||||
"onRun": "{{handleRun}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Box",
|
||||
"sx": { "flex": 1, "display": "flex", "overflow": "hidden" },
|
||||
"children": [
|
||||
{
|
||||
"type": "ComponentRef",
|
||||
"ref": "nerd_mode_file_explorer",
|
||||
"props": {
|
||||
"files": "{{fileTree}}",
|
||||
"selectedPath": "{{currentFile?.path}}",
|
||||
"onSelect": "{{handleFileSelect}}",
|
||||
"onCreateFile": "{{handleCreateFile}}",
|
||||
"onCreateFolder": "{{handleCreateFolder}}",
|
||||
"onDelete": "{{handleDelete}}",
|
||||
"onRename": "{{handleRename}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Box",
|
||||
"sx": { "flex": 1, "display": "flex", "flexDirection": "column", "overflow": "hidden" },
|
||||
"children": [
|
||||
{
|
||||
"type": "ComponentRef",
|
||||
"ref": "nerd_mode_editor_panel",
|
||||
"props": {
|
||||
"file": "{{currentFile}}",
|
||||
"onChange": "{{handleContentChange}}",
|
||||
"openTabs": "{{openTabs}}",
|
||||
"onTabSelect": "{{handleTabSelect}}",
|
||||
"onTabClose": "{{handleTabClose}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "conditional",
|
||||
"condition": "{{showBottomPanel}}",
|
||||
"then": {
|
||||
"type": "Box",
|
||||
"sx": { "height": "{{bottomPanelHeight}}", "borderTop": 1, "borderColor": "divider" },
|
||||
"children": [
|
||||
{
|
||||
"type": "Tabs",
|
||||
"value": "{{activeBottomTab}}",
|
||||
"onChange": "{{handleBottomTabChange}}",
|
||||
"sx": { "minHeight": 36 },
|
||||
"children": [
|
||||
{
|
||||
"type": "Tab",
|
||||
"label": "Console",
|
||||
"value": "console",
|
||||
"sx": { "minHeight": 36, "py": 0 }
|
||||
},
|
||||
{
|
||||
"type": "Tab",
|
||||
"label": "Tests",
|
||||
"value": "tests",
|
||||
"sx": { "minHeight": 36, "py": 0 }
|
||||
},
|
||||
{
|
||||
"type": "Tab",
|
||||
"label": "Git",
|
||||
"value": "git",
|
||||
"sx": { "minHeight": 36, "py": 0 }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Box",
|
||||
"sx": { "flex": 1, "overflow": "auto" },
|
||||
"children": [
|
||||
{
|
||||
"type": "conditional",
|
||||
"condition": "{{activeBottomTab === 'console'}}",
|
||||
"then": {
|
||||
"type": "ComponentRef",
|
||||
"ref": "nerd_mode_console_panel",
|
||||
"props": {
|
||||
"logs": "{{consoleLogs}}",
|
||||
"onClear": "{{handleClearConsole}}",
|
||||
"onCommand": "{{handleConsoleCommand}}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "conditional",
|
||||
"condition": "{{activeBottomTab === 'tests'}}",
|
||||
"then": {
|
||||
"type": "ComponentRef",
|
||||
"ref": "nerd_mode_tests_panel",
|
||||
"props": {
|
||||
"testResults": "{{testResults}}",
|
||||
"onRunTests": "{{handleRunTests}}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "conditional",
|
||||
"condition": "{{activeBottomTab === 'git'}}",
|
||||
"then": {
|
||||
"type": "ComponentRef",
|
||||
"ref": "nerd_mode_git_panel",
|
||||
"props": {
|
||||
"changes": "{{gitChanges}}",
|
||||
"branch": "{{currentBranch}}",
|
||||
"onCommit": "{{handleCommit}}",
|
||||
"onPush": "{{handlePush}}",
|
||||
"onPull": "{{handlePull}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "nerd_mode_ide_header",
|
||||
"name": "NerdModeIDEHeader",
|
||||
"description": "IDE header with file info and actions",
|
||||
"props": [
|
||||
{
|
||||
"name": "currentFile",
|
||||
"type": "object",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "onSave",
|
||||
"type": "function",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "onRun",
|
||||
"type": "function",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"render": {
|
||||
"type": "element",
|
||||
"template": {
|
||||
"type": "Paper",
|
||||
"elevation": 0,
|
||||
"sx": { "px": 2, "py": 1, "borderBottom": 1, "borderColor": "divider", "display": "flex", "alignItems": "center", "gap": 2 },
|
||||
"children": [
|
||||
{
|
||||
"type": "Icon",
|
||||
"name": "Code",
|
||||
"color": "primary"
|
||||
},
|
||||
{
|
||||
"type": "Typography",
|
||||
"variant": "subtitle1",
|
||||
"fontWeight": "bold",
|
||||
"children": "Nerd Mode IDE"
|
||||
},
|
||||
{
|
||||
"type": "Box",
|
||||
"sx": { "flex": 1 }
|
||||
},
|
||||
{
|
||||
"type": "conditional",
|
||||
"condition": "{{currentFile}}",
|
||||
"then": {
|
||||
"type": "Chip",
|
||||
"label": "{{currentFile.path}}",
|
||||
"size": "small",
|
||||
"variant": "outlined"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "ButtonGroup",
|
||||
"size": "small",
|
||||
"children": [
|
||||
{
|
||||
"type": "Button",
|
||||
"startIcon": {
|
||||
"type": "Icon",
|
||||
"name": "Save"
|
||||
},
|
||||
"onClick": "{{onSave}}",
|
||||
"disabled": "{{!currentFile}}",
|
||||
"children": "Save"
|
||||
},
|
||||
{
|
||||
"type": "Button",
|
||||
"startIcon": {
|
||||
"type": "Icon",
|
||||
"name": "PlayArrow"
|
||||
},
|
||||
"onClick": "{{onRun}}",
|
||||
"disabled": "{{!currentFile}}",
|
||||
"children": "Run"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "nerd_mode_file_explorer",
|
||||
"name": "NerdModeFileExplorer",
|
||||
"description": "File tree explorer with CRUD operations",
|
||||
"props": [
|
||||
{
|
||||
"name": "files",
|
||||
"type": "array",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "selectedPath",
|
||||
"type": "string",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "onSelect",
|
||||
"type": "function",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "onCreateFile",
|
||||
"type": "function",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "onCreateFolder",
|
||||
"type": "function",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "onDelete",
|
||||
"type": "function",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "onRename",
|
||||
"type": "function",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"render": {
|
||||
"type": "element",
|
||||
"template": {
|
||||
"type": "Paper",
|
||||
"variant": "outlined",
|
||||
"sx": { "width": 240, "height": "100%", "display": "flex", "flexDirection": "column", "borderRadius": 0 },
|
||||
"children": [
|
||||
{
|
||||
"type": "Box",
|
||||
"sx": { "p": 1, "borderBottom": 1, "borderColor": "divider", "display": "flex", "alignItems": "center", "justifyContent": "space-between" },
|
||||
"children": [
|
||||
{
|
||||
"type": "Typography",
|
||||
"variant": "caption",
|
||||
"fontWeight": "bold",
|
||||
"color": "textSecondary",
|
||||
"children": "EXPLORER"
|
||||
},
|
||||
{
|
||||
"type": "Stack",
|
||||
"direction": "row",
|
||||
"spacing": 0.5,
|
||||
"children": [
|
||||
{
|
||||
"type": "IconButton",
|
||||
"size": "small",
|
||||
"onClick": "{{onCreateFile}}",
|
||||
"children": [
|
||||
{
|
||||
"type": "Icon",
|
||||
"name": "NoteAdd",
|
||||
"fontSize": "small"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "IconButton",
|
||||
"size": "small",
|
||||
"onClick": "{{onCreateFolder}}",
|
||||
"children": [
|
||||
{
|
||||
"type": "Icon",
|
||||
"name": "CreateNewFolder",
|
||||
"fontSize": "small"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Box",
|
||||
"sx": { "flex": 1, "overflow": "auto", "p": 1 },
|
||||
"children": [
|
||||
{
|
||||
"type": "TreeView",
|
||||
"defaultCollapseIcon": {
|
||||
"type": "Icon",
|
||||
"name": "ExpandMore"
|
||||
},
|
||||
"defaultExpandIcon": {
|
||||
"type": "Icon",
|
||||
"name": "ChevronRight"
|
||||
},
|
||||
"selected": "{{selectedPath}}",
|
||||
"children": [
|
||||
{
|
||||
"type": "each",
|
||||
"items": "{{files}}",
|
||||
"as": "node",
|
||||
"render": {
|
||||
"type": "TreeItem",
|
||||
"nodeId": "{{node.path}}",
|
||||
"label": "{{node.name}}",
|
||||
"onClick": "{{() => onSelect(node)}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "nerd_mode_editor_panel",
|
||||
"name": "NerdModeEditorPanel",
|
||||
"description": "Code editor with tabs",
|
||||
"props": [
|
||||
{
|
||||
"name": "file",
|
||||
"type": "object",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "onChange",
|
||||
"type": "function",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "openTabs",
|
||||
"type": "array",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "onTabSelect",
|
||||
"type": "function",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "onTabClose",
|
||||
"type": "function",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"render": {
|
||||
"type": "element",
|
||||
"template": {
|
||||
"type": "Box",
|
||||
"sx": { "flex": 1, "display": "flex", "flexDirection": "column", "overflow": "hidden" },
|
||||
"children": [
|
||||
{
|
||||
"type": "Box",
|
||||
"sx": { "borderBottom": 1, "borderColor": "divider", "display": "flex", "overflow": "auto" },
|
||||
"children": [
|
||||
{
|
||||
"type": "each",
|
||||
"items": "{{openTabs}}",
|
||||
"as": "tab",
|
||||
"render": {
|
||||
"type": "Chip",
|
||||
"label": "{{tab.name}}",
|
||||
"onClick": "{{() => onTabSelect(tab)}}",
|
||||
"onDelete": "{{() => onTabClose(tab)}}",
|
||||
"variant": "{{file?.path === tab.path ? 'filled' : 'outlined'}}",
|
||||
"size": "small",
|
||||
"sx": { "borderRadius": 0, "m": 0.5 }
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "conditional",
|
||||
"condition": "{{file}}",
|
||||
"then": {
|
||||
"type": "Box",
|
||||
"sx": { "flex": 1, "overflow": "hidden" },
|
||||
"children": [
|
||||
{
|
||||
"type": "ComponentRef",
|
||||
"ref": "code_editor.CodeEditor",
|
||||
"props": {
|
||||
"value": "{{file.content}}",
|
||||
"language": "{{file.language}}",
|
||||
"onChange": "{{onChange}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"else": {
|
||||
"type": "Box",
|
||||
"sx": { "flex": 1, "display": "flex", "alignItems": "center", "justifyContent": "center" },
|
||||
"children": [
|
||||
{
|
||||
"type": "Typography",
|
||||
"color": "textSecondary",
|
||||
"children": "Select a file to edit"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "nerd_mode_console_panel",
|
||||
"name": "NerdModeConsolePanel",
|
||||
"description": "Console output panel",
|
||||
"props": [
|
||||
{
|
||||
"name": "logs",
|
||||
"type": "array",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "onClear",
|
||||
"type": "function",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "onCommand",
|
||||
"type": "function",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"render": {
|
||||
"type": "element",
|
||||
"template": {
|
||||
"type": "Box",
|
||||
"sx": { "height": "100%", "display": "flex", "flexDirection": "column", "bgcolor": "grey.900" },
|
||||
"children": [
|
||||
{
|
||||
"type": "Box",
|
||||
"sx": { "flex": 1, "overflow": "auto", "p": 1, "fontFamily": "monospace", "fontSize": 12 },
|
||||
"children": [
|
||||
{
|
||||
"type": "each",
|
||||
"items": "{{logs}}",
|
||||
"as": "log",
|
||||
"render": {
|
||||
"type": "Typography",
|
||||
"variant": "body2",
|
||||
"sx": { "fontFamily": "monospace", "color": "{{log.type === 'error' ? 'error.main' : log.type === 'warn' ? 'warning.main' : 'grey.300'}}" },
|
||||
"children": "{{log.message}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "TextField",
|
||||
"placeholder": "> Enter command..."
|
||||
"size": "small",
|
||||
"fullWidth": true,
|
||||
"onKeyPress": "{{handleKeyPress}}",
|
||||
"sx": { "bgcolor": "grey.800", "input": { "fontFamily": "monospace", "color": "grey.100" } }
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "nerd_mode_tests_panel",
|
||||
"name": "NerdModeTestsPanel",
|
||||
"description": "Test runner panel",
|
||||
"props": [
|
||||
{
|
||||
"name": "testResults",
|
||||
"type": "array",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "onRunTests",
|
||||
"type": "function",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"render": {
|
||||
"type": "element",
|
||||
"template": {
|
||||
"type": "Box",
|
||||
"sx": { "height": "100%", "display": "flex", "flexDirection": "column" },
|
||||
"children": [
|
||||
{
|
||||
"type": "Box",
|
||||
"sx": { "p": 1, "borderBottom": 1, "borderColor": "divider", "display": "flex", "alignItems": "center", "gap": 1 },
|
||||
"children": [
|
||||
{
|
||||
"type": "Button",
|
||||
"size": "small",
|
||||
"startIcon": {
|
||||
"type": "Icon",
|
||||
"name": "PlayArrow"
|
||||
},
|
||||
"onClick": "{{onRunTests}}",
|
||||
"children": "Run All Tests"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "List",
|
||||
"dense": true,
|
||||
"sx": { "flex": 1, "overflow": "auto" },
|
||||
"children": [
|
||||
{
|
||||
"type": "each",
|
||||
"items": "{{testResults}}",
|
||||
"as": "test",
|
||||
"render": {
|
||||
"type": "ListItem",
|
||||
"children": [
|
||||
{
|
||||
"type": "ListItemIcon",
|
||||
"children": [
|
||||
{
|
||||
"type": "Icon",
|
||||
"name": "{{test.passed ? 'CheckCircle' : 'Cancel'}}",
|
||||
"color": "{{test.passed ? 'success' : 'error'}}",
|
||||
"fontSize": "small"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "ListItemText",
|
||||
"primary": "{{test.name}}",
|
||||
"secondary": "{{test.duration}}ms"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "nerd_mode_git_panel",
|
||||
"name": "NerdModeGitPanel",
|
||||
"description": "Git integration panel",
|
||||
"props": [
|
||||
{
|
||||
"name": "changes",
|
||||
"type": "array",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "branch",
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "onCommit",
|
||||
"type": "function",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "onPush",
|
||||
"type": "function",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "onPull",
|
||||
"type": "function",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"render": {
|
||||
"type": "element",
|
||||
"template": {
|
||||
"type": "Box",
|
||||
"sx": { "height": "100%", "display": "flex", "flexDirection": "column" },
|
||||
"children": [
|
||||
{
|
||||
"type": "Box",
|
||||
"sx": { "p": 1, "borderBottom": 1, "borderColor": "divider", "display": "flex", "alignItems": "center", "gap": 1 },
|
||||
"children": [
|
||||
{
|
||||
"type": "Chip",
|
||||
"icon": {
|
||||
"type": "Icon",
|
||||
"name": "AccountTree"
|
||||
},
|
||||
"label": "{{branch}}",
|
||||
"size": "small",
|
||||
"variant": "outlined"
|
||||
},
|
||||
{
|
||||
"type": "Box",
|
||||
"sx": { "flex": 1 }
|
||||
},
|
||||
{
|
||||
"type": "ButtonGroup",
|
||||
"size": "small",
|
||||
"children": [
|
||||
{
|
||||
"type": "Button",
|
||||
"onClick": "{{onPull}}",
|
||||
"children": "Pull"
|
||||
},
|
||||
{
|
||||
"type": "Button",
|
||||
"onClick": "{{onPush}}",
|
||||
"children": "Push"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "List",
|
||||
"dense": true,
|
||||
"sx": { "flex": 1, "overflow": "auto" },
|
||||
"children": [
|
||||
{
|
||||
"type": "each",
|
||||
"items": "{{changes}}",
|
||||
"as": "change",
|
||||
"render": {
|
||||
"type": "ListItem",
|
||||
"children": [
|
||||
{
|
||||
"type": "ListItemIcon",
|
||||
"children": [
|
||||
{
|
||||
"type": "Icon",
|
||||
"name": "{{change.type === 'added' ? 'Add' : change.type === 'deleted' ? 'Remove' : 'Edit'}}",
|
||||
"color": "{{change.type === 'added' ? 'success' : change.type === 'deleted' ? 'error' : 'warning'}}",
|
||||
"fontSize": "small"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "ListItemText",
|
||||
"primary": "{{change.path}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Box",
|
||||
"sx": { "p": 1, "borderTop": 1, "borderColor": "divider" },
|
||||
"children": [
|
||||
{
|
||||
"type": "TextField",
|
||||
"placeholder": "Commit message...",
|
||||
"size": "small",
|
||||
"fullWidth": true,
|
||||
"value": "{{commitMessage}}",
|
||||
"onChange": "{{handleCommitMessageChange}}",
|
||||
"sx": { "mb": 1 }
|
||||
},
|
||||
{
|
||||
"type": "Button",
|
||||
"variant": "contained",
|
||||
"fullWidth": true,
|
||||
"onClick": "{{onCommit}}",
|
||||
"disabled": "{{!commitMessage || changes.length === 0}}",
|
||||
"children": "Commit"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
40
packages/nerd_mode_ide/package.json
Normal file
40
packages/nerd_mode_ide/package.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"$schema": "https://metabuilder.dev/schemas/package-metadata.schema.json",
|
||||
"packageId": "nerd_mode_ide",
|
||||
"name": "Nerd Mode IDE",
|
||||
"version": "1.0.0",
|
||||
"description": "Full-featured in-browser IDE with file explorer, editor panels, console, git integration, and test runner",
|
||||
"author": "MetaBuilder",
|
||||
"license": "MIT",
|
||||
"category": "tools",
|
||||
"icon": "static_content/icon.svg",
|
||||
"minLevel": 4,
|
||||
"primary": false,
|
||||
"keywords": ["ide", "editor", "code", "files", "git", "console", "tests", "development"],
|
||||
"dependencies": {
|
||||
"code_editor": "*",
|
||||
"ui_permissions": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"testing": "*"
|
||||
},
|
||||
"exports": {
|
||||
"components": [
|
||||
"NerdModeIDE",
|
||||
"NerdModeIDEHeader",
|
||||
"NerdModeFileExplorer",
|
||||
"NerdModeEditorPanel",
|
||||
"NerdModeConsolePanel",
|
||||
"NerdModeGitPanel",
|
||||
"NerdModeTestsPanel"
|
||||
],
|
||||
"scripts": [
|
||||
"ide"
|
||||
]
|
||||
},
|
||||
"tests": {
|
||||
"suites": [
|
||||
"tests/metadata.test.json"
|
||||
]
|
||||
}
|
||||
}
|
||||
53
packages/nerd_mode_ide/permissions/roles.json
Normal file
53
packages/nerd_mode_ide/permissions/roles.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"$schema": "https://metabuilder.dev/schemas/permissions.schema.json",
|
||||
"schemaVersion": "1.0.0",
|
||||
"package": "nerd_mode_ide",
|
||||
"description": "Nerd Mode IDE access permissions",
|
||||
"permissions": [
|
||||
{
|
||||
"id": "ide.view",
|
||||
"name": "View IDE",
|
||||
"description": "Access the IDE interface",
|
||||
"resource": "ide",
|
||||
"action": "read",
|
||||
"scope": "global",
|
||||
"minLevel": 4
|
||||
},
|
||||
{
|
||||
"id": "ide.edit",
|
||||
"name": "Edit Files",
|
||||
"description": "Create, edit, and delete files",
|
||||
"resource": "ide",
|
||||
"action": "write",
|
||||
"scope": "global",
|
||||
"minLevel": 4
|
||||
},
|
||||
{
|
||||
"id": "ide.execute",
|
||||
"name": "Execute Scripts",
|
||||
"description": "Run scripts and tests",
|
||||
"resource": "ide",
|
||||
"action": "execute",
|
||||
"scope": "global",
|
||||
"minLevel": 4
|
||||
},
|
||||
{
|
||||
"id": "ide.git",
|
||||
"name": "Git Operations",
|
||||
"description": "Commit, push, and pull",
|
||||
"resource": "ide",
|
||||
"action": "git",
|
||||
"scope": "global",
|
||||
"minLevel": 4
|
||||
}
|
||||
],
|
||||
"resources": [
|
||||
{
|
||||
"id": "ide",
|
||||
"name": "IDE",
|
||||
"type": "system",
|
||||
"description": "Nerd Mode IDE resources",
|
||||
"actions": ["read", "write", "execute", "git"]
|
||||
}
|
||||
]
|
||||
}
|
||||
138
packages/nerd_mode_ide/scripts/functions.json
Normal file
138
packages/nerd_mode_ide/scripts/functions.json
Normal file
@@ -0,0 +1,138 @@
|
||||
{
|
||||
"$schema": "https://metabuilder.dev/schemas/json-script.schema.json",
|
||||
"schemaVersion": "2.2.0",
|
||||
"package": "nerd_mode_ide",
|
||||
"description": "IDE file system and execution functions",
|
||||
"functions": [
|
||||
{
|
||||
"id": "ide_list_files",
|
||||
"name": "listFiles",
|
||||
"exported": true,
|
||||
"description": "List files in a directory",
|
||||
"category": "ide",
|
||||
"luaScript": "ide.lua"
|
||||
},
|
||||
{
|
||||
"id": "ide_read_file",
|
||||
"name": "readFile",
|
||||
"exported": true,
|
||||
"description": "Read file contents",
|
||||
"category": "ide",
|
||||
"luaScript": "ide.lua"
|
||||
},
|
||||
{
|
||||
"id": "ide_write_file",
|
||||
"name": "writeFile",
|
||||
"exported": true,
|
||||
"description": "Write file contents",
|
||||
"category": "ide",
|
||||
"luaScript": "ide.lua"
|
||||
},
|
||||
{
|
||||
"id": "ide_create_file",
|
||||
"name": "createFile",
|
||||
"exported": true,
|
||||
"description": "Create a new file",
|
||||
"category": "ide",
|
||||
"luaScript": "ide.lua"
|
||||
},
|
||||
{
|
||||
"id": "ide_create_folder",
|
||||
"name": "createFolder",
|
||||
"exported": true,
|
||||
"description": "Create a new folder",
|
||||
"category": "ide",
|
||||
"luaScript": "ide.lua"
|
||||
},
|
||||
{
|
||||
"id": "ide_delete_item",
|
||||
"name": "deleteItem",
|
||||
"exported": true,
|
||||
"description": "Delete a file or folder",
|
||||
"category": "ide",
|
||||
"luaScript": "ide.lua"
|
||||
},
|
||||
{
|
||||
"id": "ide_rename_item",
|
||||
"name": "renameItem",
|
||||
"exported": true,
|
||||
"description": "Rename a file or folder",
|
||||
"category": "ide",
|
||||
"luaScript": "ide.lua"
|
||||
},
|
||||
{
|
||||
"id": "ide_run_script",
|
||||
"name": "runScript",
|
||||
"exported": true,
|
||||
"description": "Execute a script file",
|
||||
"category": "ide",
|
||||
"luaScript": "ide.lua"
|
||||
},
|
||||
{
|
||||
"id": "ide_run_tests",
|
||||
"name": "runTests",
|
||||
"exported": true,
|
||||
"description": "Run test suite",
|
||||
"category": "ide",
|
||||
"luaScript": "ide.lua"
|
||||
},
|
||||
{
|
||||
"id": "ide_get_git_status",
|
||||
"name": "getGitStatus",
|
||||
"exported": true,
|
||||
"description": "Get git status for workspace",
|
||||
"category": "ide",
|
||||
"luaScript": "ide.lua"
|
||||
},
|
||||
{
|
||||
"id": "ide_git_commit",
|
||||
"name": "gitCommit",
|
||||
"exported": true,
|
||||
"description": "Commit changes to git",
|
||||
"category": "ide",
|
||||
"luaScript": "ide.lua"
|
||||
},
|
||||
{
|
||||
"id": "ide_git_push",
|
||||
"name": "gitPush",
|
||||
"exported": true,
|
||||
"description": "Push commits to remote",
|
||||
"category": "ide",
|
||||
"luaScript": "ide.lua"
|
||||
},
|
||||
{
|
||||
"id": "ide_git_pull",
|
||||
"name": "gitPull",
|
||||
"exported": true,
|
||||
"description": "Pull from remote",
|
||||
"category": "ide",
|
||||
"luaScript": "ide.lua"
|
||||
},
|
||||
{
|
||||
"id": "ide_detect_language",
|
||||
"name": "detectLanguage",
|
||||
"exported": true,
|
||||
"description": "Detect file language from extension",
|
||||
"category": "ide",
|
||||
"luaScript": "ide.lua"
|
||||
}
|
||||
],
|
||||
"exports": {
|
||||
"functions": [
|
||||
"listFiles",
|
||||
"readFile",
|
||||
"writeFile",
|
||||
"createFile",
|
||||
"createFolder",
|
||||
"deleteItem",
|
||||
"renameItem",
|
||||
"runScript",
|
||||
"runTests",
|
||||
"getGitStatus",
|
||||
"gitCommit",
|
||||
"gitPush",
|
||||
"gitPull",
|
||||
"detectLanguage"
|
||||
]
|
||||
}
|
||||
}
|
||||
24
packages/nerd_mode_ide/static_content/icon.svg
Normal file
24
packages/nerd_mode_ide/static_content/icon.svg
Normal file
@@ -0,0 +1,24 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<!-- Main IDE window -->
|
||||
<rect x="4" y="8" width="56" height="48" rx="3" fill="none"/>
|
||||
<!-- Title bar -->
|
||||
<path d="M4 16 L60 16" stroke-width="1.5"/>
|
||||
<circle cx="10" cy="12" r="2" fill="currentColor"/>
|
||||
<circle cx="17" cy="12" r="2" fill="currentColor"/>
|
||||
<circle cx="24" cy="12" r="2" fill="currentColor"/>
|
||||
<!-- File tree sidebar -->
|
||||
<path d="M18 16 L18 56" stroke-width="1"/>
|
||||
<path d="M8 24 L14 24 M10 30 L14 30 M10 36 L14 36 M8 42 L14 42 M10 48 L14 48" stroke-width="1.5"/>
|
||||
<!-- Code editor area -->
|
||||
<path d="M22 24 L42 24" stroke-width="1.5"/>
|
||||
<path d="M22 30 L52 30" stroke-width="1.5"/>
|
||||
<path d="M26 36 L48 36" stroke-width="1.5"/>
|
||||
<path d="M26 42 L44 42" stroke-width="1.5"/>
|
||||
<path d="M22 48 L38 48" stroke-width="1.5"/>
|
||||
<!-- Bottom panel divider -->
|
||||
<path d="M18 52 L60 52" stroke-width="1"/>
|
||||
<!-- Glasses emoji (nerd) -->
|
||||
<circle cx="52" cy="12" r="3" fill="none" stroke-width="1"/>
|
||||
<circle cx="58" cy="12" r="3" fill="none" stroke-width="1"/>
|
||||
<path d="M55 12 L55 12" stroke-width="1"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
85
packages/nerd_mode_ide/storybook/config.json
Normal file
85
packages/nerd_mode_ide/storybook/config.json
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"$schema": "https://metabuilder.dev/schemas/package-storybook.schema.json",
|
||||
"featured": true,
|
||||
"title": "Nerd Mode IDE",
|
||||
"description": "Full-featured in-browser development environment",
|
||||
"stories": [
|
||||
{
|
||||
"name": "NerdModeIDE",
|
||||
"render": "ide",
|
||||
"description": "Complete IDE interface",
|
||||
"args": {
|
||||
"fileTree": [
|
||||
{
|
||||
"name": "src",
|
||||
"path": "/src",
|
||||
"type": "folder",
|
||||
"children": [
|
||||
{ "name": "index.ts", "path": "/src/index.ts", "type": "file" },
|
||||
{ "name": "utils.ts", "path": "/src/utils.ts", "type": "file" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "package.json",
|
||||
"path": "/package.json",
|
||||
"type": "file"
|
||||
}
|
||||
],
|
||||
"currentFile": {
|
||||
"path": "/src/index.ts",
|
||||
"name": "index.ts",
|
||||
"language": "typescript",
|
||||
"content": "export function hello() {\n console.log('Hello, World!');\n}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "FileExplorer",
|
||||
"render": "explorer",
|
||||
"description": "File tree explorer",
|
||||
"args": {
|
||||
"files": [
|
||||
{ "name": "components", "path": "/components", "type": "folder" },
|
||||
{ "name": "lib", "path": "/lib", "type": "folder" },
|
||||
{ "name": "README.md", "path": "/README.md", "type": "file" }
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ConsolePanel",
|
||||
"render": "console",
|
||||
"description": "Console output panel",
|
||||
"args": {
|
||||
"logs": [
|
||||
{ "type": "info", "message": "Server started on port 3000" },
|
||||
{ "type": "warn", "message": "Deprecation warning: use X instead of Y" },
|
||||
{ "type": "error", "message": "Error: Failed to connect" }
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"renders": {
|
||||
"ide": {
|
||||
"description": "Full IDE",
|
||||
"featured": true
|
||||
},
|
||||
"explorer": {
|
||||
"description": "File explorer"
|
||||
},
|
||||
"console": {
|
||||
"description": "Console panel"
|
||||
}
|
||||
},
|
||||
"defaultContext": {
|
||||
"user": {
|
||||
"id": "admin-user",
|
||||
"username": "admin",
|
||||
"level": 4,
|
||||
"email": "admin@example.com"
|
||||
},
|
||||
"tenant": {
|
||||
"id": "demo-tenant",
|
||||
"name": "Demo Organization"
|
||||
}
|
||||
}
|
||||
}
|
||||
20
packages/nerd_mode_ide/styles/tokens.json
Normal file
20
packages/nerd_mode_ide/styles/tokens.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"$schema": "https://metabuilder.dev/schemas/package-styles.schema.json",
|
||||
"schemaVersion": "2.0.0",
|
||||
"colors": {
|
||||
"editorBackground": "#1e1e1e",
|
||||
"sidebarBackground": "#252526",
|
||||
"tabBarBackground": "#2d2d2d",
|
||||
"terminalBackground": "#0d1117",
|
||||
"lineNumberColor": "#858585",
|
||||
"selectionBackground": "#264f78"
|
||||
},
|
||||
"spacing": {
|
||||
"sidebarWidth": "240px",
|
||||
"bottomPanelHeight": "200px",
|
||||
"tabHeight": "36px"
|
||||
},
|
||||
"shadows": {
|
||||
"panel": "0 2px 8px rgba(0, 0, 0, 0.3)"
|
||||
}
|
||||
}
|
||||
22
packages/nerd_mode_ide/tests/metadata.params.json
Normal file
22
packages/nerd_mode_ide/tests/metadata.params.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"$schema": "https://metabuilder.dev/schemas/test-parameters.schema.json",
|
||||
"schemaVersion": "2.0.0",
|
||||
"package": "nerd_mode_ide",
|
||||
"description": "Parameterized test data for nerd mode IDE tests",
|
||||
|
||||
"parameters": {
|
||||
"sampleFiles": [
|
||||
{ "path": "/index.ts", "language": "typescript" },
|
||||
{ "path": "/styles.css", "language": "css" },
|
||||
{ "path": "/data.json", "language": "json" },
|
||||
{ "path": "/script.lua", "language": "lua" },
|
||||
{ "path": "/README.md", "language": "markdown" }
|
||||
],
|
||||
"gitOperations": [
|
||||
{ "operation": "commit", "requiresMessage": true },
|
||||
{ "operation": "push", "requiresRemote": true },
|
||||
{ "operation": "pull", "requiresRemote": true }
|
||||
],
|
||||
"consoleLogTypes": ["info", "warn", "error", "debug"]
|
||||
}
|
||||
}
|
||||
93
packages/nerd_mode_ide/tests/metadata.test.json
Normal file
93
packages/nerd_mode_ide/tests/metadata.test.json
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"$schema": "https://metabuilder.dev/schemas/tests.schema.json",
|
||||
"schemaVersion": "2.0.0",
|
||||
"package": "nerd_mode_ide",
|
||||
"description": "Package metadata validation tests",
|
||||
|
||||
"testSuites": [
|
||||
{
|
||||
"id": "package-metadata",
|
||||
"name": "Package Metadata Tests",
|
||||
"description": "Validate package.json metadata structure and values",
|
||||
"tags": ["metadata", "validation"],
|
||||
|
||||
"tests": [
|
||||
{
|
||||
"id": "test-package-id",
|
||||
"name": "should have correct packageId",
|
||||
"act": {
|
||||
"type": "function_call",
|
||||
"target": "getPackageMetadata",
|
||||
"input": "nerd_mode_ide"
|
||||
},
|
||||
"assert": {
|
||||
"expectations": [
|
||||
{
|
||||
"type": "equals",
|
||||
"actual": "result.packageId",
|
||||
"expected": "nerd_mode_ide",
|
||||
"description": "Package ID should match"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "test-min-level",
|
||||
"name": "should require Admin level",
|
||||
"act": {
|
||||
"type": "function_call",
|
||||
"target": "getPackageMetadata",
|
||||
"input": "nerd_mode_ide"
|
||||
},
|
||||
"assert": {
|
||||
"expectations": [
|
||||
{
|
||||
"type": "equals",
|
||||
"actual": "result.minLevel",
|
||||
"expected": 4,
|
||||
"description": "minLevel should be 4 (Admin)"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "test-icon-exists",
|
||||
"name": "should have an icon file",
|
||||
"act": {
|
||||
"type": "function_call",
|
||||
"target": "checkFileExists",
|
||||
"input": "nerd_mode_ide/static_content/icon.svg"
|
||||
},
|
||||
"assert": {
|
||||
"expectations": [
|
||||
{
|
||||
"type": "truthy",
|
||||
"actual": "result",
|
||||
"description": "Icon file should exist"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "test-category",
|
||||
"name": "should be in tools category",
|
||||
"act": {
|
||||
"type": "function_call",
|
||||
"target": "getPackageMetadata",
|
||||
"input": "nerd_mode_ide"
|
||||
},
|
||||
"assert": {
|
||||
"expectations": [
|
||||
{
|
||||
"type": "equals",
|
||||
"actual": "result.category",
|
||||
"expected": "tools",
|
||||
"description": "Category should be tools"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user