{"id":26660617,"url":"https://github.com/codevideo/codevideo-virtual-ide","last_synced_at":"2025-04-11T16:13:22.634Z","repository":{"id":273224184,"uuid":"886933426","full_name":"codevideo/codevideo-virtual-ide","owner":"codevideo","description":"A fully time-travelable virtual editor, comprised of one or more codevideo-virtual-code-block and codevideo-virtual-terminal","archived":false,"fork":false,"pushed_at":"2025-03-20T11:02:45.000Z","size":546,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T07:15:55.441Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codevideo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-11T21:48:07.000Z","updated_at":"2025-03-20T11:02:49.000Z","dependencies_parsed_at":"2025-01-19T16:08:10.672Z","dependency_job_id":"e5ec5731-4d36-445a-9cec-c240b61886d5","html_url":"https://github.com/codevideo/codevideo-virtual-ide","commit_stats":null,"previous_names":["codevideo/codevideo-virtual-ide"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codevideo%2Fcodevideo-virtual-ide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codevideo%2Fcodevideo-virtual-ide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codevideo%2Fcodevideo-virtual-ide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codevideo%2Fcodevideo-virtual-ide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codevideo","download_url":"https://codeload.github.com/codevideo/codevideo-virtual-ide/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248438513,"owners_count":21103410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-25T12:18:48.251Z","updated_at":"2025-04-11T16:13:22.615Z","avatar_url":"https://github.com/codevideo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @fullstackcraft/codevideo-virtual-ide\n\n![NPM Version](https://img.shields.io/npm/v/@fullstackcraftllc/codevideo-virtual-ide)\n\n`codevideo-virtual-ide` is a TypeScript class that simulates a terminal with features like cursor navigation, text insertion, and line manipulation. It provides a flexible interface for applying various editing actions such as typing, moving the cursor, and executing commands. This lightweight and versatile library is ideal for building educational tools, code playgrounds, and interactive coding environments within web applications.\n\nThis library heavily relies on the types from [codevideo-types](https://github.com/codevideo/codevideo-types)\n\n## Example Usage\n\n```typescript\nimport { VirtualIDE } from '@fullstackcraftllc/codevideo-virtual-ide';\nimport { VirtualEditor } from '@fullstackcraftllc/codevideo-virtual-editor';\nimport { VirtualTerminal } from '@fullstackcraftllc/codevideo-virtual-terminal';\nimport { VirtualAuthor } from '@fullstackcraftllc/codevideo-virtual-author';\n\nconst virtualIDE = new VirtualIDE();\nvirtualIDE.addVirtualEditor(new VirtualEditor());\nvirtualIDE.addVirtualTerminal(new VirtualTerminal());\nvirtualIDE.addVirtualAuthor(new VirtualAuthor());\n\n// Create a basic project structure\nvirtualIDE.applyAction({\n  name: 'create-folder',\n  value: 'src'\n});\n\nvirtualIDE.applyAction({\n  name: 'create-file',\n  value: 'src/index.js'\n});\n\n// Add narration\nvirtualIDE.applyAction({\n  name: 'speak-before',\n  value: \"Let's create a simple JavaScript program.\"\n});\n\n// Open and edit the file\nvirtualIDE.applyAction({\n  name: 'click-filename',\n  value: 'src/index.js'\n});\n\nvirtualIDE.applyAction({\n  name: 'type-editor',\n  value: 'console.log(\"Hello, World!\");'\n});\n\n// Execute in terminal\nvirtualIDE.applyAction({\n  name: 'open-terminal',\n  value: '1'\n});\n\nvirtualIDE.applyAction({\n  name: 'type-terminal',\n  value: 'node src/index.js'\n});\n\nconst courseSnapshot = virtualIDE.getCourseSnapshot();\n\nconsole.log(courseSnapshot);\n/* Output:\n{\n  editorSnapshot: {\n    fileStructure: {\n      src: {\n        type: 'directory',\n        content: '',\n        collapsed: false,\n        children: {\n          'index.js': {\n            type: 'file',\n            content: 'console.log(\"Hello, World!\");',\n            language: 'js',\n            caretPosition: { row: 0, col: 27 }\n          }\n        }\n      }\n    },\n    currentFile: 'src/index.js',\n    terminalContents: 'node src/index.js'\n  },\n  mouseSnapshot: {\n    x: 0,\n    y: 0,\n    timestamp: 0,\n    type: 'move',\n    buttonStates: { left: false, right: false, middle: false },\n    scrollPosition: { x: 0, y: 0 }\n  },\n  authorSnapshot: {\n    currentSpeechCaption: \"\"\n  }\n}\n*/\n```\n\n## Why?\n\nThis library is the main powerhouse used to build projections that are used to validate actions across the CodeVideo ecosystem. This is a small part of a larger project to create a declarative way to build, edit, and generate step by step educational video software courses.\n\nSee more at [codevideo.io](https://codevideo.io)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodevideo%2Fcodevideo-virtual-ide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodevideo%2Fcodevideo-virtual-ide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodevideo%2Fcodevideo-virtual-ide/lists"}