1
0

tasks.json 9.3 KB

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