@pylonsync/create-pylon 0.22.74 → 0.22.76

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 (595) hide show
  1. package/bin/create-pylon.js +24 -74
  2. package/package.json +1 -1
  3. package/skill/SKILL.md +8 -11
  4. package/templates/_root/README.md +2 -8
  5. package/templates/agency/AGENTS.md +17 -0
  6. package/templates/agency/app/globals.css +5 -1
  7. package/templates/agency/app/internal/components/page.tsx +248 -0
  8. package/templates/agency/app/internal/design/page.tsx +169 -0
  9. package/templates/agency/app/internal/layout.tsx +89 -0
  10. package/templates/agency/app/internal/sections.ts +26 -0
  11. package/templates/agency/app/internal/showcase.tsx +43 -0
  12. package/templates/agency/app/robots.ts +1 -1
  13. package/templates/agency/components/ui/button.tsx +22 -20
  14. package/templates/agency/components/ui/dialog.tsx +77 -64
  15. package/templates/agency/components/ui/input.tsx +5 -5
  16. package/templates/agency/components/ui/label.tsx +5 -3
  17. package/templates/agency/components/ui/select.tsx +81 -19
  18. package/templates/agency/components/ui/textarea.tsx +5 -3
  19. package/templates/agency/lib/utils.ts +4 -4
  20. package/templates/agency/package.json +3 -3
  21. package/templates/ai-chat/AGENTS.md +17 -0
  22. package/templates/ai-chat/app/globals.css +5 -1
  23. package/templates/ai-chat/app/internal/components/page.tsx +248 -0
  24. package/templates/ai-chat/app/internal/design/page.tsx +173 -0
  25. package/templates/ai-chat/app/internal/layout.tsx +89 -0
  26. package/templates/ai-chat/app/internal/sections.ts +26 -0
  27. package/templates/ai-chat/app/internal/showcase.tsx +43 -0
  28. package/templates/ai-chat/app/robots.ts +1 -1
  29. package/templates/ai-chat/components/ui/button.tsx +22 -20
  30. package/templates/ai-chat/components/ui/dialog.tsx +77 -64
  31. package/templates/ai-chat/components/ui/input.tsx +5 -5
  32. package/templates/ai-chat/components/ui/label.tsx +5 -3
  33. package/templates/ai-chat/components/ui/select.tsx +81 -19
  34. package/templates/ai-chat/components/ui/textarea.tsx +5 -3
  35. package/templates/ai-chat/lib/utils.ts +4 -4
  36. package/templates/ai-chat/package.json +4 -4
  37. package/templates/ai-studio/AGENTS.md +17 -0
  38. package/templates/ai-studio/app/globals.css +5 -1
  39. package/templates/ai-studio/app/internal/components/page.tsx +248 -0
  40. package/templates/ai-studio/app/internal/design/page.tsx +168 -0
  41. package/templates/ai-studio/app/internal/layout.tsx +89 -0
  42. package/templates/ai-studio/app/internal/sections.ts +26 -0
  43. package/templates/ai-studio/app/internal/showcase.tsx +43 -0
  44. package/templates/ai-studio/app/robots.ts +1 -1
  45. package/templates/ai-studio/components/ui/button.tsx +22 -20
  46. package/templates/ai-studio/components/ui/dialog.tsx +77 -64
  47. package/templates/ai-studio/components/ui/input.tsx +5 -5
  48. package/templates/ai-studio/components/ui/label.tsx +5 -3
  49. package/templates/ai-studio/components/ui/select.tsx +81 -19
  50. package/templates/ai-studio/components/ui/textarea.tsx +5 -3
  51. package/templates/ai-studio/lib/utils.ts +4 -4
  52. package/templates/ai-studio/package.json +4 -4
  53. package/templates/barebones/AGENTS.md +17 -0
  54. package/templates/barebones/README.md +6 -3
  55. package/templates/barebones/app/(app)/layout.tsx +16 -0
  56. package/templates/barebones/app/{page.tsx → (app)/page.tsx} +2 -2
  57. package/templates/barebones/app/error.tsx +1 -1
  58. package/templates/barebones/app/globals.css +9 -7
  59. package/templates/barebones/app/internal/components/page.tsx +248 -0
  60. package/templates/barebones/app/internal/design/page.tsx +165 -0
  61. package/templates/barebones/app/internal/layout.tsx +89 -0
  62. package/templates/barebones/app/internal/sections.ts +26 -0
  63. package/templates/barebones/app/internal/showcase.tsx +43 -0
  64. package/templates/barebones/app/layout.tsx +4 -6
  65. package/templates/barebones/app/not-found.tsx +2 -4
  66. package/templates/barebones/app/robots.ts +1 -1
  67. package/templates/barebones/components/ui/button.tsx +22 -20
  68. package/templates/barebones/components/ui/dialog.tsx +77 -64
  69. package/templates/barebones/components/ui/input.tsx +5 -5
  70. package/templates/barebones/components/ui/label.tsx +5 -3
  71. package/templates/barebones/components/ui/select.tsx +81 -19
  72. package/templates/barebones/components/ui/textarea.tsx +5 -3
  73. package/templates/barebones/lib/utils.ts +4 -4
  74. package/templates/barebones/package.json +3 -3
  75. package/templates/chat/AGENTS.md +17 -0
  76. package/templates/chat/app/globals.css +7 -5
  77. package/templates/chat/app/internal/components/page.tsx +248 -0
  78. package/templates/chat/app/internal/design/page.tsx +170 -0
  79. package/templates/chat/app/internal/layout.tsx +89 -0
  80. package/templates/chat/app/internal/sections.ts +26 -0
  81. package/templates/chat/app/internal/showcase.tsx +43 -0
  82. package/templates/chat/app/not-found.tsx +1 -3
  83. package/templates/chat/app/robots.ts +1 -1
  84. package/templates/chat/components/ui/button.tsx +22 -20
  85. package/templates/chat/components/ui/dialog.tsx +77 -64
  86. package/templates/chat/components/ui/input.tsx +5 -5
  87. package/templates/chat/components/ui/label.tsx +5 -3
  88. package/templates/chat/components/ui/select.tsx +81 -19
  89. package/templates/chat/components/ui/textarea.tsx +5 -3
  90. package/templates/chat/lib/utils.ts +4 -4
  91. package/templates/chat/package.json +4 -4
  92. package/templates/consumer/AGENTS.md +17 -0
  93. package/templates/consumer/app/globals.css +9 -7
  94. package/templates/consumer/app/internal/components/page.tsx +248 -0
  95. package/templates/consumer/app/internal/design/page.tsx +167 -0
  96. package/templates/consumer/app/internal/layout.tsx +89 -0
  97. package/templates/consumer/app/internal/sections.ts +26 -0
  98. package/templates/consumer/app/internal/showcase.tsx +43 -0
  99. package/templates/consumer/app/robots.ts +1 -1
  100. package/templates/consumer/components/ui/button.tsx +22 -20
  101. package/templates/consumer/components/ui/dialog.tsx +77 -64
  102. package/templates/consumer/components/ui/input.tsx +5 -5
  103. package/templates/consumer/components/ui/label.tsx +5 -3
  104. package/templates/consumer/components/ui/select.tsx +81 -19
  105. package/templates/consumer/components/ui/textarea.tsx +5 -3
  106. package/templates/consumer/lib/utils.ts +4 -4
  107. package/templates/consumer/package.json +4 -4
  108. package/templates/creator/AGENTS.md +17 -0
  109. package/templates/creator/app/globals.css +5 -1
  110. package/templates/creator/app/internal/components/page.tsx +248 -0
  111. package/templates/creator/app/internal/design/page.tsx +171 -0
  112. package/templates/creator/app/internal/layout.tsx +89 -0
  113. package/templates/creator/app/internal/sections.ts +26 -0
  114. package/templates/creator/app/internal/showcase.tsx +43 -0
  115. package/templates/creator/app/robots.ts +1 -1
  116. package/templates/creator/components/ui/button.tsx +22 -20
  117. package/templates/creator/components/ui/dialog.tsx +77 -64
  118. package/templates/creator/components/ui/input.tsx +5 -5
  119. package/templates/creator/components/ui/label.tsx +5 -3
  120. package/templates/creator/components/ui/select.tsx +81 -19
  121. package/templates/creator/components/ui/textarea.tsx +5 -3
  122. package/templates/creator/lib/utils.ts +4 -4
  123. package/templates/creator/package.json +4 -4
  124. package/templates/crm/AGENTS.md +17 -0
  125. package/templates/crm/README.md +3 -4
  126. package/templates/crm/app/deals/[id]/deal-view.tsx +9 -14
  127. package/templates/crm/app/globals.css +5 -2
  128. package/templates/crm/app/internal/components/page.tsx +282 -0
  129. package/templates/crm/app/internal/design/page.tsx +163 -0
  130. package/templates/crm/app/internal/layout.tsx +89 -0
  131. package/templates/crm/app/internal/sections.ts +27 -0
  132. package/templates/crm/app/internal/showcase.tsx +43 -0
  133. package/templates/crm/app/not-found.tsx +1 -3
  134. package/templates/crm/app/robots.ts +1 -1
  135. package/templates/crm/components/activity-timeline.tsx +6 -8
  136. package/templates/crm/components/app-shell.tsx +25 -26
  137. package/templates/crm/components/deal-dialog.tsx +15 -17
  138. package/templates/crm/components/record-dialog.tsx +10 -11
  139. package/templates/crm/components/ui/button.tsx +22 -20
  140. package/templates/crm/components/ui/dialog.tsx +77 -64
  141. package/templates/crm/components/ui/input.tsx +5 -5
  142. package/templates/crm/components/ui/label.tsx +5 -3
  143. package/templates/crm/components/ui/select.tsx +81 -19
  144. package/templates/crm/components/ui/sheet.tsx +64 -0
  145. package/templates/crm/components/ui/textarea.tsx +5 -3
  146. package/templates/crm/lib/utils.ts +4 -4
  147. package/templates/crm/package.json +4 -4
  148. package/templates/directory/AGENTS.md +17 -0
  149. package/templates/directory/app/globals.css +5 -1
  150. package/templates/directory/app/internal/components/page.tsx +248 -0
  151. package/templates/directory/app/internal/design/page.tsx +168 -0
  152. package/templates/directory/app/internal/layout.tsx +89 -0
  153. package/templates/directory/app/internal/sections.ts +26 -0
  154. package/templates/directory/app/internal/showcase.tsx +43 -0
  155. package/templates/directory/app/robots.ts +1 -1
  156. package/templates/directory/components/ui/button.tsx +22 -20
  157. package/templates/directory/components/ui/dialog.tsx +77 -64
  158. package/templates/directory/components/ui/input.tsx +5 -5
  159. package/templates/directory/components/ui/label.tsx +5 -3
  160. package/templates/directory/components/ui/select.tsx +81 -19
  161. package/templates/directory/components/ui/textarea.tsx +5 -3
  162. package/templates/directory/lib/utils.ts +4 -4
  163. package/templates/directory/package.json +4 -4
  164. package/templates/helpdesk/AGENTS.md +17 -0
  165. package/templates/helpdesk/README.md +1 -1
  166. package/templates/helpdesk/app/globals.css +5 -2
  167. package/templates/helpdesk/app/internal/components/page.tsx +282 -0
  168. package/templates/helpdesk/app/internal/design/page.tsx +163 -0
  169. package/templates/helpdesk/app/internal/layout.tsx +89 -0
  170. package/templates/helpdesk/app/internal/sections.ts +27 -0
  171. package/templates/helpdesk/app/internal/showcase.tsx +43 -0
  172. package/templates/helpdesk/app/not-found.tsx +1 -3
  173. package/templates/helpdesk/app/robots.ts +1 -1
  174. package/templates/helpdesk/app/tickets/[id]/ticket-view.tsx +22 -29
  175. package/templates/helpdesk/components/app-shell.tsx +25 -26
  176. package/templates/helpdesk/components/new-ticket-dialog.tsx +15 -17
  177. package/templates/helpdesk/components/record-dialog.tsx +10 -11
  178. package/templates/helpdesk/components/ui/button.tsx +22 -20
  179. package/templates/helpdesk/components/ui/dialog.tsx +77 -64
  180. package/templates/helpdesk/components/ui/input.tsx +5 -5
  181. package/templates/helpdesk/components/ui/label.tsx +5 -3
  182. package/templates/helpdesk/components/ui/select.tsx +81 -19
  183. package/templates/helpdesk/components/ui/sheet.tsx +64 -0
  184. package/templates/helpdesk/components/ui/textarea.tsx +5 -3
  185. package/templates/helpdesk/lib/utils.ts +4 -4
  186. package/templates/helpdesk/package.json +4 -4
  187. package/templates/imessage/AGENTS.md +17 -0
  188. package/templates/imessage/app/globals.css +4 -0
  189. package/templates/imessage/app/internal/components/page.tsx +248 -0
  190. package/templates/imessage/app/internal/design/page.tsx +163 -0
  191. package/templates/imessage/app/internal/layout.tsx +89 -0
  192. package/templates/imessage/app/internal/sections.ts +26 -0
  193. package/templates/imessage/app/internal/showcase.tsx +43 -0
  194. package/templates/imessage/components/ui/button.tsx +22 -20
  195. package/templates/imessage/components/ui/dialog.tsx +77 -64
  196. package/templates/imessage/components/ui/input.tsx +5 -5
  197. package/templates/imessage/components/ui/label.tsx +5 -3
  198. package/templates/imessage/components/ui/select.tsx +81 -19
  199. package/templates/imessage/components/ui/textarea.tsx +5 -3
  200. package/templates/imessage/lib/utils.ts +4 -4
  201. package/templates/imessage/package.json +4 -4
  202. package/templates/inventory/AGENTS.md +17 -0
  203. package/templates/inventory/README.md +1 -1
  204. package/templates/inventory/app/globals.css +5 -2
  205. package/templates/inventory/app/internal/components/page.tsx +282 -0
  206. package/templates/inventory/app/internal/design/page.tsx +163 -0
  207. package/templates/inventory/app/internal/layout.tsx +89 -0
  208. package/templates/inventory/app/internal/sections.ts +27 -0
  209. package/templates/inventory/app/internal/showcase.tsx +43 -0
  210. package/templates/inventory/app/not-found.tsx +1 -3
  211. package/templates/inventory/app/products/[id]/product-view.tsx +1 -3
  212. package/templates/inventory/app/robots.ts +1 -1
  213. package/templates/inventory/components/app-shell.tsx +25 -26
  214. package/templates/inventory/components/movement-dialog.tsx +15 -17
  215. package/templates/inventory/components/record-dialog.tsx +10 -11
  216. package/templates/inventory/components/ui/button.tsx +22 -20
  217. package/templates/inventory/components/ui/dialog.tsx +77 -64
  218. package/templates/inventory/components/ui/input.tsx +5 -5
  219. package/templates/inventory/components/ui/label.tsx +5 -3
  220. package/templates/inventory/components/ui/select.tsx +81 -19
  221. package/templates/inventory/components/ui/sheet.tsx +64 -0
  222. package/templates/inventory/components/ui/textarea.tsx +5 -3
  223. package/templates/inventory/lib/utils.ts +4 -4
  224. package/templates/inventory/package.json +4 -4
  225. package/templates/inventory/tests/components.test.tsx +27 -14
  226. package/templates/invoices/AGENTS.md +17 -0
  227. package/templates/invoices/README.md +1 -1
  228. package/templates/invoices/app/globals.css +5 -2
  229. package/templates/invoices/app/internal/components/page.tsx +282 -0
  230. package/templates/invoices/app/internal/design/page.tsx +163 -0
  231. package/templates/invoices/app/internal/layout.tsx +89 -0
  232. package/templates/invoices/app/internal/sections.ts +27 -0
  233. package/templates/invoices/app/internal/showcase.tsx +43 -0
  234. package/templates/invoices/app/invoices/[id]/invoice-view.tsx +20 -26
  235. package/templates/invoices/app/not-found.tsx +1 -3
  236. package/templates/invoices/app/robots.ts +1 -1
  237. package/templates/invoices/components/app-shell.tsx +25 -26
  238. package/templates/invoices/components/payment-dialog.tsx +6 -8
  239. package/templates/invoices/components/record-dialog.tsx +10 -11
  240. package/templates/invoices/components/ui/button.tsx +22 -20
  241. package/templates/invoices/components/ui/dialog.tsx +77 -64
  242. package/templates/invoices/components/ui/input.tsx +5 -5
  243. package/templates/invoices/components/ui/label.tsx +5 -3
  244. package/templates/invoices/components/ui/select.tsx +81 -19
  245. package/templates/invoices/components/ui/sheet.tsx +64 -0
  246. package/templates/invoices/components/ui/textarea.tsx +5 -3
  247. package/templates/invoices/lib/utils.ts +4 -4
  248. package/templates/invoices/package.json +4 -4
  249. package/templates/local-service/AGENTS.md +17 -0
  250. package/templates/local-service/app/globals.css +5 -1
  251. package/templates/local-service/app/internal/components/page.tsx +248 -0
  252. package/templates/local-service/app/internal/design/page.tsx +170 -0
  253. package/templates/local-service/app/internal/layout.tsx +89 -0
  254. package/templates/local-service/app/internal/sections.ts +26 -0
  255. package/templates/local-service/app/internal/showcase.tsx +43 -0
  256. package/templates/local-service/app/robots.ts +1 -1
  257. package/templates/local-service/components/ui/button.tsx +22 -20
  258. package/templates/local-service/components/ui/dialog.tsx +77 -64
  259. package/templates/local-service/components/ui/input.tsx +5 -5
  260. package/templates/local-service/components/ui/label.tsx +5 -3
  261. package/templates/local-service/components/ui/select.tsx +81 -19
  262. package/templates/local-service/components/ui/textarea.tsx +5 -3
  263. package/templates/local-service/lib/utils.ts +4 -4
  264. package/templates/local-service/package.json +4 -4
  265. package/templates/marketplace/AGENTS.md +17 -0
  266. package/templates/marketplace/README.md +8 -5
  267. package/templates/marketplace/app/(market)/layout.tsx +113 -0
  268. package/templates/marketplace/app/{listing → (market)/listing}/[id]/page.tsx +7 -7
  269. package/templates/marketplace/app/{me → (market)/me}/page.tsx +1 -1
  270. package/templates/marketplace/app/{not-found.tsx → (market)/not-found.tsx} +1 -3
  271. package/templates/marketplace/app/{page.tsx → (market)/page.tsx} +5 -5
  272. package/templates/marketplace/app/{sell → (market)/sell}/page.tsx +1 -1
  273. package/templates/marketplace/app/error.tsx +1 -3
  274. package/templates/marketplace/app/globals.css +4 -0
  275. package/templates/marketplace/app/internal/components/page.tsx +335 -0
  276. package/templates/marketplace/app/internal/design/page.tsx +158 -0
  277. package/templates/marketplace/app/internal/layout.tsx +89 -0
  278. package/templates/marketplace/app/internal/sections.ts +30 -0
  279. package/templates/marketplace/app/internal/showcase.tsx +43 -0
  280. package/templates/marketplace/app/layout.tsx +4 -100
  281. package/templates/marketplace/app/robots.ts +1 -1
  282. package/templates/marketplace/client/ListingCard.tsx +1 -1
  283. package/templates/marketplace/components/ui/button.tsx +22 -21
  284. package/templates/marketplace/components/ui/dialog.tsx +77 -64
  285. package/templates/marketplace/components/ui/input.tsx +5 -5
  286. package/templates/marketplace/components/ui/label.tsx +5 -4
  287. package/templates/marketplace/components/ui/select.tsx +101 -0
  288. package/templates/marketplace/components/ui/separator.tsx +5 -8
  289. package/templates/marketplace/components/ui/textarea.tsx +5 -3
  290. package/templates/marketplace/lib/utils.ts +4 -4
  291. package/templates/marketplace/package.json +3 -5
  292. package/templates/projects/AGENTS.md +17 -0
  293. package/templates/projects/README.md +1 -1
  294. package/templates/projects/app/globals.css +5 -2
  295. package/templates/projects/app/internal/components/page.tsx +282 -0
  296. package/templates/projects/app/internal/design/page.tsx +163 -0
  297. package/templates/projects/app/internal/layout.tsx +89 -0
  298. package/templates/projects/app/internal/sections.ts +27 -0
  299. package/templates/projects/app/internal/showcase.tsx +43 -0
  300. package/templates/projects/app/not-found.tsx +1 -3
  301. package/templates/projects/app/projects/[id]/project-view.tsx +9 -14
  302. package/templates/projects/app/robots.ts +1 -1
  303. package/templates/projects/components/app-shell.tsx +25 -26
  304. package/templates/projects/components/record-dialog.tsx +10 -11
  305. package/templates/projects/components/time-dialog.tsx +6 -8
  306. package/templates/projects/components/ui/button.tsx +22 -20
  307. package/templates/projects/components/ui/dialog.tsx +77 -64
  308. package/templates/projects/components/ui/input.tsx +5 -5
  309. package/templates/projects/components/ui/label.tsx +5 -3
  310. package/templates/projects/components/ui/select.tsx +81 -19
  311. package/templates/projects/components/ui/sheet.tsx +64 -0
  312. package/templates/projects/components/ui/textarea.tsx +5 -3
  313. package/templates/projects/lib/utils.ts +4 -4
  314. package/templates/projects/package.json +4 -4
  315. package/templates/restaurant/AGENTS.md +17 -0
  316. package/templates/restaurant/app/globals.css +5 -1
  317. package/templates/restaurant/app/internal/components/page.tsx +248 -0
  318. package/templates/restaurant/app/internal/design/page.tsx +168 -0
  319. package/templates/restaurant/app/internal/layout.tsx +89 -0
  320. package/templates/restaurant/app/internal/sections.ts +26 -0
  321. package/templates/restaurant/app/internal/showcase.tsx +43 -0
  322. package/templates/restaurant/app/robots.ts +1 -1
  323. package/templates/restaurant/components/ui/button.tsx +22 -20
  324. package/templates/restaurant/components/ui/dialog.tsx +77 -64
  325. package/templates/restaurant/components/ui/input.tsx +5 -5
  326. package/templates/restaurant/components/ui/label.tsx +5 -3
  327. package/templates/restaurant/components/ui/select.tsx +81 -19
  328. package/templates/restaurant/components/ui/textarea.tsx +5 -3
  329. package/templates/restaurant/lib/utils.ts +4 -4
  330. package/templates/restaurant/package.json +4 -4
  331. package/templates/saas/AGENTS.md +17 -0
  332. package/templates/saas/README.md +1 -1
  333. package/templates/saas/app/(marketing)/not-found.tsx +1 -3
  334. package/templates/saas/app/dashboard/board-client.tsx +32 -42
  335. package/templates/saas/app/globals.css +9 -7
  336. package/templates/saas/app/internal/components/page.tsx +282 -0
  337. package/templates/saas/app/internal/design/page.tsx +168 -0
  338. package/templates/saas/app/internal/layout.tsx +89 -0
  339. package/templates/saas/app/internal/sections.ts +27 -0
  340. package/templates/saas/app/internal/showcase.tsx +43 -0
  341. package/templates/saas/app/robots.ts +1 -1
  342. package/templates/saas/components/dashboard-shell.tsx +28 -21
  343. package/templates/saas/components/ui/button.tsx +22 -20
  344. package/templates/saas/components/ui/dialog.tsx +77 -64
  345. package/templates/saas/components/ui/input.tsx +5 -5
  346. package/templates/saas/components/ui/label.tsx +5 -3
  347. package/templates/saas/components/ui/select.tsx +81 -19
  348. package/templates/saas/components/ui/sheet.tsx +64 -0
  349. package/templates/saas/components/ui/textarea.tsx +5 -3
  350. package/templates/saas/lib/utils.ts +4 -4
  351. package/templates/saas/package.json +4 -4
  352. package/templates/shop/AGENTS.md +17 -0
  353. package/templates/shop/app/globals.css +5 -1
  354. package/templates/shop/app/internal/components/page.tsx +248 -0
  355. package/templates/shop/app/internal/design/page.tsx +173 -0
  356. package/templates/shop/app/internal/layout.tsx +89 -0
  357. package/templates/shop/app/internal/sections.ts +26 -0
  358. package/templates/shop/app/internal/showcase.tsx +43 -0
  359. package/templates/shop/app/robots.ts +1 -1
  360. package/templates/shop/components/ui/button.tsx +22 -20
  361. package/templates/shop/components/ui/dialog.tsx +77 -64
  362. package/templates/shop/components/ui/input.tsx +5 -5
  363. package/templates/shop/components/ui/label.tsx +5 -3
  364. package/templates/shop/components/ui/select.tsx +81 -19
  365. package/templates/shop/components/ui/textarea.tsx +5 -3
  366. package/templates/shop/functions/checkout.ts +9 -8
  367. package/templates/shop/lib/utils.ts +4 -4
  368. package/templates/shop/package.json +4 -4
  369. package/templates/todo/AGENTS.md +17 -0
  370. package/templates/todo/README.md +7 -4
  371. package/templates/todo/app/(app)/layout.tsx +16 -0
  372. package/templates/todo/app/{page.tsx → (app)/page.tsx} +2 -2
  373. package/templates/todo/app/error.tsx +1 -1
  374. package/templates/todo/app/globals.css +9 -7
  375. package/templates/todo/app/internal/components/page.tsx +248 -0
  376. package/templates/todo/app/internal/design/page.tsx +165 -0
  377. package/templates/todo/app/internal/layout.tsx +89 -0
  378. package/templates/todo/app/internal/sections.ts +26 -0
  379. package/templates/todo/app/internal/showcase.tsx +43 -0
  380. package/templates/todo/app/layout.tsx +5 -7
  381. package/templates/todo/app/not-found.tsx +2 -4
  382. package/templates/todo/app/robots.ts +1 -1
  383. package/templates/todo/components/ui/button.tsx +22 -20
  384. package/templates/todo/components/ui/dialog.tsx +77 -64
  385. package/templates/todo/components/ui/input.tsx +5 -5
  386. package/templates/todo/components/ui/label.tsx +5 -3
  387. package/templates/todo/components/ui/select.tsx +81 -19
  388. package/templates/todo/components/ui/textarea.tsx +5 -3
  389. package/templates/todo/lib/utils.ts +4 -4
  390. package/templates/todo/package.json +4 -4
  391. package/templates/waitlist/AGENTS.md +17 -0
  392. package/templates/waitlist/app/globals.css +5 -1
  393. package/templates/waitlist/app/internal/components/page.tsx +248 -0
  394. package/templates/waitlist/app/internal/design/page.tsx +173 -0
  395. package/templates/waitlist/app/internal/layout.tsx +89 -0
  396. package/templates/waitlist/app/internal/sections.ts +26 -0
  397. package/templates/waitlist/app/internal/showcase.tsx +43 -0
  398. package/templates/waitlist/app/robots.ts +1 -1
  399. package/templates/waitlist/components/ui/button.tsx +22 -20
  400. package/templates/waitlist/components/ui/dialog.tsx +77 -64
  401. package/templates/waitlist/components/ui/input.tsx +5 -5
  402. package/templates/waitlist/components/ui/label.tsx +5 -3
  403. package/templates/waitlist/components/ui/select.tsx +81 -19
  404. package/templates/waitlist/components/ui/textarea.tsx +5 -3
  405. package/templates/waitlist/lib/utils.ts +4 -4
  406. package/templates/waitlist/package.json +4 -4
  407. package/templates/agency/components.json +0 -20
  408. package/templates/ai-chat/components.json +0 -20
  409. package/templates/ai-studio/components.json +0 -20
  410. package/templates/backend/b2b/apps/api/functions/archiveProject.ts +0 -13
  411. package/templates/backend/b2b/apps/api/functions/createOrg.ts +0 -44
  412. package/templates/backend/b2b/apps/api/functions/createProject.ts +0 -22
  413. package/templates/backend/b2b/apps/api/functions/inviteMember.ts +0 -41
  414. package/templates/backend/b2b/apps/api/functions/myOrgs.ts +0 -37
  415. package/templates/backend/b2b/apps/api/functions/orgMembers.ts +0 -13
  416. package/templates/backend/b2b/apps/api/functions/orgProjects.ts +0 -15
  417. package/templates/backend/b2b/apps/api/functions/removeMember.ts +0 -25
  418. package/templates/backend/b2b/apps/api/functions/setMemberRole.ts +0 -33
  419. package/templates/backend/b2b/apps/api/package.json +0 -20
  420. package/templates/backend/b2b/apps/api/schema.ts +0 -182
  421. package/templates/backend/b2b/apps/api/tsconfig.json +0 -13
  422. package/templates/backend/barebones/apps/api/functions/createWidget.ts +0 -26
  423. package/templates/backend/barebones/apps/api/functions/listWidgets.ts +0 -19
  424. package/templates/backend/barebones/apps/api/package.json +0 -20
  425. package/templates/backend/barebones/apps/api/schema.ts +0 -64
  426. package/templates/backend/barebones/apps/api/tsconfig.json +0 -13
  427. package/templates/backend/chat/apps/api/functions/createRoom.ts +0 -32
  428. package/templates/backend/chat/apps/api/functions/listRooms.ts +0 -15
  429. package/templates/backend/chat/apps/api/functions/roomMessages.ts +0 -20
  430. package/templates/backend/chat/apps/api/functions/sendMessage.ts +0 -37
  431. package/templates/backend/chat/apps/api/package.json +0 -20
  432. package/templates/backend/chat/apps/api/schema.ts +0 -99
  433. package/templates/backend/chat/apps/api/tsconfig.json +0 -13
  434. package/templates/backend/todo/apps/api/functions/addTodo.ts +0 -31
  435. package/templates/backend/todo/apps/api/functions/deleteTodo.ts +0 -15
  436. package/templates/backend/todo/apps/api/functions/editTodo.ts +0 -17
  437. package/templates/backend/todo/apps/api/functions/listTodos.ts +0 -25
  438. package/templates/backend/todo/apps/api/functions/reorderTodo.ts +0 -15
  439. package/templates/backend/todo/apps/api/functions/toggleTodo.ts +0 -14
  440. package/templates/backend/todo/apps/api/package.json +0 -20
  441. package/templates/backend/todo/apps/api/schema.ts +0 -88
  442. package/templates/backend/todo/apps/api/tsconfig.json +0 -13
  443. package/templates/barebones/components.json +0 -20
  444. package/templates/chat/components.json +0 -20
  445. package/templates/consumer/components.json +0 -20
  446. package/templates/creator/components.json +0 -20
  447. package/templates/crm/components.json +0 -20
  448. package/templates/directory/components.json +0 -20
  449. package/templates/expo/barebones/apps/expo/App.tsx +0 -166
  450. package/templates/expo/barebones/apps/expo/app.json +0 -31
  451. package/templates/expo/barebones/apps/expo/babel.config.js +0 -6
  452. package/templates/expo/barebones/apps/expo/package.json +0 -31
  453. package/templates/expo/barebones/apps/expo/tsconfig.json +0 -16
  454. package/templates/expo/chat/apps/expo/App.tsx +0 -391
  455. package/templates/expo/chat/apps/expo/app.json +0 -25
  456. package/templates/expo/chat/apps/expo/babel.config.js +0 -6
  457. package/templates/expo/chat/apps/expo/package.json +0 -32
  458. package/templates/expo/chat/apps/expo/tsconfig.json +0 -16
  459. package/templates/expo/todo/apps/expo/App.tsx +0 -287
  460. package/templates/expo/todo/apps/expo/app.json +0 -25
  461. package/templates/expo/todo/apps/expo/babel.config.js +0 -6
  462. package/templates/expo/todo/apps/expo/package.json +0 -31
  463. package/templates/expo/todo/apps/expo/tsconfig.json +0 -16
  464. package/templates/helpdesk/components.json +0 -20
  465. package/templates/imessage/components.json +0 -20
  466. package/templates/inventory/components.json +0 -20
  467. package/templates/invoices/components.json +0 -20
  468. package/templates/ios/barebones/apps/ios/Package.swift +0 -34
  469. package/templates/ios/barebones/apps/ios/Sources/__APP_NAME_PASCAL__/ContentView.swift +0 -98
  470. package/templates/ios/barebones/apps/ios/Sources/__APP_NAME_PASCAL__/Models.swift +0 -17
  471. package/templates/ios/barebones/apps/ios/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -34
  472. package/templates/ios/barebones/apps/ios/project.yml +0 -42
  473. package/templates/ios/chat/apps/ios/Package.swift +0 -24
  474. package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/ChatRootView.swift +0 -116
  475. package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/Models.swift +0 -26
  476. package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/RoomView.swift +0 -136
  477. package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -58
  478. package/templates/ios/chat/apps/ios/project.yml +0 -44
  479. package/templates/ios/todo/apps/ios/Package.swift +0 -23
  480. package/templates/ios/todo/apps/ios/Sources/__APP_NAME_PASCAL__/Models.swift +0 -18
  481. package/templates/ios/todo/apps/ios/Sources/__APP_NAME_PASCAL__/TodoListView.swift +0 -230
  482. package/templates/ios/todo/apps/ios/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -28
  483. package/templates/ios/todo/apps/ios/project.yml +0 -32
  484. package/templates/local-service/components.json +0 -20
  485. package/templates/mac/b2b/apps/mac/Package.swift +0 -22
  486. package/templates/mac/b2b/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -15
  487. package/templates/mac/b2b/apps/mac/Sources/__APP_NAME_PASCAL__/OrgPickerView.swift +0 -178
  488. package/templates/mac/b2b/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -30
  489. package/templates/mac/b2b/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
  490. package/templates/mac/b2b/apps/mac/project.yml +0 -34
  491. package/templates/mac/barebones/apps/mac/Package.swift +0 -33
  492. package/templates/mac/barebones/apps/mac/Sources/__APP_NAME_PASCAL__/ContentView.swift +0 -104
  493. package/templates/mac/barebones/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -17
  494. package/templates/mac/barebones/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -30
  495. package/templates/mac/barebones/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
  496. package/templates/mac/barebones/apps/mac/project.yml +0 -34
  497. package/templates/mac/chat/apps/mac/Package.swift +0 -34
  498. package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/ChatRootView.swift +0 -143
  499. package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -26
  500. package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/RoomView.swift +0 -136
  501. package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -58
  502. package/templates/mac/chat/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
  503. package/templates/mac/chat/apps/mac/project.yml +0 -36
  504. package/templates/mac/consumer/apps/mac/Package.swift +0 -34
  505. package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/FeedView.swift +0 -199
  506. package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -34
  507. package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/ProfileSetupView.swift +0 -68
  508. package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/RootView.swift +0 -40
  509. package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -59
  510. package/templates/mac/consumer/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
  511. package/templates/mac/consumer/apps/mac/project.yml +0 -36
  512. package/templates/mac/todo/apps/mac/Package.swift +0 -33
  513. package/templates/mac/todo/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -19
  514. package/templates/mac/todo/apps/mac/Sources/__APP_NAME_PASCAL__/TodoListView.swift +0 -244
  515. package/templates/mac/todo/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -30
  516. package/templates/mac/todo/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
  517. package/templates/mac/todo/apps/mac/project.yml +0 -34
  518. package/templates/marketplace/components/ui/native-select.tsx +0 -62
  519. package/templates/marketplace/components.json +0 -20
  520. package/templates/projects/components.json +0 -20
  521. package/templates/restaurant/components.json +0 -20
  522. package/templates/saas/components.json +0 -20
  523. package/templates/shop/components.json +0 -20
  524. package/templates/todo/components.json +0 -20
  525. package/templates/ui/packages/ui/package.json +0 -26
  526. package/templates/ui/packages/ui/src/button.tsx +0 -44
  527. package/templates/ui/packages/ui/src/card.tsx +0 -39
  528. package/templates/ui/packages/ui/src/cn.ts +0 -12
  529. package/templates/ui/packages/ui/src/index.ts +0 -4
  530. package/templates/ui/packages/ui/src/input.tsx +0 -19
  531. package/templates/ui/packages/ui/tsconfig.json +0 -15
  532. package/templates/vite/todo/apps/web/index.html +0 -12
  533. package/templates/vite/todo/apps/web/package.json +0 -31
  534. package/templates/vite/todo/apps/web/src/App.tsx +0 -16
  535. package/templates/vite/todo/apps/web/src/components/TodoList.tsx +0 -281
  536. package/templates/vite/todo/apps/web/src/index.css +0 -14
  537. package/templates/vite/todo/apps/web/src/main.tsx +0 -20
  538. package/templates/vite/todo/apps/web/tsconfig.json +0 -24
  539. package/templates/vite/todo/apps/web/vite.config.ts +0 -41
  540. package/templates/waitlist/components.json +0 -20
  541. package/templates/web/b2b/apps/web/next-env.d.ts +0 -2
  542. package/templates/web/b2b/apps/web/next.config.ts +0 -24
  543. package/templates/web/b2b/apps/web/package.json +0 -27
  544. package/templates/web/b2b/apps/web/postcss.config.mjs +0 -3
  545. package/templates/web/b2b/apps/web/src/app/components/OrgPicker.tsx +0 -171
  546. package/templates/web/b2b/apps/web/src/app/globals.css +0 -6
  547. package/templates/web/b2b/apps/web/src/app/layout.tsx +0 -21
  548. package/templates/web/b2b/apps/web/src/app/page.tsx +0 -39
  549. package/templates/web/b2b/apps/web/src/lib/pylon.ts +0 -5
  550. package/templates/web/b2b/apps/web/tsconfig.json +0 -26
  551. package/templates/web/barebones/apps/web/next-env.d.ts +0 -2
  552. package/templates/web/barebones/apps/web/next.config.ts +0 -40
  553. package/templates/web/barebones/apps/web/package.json +0 -27
  554. package/templates/web/barebones/apps/web/postcss.config.mjs +0 -3
  555. package/templates/web/barebones/apps/web/src/app/components/WidgetList.tsx +0 -81
  556. package/templates/web/barebones/apps/web/src/app/globals.css +0 -6
  557. package/templates/web/barebones/apps/web/src/app/layout.tsx +0 -21
  558. package/templates/web/barebones/apps/web/src/app/page.tsx +0 -43
  559. package/templates/web/barebones/apps/web/src/lib/pylon.ts +0 -14
  560. package/templates/web/barebones/apps/web/tsconfig.json +0 -26
  561. package/templates/web/chat/apps/web/next-env.d.ts +0 -2
  562. package/templates/web/chat/apps/web/next.config.ts +0 -24
  563. package/templates/web/chat/apps/web/package.json +0 -27
  564. package/templates/web/chat/apps/web/postcss.config.mjs +0 -3
  565. package/templates/web/chat/apps/web/src/app/components/ChatRoom.tsx +0 -231
  566. package/templates/web/chat/apps/web/src/app/globals.css +0 -6
  567. package/templates/web/chat/apps/web/src/app/layout.tsx +0 -22
  568. package/templates/web/chat/apps/web/src/app/page.tsx +0 -12
  569. package/templates/web/chat/apps/web/src/app/providers.tsx +0 -25
  570. package/templates/web/chat/apps/web/src/lib/pylon.ts +0 -5
  571. package/templates/web/chat/apps/web/tsconfig.json +0 -26
  572. package/templates/web/consumer/apps/web/next-env.d.ts +0 -2
  573. package/templates/web/consumer/apps/web/next.config.ts +0 -24
  574. package/templates/web/consumer/apps/web/package.json +0 -27
  575. package/templates/web/consumer/apps/web/postcss.config.mjs +0 -3
  576. package/templates/web/consumer/apps/web/src/app/components/Feed.tsx +0 -315
  577. package/templates/web/consumer/apps/web/src/app/globals.css +0 -6
  578. package/templates/web/consumer/apps/web/src/app/layout.tsx +0 -22
  579. package/templates/web/consumer/apps/web/src/app/page.tsx +0 -21
  580. package/templates/web/consumer/apps/web/src/app/providers.tsx +0 -25
  581. package/templates/web/consumer/apps/web/src/lib/pylon.ts +0 -5
  582. package/templates/web/consumer/apps/web/tsconfig.json +0 -26
  583. package/templates/web/todo/apps/web/next-env.d.ts +0 -2
  584. package/templates/web/todo/apps/web/next.config.ts +0 -26
  585. package/templates/web/todo/apps/web/package.json +0 -30
  586. package/templates/web/todo/apps/web/postcss.config.mjs +0 -3
  587. package/templates/web/todo/apps/web/src/app/components/TodoList.tsx +0 -310
  588. package/templates/web/todo/apps/web/src/app/globals.css +0 -6
  589. package/templates/web/todo/apps/web/src/app/layout.tsx +0 -21
  590. package/templates/web/todo/apps/web/src/app/page.tsx +0 -36
  591. package/templates/web/todo/apps/web/src/lib/pylon.ts +0 -5
  592. package/templates/web/todo/apps/web/tsconfig.json +0 -26
  593. /package/templates/barebones/app/{items-client.tsx → (app)/items-client.tsx} +0 -0
  594. /package/templates/marketplace/{app/_components → components}/CategoryIcon.tsx +0 -0
  595. /package/templates/todo/app/{todo-app.tsx → (app)/todo-app.tsx} +0 -0
@@ -1,24 +0,0 @@
1
- // swift-tools-version:5.9
2
- import PackageDescription
3
-
4
- let package = Package(
5
- name: "__APP_NAME_PASCAL__",
6
- platforms: [
7
- .iOS(.v16),
8
- .macOS(.v13),
9
- ],
10
- dependencies: [
11
- .package(url: "https://github.com/pylonsync/pylon-swift.git", from: "0.3.0"),
12
- ],
13
- targets: [
14
- .executableTarget(
15
- name: "__APP_NAME_PASCAL__",
16
- dependencies: [
17
- .product(name: "PylonClient", package: "pylon-swift"),
18
- .product(name: "PylonSync", package: "pylon-swift"),
19
- .product(name: "PylonSwiftUI", package: "pylon-swift"),
20
- ],
21
- path: "Sources/__APP_NAME_PASCAL__"
22
- ),
23
- ]
24
- )
@@ -1,116 +0,0 @@
1
- import SwiftUI
2
- import PylonClient
3
- import PylonSync
4
- import PylonSwiftUI
5
-
6
- /// Two-pane chat: rooms list → room view. Subscribes to Room
7
- /// inserts/deletes via PylonQuery — every new room created on any
8
- /// device shows up here within ~ms over the WebSocket sync channel.
9
- struct ChatRootView: View {
10
- @EnvironmentObject var session: AppSession
11
- let engine: SyncEngine
12
- @StateObject private var rooms: PylonQuery<Room>
13
- @State private var errorMessage: String?
14
-
15
- init(engine: SyncEngine) {
16
- self.engine = engine
17
- _rooms = StateObject(
18
- wrappedValue: PylonQuery<Room>(engine: engine, entity: "Room"),
19
- )
20
- }
21
-
22
- var body: some View {
23
- NavigationStack {
24
- List {
25
- Section("Your name") {
26
- TextField("display name", text: Binding(
27
- get: { session.authorName },
28
- set: { session.setAuthorName($0) },
29
- ))
30
- .autocorrectionDisabled()
31
- }
32
- Section("Rooms") {
33
- if rooms.rows.isEmpty {
34
- Text("No rooms yet — create one below.")
35
- .foregroundStyle(.secondary)
36
- } else {
37
- ForEach(sortedRooms) { r in
38
- NavigationLink(value: r) {
39
- VStack(alignment: .leading) {
40
- Text(r.name)
41
- Text("#\(r.slug)")
42
- .font(.system(.caption, design: .monospaced))
43
- .foregroundStyle(.secondary)
44
- }
45
- }
46
- }
47
- }
48
- }
49
- Section {
50
- Button("Create room") {
51
- Task { await createRoom() }
52
- }
53
- }
54
- if let errorMessage {
55
- Section {
56
- Text(errorMessage)
57
- .foregroundStyle(.red)
58
- .font(.caption)
59
- }
60
- }
61
- }
62
- .navigationTitle("__APP_NAME__")
63
- .navigationDestination(for: Room.self) { room in
64
- RoomView(room: room, engine: engine)
65
- }
66
- }
67
- }
68
-
69
- private var sortedRooms: [Room] {
70
- rooms.rows.sorted { $0.createdAt < $1.createdAt }
71
- }
72
-
73
- private func createRoom() async {
74
- let name = await prompt(title: "Create room", message: "Room name?")
75
- guard let name = name?.trimmingCharacters(in: .whitespaces),
76
- !name.isEmpty
77
- else { return }
78
- let slug = name.lowercased()
79
- .replacingOccurrences(of: "[^a-z0-9]+", with: "-", options: .regularExpression)
80
- .trimmingCharacters(in: CharacterSet(charactersIn: "-"))
81
- do {
82
- // Server validates + writes via ctx.db.insert. The change_event
83
- // flows back through the SyncEngine and PylonQuery picks up
84
- // the new Room without us touching local state.
85
- let _: Room = try await session.client.callFn(
86
- "createRoom",
87
- args: CreateRoomArgs(slug: slug, name: name),
88
- )
89
- } catch {
90
- errorMessage = "Create failed: \(error.localizedDescription)"
91
- }
92
- }
93
-
94
- @MainActor
95
- private func prompt(title: String, message: String) async -> String? {
96
- #if canImport(UIKit)
97
- await withCheckedContinuation { (cont: CheckedContinuation<String?, Never>) in
98
- let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
99
- alert.addTextField()
100
- alert.addAction(UIAlertAction(title: "Cancel", style: .cancel) { _ in cont.resume(returning: nil) })
101
- alert.addAction(UIAlertAction(title: "Create", style: .default) { _ in cont.resume(returning: alert.textFields?.first?.text) })
102
- UIApplication.shared.connectedScenes
103
- .compactMap { ($0 as? UIWindowScene)?.windows.first }
104
- .first?
105
- .rootViewController?
106
- .present(alert, animated: true)
107
- }
108
- #else
109
- return nil
110
- #endif
111
- }
112
- }
113
-
114
- #if canImport(UIKit)
115
- import UIKit
116
- #endif
@@ -1,26 +0,0 @@
1
- import Foundation
2
-
3
- struct Room: Codable, Identifiable, Hashable {
4
- let id: String
5
- let slug: String
6
- let name: String
7
- let createdAt: String
8
- }
9
-
10
- struct Message: Codable, Identifiable, Hashable {
11
- let id: String
12
- let roomId: String
13
- let authorId: String
14
- let authorName: String
15
- let body: String
16
- let createdAt: String
17
- }
18
-
19
- struct CreateRoomArgs: Encodable { let slug: String; let name: String }
20
- struct RoomMessagesArgs: Encodable { let roomId: String }
21
- struct SendMessageArgs: Encodable {
22
- let roomId: String
23
- let body: String
24
- let authorName: String
25
- }
26
- struct EmptyArgs: Encodable {}
@@ -1,136 +0,0 @@
1
- import SwiftUI
2
- import PylonClient
3
- import PylonSync
4
- import PylonSwiftUI
5
-
6
- /// Live room view. PylonQuery<Message> with a `where` predicate that
7
- /// matches `roomId` to the active room. The sync engine pushes diffs
8
- /// over WebSocket; new messages from any client land in `messages.rows`
9
- /// without us polling.
10
- struct RoomView: View {
11
- @EnvironmentObject var session: AppSession
12
- let room: Room
13
- let engine: SyncEngine
14
- @StateObject private var messages: PylonQuery<Message>
15
- @State private var draft = ""
16
- @State private var sending = false
17
- @State private var errorMessage: String?
18
-
19
- init(room: Room, engine: SyncEngine) {
20
- self.room = room
21
- self.engine = engine
22
- let roomId = room.id
23
- _messages = StateObject(
24
- wrappedValue: PylonQuery<Message>(
25
- engine: engine,
26
- entity: "Message",
27
- where: { row in
28
- row["roomId"]?.stringValue == roomId
29
- },
30
- ),
31
- )
32
- }
33
-
34
- var body: some View {
35
- VStack(spacing: 0) {
36
- ScrollViewReader { proxy in
37
- ScrollView {
38
- LazyVStack(alignment: .leading, spacing: 12) {
39
- ForEach(sortedMessages) { msg in
40
- messageRow(msg).id(msg.id)
41
- }
42
- if messages.rows.isEmpty {
43
- Text("No messages yet. Say hi.")
44
- .foregroundStyle(.secondary)
45
- .padding(.top, 32)
46
- .frame(maxWidth: .infinity)
47
- }
48
- }
49
- .padding(16)
50
- }
51
- .onChange(of: messages.rows.count) { _, _ in
52
- if let last = sortedMessages.last {
53
- withAnimation { proxy.scrollTo(last.id, anchor: .bottom) }
54
- }
55
- }
56
- }
57
-
58
- if let errorMessage {
59
- Text(errorMessage)
60
- .foregroundStyle(.red)
61
- .font(.caption)
62
- .padding(8)
63
- }
64
-
65
- HStack {
66
- TextField("Message #\(room.slug)…", text: $draft, axis: .vertical)
67
- .textFieldStyle(.roundedBorder)
68
- .lineLimit(1...4)
69
- .onSubmit { Task { await send() } }
70
- Button("Send") { Task { await send() } }
71
- .keyboardShortcut(.defaultAction)
72
- .disabled(draft.trimmingCharacters(in: .whitespaces).isEmpty || sending)
73
- }
74
- .padding(12)
75
- .background(.thinMaterial)
76
- }
77
- .navigationTitle(room.name)
78
- #if os(iOS)
79
- .navigationBarTitleDisplayMode(.inline)
80
- #endif
81
- }
82
-
83
- private var sortedMessages: [Message] {
84
- messages.rows.sorted { $0.createdAt < $1.createdAt }
85
- }
86
-
87
- @ViewBuilder
88
- private func messageRow(_ msg: Message) -> some View {
89
- VStack(alignment: .leading, spacing: 2) {
90
- HStack(alignment: .firstTextBaseline) {
91
- Text(msg.authorName).font(.subheadline.weight(.medium))
92
- Text(formatTime(msg.createdAt))
93
- .font(.caption2)
94
- .foregroundStyle(.tertiary)
95
- }
96
- Text(msg.body)
97
- .font(.body)
98
- .fixedSize(horizontal: false, vertical: true)
99
- }
100
- }
101
-
102
- private func formatTime(_ iso: String) -> String {
103
- let formatter = ISO8601DateFormatter()
104
- formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
105
- guard let date = formatter.date(from: iso) ?? ISO8601DateFormatter().date(from: iso) else {
106
- return ""
107
- }
108
- let display = DateFormatter()
109
- display.timeStyle = .short
110
- return display.string(from: date)
111
- }
112
-
113
- private func send() async {
114
- let body = draft.trimmingCharacters(in: .whitespaces)
115
- guard !body.isEmpty else { return }
116
- sending = true
117
- defer { sending = false }
118
- do {
119
- // Server inserts via ctx.db.insert; the change_event flows
120
- // back through the SyncEngine and our PylonQuery picks up
121
- // the new row. We only clear the draft here.
122
- let _: Message = try await session.client.callFn(
123
- "sendMessage",
124
- args: SendMessageArgs(
125
- roomId: room.id,
126
- body: body,
127
- authorName: session.authorName,
128
- ),
129
- )
130
- draft = ""
131
- errorMessage = nil
132
- } catch {
133
- errorMessage = "Send failed: \(error.localizedDescription)"
134
- }
135
- }
136
- }
@@ -1,58 +0,0 @@
1
- import SwiftUI
2
- import PylonClient
3
- import PylonSync
4
-
5
- @main
6
- struct __APP_NAME_PASCAL__App: App {
7
- @StateObject private var session = AppSession()
8
-
9
- var body: some Scene {
10
- WindowGroup {
11
- Group {
12
- if let engine = session.engine {
13
- ChatRootView(engine: engine)
14
- .environmentObject(session)
15
- } else {
16
- ProgressView()
17
- .frame(maxWidth: .infinity, maxHeight: .infinity)
18
- }
19
- }
20
- .task { await session.bootIfNeeded() }
21
- }
22
- }
23
- }
24
-
25
- @MainActor
26
- final class AppSession: ObservableObject {
27
- let client: PylonClient
28
- @Published private(set) var engine: SyncEngine?
29
- @Published var authorName: String
30
-
31
- init() {
32
- let baseURLString = ProcessInfo.processInfo.environment["PYLON_BASE_URL"]
33
- ?? "http://localhost:4321"
34
- guard let url = URL(string: baseURLString) else {
35
- fatalError("Invalid PYLON_BASE_URL: \(baseURLString)")
36
- }
37
- self.client = PylonClient(baseURL: url, appName: "__APP_NAME_SNAKE__")
38
- self.authorName = UserDefaults.standard.string(forKey: "authorName") ?? "anonymous"
39
- }
40
-
41
- /// Construct + start the SyncEngine. Idempotent — safe to call from
42
- /// .task on every scene mount.
43
- func bootIfNeeded() async {
44
- guard engine == nil else { return }
45
- let baseURLString = ProcessInfo.processInfo.environment["PYLON_BASE_URL"]
46
- ?? "http://localhost:4321"
47
- guard let url = URL(string: baseURLString) else { return }
48
- let config = SyncEngineConfig(baseURL: url, appName: "__APP_NAME_SNAKE__")
49
- let engine = await SyncEngine(config: config, client: client)
50
- await engine.start()
51
- self.engine = engine
52
- }
53
-
54
- func setAuthorName(_ name: String) {
55
- authorName = name
56
- UserDefaults.standard.set(name, forKey: "authorName")
57
- }
58
- }
@@ -1,44 +0,0 @@
1
- # xcodegen spec for the iOS build of __APP_NAME__.
2
- #
3
- # Materialize the Xcode project once with:
4
- # brew install xcodegen
5
- # xcodegen generate
6
- # Then open __APP_NAME_PASCAL__.xcodeproj.
7
-
8
- name: __APP_NAME_PASCAL__
9
- options:
10
- bundleIdPrefix: com.example
11
- deploymentTarget:
12
- iOS: "16.0"
13
-
14
- packages:
15
- pylon:
16
- url: https://github.com/pylonsync/pylon-swift.git
17
- from: "0.3.0"
18
-
19
- targets:
20
- __APP_NAME_PASCAL__:
21
- type: application
22
- platform: iOS
23
- sources:
24
- - path: Sources/__APP_NAME_PASCAL__
25
- settings:
26
- base:
27
- GENERATE_INFOPLIST_FILE: YES
28
- INFOPLIST_KEY_UIApplicationSceneManifest_Generation: YES
29
- INFOPLIST_KEY_UILaunchScreen_Generation: YES
30
- INFOPLIST_KEY_UISupportedInterfaceOrientations: "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"
31
- TARGETED_DEVICE_FAMILY: "1,2"
32
- SWIFT_VERSION: "5.9"
33
- ENABLE_PREVIEWS: YES
34
- # __APP_NAME__ talks to a Pylon backend on localhost during dev.
35
- # The simulator can reach localhost directly; on a physical device
36
- # set PYLON_BASE_URL to your machine's LAN IP.
37
- INFOPLIST_KEY_NSAppTransportSecurity: "{NSAllowsLocalNetworking = YES;}"
38
- dependencies:
39
- - package: pylon
40
- product: PylonClient
41
- - package: pylon
42
- product: PylonSync
43
- - package: pylon
44
- product: PylonSwiftUI
@@ -1,23 +0,0 @@
1
- // swift-tools-version:5.9
2
- import PackageDescription
3
-
4
- let package = Package(
5
- name: "__APP_NAME_PASCAL__",
6
- platforms: [
7
- .iOS(.v16),
8
- .macOS(.v13),
9
- ],
10
- dependencies: [
11
- .package(url: "https://github.com/pylonsync/pylon-swift.git", from: "0.3.0"),
12
- ],
13
- targets: [
14
- .executableTarget(
15
- name: "__APP_NAME_PASCAL__",
16
- dependencies: [
17
- .product(name: "PylonClient", package: "pylon-swift"),
18
- .product(name: "PylonSwiftUI", package: "pylon-swift"),
19
- ],
20
- path: "Sources/__APP_NAME_PASCAL__"
21
- ),
22
- ]
23
- )
@@ -1,18 +0,0 @@
1
- import Foundation
2
-
3
- /// Mirrors `Todo` from `apps/api/schema.ts`. For production, regenerate
4
- /// from the schema with `pylon codegen client schema.ts --target swift`.
5
- struct Todo: Codable, Identifiable, Hashable {
6
- let id: String
7
- var title: String
8
- var done: Bool
9
- let createdAt: String
10
- var position: Double?
11
- }
12
-
13
- struct AddTodoArgs: Encodable { let title: String }
14
- struct ToggleTodoArgs: Encodable { let id: String; let done: Bool }
15
- struct EditTodoArgs: Encodable { let id: String; let title: String }
16
- struct DeleteTodoArgs: Encodable { let id: String }
17
- struct ReorderTodoArgs: Encodable { let id: String; let position: Double }
18
- struct EmptyArgs: Encodable {}
@@ -1,230 +0,0 @@
1
- import SwiftUI
2
- import PylonClient
3
-
4
- /// Live Todo list with add, toggle, edit, drag-reorder, and delete.
5
- /// Uses PylonClient's HTTP API directly. Drop-in upgrade path:
6
- /// swap `load()` for a `PylonQuery<Todo>` ObservableObject from
7
- /// PylonSwiftUI to get realtime updates without polling.
8
- struct TodoListView: View {
9
- @EnvironmentObject var session: AppSession
10
-
11
- @State private var todos: [Todo] = []
12
- @State private var draftTitle: String = ""
13
- @State private var loading = true
14
- @State private var pending = false
15
- @State private var errorMessage: String?
16
- @State private var editingId: String?
17
- @State private var editingDraft: String = ""
18
-
19
- var body: some View {
20
- NavigationStack {
21
- List {
22
- Section("Add") {
23
- HStack {
24
- TextField("What needs doing?", text: $draftTitle)
25
- .textFieldStyle(.roundedBorder)
26
- .onSubmit { Task { await add() } }
27
- Button("Add") { Task { await add() } }
28
- .buttonStyle(.borderedProminent)
29
- .disabled(draftTitle.trimmingCharacters(in: .whitespaces).isEmpty || pending)
30
- }
31
- }
32
-
33
- Section("Todos") {
34
- if loading {
35
- ProgressView()
36
- } else if todos.isEmpty {
37
- Text("No todos yet.").foregroundStyle(.secondary)
38
- } else {
39
- ForEach(todos) { todo in
40
- row(todo)
41
- }
42
- .onMove { source, destination in
43
- Task { await reorder(from: source, to: destination) }
44
- }
45
- .onDelete { offsets in
46
- Task { await delete(at: offsets) }
47
- }
48
- }
49
- }
50
-
51
- if let errorMessage {
52
- Section {
53
- Text(errorMessage)
54
- .foregroundStyle(.red)
55
- .font(.caption)
56
- }
57
- }
58
- }
59
- .navigationTitle("__APP_NAME__")
60
- .toolbar { EditButton() }
61
- .task { await load() }
62
- .refreshable { await load() }
63
- }
64
- }
65
-
66
- @ViewBuilder
67
- private func row(_ todo: Todo) -> some View {
68
- HStack(spacing: 12) {
69
- Button {
70
- Task { await toggle(todo) }
71
- } label: {
72
- Image(systemName: todo.done ? "checkmark.circle.fill" : "circle")
73
- .foregroundStyle(todo.done ? .green : .secondary)
74
- }
75
- .buttonStyle(.plain)
76
-
77
- if editingId == todo.id {
78
- TextField("Title", text: $editingDraft)
79
- .textFieldStyle(.roundedBorder)
80
- .onSubmit { Task { await commitEdit(todo) } }
81
- Button("Save") { Task { await commitEdit(todo) } }
82
- .buttonStyle(.bordered)
83
- Button("Cancel") {
84
- editingId = nil
85
- editingDraft = ""
86
- }
87
- .buttonStyle(.bordered)
88
- } else {
89
- Text(todo.title)
90
- .strikethrough(todo.done, color: .secondary)
91
- .foregroundStyle(todo.done ? .secondary : .primary)
92
- Spacer()
93
- Button("Edit") {
94
- editingId = todo.id
95
- editingDraft = todo.title
96
- }
97
- .buttonStyle(.borderless)
98
- .font(.caption)
99
- }
100
- }
101
- }
102
-
103
- // MARK: - Network
104
-
105
- private func load() async {
106
- loading = true
107
- defer { loading = false }
108
- do {
109
- let rows: [Todo] = try await session.pylon.callFn("listTodos", args: EmptyArgs())
110
- todos = rows
111
- errorMessage = nil
112
- } catch {
113
- errorMessage = "Load failed: \(error.localizedDescription)"
114
- }
115
- }
116
-
117
- private func add() async {
118
- let trimmed = draftTitle.trimmingCharacters(in: .whitespaces)
119
- guard !trimmed.isEmpty else { return }
120
- pending = true
121
- defer { pending = false }
122
- do {
123
- let todo: Todo = try await session.pylon.callFn(
124
- "addTodo",
125
- args: AddTodoArgs(title: trimmed),
126
- )
127
- todos.append(todo)
128
- draftTitle = ""
129
- } catch {
130
- errorMessage = "Add failed: \(error.localizedDescription)"
131
- }
132
- }
133
-
134
- private func toggle(_ todo: Todo) async {
135
- let nextDone = !todo.done
136
- // Optimistic update
137
- if let i = todos.firstIndex(where: { $0.id == todo.id }) {
138
- todos[i].done = nextDone
139
- }
140
- do {
141
- let _: Todo = try await session.pylon.callFn(
142
- "toggleTodo",
143
- args: ToggleTodoArgs(id: todo.id, done: nextDone),
144
- )
145
- } catch {
146
- // Revert
147
- if let i = todos.firstIndex(where: { $0.id == todo.id }) {
148
- todos[i].done = todo.done
149
- }
150
- errorMessage = "Toggle failed: \(error.localizedDescription)"
151
- }
152
- }
153
-
154
- private func commitEdit(_ todo: Todo) async {
155
- let trimmed = editingDraft.trimmingCharacters(in: .whitespaces)
156
- guard !trimmed.isEmpty, trimmed != todo.title else {
157
- editingId = nil
158
- editingDraft = ""
159
- return
160
- }
161
- let originalTitle = todo.title
162
- if let i = todos.firstIndex(where: { $0.id == todo.id }) {
163
- todos[i].title = trimmed
164
- }
165
- editingId = nil
166
- editingDraft = ""
167
- do {
168
- let _: Todo = try await session.pylon.callFn(
169
- "editTodo",
170
- args: EditTodoArgs(id: todo.id, title: trimmed),
171
- )
172
- } catch {
173
- if let i = todos.firstIndex(where: { $0.id == todo.id }) {
174
- todos[i].title = originalTitle
175
- }
176
- errorMessage = "Rename failed: \(error.localizedDescription)"
177
- }
178
- }
179
-
180
- private func delete(at offsets: IndexSet) async {
181
- let removed = offsets.map { todos[$0] }
182
- todos.remove(atOffsets: offsets)
183
- for todo in removed {
184
- do {
185
- let _: Todo = try await session.pylon.callFn(
186
- "deleteTodo",
187
- args: DeleteTodoArgs(id: todo.id),
188
- )
189
- } catch {
190
- todos.append(todo)
191
- errorMessage = "Delete failed: \(error.localizedDescription)"
192
- }
193
- }
194
- }
195
-
196
- private func reorder(from source: IndexSet, to destination: Int) async {
197
- var moved = todos
198
- moved.move(fromOffsets: source, toOffset: destination)
199
- guard let movedIndex = source.first else { return }
200
- // Compute the moved row's new index after the move
201
- let newIndex = destination > movedIndex ? destination - 1 : destination
202
- guard newIndex < moved.count else { return }
203
- let movedTodo = moved[newIndex]
204
- let prev = newIndex > 0 ? moved[newIndex - 1] : nil
205
- let next = newIndex + 1 < moved.count ? moved[newIndex + 1] : nil
206
- let prevPos = prev?.position ?? 0
207
- let nextPos = next?.position ?? 0
208
- let position: Double
209
- if prev != nil && next != nil {
210
- position = (prevPos + nextPos) / 2
211
- } else if prev != nil {
212
- position = prevPos + 1024
213
- } else if next != nil {
214
- position = nextPos - 1024
215
- } else {
216
- position = 1024
217
- }
218
- let snapshot = todos
219
- todos = moved
220
- do {
221
- let _: Todo = try await session.pylon.callFn(
222
- "reorderTodo",
223
- args: ReorderTodoArgs(id: movedTodo.id, position: position),
224
- )
225
- } catch {
226
- todos = snapshot
227
- errorMessage = "Reorder failed: \(error.localizedDescription)"
228
- }
229
- }
230
- }