"feat: 增加助手应用配置管理功能与服务器守护进程支持"
This commit is contained in:
		
							
								
								
									
										34
									
								
								assistant/tasks/silkyai/deno.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								assistant/tasks/silkyai/deno.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| { | ||||
|   "tasks": { | ||||
|     "dev": { | ||||
|       "command": "deno run -A talkshow.ts", | ||||
|       "desc": "Run the server in development mode" | ||||
|     }, | ||||
|     "build": { | ||||
|       "command": "deno run --allow-all --unstable src/build.ts", | ||||
|       "desc": "Build the project" | ||||
|     }, | ||||
|     "build:dts": { | ||||
|       "command": "deno run -A talkshow.ts --dts", | ||||
|       "desc": "Build the project with dts" | ||||
|     } | ||||
|   }, | ||||
|   "lint": { | ||||
|     "files": [ | ||||
|       "src/**/*.ts", | ||||
|       "src/**/*.tsx", | ||||
|       "src/**/*.js", | ||||
|       "src/**/*.jsx" | ||||
|     ], | ||||
|     "options": { | ||||
|       "rules": { | ||||
|         "ban-untagged-todo": false, | ||||
|         "no-explicit-any": false, | ||||
|         "no-unused-vars": false | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   "imports": { | ||||
|     "https://esm.xiongxiao.me/@kevisual/task-command/mod.ts": "../../task-command/mod.ts" | ||||
|   } | ||||
| } | ||||
							
								
								
									
										17
									
								
								assistant/tasks/silkyai/deno.lock
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								assistant/tasks/silkyai/deno.lock
									
									
									
										generated
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| { | ||||
|   "version": "4", | ||||
|   "specifiers": { | ||||
|     "npm:@types/node@*": "22.12.0" | ||||
|   }, | ||||
|   "npm": { | ||||
|     "@types/node@22.12.0": { | ||||
|       "integrity": "sha512-Fll2FZ1riMjNmlmJOdAyY5pUbkftXslB5DgEzlIuNaiWhXd00FhWxVC/r4yV/4wBb9JfImTu+jiSvXTkJ7F/gA==", | ||||
|       "dependencies": [ | ||||
|         "undici-types" | ||||
|       ] | ||||
|     }, | ||||
|     "undici-types@6.20.0": { | ||||
|       "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==" | ||||
|     } | ||||
|   } | ||||
| } | ||||
| @@ -1,3 +1,40 @@ | ||||
| import { TasksCommand } from 'https://esm.xiongxiao.me/@kevisual/task-command/mod.ts'; | ||||
| // import { TasksCommand } from '../../task-command/mod.ts'; | ||||
| const init = { | ||||
|   description: '安装依赖', | ||||
|   command: 'npm install -g @kevisual/cli --registry=https://registry.npmmirror.com', | ||||
|   afterCheck: 'added', | ||||
| }; | ||||
| const init1 = { | ||||
|   description: '安装 pm2', | ||||
|   type: 'npm-install', | ||||
|   command: 'npm install -g pm2 --registry=https://registry.npmmirror.com', | ||||
|   before: 'pm2 -v', | ||||
| }; | ||||
| const init2 = { | ||||
|   description: '安装 deno', | ||||
|   command: 'npm install -g deno --registry=https://registry.npmmirror.com', | ||||
|   type: 'npm-install', | ||||
|   before: 'deno -v', | ||||
|   beforeCheck: 'deno', | ||||
| }; | ||||
| const init3 = { | ||||
|   description: '安装 bun', | ||||
|   type: 'npm-install', | ||||
|   command: 'npm install -g bun --registry=https://registry.npmmirror.com', | ||||
|   beforeCheck: 'bun -v', | ||||
| }; | ||||
|  | ||||
| // =========================== | ||||
| // 安装talkshow的程序到本地 | ||||
| const talk = { | ||||
|   description: '设置默认的 base registry 地址 为 https://kevisual.silkyai.cn', | ||||
|   command: 'ev base -s https://kevisual.silkyai.cn', | ||||
| }; | ||||
| const talkInit = { | ||||
|   description: '初始化一个助手客户端,生成配置文件。', | ||||
|   command: 'asst init', | ||||
| }; | ||||
| const task1 = { | ||||
|   description: '下载前端应用 root/center 应用', | ||||
|   command: 'ev app download -i root/center -o assistant-app/page', | ||||
| @@ -12,3 +49,26 @@ const task3 = { | ||||
|   description: '安装后端应用 root/talkshow-code-center 应用', | ||||
|   command: 'ev app download -i root/talkshow-code-center -t app -o assistant-app/apps/talkshow-code-center', | ||||
| }; | ||||
|  | ||||
| // =========================== | ||||
|  | ||||
| const runTask1 = async () => { | ||||
|   const tasksCommand = new TasksCommand(); | ||||
|   tasksCommand.addTask(init2); | ||||
|   const res = tasksCommand.runTask(init2.description); | ||||
|   console.log(res); | ||||
| }; | ||||
| // runTask1(); | ||||
| const runTestTask = async () => { | ||||
|   const tasksCommand = new TasksCommand(); | ||||
|   const task = { | ||||
|     description: 'test', | ||||
|     command: 'npm i -g rollup --registry=https://registry.npmmirror.com', | ||||
|     type: 'npm-install', | ||||
|   }; | ||||
|   tasksCommand.addTask(task); | ||||
|   const res = tasksCommand.runTask(task.description); | ||||
|   console.log(res); | ||||
|   return res; | ||||
| }; | ||||
| runTestTask(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user