trident-git 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/app-path-routes-manifest.json +23 -0
  3. package/.next/build-manifest.json +20 -0
  4. package/.next/export-marker.json +6 -0
  5. package/.next/images-manifest.json +73 -0
  6. package/.next/next-minimal-server.js.nft.json +1 -0
  7. package/.next/next-server.js.nft.json +1 -0
  8. package/.next/package.json +1 -0
  9. package/.next/prerender-manifest.json +282 -0
  10. package/.next/react-loadable-manifest.json +1 -0
  11. package/.next/required-server-files.js +330 -0
  12. package/.next/required-server-files.json +330 -0
  13. package/.next/routes-manifest.json +170 -0
  14. package/.next/server/app/_global-error/page.js +3 -0
  15. package/.next/server/app/_global-error/page.js.nft.json +1 -0
  16. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -0
  17. package/.next/server/app/_global-error.html +2 -0
  18. package/.next/server/app/_global-error.meta +16 -0
  19. package/.next/server/app/_global-error.rsc +12 -0
  20. package/.next/server/app/_global-error.segments/_full.segment.rsc +12 -0
  21. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +5 -0
  22. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +4 -0
  23. package/.next/server/app/_global-error.segments/_head.segment.rsc +5 -0
  24. package/.next/server/app/_global-error.segments/_index.segment.rsc +4 -0
  25. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
  26. package/.next/server/app/_not-found/page.js +2 -0
  27. package/.next/server/app/_not-found/page.js.nft.json +1 -0
  28. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
  29. package/.next/server/app/_not-found.html +1 -0
  30. package/.next/server/app/_not-found.meta +16 -0
  31. package/.next/server/app/_not-found.rsc +19 -0
  32. package/.next/server/app/_not-found.segments/_full.segment.rsc +19 -0
  33. package/.next/server/app/_not-found.segments/_head.segment.rsc +6 -0
  34. package/.next/server/app/_not-found.segments/_index.segment.rsc +8 -0
  35. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
  36. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +4 -0
  37. package/.next/server/app/_not-found.segments/_tree.segment.rsc +6 -0
  38. package/.next/server/app/api/credentials/route.js +1 -0
  39. package/.next/server/app/api/credentials/route.js.nft.json +1 -0
  40. package/.next/server/app/api/credentials/route_client-reference-manifest.js +1 -0
  41. package/.next/server/app/api/custom-scripts/route.js +3 -0
  42. package/.next/server/app/api/custom-scripts/route.js.nft.json +1 -0
  43. package/.next/server/app/api/custom-scripts/route_client-reference-manifest.js +1 -0
  44. package/.next/server/app/api/fs/route.js +1 -0
  45. package/.next/server/app/api/fs/route.js.nft.json +1 -0
  46. package/.next/server/app/api/fs/route_client-reference-manifest.js +1 -0
  47. package/.next/server/app/api/git/action/route.js +1 -0
  48. package/.next/server/app/api/git/action/route.js.nft.json +1 -0
  49. package/.next/server/app/api/git/action/route_client-reference-manifest.js +1 -0
  50. package/.next/server/app/api/git/branches/route.js +1 -0
  51. package/.next/server/app/api/git/branches/route.js.nft.json +1 -0
  52. package/.next/server/app/api/git/branches/route_client-reference-manifest.js +1 -0
  53. package/.next/server/app/api/git/diff/route.js +1 -0
  54. package/.next/server/app/api/git/diff/route.js.nft.json +1 -0
  55. package/.next/server/app/api/git/diff/route_client-reference-manifest.js +1 -0
  56. package/.next/server/app/api/git/log/route.js +1 -0
  57. package/.next/server/app/api/git/log/route.js.nft.json +1 -0
  58. package/.next/server/app/api/git/log/route_client-reference-manifest.js +1 -0
  59. package/.next/server/app/api/git/status/route.js +1 -0
  60. package/.next/server/app/api/git/status/route.js.nft.json +1 -0
  61. package/.next/server/app/api/git/status/route_client-reference-manifest.js +1 -0
  62. package/.next/server/app/api/repos/route.js +1 -0
  63. package/.next/server/app/api/repos/route.js.nft.json +1 -0
  64. package/.next/server/app/api/repos/route_client-reference-manifest.js +1 -0
  65. package/.next/server/app/api/settings/route.js +1 -0
  66. package/.next/server/app/api/settings/route.js.nft.json +1 -0
  67. package/.next/server/app/api/settings/route_client-reference-manifest.js +1 -0
  68. package/.next/server/app/credentials/page.js +4 -0
  69. package/.next/server/app/credentials/page.js.nft.json +1 -0
  70. package/.next/server/app/credentials/page_client-reference-manifest.js +1 -0
  71. package/.next/server/app/credentials.html +1 -0
  72. package/.next/server/app/credentials.meta +15 -0
  73. package/.next/server/app/credentials.rsc +23 -0
  74. package/.next/server/app/credentials.segments/_full.segment.rsc +23 -0
  75. package/.next/server/app/credentials.segments/_head.segment.rsc +6 -0
  76. package/.next/server/app/credentials.segments/_index.segment.rsc +8 -0
  77. package/.next/server/app/credentials.segments/_tree.segment.rsc +6 -0
  78. package/.next/server/app/credentials.segments/credentials/__PAGE__.segment.rsc +9 -0
  79. package/.next/server/app/credentials.segments/credentials.segment.rsc +4 -0
  80. package/.next/server/app/icon.png/route.js +1 -0
  81. package/.next/server/app/icon.png/route.js.nft.json +1 -0
  82. package/.next/server/app/icon.png.meta +1 -0
  83. package/.next/server/app/index.html +1 -0
  84. package/.next/server/app/index.meta +14 -0
  85. package/.next/server/app/index.rsc +20 -0
  86. package/.next/server/app/index.segments/__PAGE__.segment.rsc +6 -0
  87. package/.next/server/app/index.segments/_full.segment.rsc +20 -0
  88. package/.next/server/app/index.segments/_head.segment.rsc +6 -0
  89. package/.next/server/app/index.segments/_index.segment.rsc +8 -0
  90. package/.next/server/app/index.segments/_tree.segment.rsc +6 -0
  91. package/.next/server/app/page.js +2 -0
  92. package/.next/server/app/page.js.nft.json +1 -0
  93. package/.next/server/app/page_client-reference-manifest.js +1 -0
  94. package/.next/server/app/workspace/changes/page.js +4 -0
  95. package/.next/server/app/workspace/changes/page.js.nft.json +1 -0
  96. package/.next/server/app/workspace/changes/page_client-reference-manifest.js +1 -0
  97. package/.next/server/app/workspace/changes.html +1 -0
  98. package/.next/server/app/workspace/changes.meta +16 -0
  99. package/.next/server/app/workspace/changes.rsc +26 -0
  100. package/.next/server/app/workspace/changes.segments/_full.segment.rsc +26 -0
  101. package/.next/server/app/workspace/changes.segments/_head.segment.rsc +6 -0
  102. package/.next/server/app/workspace/changes.segments/_index.segment.rsc +8 -0
  103. package/.next/server/app/workspace/changes.segments/_tree.segment.rsc +7 -0
  104. package/.next/server/app/workspace/changes.segments/workspace/changes/__PAGE__.segment.rsc +10 -0
  105. package/.next/server/app/workspace/changes.segments/workspace/changes.segment.rsc +4 -0
  106. package/.next/server/app/workspace/changes.segments/workspace.segment.rsc +7 -0
  107. package/.next/server/app/workspace/custom-scripts/page.js +2 -0
  108. package/.next/server/app/workspace/custom-scripts/page.js.nft.json +1 -0
  109. package/.next/server/app/workspace/custom-scripts/page_client-reference-manifest.js +1 -0
  110. package/.next/server/app/workspace/custom-scripts.html +1 -0
  111. package/.next/server/app/workspace/custom-scripts.meta +16 -0
  112. package/.next/server/app/workspace/custom-scripts.rsc +25 -0
  113. package/.next/server/app/workspace/custom-scripts.segments/_full.segment.rsc +25 -0
  114. package/.next/server/app/workspace/custom-scripts.segments/_head.segment.rsc +6 -0
  115. package/.next/server/app/workspace/custom-scripts.segments/_index.segment.rsc +8 -0
  116. package/.next/server/app/workspace/custom-scripts.segments/_tree.segment.rsc +6 -0
  117. package/.next/server/app/workspace/custom-scripts.segments/workspace/custom-scripts/__PAGE__.segment.rsc +9 -0
  118. package/.next/server/app/workspace/custom-scripts.segments/workspace/custom-scripts.segment.rsc +4 -0
  119. package/.next/server/app/workspace/custom-scripts.segments/workspace.segment.rsc +7 -0
  120. package/.next/server/app/workspace/history/page.js +2 -0
  121. package/.next/server/app/workspace/history/page.js.nft.json +1 -0
  122. package/.next/server/app/workspace/history/page_client-reference-manifest.js +1 -0
  123. package/.next/server/app/workspace/history.html +1 -0
  124. package/.next/server/app/workspace/history.meta +16 -0
  125. package/.next/server/app/workspace/history.rsc +26 -0
  126. package/.next/server/app/workspace/history.segments/_full.segment.rsc +26 -0
  127. package/.next/server/app/workspace/history.segments/_head.segment.rsc +6 -0
  128. package/.next/server/app/workspace/history.segments/_index.segment.rsc +8 -0
  129. package/.next/server/app/workspace/history.segments/_tree.segment.rsc +7 -0
  130. package/.next/server/app/workspace/history.segments/workspace/history/__PAGE__.segment.rsc +10 -0
  131. package/.next/server/app/workspace/history.segments/workspace/history.segment.rsc +4 -0
  132. package/.next/server/app/workspace/history.segments/workspace.segment.rsc +7 -0
  133. package/.next/server/app/workspace/page.js +2 -0
  134. package/.next/server/app/workspace/page.js.nft.json +1 -0
  135. package/.next/server/app/workspace/page_client-reference-manifest.js +1 -0
  136. package/.next/server/app/workspace/settings/page.js +2 -0
  137. package/.next/server/app/workspace/settings/page.js.nft.json +1 -0
  138. package/.next/server/app/workspace/settings/page_client-reference-manifest.js +1 -0
  139. package/.next/server/app/workspace/settings.html +1 -0
  140. package/.next/server/app/workspace/settings.meta +16 -0
  141. package/.next/server/app/workspace/settings.rsc +25 -0
  142. package/.next/server/app/workspace/settings.segments/_full.segment.rsc +25 -0
  143. package/.next/server/app/workspace/settings.segments/_head.segment.rsc +6 -0
  144. package/.next/server/app/workspace/settings.segments/_index.segment.rsc +8 -0
  145. package/.next/server/app/workspace/settings.segments/_tree.segment.rsc +6 -0
  146. package/.next/server/app/workspace/settings.segments/workspace/settings/__PAGE__.segment.rsc +9 -0
  147. package/.next/server/app/workspace/settings.segments/workspace/settings.segment.rsc +4 -0
  148. package/.next/server/app/workspace/settings.segments/workspace.segment.rsc +7 -0
  149. package/.next/server/app/workspace/stashes/page.js +2 -0
  150. package/.next/server/app/workspace/stashes/page.js.nft.json +1 -0
  151. package/.next/server/app/workspace/stashes/page_client-reference-manifest.js +1 -0
  152. package/.next/server/app/workspace/stashes.html +1 -0
  153. package/.next/server/app/workspace/stashes.meta +16 -0
  154. package/.next/server/app/workspace/stashes.rsc +26 -0
  155. package/.next/server/app/workspace/stashes.segments/_full.segment.rsc +26 -0
  156. package/.next/server/app/workspace/stashes.segments/_head.segment.rsc +6 -0
  157. package/.next/server/app/workspace/stashes.segments/_index.segment.rsc +8 -0
  158. package/.next/server/app/workspace/stashes.segments/_tree.segment.rsc +7 -0
  159. package/.next/server/app/workspace/stashes.segments/workspace/stashes/__PAGE__.segment.rsc +10 -0
  160. package/.next/server/app/workspace/stashes.segments/workspace/stashes.segment.rsc +4 -0
  161. package/.next/server/app/workspace/stashes.segments/workspace.segment.rsc +7 -0
  162. package/.next/server/app/workspace.html +1 -0
  163. package/.next/server/app/workspace.meta +15 -0
  164. package/.next/server/app/workspace.rsc +26 -0
  165. package/.next/server/app/workspace.segments/_full.segment.rsc +26 -0
  166. package/.next/server/app/workspace.segments/_head.segment.rsc +6 -0
  167. package/.next/server/app/workspace.segments/_index.segment.rsc +8 -0
  168. package/.next/server/app/workspace.segments/_tree.segment.rsc +7 -0
  169. package/.next/server/app/workspace.segments/workspace/__PAGE__.segment.rsc +10 -0
  170. package/.next/server/app/workspace.segments/workspace.segment.rsc +7 -0
  171. package/.next/server/app-paths-manifest.json +23 -0
  172. package/.next/server/chunks/116.js +1 -0
  173. package/.next/server/chunks/170.js +1 -0
  174. package/.next/server/chunks/309.js +6 -0
  175. package/.next/server/chunks/356.js +1 -0
  176. package/.next/server/chunks/392.js +1 -0
  177. package/.next/server/chunks/443.js +37 -0
  178. package/.next/server/chunks/445.js +22 -0
  179. package/.next/server/chunks/471.js +13 -0
  180. package/.next/server/chunks/557.js +5 -0
  181. package/.next/server/chunks/680.js +1 -0
  182. package/.next/server/chunks/739.js +5 -0
  183. package/.next/server/chunks/781.js +1 -0
  184. package/.next/server/chunks/813.js +1 -0
  185. package/.next/server/chunks/816.js +13 -0
  186. package/.next/server/functions-config-manifest.json +6 -0
  187. package/.next/server/interception-route-rewrite-manifest.js +1 -0
  188. package/.next/server/middleware-build-manifest.js +1 -0
  189. package/.next/server/middleware-manifest.json +6 -0
  190. package/.next/server/middleware-react-loadable-manifest.js +1 -0
  191. package/.next/server/next-font-manifest.js +1 -0
  192. package/.next/server/next-font-manifest.json +1 -0
  193. package/.next/server/pages/404.html +1 -0
  194. package/.next/server/pages/500.html +2 -0
  195. package/.next/server/pages-manifest.json +4 -0
  196. package/.next/server/server-reference-manifest.js +1 -0
  197. package/.next/server/server-reference-manifest.json +1 -0
  198. package/.next/server/webpack-runtime.js +1 -0
  199. package/.next/static/VTWJwhFJd5VcC6GP5bbli/_buildManifest.js +1 -0
  200. package/.next/static/VTWJwhFJd5VcC6GP5bbli/_ssgManifest.js +1 -0
  201. package/.next/static/chunks/131-6237c77d708182b1.js +1 -0
  202. package/.next/static/chunks/147-d4cb3e03218d75df.js +6 -0
  203. package/.next/static/chunks/176-b068120641913226.js +1 -0
  204. package/.next/static/chunks/200-3664e65687e716a2.js +1 -0
  205. package/.next/static/chunks/26-d93e82c9c09ff972.js +1 -0
  206. package/.next/static/chunks/4bd1b696-096d35a2bd1da3af.js +1 -0
  207. package/.next/static/chunks/500-5d45efbf86b8d36e.js +1 -0
  208. package/.next/static/chunks/772-b39107b40c31b6b6.js +3 -0
  209. package/.next/static/chunks/785-e6d755147ff87934.js +1 -0
  210. package/.next/static/chunks/790-3e8fa6e595d97940.js +6 -0
  211. package/.next/static/chunks/794-37dad9bbc14b04b8.js +2 -0
  212. package/.next/static/chunks/841-4d865378216d36eb.js +13 -0
  213. package/.next/static/chunks/app/_global-error/page-9eb8a19109bbd711.js +1 -0
  214. package/.next/static/chunks/app/_not-found/page-5bea07380837254f.js +1 -0
  215. package/.next/static/chunks/app/api/credentials/route-9eb8a19109bbd711.js +1 -0
  216. package/.next/static/chunks/app/api/custom-scripts/route-9eb8a19109bbd711.js +1 -0
  217. package/.next/static/chunks/app/api/fs/route-9eb8a19109bbd711.js +1 -0
  218. package/.next/static/chunks/app/api/git/action/route-9eb8a19109bbd711.js +1 -0
  219. package/.next/static/chunks/app/api/git/branches/route-9eb8a19109bbd711.js +1 -0
  220. package/.next/static/chunks/app/api/git/diff/route-9eb8a19109bbd711.js +1 -0
  221. package/.next/static/chunks/app/api/git/log/route-9eb8a19109bbd711.js +1 -0
  222. package/.next/static/chunks/app/api/git/status/route-9eb8a19109bbd711.js +1 -0
  223. package/.next/static/chunks/app/api/repos/route-9eb8a19109bbd711.js +1 -0
  224. package/.next/static/chunks/app/api/settings/route-9eb8a19109bbd711.js +1 -0
  225. package/.next/static/chunks/app/credentials/page-23c1807ad9f68a40.js +1 -0
  226. package/.next/static/chunks/app/layout-a06241c385e50ae0.js +1 -0
  227. package/.next/static/chunks/app/page-c8404790f5191fd7.js +1 -0
  228. package/.next/static/chunks/app/workspace/changes/page-8cca17f80e66f534.js +3 -0
  229. package/.next/static/chunks/app/workspace/custom-scripts/page-ee24b9dd7779244f.js +1 -0
  230. package/.next/static/chunks/app/workspace/history/page-b7017fea285c804c.js +1 -0
  231. package/.next/static/chunks/app/workspace/layout-cb86c00fdcd8db08.js +1 -0
  232. package/.next/static/chunks/app/workspace/page-21211acc90c08509.js +1 -0
  233. package/.next/static/chunks/app/workspace/settings/page-7ccb58ece31492e9.js +1 -0
  234. package/.next/static/chunks/app/workspace/stashes/page-0e1b8304c4b0f4f3.js +1 -0
  235. package/.next/static/chunks/framework-75892d61b920805f.js +1 -0
  236. package/.next/static/chunks/main-app-221e1b945693a142.js +1 -0
  237. package/.next/static/chunks/main-f1d55fffd3cc9809.js +5 -0
  238. package/.next/static/chunks/next/dist/client/components/builtin/app-error-9eb8a19109bbd711.js +1 -0
  239. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-9eb8a19109bbd711.js +1 -0
  240. package/.next/static/chunks/next/dist/client/components/builtin/global-error-f2a2c324f3740ed8.js +1 -0
  241. package/.next/static/chunks/next/dist/client/components/builtin/not-found-9eb8a19109bbd711.js +1 -0
  242. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-9eb8a19109bbd711.js +1 -0
  243. package/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  244. package/.next/static/chunks/webpack-7dec27dc3bfe207a.js +1 -0
  245. package/.next/static/css/36968b90b2339533.css +1 -0
  246. package/.next/static/css/c56c0e57397a3a60.css +1 -0
  247. package/.next/static/css/de70bee13400563f.css +1 -0
  248. package/.next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
  249. package/.next/static/media/747892c23ea88013-s.woff2 +0 -0
  250. package/.next/static/media/8d697b304b401681-s.woff2 +0 -0
  251. package/.next/static/media/93f479601ee12b01-s.p.woff2 +0 -0
  252. package/.next/static/media/9610d9e46709d722-s.woff2 +0 -0
  253. package/.next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
  254. package/README.md +2 -0
  255. package/bin/trident-git.mjs +9 -11
  256. package/{next.config.ts → next.config.mjs} +7 -8
  257. package/package.json +8 -6
  258. package/eslint.config.mjs +0 -18
  259. package/postcss.config.mjs +0 -7
  260. package/src/app/api/credentials/route.ts +0 -113
  261. package/src/app/api/custom-scripts/route.ts +0 -203
  262. package/src/app/api/fs/route.ts +0 -75
  263. package/src/app/api/git/action/route.ts +0 -383
  264. package/src/app/api/git/branches/route.ts +0 -20
  265. package/src/app/api/git/diff/route.ts +0 -104
  266. package/src/app/api/git/log/route.ts +0 -28
  267. package/src/app/api/git/status/route.ts +0 -28
  268. package/src/app/api/repos/route.ts +0 -84
  269. package/src/app/api/settings/route.ts +0 -37
  270. package/src/app/credentials/page.tsx +0 -408
  271. package/src/app/globals.css +0 -109
  272. package/src/app/layout.tsx +0 -38
  273. package/src/app/page.tsx +0 -10
  274. package/src/app/providers.tsx +0 -21
  275. package/src/app/workspace/changes/page.tsx +0 -27
  276. package/src/app/workspace/custom-scripts/page.tsx +0 -247
  277. package/src/app/workspace/history/page.tsx +0 -27
  278. package/src/app/workspace/layout.tsx +0 -26
  279. package/src/app/workspace/page.tsx +0 -27
  280. package/src/app/workspace/settings/page.tsx +0 -233
  281. package/src/app/workspace/stashes/page.tsx +0 -395
  282. package/src/components/command-palette.tsx +0 -178
  283. package/src/components/context-menu.tsx +0 -200
  284. package/src/components/fs-browser.tsx +0 -154
  285. package/src/components/git/diff-view.tsx +0 -137
  286. package/src/components/git/git-graph.tsx +0 -489
  287. package/src/components/git/grouped-diff-viewer.tsx +0 -332
  288. package/src/components/git/history-view.tsx +0 -4862
  289. package/src/components/git/image-diff-view.tsx +0 -342
  290. package/src/components/git/status-view.tsx +0 -597
  291. package/src/components/home-settings-modal.tsx +0 -192
  292. package/src/components/layout/sidebar.tsx +0 -256
  293. package/src/components/repo-list.tsx +0 -206
  294. package/src/components/theme-toggle.tsx +0 -37
  295. package/src/components/toaster.tsx +0 -36
  296. package/src/components/workspace-repo-open-tracker.tsx +0 -39
  297. package/src/hooks/use-credentials.ts +0 -123
  298. package/src/hooks/use-escape-dismiss.ts +0 -72
  299. package/src/hooks/use-git.ts +0 -448
  300. package/src/hooks/use-toast.ts +0 -280
  301. package/src/hooks/use-workspace-title.ts +0 -23
  302. package/src/lib/api-utils.ts +0 -24
  303. package/src/lib/branch-colors.ts +0 -98
  304. package/src/lib/credentials.ts +0 -404
  305. package/src/lib/git.ts +0 -1510
  306. package/src/lib/graph-utils.ts +0 -253
  307. package/src/lib/store.ts +0 -145
  308. package/src/lib/types.ts +0 -95
  309. package/src/lib/utils.ts +0 -266
  310. package/tsconfig.json +0 -34
  311. /package/{src/app/icon.png → .next/server/app/icon.png.body} +0 -0
package/README.md CHANGED
@@ -125,6 +125,8 @@ npx trident-git --port 3200
125
125
  npx trident-git --dev
126
126
  ```
127
127
 
128
+ Published npm packages are expected to include a prebuilt `.next` output, so `npx trident-git` does not build on the end user's machine.
129
+
128
130
  ### Installation
129
131
 
130
132
  ```bash
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { spawn } from "node:child_process";
4
4
  import fs from "node:fs";
5
+ import { createRequire } from "node:module";
5
6
  import net from "node:net";
6
7
  import path from "node:path";
7
8
  import { fileURLToPath } from "node:url";
@@ -9,7 +10,8 @@ import { fileURLToPath } from "node:url";
9
10
  const __filename = fileURLToPath(import.meta.url);
10
11
  const __dirname = path.dirname(__filename);
11
12
  const APP_ROOT = path.resolve(__dirname, "..");
12
- const NEXT_BIN = path.join(APP_ROOT, "node_modules", "next", "dist", "bin", "next");
13
+ const require = createRequire(import.meta.url);
14
+ const NEXT_BIN = require.resolve("next/dist/bin/next");
13
15
  const DEFAULT_PORT = 3100;
14
16
 
15
17
  function printHelp() {
@@ -106,16 +108,12 @@ function runNext(args) {
106
108
  });
107
109
  }
108
110
 
109
- async function ensureBuildExists() {
111
+ function ensureBuildExists() {
110
112
  const buildIdPath = path.join(APP_ROOT, ".next", "BUILD_ID");
111
- if (fs.existsSync(buildIdPath)) {
112
- return;
113
- }
114
-
115
- console.log("No production build found. Building trident-git...");
116
- const exitCode = await runNext(["build", "--webpack"]);
117
- if (exitCode !== 0) {
118
- process.exit(exitCode);
113
+ if (!fs.existsSync(buildIdPath)) {
114
+ throw new Error(
115
+ "No production build found in this package (.next/BUILD_ID is missing). The npm package must be published with prebuilt assets.",
116
+ );
119
117
  }
120
118
  }
121
119
 
@@ -140,7 +138,7 @@ async function main() {
140
138
  process.exit(await runNext(["dev", "--webpack", "-p", String(port)]));
141
139
  }
142
140
 
143
- await ensureBuildExists();
141
+ ensureBuildExists();
144
142
  console.log(`Starting trident-git on http://localhost:${port}`);
145
143
  process.exit(await runNext(["start", "-p", String(port)]));
146
144
  } catch (error) {
@@ -1,6 +1,5 @@
1
- import type { NextConfig } from "next";
2
-
3
- const nextConfig: NextConfig = {
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {
4
3
  // Disable Turbopack for production builds as keytar is a native module
5
4
  // that requires webpack's externals configuration
6
5
  experimental: {
@@ -11,20 +10,20 @@ const nextConfig: NextConfig = {
11
10
  if (isServer) {
12
11
  // Externalize keytar - it's a native module that should be loaded at runtime
13
12
  config.externals = config.externals || [];
14
- config.externals.push('keytar');
13
+ config.externals.push("keytar");
15
14
  }
16
15
  return config;
17
16
  },
18
17
  images: {
19
18
  remotePatterns: [
20
19
  {
21
- protocol: 'https',
22
- hostname: 'www.google.com',
23
- pathname: '/s2/favicons',
20
+ protocol: "https",
21
+ hostname: "www.google.com",
22
+ pathname: "/s2/favicons",
24
23
  },
25
24
  ],
26
25
  },
27
- serverExternalPackages: ['keytar'],
26
+ serverExternalPackages: ["keytar"],
28
27
  };
29
28
 
30
29
  export default nextConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trident-git",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "private": false,
5
5
  "description": "A modern, web-based Git client.",
6
6
  "bin": {
@@ -8,17 +8,19 @@
8
8
  },
9
9
  "files": [
10
10
  "bin",
11
- "src",
11
+ ".next/BUILD_ID",
12
+ ".next/server",
13
+ ".next/static",
14
+ ".next/*.json",
15
+ ".next/*.js",
12
16
  "public",
13
- "next.config.ts",
14
- "postcss.config.mjs",
15
- "tsconfig.json",
16
- "eslint.config.mjs",
17
+ "next.config.mjs",
17
18
  "README.md"
18
19
  ],
19
20
  "scripts": {
20
21
  "dev": "npx gfport 3100 -- next dev --webpack -p {PORT}",
21
22
  "build": "next build --webpack",
23
+ "prepack": "rm -rf .next && npm run build",
22
24
  "start": "next start -p 3100",
23
25
  "lint": "eslint",
24
26
  "cli": "node ./bin/trident-git.mjs",
package/eslint.config.mjs DELETED
@@ -1,18 +0,0 @@
1
- import { defineConfig, globalIgnores } from "eslint/config";
2
- import nextVitals from "eslint-config-next/core-web-vitals";
3
- import nextTs from "eslint-config-next/typescript";
4
-
5
- const eslintConfig = defineConfig([
6
- ...nextVitals,
7
- ...nextTs,
8
- // Override default ignores of eslint-config-next.
9
- globalIgnores([
10
- // Default ignores of eslint-config-next:
11
- ".next/**",
12
- "out/**",
13
- "build/**",
14
- "next-env.d.ts",
15
- ]),
16
- ]);
17
-
18
- export default eslintConfig;
@@ -1,7 +0,0 @@
1
- const config = {
2
- plugins: {
3
- "@tailwindcss/postcss": {},
4
- },
5
- };
6
-
7
- export default config;
@@ -1,113 +0,0 @@
1
- import { NextResponse } from 'next/server';
2
- import { z } from 'zod';
3
- import {
4
- getAllCredentials,
5
- createGitHubCredential,
6
- createGitLabCredential,
7
- updateCredential,
8
- deleteCredential,
9
- } from '@/lib/credentials';
10
-
11
- // GET - List all credentials
12
- export async function GET() {
13
- try {
14
- const credentials = await getAllCredentials();
15
- return NextResponse.json(credentials);
16
- } catch (error) {
17
- console.error('Failed to get credentials:', error);
18
- return NextResponse.json({ error: 'Failed to get credentials' }, { status: 500 });
19
- }
20
- }
21
-
22
- // POST - Create a new credential
23
- const createGitHubSchema = z.object({
24
- type: z.literal('github'),
25
- token: z.string().min(1, 'Token is required'),
26
- });
27
-
28
- const createGitLabSchema = z.object({
29
- type: z.literal('gitlab'),
30
- serverUrl: z.string().url('Invalid server URL'),
31
- token: z.string().min(1, 'Token is required'),
32
- });
33
-
34
- const createSchema = z.discriminatedUnion('type', [createGitHubSchema, createGitLabSchema]);
35
-
36
- export async function POST(request: Request) {
37
- try {
38
- const body = await request.json();
39
- const data = createSchema.parse(body);
40
-
41
- let result;
42
- if (data.type === 'github') {
43
- result = await createGitHubCredential(data.token);
44
- } else {
45
- result = await createGitLabCredential(data.serverUrl, data.token);
46
- }
47
-
48
- if (!result.success) {
49
- return NextResponse.json({ error: result.error }, { status: 400 });
50
- }
51
-
52
- return NextResponse.json(result.credential);
53
- } catch (error) {
54
- if (error instanceof z.ZodError) {
55
- return NextResponse.json({ error: error.issues[0].message }, { status: 400 });
56
- }
57
- console.error('Failed to create credential:', error);
58
- return NextResponse.json({ error: 'Failed to create credential' }, { status: 500 });
59
- }
60
- }
61
-
62
- // PUT - Update a credential
63
- const updateSchema = z.object({
64
- id: z.string().min(1, 'Credential ID is required'),
65
- token: z.string().min(1, 'Token is required'),
66
- });
67
-
68
- export async function PUT(request: Request) {
69
- try {
70
- const body = await request.json();
71
- const { id, token } = updateSchema.parse(body);
72
-
73
- const result = await updateCredential(id, token);
74
-
75
- if (!result.success) {
76
- return NextResponse.json({ error: result.error }, { status: 400 });
77
- }
78
-
79
- return NextResponse.json(result.credential);
80
- } catch (error) {
81
- if (error instanceof z.ZodError) {
82
- return NextResponse.json({ error: error.issues[0].message }, { status: 400 });
83
- }
84
- console.error('Failed to update credential:', error);
85
- return NextResponse.json({ error: 'Failed to update credential' }, { status: 500 });
86
- }
87
- }
88
-
89
- // DELETE - Delete a credential
90
- const deleteSchema = z.object({
91
- id: z.string().min(1, 'Credential ID is required'),
92
- });
93
-
94
- export async function DELETE(request: Request) {
95
- try {
96
- const body = await request.json();
97
- const { id } = deleteSchema.parse(body);
98
-
99
- const result = await deleteCredential(id);
100
-
101
- if (!result.success) {
102
- return NextResponse.json({ error: result.error }, { status: 400 });
103
- }
104
-
105
- return NextResponse.json({ success: true });
106
- } catch (error) {
107
- if (error instanceof z.ZodError) {
108
- return NextResponse.json({ error: error.issues[0].message }, { status: 400 });
109
- }
110
- console.error('Failed to delete credential:', error);
111
- return NextResponse.json({ error: 'Failed to delete credential' }, { status: 500 });
112
- }
113
- }
@@ -1,203 +0,0 @@
1
- import { NextResponse } from 'next/server';
2
- import { spawn, ChildProcessWithoutNullStreams } from 'node:child_process';
3
- import fs from 'node:fs';
4
- import { z } from 'zod';
5
- import { GitService } from '@/lib/git';
6
-
7
- export const runtime = 'nodejs';
8
-
9
- type ExecutionStatus = 'running' | 'completed' | 'failed' | 'canceled';
10
-
11
- interface ScriptExecution {
12
- id: string;
13
- status: ExecutionStatus;
14
- cancelRequested: boolean;
15
- output: string;
16
- exitCode: number | null;
17
- signal: NodeJS.Signals | null;
18
- startedAt: string;
19
- finishedAt: string | null;
20
- process: ChildProcessWithoutNullStreams | null;
21
- }
22
-
23
- const executions = new Map<string, ScriptExecution>();
24
- const MAX_OUTPUT_LENGTH = 500_000;
25
- const FINISHED_EXECUTION_TTL_MS = 30 * 60 * 1000;
26
-
27
- const startSchema = z.object({
28
- command: z.literal('start'),
29
- repoPath: z.string().min(1),
30
- branchRef: z.string().min(1),
31
- scriptContent: z.string(),
32
- });
33
-
34
- const statusSchema = z.object({
35
- command: z.literal('status'),
36
- executionId: z.string().min(1),
37
- });
38
-
39
- const cancelSchema = z.object({
40
- command: z.literal('cancel'),
41
- executionId: z.string().min(1),
42
- });
43
-
44
- const requestSchema = z.discriminatedUnion('command', [startSchema, statusSchema, cancelSchema]);
45
-
46
- function normalizeBranchForCheckout(branchRef: string): string {
47
- return branchRef.startsWith('remotes/') ? branchRef.slice('remotes/'.length) : branchRef;
48
- }
49
-
50
- function appendOutput(execution: ScriptExecution, text: string) {
51
- execution.output += text;
52
- if (execution.output.length > MAX_OUTPUT_LENGTH) {
53
- execution.output = execution.output.slice(execution.output.length - MAX_OUTPUT_LENGTH);
54
- }
55
- }
56
-
57
- function toResponsePayload(execution: ScriptExecution) {
58
- return {
59
- executionId: execution.id,
60
- status: execution.status,
61
- cancelRequested: execution.cancelRequested,
62
- output: execution.output,
63
- exitCode: execution.exitCode,
64
- signal: execution.signal,
65
- startedAt: execution.startedAt,
66
- finishedAt: execution.finishedAt,
67
- };
68
- }
69
-
70
- function cleanupFinishedExecutions() {
71
- const now = Date.now();
72
- for (const [id, execution] of executions.entries()) {
73
- if (execution.status === 'running') continue;
74
- if (!execution.finishedAt) continue;
75
- const finishedAtMs = new Date(execution.finishedAt).getTime();
76
- if (Number.isNaN(finishedAtMs)) continue;
77
- if (now - finishedAtMs > FINISHED_EXECUTION_TTL_MS) {
78
- executions.delete(id);
79
- }
80
- }
81
- }
82
-
83
- export async function POST(request: Request) {
84
- try {
85
- cleanupFinishedExecutions();
86
-
87
- const body = await request.json();
88
- const payload = requestSchema.parse(body);
89
-
90
- if (payload.command === 'status') {
91
- const execution = executions.get(payload.executionId);
92
- if (!execution) {
93
- return NextResponse.json({ error: 'Execution not found' }, { status: 404 });
94
- }
95
-
96
- return NextResponse.json({ success: true, ...toResponsePayload(execution) });
97
- }
98
-
99
- if (payload.command === 'cancel') {
100
- const execution = executions.get(payload.executionId);
101
- if (!execution) {
102
- return NextResponse.json({ error: 'Execution not found' }, { status: 404 });
103
- }
104
-
105
- if (execution.status === 'running' && execution.process) {
106
- execution.cancelRequested = true;
107
- appendOutput(execution, '\n[info] Cancel requested...\n');
108
- execution.process.kill('SIGTERM');
109
-
110
- setTimeout(() => {
111
- if (execution.process && execution.cancelRequested) {
112
- execution.process.kill('SIGKILL');
113
- }
114
- }, 1500);
115
- }
116
-
117
- return NextResponse.json({ success: true, ...toResponsePayload(execution) });
118
- }
119
-
120
- const { repoPath, branchRef, scriptContent } = payload;
121
-
122
- if (!fs.existsSync(repoPath)) {
123
- return NextResponse.json({ error: `Path not found: ${repoPath}` }, { status: 404 });
124
- }
125
-
126
- if (!fs.statSync(repoPath).isDirectory()) {
127
- return NextResponse.json({ error: 'Repository path must be a directory' }, { status: 400 });
128
- }
129
-
130
- const git = new GitService(repoPath);
131
- const branches = await git.getBranches();
132
- const checkoutBranch = normalizeBranchForCheckout(branchRef);
133
- const currentBranch = branches.current;
134
-
135
- if (!currentBranch || currentBranch !== checkoutBranch) {
136
- await git.checkout(checkoutBranch);
137
- }
138
-
139
- const executionId = crypto.randomUUID();
140
- const child = spawn('bash', ['-s'], {
141
- cwd: repoPath,
142
- env: process.env,
143
- stdio: 'pipe',
144
- });
145
-
146
- const execution: ScriptExecution = {
147
- id: executionId,
148
- status: 'running',
149
- cancelRequested: false,
150
- output: '',
151
- exitCode: null,
152
- signal: null,
153
- startedAt: new Date().toISOString(),
154
- finishedAt: null,
155
- process: child,
156
- };
157
-
158
- executions.set(executionId, execution);
159
-
160
- const onData = (chunk: Buffer | string) => {
161
- appendOutput(execution, typeof chunk === 'string' ? chunk : chunk.toString('utf-8'));
162
- };
163
-
164
- child.stdout.on('data', onData);
165
- child.stderr.on('data', onData);
166
-
167
- child.on('error', (error) => {
168
- appendOutput(execution, `\n[error] ${error.message}\n`);
169
- execution.status = execution.cancelRequested ? 'canceled' : 'failed';
170
- execution.finishedAt = new Date().toISOString();
171
- execution.process = null;
172
- });
173
-
174
- child.on('close', (code, signal) => {
175
- execution.exitCode = code;
176
- execution.signal = signal;
177
- execution.finishedAt = new Date().toISOString();
178
- execution.process = null;
179
-
180
- if (execution.cancelRequested) {
181
- execution.status = 'canceled';
182
- return;
183
- }
184
-
185
- execution.status = code === 0 ? 'completed' : 'failed';
186
- });
187
-
188
- child.stdin.write(scriptContent);
189
- child.stdin.end();
190
-
191
- return NextResponse.json({
192
- success: true,
193
- ...toResponsePayload(execution),
194
- checkedOutBranch: checkoutBranch,
195
- previousBranch: currentBranch,
196
- });
197
- } catch (error) {
198
- if (error instanceof z.ZodError) {
199
- return NextResponse.json({ error: error.issues }, { status: 400 });
200
- }
201
- return NextResponse.json({ error: (error as Error).message }, { status: 500 });
202
- }
203
- }
@@ -1,75 +0,0 @@
1
- import { NextResponse } from 'next/server';
2
- import fs from 'fs';
3
- import path from 'path';
4
- import os from 'os';
5
-
6
- export async function GET(request: Request) {
7
- const { searchParams } = new URL(request.url);
8
- const requestedPath = searchParams.get('path');
9
-
10
- // Default to home directory
11
- const currentPath = requestedPath ? requestedPath : os.homedir();
12
-
13
- try {
14
- // Security check: though this is local app, basic sanity check
15
- // For now, allow reading anywhere as it's a dev tool/local tool.
16
-
17
- const stats = await fs.promises.stat(currentPath);
18
- if (!stats.isDirectory()) {
19
- return NextResponse.json({ error: 'Not a directory' }, { status: 400 });
20
- }
21
-
22
- const items = await fs.promises.readdir(currentPath, { withFileTypes: true });
23
-
24
- // Let's verify if they are git repos
25
- const directories = items.filter(item => item.isDirectory());
26
-
27
- const contents = [];
28
- const BATCH_SIZE = 50;
29
-
30
- for (let i = 0; i < directories.length; i += BATCH_SIZE) {
31
- const batch = directories.slice(i, i + BATCH_SIZE);
32
- const batchResults = await Promise.all(batch.map(async (item) => {
33
- const itemPath = path.join(currentPath, item.name);
34
- let isRepo = false;
35
- try {
36
- // Check for .git directory inside
37
- await fs.promises.access(path.join(itemPath, '.git'), fs.constants.F_OK);
38
- isRepo = true;
39
- } catch (e) {}
40
-
41
- return {
42
- name: item.name,
43
- path: itemPath,
44
- isRepo
45
- };
46
- }));
47
- contents.push(...batchResults);
48
- }
49
-
50
- // Sort: Visible folders first, then Repos first within that group, then alphabetical
51
- contents.sort((a, b) => {
52
- const aHidden = a.name.startsWith('.');
53
- const bHidden = b.name.startsWith('.');
54
-
55
- // Visible first
56
- if (!aHidden && bHidden) return -1;
57
- if (aHidden && !bHidden) return 1;
58
-
59
- // Repos first
60
- if (a.isRepo && !b.isRepo) return -1;
61
- if (!a.isRepo && b.isRepo) return 1;
62
-
63
- return a.name.localeCompare(b.name);
64
- });
65
-
66
- return NextResponse.json({
67
- path: currentPath,
68
- folders: contents,
69
- parent: path.dirname(currentPath)
70
- });
71
-
72
- } catch (error) {
73
- return NextResponse.json({ error: (error as Error).message }, { status: 500 });
74
- }
75
- }