├── src ├── data │ ├── colors.ts │ └── examples.ts ├── shims-vue.d.ts ├── utils │ ├── delay.ts │ ├── formatter.ts │ └── parser.ts ├── components │ ├── QueueView.vue │ ├── StackView.vue │ ├── TerminalLog.vue │ ├── Controls.vue │ ├── CodeEditor.vue │ ├── HelloWorld.vue │ └── ExecutionVisualizer.vue ├── composables │ ├── useAnimator.ts │ ├── useParser.ts │ └── useExecutionFlow.ts ├── vite-env.d.ts ├── main.ts ├── App.vue ├── store │ └── execution.ts ├── assets │ └── vue.svg ├── views │ └── HomeView.vue └── style.css ├── .vscode └── extensions.json ├── tsconfig.json ├── vite.config.ts ├── .gitignore ├── index.html ├── tsconfig.app.json ├── README.md ├── tsconfig.node.json ├── package.json └── public └── vite.svg /src/data/colors.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/utils/delay.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/data/examples.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/utils/formatter.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/utils/parser.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/QueueView.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/StackView.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/TerminalLog.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/composables/useAnimator.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["Vue.volar"] 3 | } 4 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import { createPinia } from 'pinia' 4 | 5 | import './style.css' 6 | 7 | const app = createApp(App) 8 | app.use(createPinia()) 9 | app.mount('#app') 10 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "module": "ESNext", 5 | "moduleResolution": "Node", 6 | "types": ["node"], 7 | "baseUrl": ".", 8 | "paths": { 9 | "@/*": ["src/*"] 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | 11 | 17 | -------------------------------------------------------------------------------- /vite.config.ts: -------------------------------------------------------------------------------- 1 | import { fileURLToPath, URL } from 'node:url' 2 | import { defineConfig } from 'vite' 3 | import vue from '@vitejs/plugin-vue' 4 | 5 | // https://vitejs.dev/config/ 6 | export default defineConfig({ 7 | plugins: [vue()], 8 | resolve: { 9 | alias: { 10 | '@': fileURLToPath(new URL('./src', import.meta.url)) 11 | } 12 | } 13 | }) 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /src/store/execution.ts: -------------------------------------------------------------------------------- 1 | import { defineStore } from 'pinia' 2 | import type { ExecutionStep } from '../composables/useExecutionFlow' 3 | 4 | export const useExecutionStore = defineStore('execution', { 5 | state: () => ({ 6 | steps: [] as ExecutionStep[] 7 | }), 8 | actions: { 9 | setSteps(newSteps: ExecutionStep[]) { 10 | this.steps = newSteps 11 | } 12 | } 13 | }) 14 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + Vue + TS 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/composables/useParser.ts: -------------------------------------------------------------------------------- 1 | import * as esprima from 'esprima' 2 | 3 | export function useParser() { 4 | const parseCodeToAST = (code: string) => { 5 | try { 6 | const ast = esprima.parseScript(code, { loc: true }) 7 | return ast 8 | } catch (err) { 9 | console.error('Parsing error:', err) 10 | return null 11 | } 12 | } 13 | 14 | return { 15 | parseCodeToAST 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@vue/tsconfig/tsconfig.dom.json", 3 | "compilerOptions": { 4 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", 5 | 6 | /* Linting */ 7 | "strict": true, 8 | "noUnusedLocals": true, 9 | "noUnusedParameters": true, 10 | "noFallthroughCasesInSwitch": true, 11 | "noUncheckedSideEffectImports": true 12 | }, 13 | "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] 14 | } 15 | -------------------------------------------------------------------------------- /src/assets/vue.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | <<<<<<< HEAD 2 | # Vue 3 + TypeScript + Vite 3 | 4 | This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 ` 12 | 13 | 40 | -------------------------------------------------------------------------------- /src/components/CodeEditor.vue: -------------------------------------------------------------------------------- 1 |