tasks.json 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. {
  2. "version": "2.0.0",
  3. "tasks": [
  4. {
  5. "label": "go: build",
  6. "type": "shell",
  7. "command": "go",
  8. "args": [
  9. "build",
  10. "-o",
  11. "bin/3x-ui.exe",
  12. "./main.go"
  13. ],
  14. "options": {
  15. "cwd": "${workspaceFolder}"
  16. },
  17. "problemMatcher": [
  18. "$go"
  19. ],
  20. "group": {
  21. "kind": "build",
  22. "isDefault": true
  23. }
  24. },
  25. {
  26. "label": "go: run",
  27. "type": "shell",
  28. "command": "go",
  29. "args": [
  30. "run",
  31. "./main.go"
  32. ],
  33. "options": {
  34. "cwd": "${workspaceFolder}",
  35. "env": {
  36. "XUI_DEBUG": "true"
  37. }
  38. },
  39. "problemMatcher": [
  40. "$go"
  41. ]
  42. },
  43. {
  44. "label": "go: test",
  45. "type": "shell",
  46. "command": "go",
  47. "args": [
  48. "test",
  49. "./..."
  50. ],
  51. "options": {
  52. "cwd": "${workspaceFolder}"
  53. },
  54. "problemMatcher": [
  55. "$go"
  56. ],
  57. "group": "test"
  58. },
  59. {
  60. "label": "go: vet",
  61. "type": "shell",
  62. "command": "go",
  63. "args": [
  64. "vet",
  65. "./..."
  66. ],
  67. "options": {
  68. "cwd": "${workspaceFolder}"
  69. },
  70. "problemMatcher": [
  71. "$go"
  72. ]
  73. },
  74. {
  75. "label": "go: fmt",
  76. "type": "shell",
  77. "command": "go",
  78. "args": [
  79. "fmt",
  80. "./..."
  81. ],
  82. "options": {
  83. "cwd": "${workspaceFolder}"
  84. },
  85. "problemMatcher": [
  86. "$go"
  87. ]
  88. },
  89. {
  90. "label": "go: modernize",
  91. "type": "shell",
  92. "command": "modernize",
  93. "args": [
  94. "./..."
  95. ],
  96. "options": {
  97. "cwd": "${workspaceFolder}"
  98. },
  99. "linux": {
  100. "options": {
  101. "cwd": "${workspaceFolder}",
  102. "env": {
  103. "PATH": "${userHome}/go/bin:/usr/local/go/bin:${env:PATH}"
  104. }
  105. }
  106. },
  107. "osx": {
  108. "options": {
  109. "cwd": "${workspaceFolder}",
  110. "env": {
  111. "PATH": "${userHome}/go/bin:/usr/local/go/bin:${env:PATH}"
  112. }
  113. }
  114. },
  115. "problemMatcher": [
  116. "$go"
  117. ]
  118. },
  119. {
  120. "label": "go: modernize -fix",
  121. "type": "shell",
  122. "command": "modernize",
  123. "args": [
  124. "-fix",
  125. "./..."
  126. ],
  127. "options": {
  128. "cwd": "${workspaceFolder}"
  129. },
  130. "linux": {
  131. "options": {
  132. "cwd": "${workspaceFolder}",
  133. "env": {
  134. "PATH": "${userHome}/go/bin:/usr/local/go/bin:${env:PATH}"
  135. }
  136. }
  137. },
  138. "osx": {
  139. "options": {
  140. "cwd": "${workspaceFolder}",
  141. "env": {
  142. "PATH": "${userHome}/go/bin:/usr/local/go/bin:${env:PATH}"
  143. }
  144. }
  145. },
  146. "problemMatcher": [
  147. "$go"
  148. ]
  149. },
  150. {
  151. "label": "go: golangci-lint run",
  152. "type": "shell",
  153. "command": "golangci-lint",
  154. "args": [
  155. "run"
  156. ],
  157. "options": {
  158. "cwd": "${workspaceFolder}"
  159. },
  160. "linux": {
  161. "options": {
  162. "cwd": "${workspaceFolder}",
  163. "env": {
  164. "PATH": "${userHome}/go/bin:/usr/local/go/bin:${env:PATH}"
  165. }
  166. }
  167. },
  168. "osx": {
  169. "options": {
  170. "cwd": "${workspaceFolder}",
  171. "env": {
  172. "PATH": "${userHome}/go/bin:/usr/local/go/bin:${env:PATH}"
  173. }
  174. }
  175. },
  176. "problemMatcher": [
  177. "$go"
  178. ]
  179. },
  180. {
  181. "label": "go: golangci-lint run --fix",
  182. "type": "shell",
  183. "command": "golangci-lint",
  184. "args": [
  185. "run",
  186. "--fix"
  187. ],
  188. "options": {
  189. "cwd": "${workspaceFolder}"
  190. },
  191. "linux": {
  192. "options": {
  193. "cwd": "${workspaceFolder}",
  194. "env": {
  195. "PATH": "${userHome}/go/bin:/usr/local/go/bin:${env:PATH}"
  196. }
  197. }
  198. },
  199. "osx": {
  200. "options": {
  201. "cwd": "${workspaceFolder}",
  202. "env": {
  203. "PATH": "${userHome}/go/bin:/usr/local/go/bin:${env:PATH}"
  204. }
  205. }
  206. },
  207. "problemMatcher": [
  208. "$go"
  209. ]
  210. },
  211. {
  212. "label": "go: install golangci-lint",
  213. "type": "shell",
  214. "command": "go",
  215. "args": [
  216. "install",
  217. "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest"
  218. ],
  219. "options": {
  220. "cwd": "${workspaceFolder}"
  221. },
  222. "linux": {
  223. "options": {
  224. "cwd": "${workspaceFolder}",
  225. "env": {
  226. "PATH": "${userHome}/go/bin:/usr/local/go/bin:${env:PATH}"
  227. }
  228. }
  229. },
  230. "osx": {
  231. "options": {
  232. "cwd": "${workspaceFolder}",
  233. "env": {
  234. "PATH": "${userHome}/go/bin:/usr/local/go/bin:${env:PATH}"
  235. }
  236. }
  237. },
  238. "problemMatcher": []
  239. },
  240. {
  241. "label": "go: install modernize",
  242. "type": "shell",
  243. "command": "go",
  244. "args": [
  245. "install",
  246. "golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest"
  247. ],
  248. "options": {
  249. "cwd": "${workspaceFolder}"
  250. },
  251. "linux": {
  252. "options": {
  253. "cwd": "${workspaceFolder}",
  254. "env": {
  255. "PATH": "${userHome}/go/bin:/usr/local/go/bin:${env:PATH}"
  256. }
  257. }
  258. },
  259. "osx": {
  260. "options": {
  261. "cwd": "${workspaceFolder}",
  262. "env": {
  263. "PATH": "${userHome}/go/bin:/usr/local/go/bin:${env:PATH}"
  264. }
  265. }
  266. },
  267. "problemMatcher": []
  268. },
  269. {
  270. "label": "go: install tools",
  271. "dependsOrder": "sequence",
  272. "dependsOn": [
  273. "go: install golangci-lint",
  274. "go: install modernize"
  275. ],
  276. "problemMatcher": []
  277. },
  278. {
  279. "label": "frontend: ncu -u",
  280. "type": "shell",
  281. "command": "npx",
  282. "args": [
  283. "npm-check-updates",
  284. "-u"
  285. ],
  286. "options": {
  287. "cwd": "${workspaceFolder}/frontend"
  288. },
  289. "problemMatcher": []
  290. },
  291. {
  292. "label": "frontend: install",
  293. "type": "shell",
  294. "command": "npm",
  295. "args": [
  296. "install"
  297. ],
  298. "options": {
  299. "cwd": "${workspaceFolder}/frontend"
  300. },
  301. "problemMatcher": []
  302. },
  303. {
  304. "label": "frontend: dev",
  305. "type": "shell",
  306. "command": "npm",
  307. "args": [
  308. "run",
  309. "dev"
  310. ],
  311. "options": {
  312. "cwd": "${workspaceFolder}/frontend"
  313. },
  314. "isBackground": true,
  315. "problemMatcher": [],
  316. "presentation": {
  317. "panel": "dedicated",
  318. "group": "dev"
  319. }
  320. },
  321. {
  322. "label": "frontend: build",
  323. "type": "shell",
  324. "command": "npm",
  325. "args": [
  326. "run",
  327. "build"
  328. ],
  329. "options": {
  330. "cwd": "${workspaceFolder}/frontend"
  331. },
  332. "problemMatcher": [
  333. "$tsc"
  334. ],
  335. "group": "build"
  336. },
  337. {
  338. "label": "frontend: gen",
  339. "type": "shell",
  340. "command": "npm",
  341. "args": [
  342. "run",
  343. "gen"
  344. ],
  345. "options": {
  346. "cwd": "${workspaceFolder}/frontend"
  347. },
  348. "problemMatcher": []
  349. },
  350. {
  351. "label": "frontend: lint",
  352. "type": "shell",
  353. "command": "npm",
  354. "args": [
  355. "run",
  356. "lint"
  357. ],
  358. "options": {
  359. "cwd": "${workspaceFolder}/frontend"
  360. },
  361. "problemMatcher": [
  362. "$eslint-stylish"
  363. ]
  364. },
  365. {
  366. "label": "frontend: test",
  367. "type": "shell",
  368. "command": "npm",
  369. "args": [
  370. "run",
  371. "test"
  372. ],
  373. "options": {
  374. "cwd": "${workspaceFolder}/frontend"
  375. },
  376. "problemMatcher": [],
  377. "group": "test"
  378. },
  379. {
  380. "label": "frontend: test:watch",
  381. "type": "shell",
  382. "command": "npm",
  383. "args": [
  384. "run",
  385. "test:watch"
  386. ],
  387. "options": {
  388. "cwd": "${workspaceFolder}/frontend"
  389. },
  390. "isBackground": true,
  391. "problemMatcher": [],
  392. "group": "test",
  393. "presentation": {
  394. "panel": "dedicated",
  395. "group": "test"
  396. }
  397. },
  398. {
  399. "label": "frontend: typecheck",
  400. "type": "shell",
  401. "command": "npm",
  402. "args": [
  403. "run",
  404. "typecheck"
  405. ],
  406. "options": {
  407. "cwd": "${workspaceFolder}/frontend"
  408. },
  409. "problemMatcher": [
  410. "$tsc"
  411. ]
  412. },
  413. {
  414. "label": "frontend: gen:zod",
  415. "type": "shell",
  416. "command": "npm",
  417. "args": [
  418. "run",
  419. "gen:zod"
  420. ],
  421. "options": {
  422. "cwd": "${workspaceFolder}/frontend"
  423. },
  424. "problemMatcher": []
  425. },
  426. {
  427. "label": "frontend: gen:api",
  428. "type": "shell",
  429. "command": "npm",
  430. "args": [
  431. "run",
  432. "gen:api"
  433. ],
  434. "options": {
  435. "cwd": "${workspaceFolder}/frontend"
  436. },
  437. "problemMatcher": []
  438. },
  439. {
  440. "label": "build: full (frontend + go)",
  441. "dependsOrder": "sequence",
  442. "dependsOn": [
  443. "frontend: build",
  444. "go: build"
  445. ],
  446. "problemMatcher": [],
  447. "group": {
  448. "kind": "build",
  449. "isDefault": false
  450. }
  451. },
  452. {
  453. "label": "check: all",
  454. "dependsOn": [
  455. "go: vet",
  456. "go: test",
  457. "frontend: lint",
  458. "frontend: typecheck",
  459. "frontend: test"
  460. ],
  461. "problemMatcher": []
  462. }
  463. ]
  464. }