@proofkit/cli 1.0.0-beta.0

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 (317) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/LICENSE.md +21 -0
  3. package/README.md +19 -0
  4. package/dist/acorn-AKFTBDM6.js +15 -0
  5. package/dist/angular-BOQ6FHSU.js +2 -0
  6. package/dist/babel-ZTOORN7K.js +15 -0
  7. package/dist/chunk-4LISTI44.js +1 -0
  8. package/dist/estree-KOJPX4S6.js +36 -0
  9. package/dist/flow-RCI44GYZ.js +19 -0
  10. package/dist/glimmer-GV5EF5E4.js +30 -0
  11. package/dist/graphql-YXQNPQWM.js +29 -0
  12. package/dist/html-ZAJTRROK.js +22 -0
  13. package/dist/index.js +300 -0
  14. package/dist/markdown-Q75DTQI7.js +63 -0
  15. package/dist/meriyah-32K7GBV5.js +4 -0
  16. package/dist/postcss-WWYO4PGL.js +54 -0
  17. package/dist/typescript-M6N7JDNQ.js +20 -0
  18. package/dist/yaml-LY7PNAYV.js +161 -0
  19. package/index.d.ts +19 -0
  20. package/package.json +122 -0
  21. package/template/extras/_cursor/conditional-rules/nextjs-framework.mdc +51 -0
  22. package/template/extras/_cursor/conditional-rules/npm.mdc +60 -0
  23. package/template/extras/_cursor/conditional-rules/pnpm.mdc +65 -0
  24. package/template/extras/_cursor/conditional-rules/yarn.mdc +60 -0
  25. package/template/extras/_cursor/rules/cursor-rules.mdc +88 -0
  26. package/template/extras/_cursor/rules/filemaker-api.mdc +176 -0
  27. package/template/extras/_cursor/rules/troubleshooting-patterns.mdc +240 -0
  28. package/template/extras/_cursor/rules/ui-components.mdc +57 -0
  29. package/template/extras/config/_eslint.js +27 -0
  30. package/template/extras/config/_prettier.config.js +6 -0
  31. package/template/extras/config/drizzle-config-mysql.ts +12 -0
  32. package/template/extras/config/drizzle-config-postgres.ts +12 -0
  33. package/template/extras/config/drizzle-config-sqlite.ts +12 -0
  34. package/template/extras/config/fmschema.config.mjs +9 -0
  35. package/template/extras/config/get-query-client.ts +6 -0
  36. package/template/extras/config/postcss.config.cjs +7 -0
  37. package/template/extras/config/query-provider-vite.tsx +19 -0
  38. package/template/extras/config/query-provider.tsx +21 -0
  39. package/template/extras/emailProviders/none/email.tsx +24 -0
  40. package/template/extras/emailProviders/plunk/email.tsx +26 -0
  41. package/template/extras/emailProviders/plunk/service.ts +4 -0
  42. package/template/extras/emailProviders/resend/email.tsx +23 -0
  43. package/template/extras/emailProviders/resend/service.ts +4 -0
  44. package/template/extras/fmaddon-auth/app/(main)/auth/profile/actions.ts +93 -0
  45. package/template/extras/fmaddon-auth/app/(main)/auth/profile/page.tsx +27 -0
  46. package/template/extras/fmaddon-auth/app/(main)/auth/profile/profile-form.tsx +56 -0
  47. package/template/extras/fmaddon-auth/app/(main)/auth/profile/reset-password-form.tsx +110 -0
  48. package/template/extras/fmaddon-auth/app/(main)/auth/profile/schema.ts +19 -0
  49. package/template/extras/fmaddon-auth/app/auth/forgot-password/actions.ts +37 -0
  50. package/template/extras/fmaddon-auth/app/auth/forgot-password/forgot-form.tsx +41 -0
  51. package/template/extras/fmaddon-auth/app/auth/forgot-password/page.tsx +21 -0
  52. package/template/extras/fmaddon-auth/app/auth/forgot-password/schema.ts +5 -0
  53. package/template/extras/fmaddon-auth/app/auth/login/actions.ts +34 -0
  54. package/template/extras/fmaddon-auth/app/auth/login/login-form.tsx +64 -0
  55. package/template/extras/fmaddon-auth/app/auth/login/page.tsx +26 -0
  56. package/template/extras/fmaddon-auth/app/auth/login/schema.ts +6 -0
  57. package/template/extras/fmaddon-auth/app/auth/reset-password/actions.ts +50 -0
  58. package/template/extras/fmaddon-auth/app/auth/reset-password/page.tsx +32 -0
  59. package/template/extras/fmaddon-auth/app/auth/reset-password/reset-password-form.tsx +59 -0
  60. package/template/extras/fmaddon-auth/app/auth/reset-password/schema.ts +14 -0
  61. package/template/extras/fmaddon-auth/app/auth/reset-password/verify-email/actions.ts +45 -0
  62. package/template/extras/fmaddon-auth/app/auth/reset-password/verify-email/page.tsx +32 -0
  63. package/template/extras/fmaddon-auth/app/auth/reset-password/verify-email/schema.ts +5 -0
  64. package/template/extras/fmaddon-auth/app/auth/reset-password/verify-email/verify-email-form.tsx +48 -0
  65. package/template/extras/fmaddon-auth/app/auth/signup/actions.ts +49 -0
  66. package/template/extras/fmaddon-auth/app/auth/signup/page.tsx +26 -0
  67. package/template/extras/fmaddon-auth/app/auth/signup/schema.ts +12 -0
  68. package/template/extras/fmaddon-auth/app/auth/signup/signup-form.tsx +67 -0
  69. package/template/extras/fmaddon-auth/app/auth/verify-email/actions.ts +110 -0
  70. package/template/extras/fmaddon-auth/app/auth/verify-email/email-verification-form.tsx +45 -0
  71. package/template/extras/fmaddon-auth/app/auth/verify-email/page.tsx +38 -0
  72. package/template/extras/fmaddon-auth/app/auth/verify-email/resend-button.tsx +35 -0
  73. package/template/extras/fmaddon-auth/app/auth/verify-email/schema.ts +5 -0
  74. package/template/extras/fmaddon-auth/components/auth/actions.ts +16 -0
  75. package/template/extras/fmaddon-auth/components/auth/protect.tsx +17 -0
  76. package/template/extras/fmaddon-auth/components/auth/redirect.tsx +26 -0
  77. package/template/extras/fmaddon-auth/components/auth/use-user.ts +59 -0
  78. package/template/extras/fmaddon-auth/components/auth/user-menu.tsx +51 -0
  79. package/template/extras/fmaddon-auth/emails/auth-code.tsx +156 -0
  80. package/template/extras/fmaddon-auth/middleware.ts +45 -0
  81. package/template/extras/fmaddon-auth/server/auth/utils/email-verification.ts +136 -0
  82. package/template/extras/fmaddon-auth/server/auth/utils/encryption.ts +51 -0
  83. package/template/extras/fmaddon-auth/server/auth/utils/index.ts +16 -0
  84. package/template/extras/fmaddon-auth/server/auth/utils/password-reset.ts +152 -0
  85. package/template/extras/fmaddon-auth/server/auth/utils/password.ts +67 -0
  86. package/template/extras/fmaddon-auth/server/auth/utils/redirect.ts +8 -0
  87. package/template/extras/fmaddon-auth/server/auth/utils/session.ts +192 -0
  88. package/template/extras/fmaddon-auth/server/auth/utils/user.ts +147 -0
  89. package/template/extras/prisma/schema/base-planetscale.prisma +24 -0
  90. package/template/extras/prisma/schema/base.prisma +20 -0
  91. package/template/extras/prisma/schema/with-auth-planetscale.prisma +77 -0
  92. package/template/extras/prisma/schema/with-auth.prisma +74 -0
  93. package/template/extras/src/app/_components/post-tw.tsx +50 -0
  94. package/template/extras/src/app/_components/post.tsx +54 -0
  95. package/template/extras/src/app/api/auth/[...nextauth]/route.ts +4 -0
  96. package/template/extras/src/app/api/trpc/[trpc]/route.ts +34 -0
  97. package/template/extras/src/app/clerk-auth/layout.tsx +10 -0
  98. package/template/extras/src/app/clerk-auth/signin/[[...sign-in]]/page.tsx +5 -0
  99. package/template/extras/src/app/clerk-auth/signup/[[...sign-up]]/page.tsx +5 -0
  100. package/template/extras/src/app/layout/base.tsx +34 -0
  101. package/template/extras/src/app/layout/main-shell.tsx +37 -0
  102. package/template/extras/src/app/layout/with-trpc-tw.tsx +24 -0
  103. package/template/extras/src/app/layout/with-trpc.tsx +24 -0
  104. package/template/extras/src/app/layout/with-tw.tsx +20 -0
  105. package/template/extras/src/app/next-auth/layout.tsx +22 -0
  106. package/template/extras/src/app/next-auth/signin/page.tsx +82 -0
  107. package/template/extras/src/app/next-auth/signup/action.ts +24 -0
  108. package/template/extras/src/app/next-auth/signup/page.tsx +40 -0
  109. package/template/extras/src/app/next-auth/signup/validation.ts +12 -0
  110. package/template/extras/src/app/page/base.tsx +6 -0
  111. package/template/extras/src/app/page/with-auth-trpc-tw.tsx +67 -0
  112. package/template/extras/src/app/page/with-auth-trpc.tsx +68 -0
  113. package/template/extras/src/app/page/with-trpc-tw.tsx +53 -0
  114. package/template/extras/src/app/page/with-trpc.tsx +54 -0
  115. package/template/extras/src/app/page/with-tw.tsx +37 -0
  116. package/template/extras/src/components/clerk-auth/clerk-provider.tsx +18 -0
  117. package/template/extras/src/components/clerk-auth/user-menu-mobile.tsx +36 -0
  118. package/template/extras/src/components/clerk-auth/user-menu.tsx +24 -0
  119. package/template/extras/src/components/next-auth/next-auth-provider.tsx +14 -0
  120. package/template/extras/src/components/next-auth/user-menu-mobile.tsx +31 -0
  121. package/template/extras/src/components/next-auth/user-menu.tsx +38 -0
  122. package/template/extras/src/env/with-auth.ts +31 -0
  123. package/template/extras/src/env/with-clerk.ts +20 -0
  124. package/template/extras/src/index.module.css +177 -0
  125. package/template/extras/src/middleware/clerk.ts +20 -0
  126. package/template/extras/src/middleware/next-auth.ts +5 -0
  127. package/template/extras/src/pages/_app/base.tsx +14 -0
  128. package/template/extras/src/pages/_app/with-auth-trpc-tw.tsx +23 -0
  129. package/template/extras/src/pages/_app/with-auth-trpc.tsx +23 -0
  130. package/template/extras/src/pages/_app/with-auth-tw.tsx +21 -0
  131. package/template/extras/src/pages/_app/with-auth.tsx +21 -0
  132. package/template/extras/src/pages/_app/with-trpc-tw.tsx +16 -0
  133. package/template/extras/src/pages/_app/with-trpc.tsx +16 -0
  134. package/template/extras/src/pages/_app/with-tw.tsx +14 -0
  135. package/template/extras/src/pages/api/auth/[...nextauth].ts +5 -0
  136. package/template/extras/src/pages/api/trpc/[trpc].ts +19 -0
  137. package/template/extras/src/pages/index/base.tsx +47 -0
  138. package/template/extras/src/pages/index/with-auth-trpc-tw.tsx +80 -0
  139. package/template/extras/src/pages/index/with-auth-trpc.tsx +81 -0
  140. package/template/extras/src/pages/index/with-trpc-tw.tsx +52 -0
  141. package/template/extras/src/pages/index/with-trpc.tsx +53 -0
  142. package/template/extras/src/pages/index/with-tw.tsx +45 -0
  143. package/template/extras/src/server/api/root.ts +23 -0
  144. package/template/extras/src/server/api/routers/post/base.ts +40 -0
  145. package/template/extras/src/server/api/routers/post/with-auth-drizzle.ts +39 -0
  146. package/template/extras/src/server/api/routers/post/with-auth-prisma.ts +41 -0
  147. package/template/extras/src/server/api/routers/post/with-auth.ts +37 -0
  148. package/template/extras/src/server/api/routers/post/with-drizzle.ts +30 -0
  149. package/template/extras/src/server/api/routers/post/with-prisma.ts +31 -0
  150. package/template/extras/src/server/api/trpc-app/base.ts +103 -0
  151. package/template/extras/src/server/api/trpc-app/with-auth-db.ts +133 -0
  152. package/template/extras/src/server/api/trpc-app/with-auth.ts +130 -0
  153. package/template/extras/src/server/api/trpc-app/with-db.ts +106 -0
  154. package/template/extras/src/server/api/trpc-pages/base.ts +122 -0
  155. package/template/extras/src/server/api/trpc-pages/with-auth-db.ts +160 -0
  156. package/template/extras/src/server/api/trpc-pages/with-auth.ts +158 -0
  157. package/template/extras/src/server/api/trpc-pages/with-db.ts +125 -0
  158. package/template/extras/src/server/data/users.ts +23 -0
  159. package/template/extras/src/server/db/db-prisma-planetscale.ts +22 -0
  160. package/template/extras/src/server/db/db-prisma.ts +17 -0
  161. package/template/extras/src/server/db/index-drizzle/with-mysql.ts +18 -0
  162. package/template/extras/src/server/db/index-drizzle/with-planetscale.ts +7 -0
  163. package/template/extras/src/server/db/index-drizzle/with-postgres.ts +18 -0
  164. package/template/extras/src/server/db/index-drizzle/with-sqlite.ts +19 -0
  165. package/template/extras/src/server/db/schema-drizzle/base-mysql.ts +34 -0
  166. package/template/extras/src/server/db/schema-drizzle/base-planetscale.ts +34 -0
  167. package/template/extras/src/server/db/schema-drizzle/base-postgres.ts +36 -0
  168. package/template/extras/src/server/db/schema-drizzle/base-sqlite.ts +30 -0
  169. package/template/extras/src/server/db/schema-drizzle/with-auth-mysql.ts +123 -0
  170. package/template/extras/src/server/db/schema-drizzle/with-auth-planetscale.ts +117 -0
  171. package/template/extras/src/server/db/schema-drizzle/with-auth-postgres.ts +130 -0
  172. package/template/extras/src/server/db/schema-drizzle/with-auth-sqlite.ts +116 -0
  173. package/template/extras/src/server/next-auth/base.ts +111 -0
  174. package/template/extras/src/server/next-auth/password.ts +13 -0
  175. package/template/extras/src/server/next-auth/with-drizzle.ts +83 -0
  176. package/template/extras/src/server/next-auth/with-prisma.ts +72 -0
  177. package/template/extras/src/trpc/query-client.ts +25 -0
  178. package/template/extras/src/trpc/react.tsx +76 -0
  179. package/template/extras/src/trpc/server.ts +30 -0
  180. package/template/extras/src/utils/api.ts +68 -0
  181. package/template/extras/start-database/mysql.sh +54 -0
  182. package/template/extras/start-database/postgres.sh +55 -0
  183. package/template/fm-addon/ProofKitAuth/de.xml +518 -0
  184. package/template/fm-addon/ProofKitAuth/en.xml +518 -0
  185. package/template/fm-addon/ProofKitAuth/es.xml +518 -0
  186. package/template/fm-addon/ProofKitAuth/fr.xml +518 -0
  187. package/template/fm-addon/ProofKitAuth/icon.png +0 -0
  188. package/template/fm-addon/ProofKitAuth/icon@2x.png +0 -0
  189. package/template/fm-addon/ProofKitAuth/info.json +11 -0
  190. package/template/fm-addon/ProofKitAuth/info_de.json +18 -0
  191. package/template/fm-addon/ProofKitAuth/info_en.json +8 -0
  192. package/template/fm-addon/ProofKitAuth/info_es.json +18 -0
  193. package/template/fm-addon/ProofKitAuth/info_fr.json +18 -0
  194. package/template/fm-addon/ProofKitAuth/info_it.json +18 -0
  195. package/template/fm-addon/ProofKitAuth/info_ja.json +18 -0
  196. package/template/fm-addon/ProofKitAuth/info_ko.json +18 -0
  197. package/template/fm-addon/ProofKitAuth/info_nl.json +18 -0
  198. package/template/fm-addon/ProofKitAuth/info_pt.json +18 -0
  199. package/template/fm-addon/ProofKitAuth/info_sv.json +18 -0
  200. package/template/fm-addon/ProofKitAuth/info_zh.json +18 -0
  201. package/template/fm-addon/ProofKitAuth/it.xml +518 -0
  202. package/template/fm-addon/ProofKitAuth/ja.xml +518 -0
  203. package/template/fm-addon/ProofKitAuth/ko.xml +518 -0
  204. package/template/fm-addon/ProofKitAuth/nl.xml +518 -0
  205. package/template/fm-addon/ProofKitAuth/preview.png +0 -0
  206. package/template/fm-addon/ProofKitAuth/pt.xml +518 -0
  207. package/template/fm-addon/ProofKitAuth/sv.xml +518 -0
  208. package/template/fm-addon/ProofKitAuth/template.xml +0 -0
  209. package/template/fm-addon/ProofKitAuth/zh.xml +518 -0
  210. package/template/fm-addon/ProofKitWV/de.xml +896 -0
  211. package/template/fm-addon/ProofKitWV/en.xml +896 -0
  212. package/template/fm-addon/ProofKitWV/es.xml +896 -0
  213. package/template/fm-addon/ProofKitWV/fr.xml +896 -0
  214. package/template/fm-addon/ProofKitWV/icon.png +0 -0
  215. package/template/fm-addon/ProofKitWV/icon@2x.png +0 -0
  216. package/template/fm-addon/ProofKitWV/info.json +11 -0
  217. package/template/fm-addon/ProofKitWV/info_de.json +18 -0
  218. package/template/fm-addon/ProofKitWV/info_en.json +11 -0
  219. package/template/fm-addon/ProofKitWV/info_es.json +18 -0
  220. package/template/fm-addon/ProofKitWV/info_fr.json +18 -0
  221. package/template/fm-addon/ProofKitWV/info_it.json +18 -0
  222. package/template/fm-addon/ProofKitWV/info_ja.json +18 -0
  223. package/template/fm-addon/ProofKitWV/info_ko.json +18 -0
  224. package/template/fm-addon/ProofKitWV/info_nl.json +18 -0
  225. package/template/fm-addon/ProofKitWV/info_pt.json +18 -0
  226. package/template/fm-addon/ProofKitWV/info_sv.json +18 -0
  227. package/template/fm-addon/ProofKitWV/info_zh.json +18 -0
  228. package/template/fm-addon/ProofKitWV/it.xml +896 -0
  229. package/template/fm-addon/ProofKitWV/ja.xml +896 -0
  230. package/template/fm-addon/ProofKitWV/ko.xml +896 -0
  231. package/template/fm-addon/ProofKitWV/nl.xml +896 -0
  232. package/template/fm-addon/ProofKitWV/preview.png +0 -0
  233. package/template/fm-addon/ProofKitWV/pt.xml +896 -0
  234. package/template/fm-addon/ProofKitWV/records_de.xml +0 -0
  235. package/template/fm-addon/ProofKitWV/records_en.xml +0 -0
  236. package/template/fm-addon/ProofKitWV/records_es.xml +0 -0
  237. package/template/fm-addon/ProofKitWV/records_fr.xml +0 -0
  238. package/template/fm-addon/ProofKitWV/records_it.xml +0 -0
  239. package/template/fm-addon/ProofKitWV/records_ja.xml +0 -0
  240. package/template/fm-addon/ProofKitWV/records_ko.xml +0 -0
  241. package/template/fm-addon/ProofKitWV/records_nl.xml +0 -0
  242. package/template/fm-addon/ProofKitWV/records_pt.xml +0 -0
  243. package/template/fm-addon/ProofKitWV/records_sv.xml +0 -0
  244. package/template/fm-addon/ProofKitWV/records_zh.xml +0 -0
  245. package/template/fm-addon/ProofKitWV/sv.xml +896 -0
  246. package/template/fm-addon/ProofKitWV/template.xml +0 -0
  247. package/template/fm-addon/ProofKitWV/zh.xml +896 -0
  248. package/template/nextjs/README.md +27 -0
  249. package/template/nextjs/_gitignore +37 -0
  250. package/template/nextjs/next.config.ts +12 -0
  251. package/template/nextjs/package.json +50 -0
  252. package/template/nextjs/postcss.config.cjs +14 -0
  253. package/template/nextjs/proofkit.json +1 -0
  254. package/template/nextjs/public/favicon.ico +0 -0
  255. package/template/nextjs/public/proofkit.png +0 -0
  256. package/template/nextjs/src/app/(main)/layout.tsx +6 -0
  257. package/template/nextjs/src/app/(main)/page.tsx +90 -0
  258. package/template/nextjs/src/app/layout.tsx +39 -0
  259. package/template/nextjs/src/app/navigation.tsx +12 -0
  260. package/template/nextjs/src/components/AppLogo.tsx +6 -0
  261. package/template/nextjs/src/components/AppShell/internal/AppShell.tsx +21 -0
  262. package/template/nextjs/src/components/AppShell/internal/Header.module.css +40 -0
  263. package/template/nextjs/src/components/AppShell/internal/Header.tsx +34 -0
  264. package/template/nextjs/src/components/AppShell/internal/HeaderMobileMenu.tsx +27 -0
  265. package/template/nextjs/src/components/AppShell/internal/HeaderNavLink.tsx +31 -0
  266. package/template/nextjs/src/components/AppShell/internal/config.ts +1 -0
  267. package/template/nextjs/src/components/AppShell/slot-header-center.tsx +13 -0
  268. package/template/nextjs/src/components/AppShell/slot-header-left.tsx +23 -0
  269. package/template/nextjs/src/components/AppShell/slot-header-mobile-content.tsx +43 -0
  270. package/template/nextjs/src/components/AppShell/slot-header-right.tsx +26 -0
  271. package/template/nextjs/src/config/env.ts +13 -0
  272. package/template/nextjs/src/config/theme/globals.css +1 -0
  273. package/template/nextjs/src/config/theme/mantine-theme.ts +22 -0
  274. package/template/nextjs/src/server/safe-action.ts +3 -0
  275. package/template/nextjs/src/utils/notification-helpers.ts +32 -0
  276. package/template/nextjs/tsconfig.json +40 -0
  277. package/template/pages/nextjs/blank/page.tsx +5 -0
  278. package/template/pages/nextjs/table/page.tsx +17 -0
  279. package/template/pages/nextjs/table/table.tsx +18 -0
  280. package/template/pages/nextjs/table-edit/actions.ts +23 -0
  281. package/template/pages/nextjs/table-edit/page.tsx +28 -0
  282. package/template/pages/nextjs/table-edit/schema.ts +4 -0
  283. package/template/pages/nextjs/table-edit/table.tsx +43 -0
  284. package/template/pages/nextjs/table-infinite/actions.ts +62 -0
  285. package/template/pages/nextjs/table-infinite/page.tsx +11 -0
  286. package/template/pages/nextjs/table-infinite/query.ts +44 -0
  287. package/template/pages/nextjs/table-infinite/table.tsx +107 -0
  288. package/template/pages/nextjs/table-infinite-edit/actions.ts +84 -0
  289. package/template/pages/nextjs/table-infinite-edit/page.tsx +23 -0
  290. package/template/pages/nextjs/table-infinite-edit/query.ts +81 -0
  291. package/template/pages/nextjs/table-infinite-edit/schema.ts +4 -0
  292. package/template/pages/nextjs/table-infinite-edit/table.tsx +130 -0
  293. package/template/pages/vite-wv/blank/index.tsx +0 -0
  294. package/template/pages/vite-wv/table/index.tsx +34 -0
  295. package/template/pages/vite-wv/table-edit/index.tsx +72 -0
  296. package/template/vite-wv/.vscode/settings.json +11 -0
  297. package/template/vite-wv/_gitignore +18 -0
  298. package/template/vite-wv/index.html +13 -0
  299. package/template/vite-wv/package.json +52 -0
  300. package/template/vite-wv/pnpm-lock.yaml +2294 -0
  301. package/template/vite-wv/postcss.config.cjs +14 -0
  302. package/template/vite-wv/proofkit.json +1 -0
  303. package/template/vite-wv/scripts/launch-fm.sh +3 -0
  304. package/template/vite-wv/scripts/upload.js +21 -0
  305. package/template/vite-wv/src/components/AppLogo.tsx +5 -0
  306. package/template/vite-wv/src/components/full-screen-loader.tsx +9 -0
  307. package/template/vite-wv/src/config/env.ts +16 -0
  308. package/template/vite-wv/src/config/theme/globals.css +1 -0
  309. package/template/vite-wv/src/config/theme/mantine-theme.ts +22 -0
  310. package/template/vite-wv/src/main.tsx +42 -0
  311. package/template/vite-wv/src/routeTree.gen.ts +111 -0
  312. package/template/vite-wv/src/routes/__root.tsx +21 -0
  313. package/template/vite-wv/src/routes/index.tsx +63 -0
  314. package/template/vite-wv/src/routes/secondary.tsx +28 -0
  315. package/template/vite-wv/src/utils/notification-helpers.ts +32 -0
  316. package/template/vite-wv/tsconfig.json +14 -0
  317. package/template/vite-wv/vite.config.ts +18 -0
@@ -0,0 +1,133 @@
1
+ /**
2
+ * YOU PROBABLY DON'T NEED TO EDIT THIS FILE, UNLESS:
3
+ * 1. You want to modify request context (see Part 1).
4
+ * 2. You want to create a new middleware or type of procedure (see Part 3).
5
+ *
6
+ * TL;DR - This is where all the tRPC server stuff is created and plugged in. The pieces you will
7
+ * need to use are documented accordingly near the end.
8
+ */
9
+
10
+ import { initTRPC, TRPCError } from "@trpc/server";
11
+ import superjson from "superjson";
12
+ import { ZodError } from "zod/v4";
13
+
14
+ import { getServerAuthSession } from "~/server/auth";
15
+ import { db } from "~/server/db";
16
+
17
+ /**
18
+ * 1. CONTEXT
19
+ *
20
+ * This section defines the "contexts" that are available in the backend API.
21
+ *
22
+ * These allow you to access things when processing a request, like the database, the session, etc.
23
+ *
24
+ * This helper generates the "internals" for a tRPC context. The API handler and RSC clients each
25
+ * wrap this and provides the required context.
26
+ *
27
+ * @see https://trpc.io/docs/server/context
28
+ */
29
+ export const createTRPCContext = async (opts: { headers: Headers }) => {
30
+ const session = await getServerAuthSession();
31
+
32
+ return {
33
+ db,
34
+ session,
35
+ ...opts,
36
+ };
37
+ };
38
+
39
+ /**
40
+ * 2. INITIALIZATION
41
+ *
42
+ * This is where the tRPC API is initialized, connecting the context and transformer. We also parse
43
+ * ZodErrors so that you get typesafety on the frontend if your procedure fails due to validation
44
+ * errors on the backend.
45
+ */
46
+ const t = initTRPC.context<typeof createTRPCContext>().create({
47
+ transformer: superjson,
48
+ errorFormatter({ shape, error }) {
49
+ return {
50
+ ...shape,
51
+ data: {
52
+ ...shape.data,
53
+ zodError:
54
+ error.cause instanceof ZodError ? error.cause.flatten() : null,
55
+ },
56
+ };
57
+ },
58
+ });
59
+
60
+ /**
61
+ * Create a server-side caller.
62
+ *
63
+ * @see https://trpc.io/docs/server/server-side-calls
64
+ */
65
+ export const createCallerFactory = t.createCallerFactory;
66
+
67
+ /**
68
+ * 3. ROUTER & PROCEDURE (THE IMPORTANT BIT)
69
+ *
70
+ * These are the pieces you use to build your tRPC API. You should import these a lot in the
71
+ * "/src/server/api/routers" directory.
72
+ */
73
+
74
+ /**
75
+ * This is how you create new routers and sub-routers in your tRPC API.
76
+ *
77
+ * @see https://trpc.io/docs/router
78
+ */
79
+ export const createTRPCRouter = t.router;
80
+
81
+ /**
82
+ * Middleware for timing procedure execution and adding an articifial delay in development.
83
+ *
84
+ * You can remove this if you don't like it, but it can help catch unwanted waterfalls by simulating
85
+ * network latency that would occur in production but not in local development.
86
+ */
87
+ const timingMiddleware = t.middleware(async ({ next, path }) => {
88
+ const start = Date.now();
89
+
90
+ if (t._config.isDev) {
91
+ // artificial delay in dev
92
+ const waitMs = Math.floor(Math.random() * 400) + 100;
93
+ await new Promise((resolve) => setTimeout(resolve, waitMs));
94
+ }
95
+
96
+ const result = await next();
97
+
98
+ const end = Date.now();
99
+ console.log(`[TRPC] ${path} took ${end - start}ms to execute`);
100
+
101
+ return result;
102
+ });
103
+
104
+ /**
105
+ * Public (unauthenticated) procedure
106
+ *
107
+ * This is the base piece you use to build new queries and mutations on your tRPC API. It does not
108
+ * guarantee that a user querying is authorized, but you can still access user session data if they
109
+ * are logged in.
110
+ */
111
+ export const publicProcedure = t.procedure.use(timingMiddleware);
112
+
113
+ /**
114
+ * Protected (authenticated) procedure
115
+ *
116
+ * If you want a query or mutation to ONLY be accessible to logged in users, use this. It verifies
117
+ * the session is valid and guarantees `ctx.session.user` is not null.
118
+ *
119
+ * @see https://trpc.io/docs/procedures
120
+ */
121
+ export const protectedProcedure = t.procedure
122
+ .use(timingMiddleware)
123
+ .use(({ ctx, next }) => {
124
+ if (!ctx.session || !ctx.session.user) {
125
+ throw new TRPCError({ code: "UNAUTHORIZED" });
126
+ }
127
+ return next({
128
+ ctx: {
129
+ // infers the `session` as non-nullable
130
+ session: { ...ctx.session, user: ctx.session.user },
131
+ },
132
+ });
133
+ });
@@ -0,0 +1,130 @@
1
+ /**
2
+ * YOU PROBABLY DON'T NEED TO EDIT THIS FILE, UNLESS:
3
+ * 1. You want to modify request context (see Part 1).
4
+ * 2. You want to create a new middleware or type of procedure (see Part 3).
5
+ *
6
+ * TL;DR - This is where all the tRPC server stuff is created and plugged in. The pieces you will
7
+ * need to use are documented accordingly near the end.
8
+ */
9
+ import { initTRPC, TRPCError } from "@trpc/server";
10
+ import superjson from "superjson";
11
+ import { ZodError } from "zod/v4";
12
+
13
+ import { getServerAuthSession } from "~/server/auth";
14
+
15
+ /**
16
+ * 1. CONTEXT
17
+ *
18
+ * This section defines the "contexts" that are available in the backend API.
19
+ *
20
+ * These allow you to access things when processing a request, like the database, the session, etc.
21
+ *
22
+ * This helper generates the "internals" for a tRPC context. The API handler and RSC clients each
23
+ * wrap this and provides the required context.
24
+ *
25
+ * @see https://trpc.io/docs/server/context
26
+ */
27
+ export const createTRPCContext = async (opts: { headers: Headers }) => {
28
+ const session = await getServerAuthSession();
29
+
30
+ return {
31
+ session,
32
+ ...opts,
33
+ };
34
+ };
35
+
36
+ /**
37
+ * 2. INITIALIZATION
38
+ *
39
+ * This is where the tRPC API is initialized, connecting the context and transformer. We also parse
40
+ * ZodErrors so that you get typesafety on the frontend if your procedure fails due to validation
41
+ * errors on the backend.
42
+ */
43
+ const t = initTRPC.context<typeof createTRPCContext>().create({
44
+ transformer: superjson,
45
+ errorFormatter({ shape, error }) {
46
+ return {
47
+ ...shape,
48
+ data: {
49
+ ...shape.data,
50
+ zodError:
51
+ error.cause instanceof ZodError ? error.cause.flatten() : null,
52
+ },
53
+ };
54
+ },
55
+ });
56
+
57
+ /**
58
+ * Create a server-side caller.
59
+ *
60
+ * @see https://trpc.io/docs/server/server-side-calls
61
+ */
62
+ export const createCallerFactory = t.createCallerFactory;
63
+
64
+ /**
65
+ * 3. ROUTER & PROCEDURE (THE IMPORTANT BIT)
66
+ *
67
+ * These are the pieces you use to build your tRPC API. You should import these a lot in the
68
+ * "/src/server/api/routers" directory.
69
+ */
70
+
71
+ /**
72
+ * This is how you create new routers and sub-routers in your tRPC API.
73
+ *
74
+ * @see https://trpc.io/docs/router
75
+ */
76
+ export const createTRPCRouter = t.router;
77
+
78
+ /**
79
+ * Middleware for timing procedure execution and adding an articifial delay in development.
80
+ *
81
+ * You can remove this if you don't like it, but it can help catch unwanted waterfalls by simulating
82
+ * network latency that would occur in production but not in local development.
83
+ */
84
+ const timingMiddleware = t.middleware(async ({ next, path }) => {
85
+ const start = Date.now();
86
+
87
+ if (t._config.isDev) {
88
+ // artificial delay in dev
89
+ const waitMs = Math.floor(Math.random() * 400) + 100;
90
+ await new Promise((resolve) => setTimeout(resolve, waitMs));
91
+ }
92
+
93
+ const result = await next();
94
+
95
+ const end = Date.now();
96
+ console.log(`[TRPC] ${path} took ${end - start}ms to execute`);
97
+
98
+ return result;
99
+ });
100
+
101
+ /**
102
+ * Public (unauthenticated) procedure
103
+ *
104
+ * This is the base piece you use to build new queries and mutations on your tRPC API. It does not
105
+ * guarantee that a user querying is authorized, but you can still access user session data if they
106
+ * are logged in.
107
+ */
108
+ export const publicProcedure = t.procedure.use(timingMiddleware);
109
+
110
+ /**
111
+ * Protected (authenticated) procedure
112
+ *
113
+ * If you want a query or mutation to ONLY be accessible to logged in users, use this. It verifies
114
+ * the session is valid and guarantees `ctx.session.user` is not null.
115
+ *
116
+ * @see https://trpc.io/docs/procedures
117
+ */
118
+ export const protectedProcedure = t.procedure
119
+ .use(timingMiddleware)
120
+ .use(({ ctx, next }) => {
121
+ if (!ctx.session || !ctx.session.user) {
122
+ throw new TRPCError({ code: "UNAUTHORIZED" });
123
+ }
124
+ return next({
125
+ ctx: {
126
+ // infers the `session` as non-nullable
127
+ session: { ...ctx.session, user: ctx.session.user },
128
+ },
129
+ });
130
+ });
@@ -0,0 +1,106 @@
1
+ /**
2
+ * YOU PROBABLY DON'T NEED TO EDIT THIS FILE, UNLESS:
3
+ * 1. You want to modify request context (see Part 1).
4
+ * 2. You want to create a new middleware or type of procedure (see Part 3).
5
+ *
6
+ * TL;DR - This is where all the tRPC server stuff is created and plugged in. The pieces you will
7
+ * need to use are documented accordingly near the end.
8
+ */
9
+ import { initTRPC } from "@trpc/server";
10
+ import superjson from "superjson";
11
+ import { ZodError } from "zod/v4";
12
+
13
+ import { db } from "~/server/db";
14
+
15
+ /**
16
+ * 1. CONTEXT
17
+ *
18
+ * This section defines the "contexts" that are available in the backend API.
19
+ *
20
+ * These allow you to access things when processing a request, like the database, the session, etc.
21
+ *
22
+ * This helper generates the "internals" for a tRPC context. The API handler and RSC clients each
23
+ * wrap this and provides the required context.
24
+ *
25
+ * @see https://trpc.io/docs/server/context
26
+ */
27
+ export const createTRPCContext = async (opts: { headers: Headers }) => {
28
+ return {
29
+ db,
30
+ ...opts,
31
+ };
32
+ };
33
+
34
+ /**
35
+ * 2. INITIALIZATION
36
+ *
37
+ * This is where the tRPC API is initialized, connecting the context and transformer. We also parse
38
+ * ZodErrors so that you get typesafety on the frontend if your procedure fails due to validation
39
+ * errors on the backend.
40
+ */
41
+ const t = initTRPC.context<typeof createTRPCContext>().create({
42
+ transformer: superjson,
43
+ errorFormatter({ shape, error }) {
44
+ return {
45
+ ...shape,
46
+ data: {
47
+ ...shape.data,
48
+ zodError:
49
+ error.cause instanceof ZodError ? error.cause.flatten() : null,
50
+ },
51
+ };
52
+ },
53
+ });
54
+
55
+ /**
56
+ * Create a server-side caller.
57
+ *
58
+ * @see https://trpc.io/docs/server/server-side-calls
59
+ */
60
+ export const createCallerFactory = t.createCallerFactory;
61
+
62
+ /**
63
+ * 3. ROUTER & PROCEDURE (THE IMPORTANT BIT)
64
+ *
65
+ * These are the pieces you use to build your tRPC API. You should import these a lot in the
66
+ * "/src/server/api/routers" directory.
67
+ */
68
+
69
+ /**
70
+ * This is how you create new routers and sub-routers in your tRPC API.
71
+ *
72
+ * @see https://trpc.io/docs/router
73
+ */
74
+ export const createTRPCRouter = t.router;
75
+
76
+ /**
77
+ * Middleware for timing procedure execution and adding an articifial delay in development.
78
+ *
79
+ * You can remove this if you don't like it, but it can help catch unwanted waterfalls by simulating
80
+ * network latency that would occur in production but not in local development.
81
+ */
82
+ const timingMiddleware = t.middleware(async ({ next, path }) => {
83
+ const start = Date.now();
84
+
85
+ if (t._config.isDev) {
86
+ // artificial delay in dev
87
+ const waitMs = Math.floor(Math.random() * 400) + 100;
88
+ await new Promise((resolve) => setTimeout(resolve, waitMs));
89
+ }
90
+
91
+ const result = await next();
92
+
93
+ const end = Date.now();
94
+ console.log(`[TRPC] ${path} took ${end - start}ms to execute`);
95
+
96
+ return result;
97
+ });
98
+
99
+ /**
100
+ * Public (unauthenticated) procedure
101
+ *
102
+ * This is the base piece you use to build new queries and mutations on your tRPC API. It does not
103
+ * guarantee that a user querying is authorized, but you can still access user session data if they
104
+ * are logged in.
105
+ */
106
+ export const publicProcedure = t.procedure.use(timingMiddleware);
@@ -0,0 +1,122 @@
1
+ /**
2
+ * YOU PROBABLY DON'T NEED TO EDIT THIS FILE, UNLESS:
3
+ * 1. You want to modify request context (see Part 1).
4
+ * 2. You want to create a new middleware or type of procedure (see Part 3).
5
+ *
6
+ * TL;DR - This is where all the tRPC server stuff is created and plugged in. The pieces you will
7
+ * need to use are documented accordingly near the end.
8
+ */
9
+
10
+ import { initTRPC } from "@trpc/server";
11
+ import { type CreateNextContextOptions } from "@trpc/server/adapters/next";
12
+ import superjson from "superjson";
13
+ import { ZodError } from "zod/v4";
14
+
15
+ /**
16
+ * 1. CONTEXT
17
+ *
18
+ * This section defines the "contexts" that are available in the backend API.
19
+ *
20
+ * These allow you to access things when processing a request, like the database, the session, etc.
21
+ */
22
+
23
+ type CreateContextOptions = Record<string, never>;
24
+
25
+ /**
26
+ * This helper generates the "internals" for a tRPC context. If you need to use it, you can export
27
+ * it from here.
28
+ *
29
+ * Examples of things you may need it for:
30
+ * - testing, so we don't have to mock Next.js' req/res
31
+ * - tRPC's `createSSGHelpers`, where we don't have req/res
32
+ *
33
+ * @see https://create.t3.gg/en/usage/trpc#-serverapitrpcts
34
+ */
35
+ const createInnerTRPCContext = (_opts: CreateContextOptions) => {
36
+ return {};
37
+ };
38
+
39
+ /**
40
+ * This is the actual context you will use in your router. It will be used to process every request
41
+ * that goes through your tRPC endpoint.
42
+ *
43
+ * @see https://trpc.io/docs/context
44
+ */
45
+ export const createTRPCContext = (_opts: CreateNextContextOptions) => {
46
+ return createInnerTRPCContext({});
47
+ };
48
+
49
+ /**
50
+ * 2. INITIALIZATION
51
+ *
52
+ * This is where the tRPC API is initialized, connecting the context and transformer. We also parse
53
+ * ZodErrors so that you get typesafety on the frontend if your procedure fails due to validation
54
+ * errors on the backend.
55
+ */
56
+
57
+ const t = initTRPC.context<typeof createTRPCContext>().create({
58
+ transformer: superjson,
59
+ errorFormatter({ shape, error }) {
60
+ return {
61
+ ...shape,
62
+ data: {
63
+ ...shape.data,
64
+ zodError:
65
+ error.cause instanceof ZodError ? error.cause.flatten() : null,
66
+ },
67
+ };
68
+ },
69
+ });
70
+
71
+ /**
72
+ * Create a server-side caller.
73
+ *
74
+ * @see https://trpc.io/docs/server/server-side-calls
75
+ */
76
+ export const createCallerFactory = t.createCallerFactory;
77
+
78
+ /**
79
+ * 3. ROUTER & PROCEDURE (THE IMPORTANT BIT)
80
+ *
81
+ * These are the pieces you use to build your tRPC API. You should import these a lot in the
82
+ * "/src/server/api/routers" directory.
83
+ */
84
+
85
+ /**
86
+ * This is how you create new routers and sub-routers in your tRPC API.
87
+ *
88
+ * @see https://trpc.io/docs/router
89
+ */
90
+ export const createTRPCRouter = t.router;
91
+
92
+ /**
93
+ * Middleware for timing procedure execution and adding an articifial delay in development.
94
+ *
95
+ * You can remove this if you don't like it, but it can help catch unwanted waterfalls by simulating
96
+ * network latency that would occur in production but not in local development.
97
+ */
98
+ const timingMiddleware = t.middleware(async ({ next, path }) => {
99
+ const start = Date.now();
100
+
101
+ if (t._config.isDev) {
102
+ // artificial delay in dev
103
+ const waitMs = Math.floor(Math.random() * 400) + 100;
104
+ await new Promise((resolve) => setTimeout(resolve, waitMs));
105
+ }
106
+
107
+ const result = await next();
108
+
109
+ const end = Date.now();
110
+ console.log(`[TRPC] ${path} took ${end - start}ms to execute`);
111
+
112
+ return result;
113
+ });
114
+
115
+ /**
116
+ * Public (unauthenticated) procedure
117
+ *
118
+ * This is the base piece you use to build new queries and mutations on your tRPC API. It does not
119
+ * guarantee that a user querying is authorized, but you can still access user session data if they
120
+ * are logged in.
121
+ */
122
+ export const publicProcedure = t.procedure.use(timingMiddleware);
@@ -0,0 +1,160 @@
1
+ /**
2
+ * YOU PROBABLY DON'T NEED TO EDIT THIS FILE, UNLESS:
3
+ * 1. You want to modify request context (see Part 1).
4
+ * 2. You want to create a new middleware or type of procedure (see Part 3).
5
+ *
6
+ * TL;DR - This is where all the tRPC server stuff is created and plugged in. The pieces you will
7
+ * need to use are documented accordingly near the end.
8
+ */
9
+
10
+ import { initTRPC, TRPCError } from "@trpc/server";
11
+ import { type CreateNextContextOptions } from "@trpc/server/adapters/next";
12
+ import { type Session } from "next-auth";
13
+ import superjson from "superjson";
14
+ import { ZodError } from "zod/v4";
15
+
16
+ import { getServerAuthSession } from "~/server/auth";
17
+ import { db } from "~/server/db";
18
+
19
+ /**
20
+ * 1. CONTEXT
21
+ *
22
+ * This section defines the "contexts" that are available in the backend API.
23
+ *
24
+ * These allow you to access things when processing a request, like the database, the session, etc.
25
+ */
26
+
27
+ interface CreateContextOptions {
28
+ session: Session | null;
29
+ }
30
+
31
+ /**
32
+ * This helper generates the "internals" for a tRPC context. If you need to use it, you can export
33
+ * it from here.
34
+ *
35
+ * Examples of things you may need it for:
36
+ * - testing, so we don't have to mock Next.js' req/res
37
+ * - tRPC's `createSSGHelpers`, where we don't have req/res
38
+ *
39
+ * @see https://create.t3.gg/en/usage/trpc#-serverapitrpcts
40
+ */
41
+ const createInnerTRPCContext = (opts: CreateContextOptions) => {
42
+ return {
43
+ session: opts.session,
44
+ db,
45
+ };
46
+ };
47
+
48
+ /**
49
+ * This is the actual context you will use in your router. It will be used to process every request
50
+ * that goes through your tRPC endpoint.
51
+ *
52
+ * @see https://trpc.io/docs/context
53
+ */
54
+ export const createTRPCContext = async (opts: CreateNextContextOptions) => {
55
+ const { req, res } = opts;
56
+
57
+ // Get the session from the server using the getServerSession wrapper function
58
+ const session = await getServerAuthSession({ req, res });
59
+
60
+ return createInnerTRPCContext({
61
+ session,
62
+ });
63
+ };
64
+
65
+ /**
66
+ * 2. INITIALIZATION
67
+ *
68
+ * This is where the tRPC API is initialized, connecting the context and transformer. We also parse
69
+ * ZodErrors so that you get typesafety on the frontend if your procedure fails due to validation
70
+ * errors on the backend.
71
+ */
72
+
73
+ const t = initTRPC.context<typeof createTRPCContext>().create({
74
+ transformer: superjson,
75
+ errorFormatter({ shape, error }) {
76
+ return {
77
+ ...shape,
78
+ data: {
79
+ ...shape.data,
80
+ zodError:
81
+ error.cause instanceof ZodError ? error.cause.flatten() : null,
82
+ },
83
+ };
84
+ },
85
+ });
86
+
87
+ /**
88
+ * Create a server-side caller.
89
+ *
90
+ * @see https://trpc.io/docs/server/server-side-calls
91
+ */
92
+ export const createCallerFactory = t.createCallerFactory;
93
+
94
+ /**
95
+ * 3. ROUTER & PROCEDURE (THE IMPORTANT BIT)
96
+ *
97
+ * These are the pieces you use to build your tRPC API. You should import these a lot in the
98
+ * "/src/server/api/routers" directory.
99
+ */
100
+
101
+ /**
102
+ * This is how you create new routers and sub-routers in your tRPC API.
103
+ *
104
+ * @see https://trpc.io/docs/router
105
+ */
106
+ export const createTRPCRouter = t.router;
107
+
108
+ /**
109
+ * Middleware for timing procedure execution and adding an articifial delay in development.
110
+ *
111
+ * You can remove this if you don't like it, but it can help catch unwanted waterfalls by simulating
112
+ * network latency that would occur in production but not in local development.
113
+ */
114
+ const timingMiddleware = t.middleware(async ({ next, path }) => {
115
+ const start = Date.now();
116
+
117
+ if (t._config.isDev) {
118
+ // artificial delay in dev
119
+ const waitMs = Math.floor(Math.random() * 400) + 100;
120
+ await new Promise((resolve) => setTimeout(resolve, waitMs));
121
+ }
122
+
123
+ const result = await next();
124
+
125
+ const end = Date.now();
126
+ console.log(`[TRPC] ${path} took ${end - start}ms to execute`);
127
+
128
+ return result;
129
+ });
130
+
131
+ /**
132
+ * Public (unauthenticated) procedure
133
+ *
134
+ * This is the base piece you use to build new queries and mutations on your tRPC API. It does not
135
+ * guarantee that a user querying is authorized, but you can still access user session data if they
136
+ * are logged in.
137
+ */
138
+ export const publicProcedure = t.procedure.use(timingMiddleware);
139
+
140
+ /**
141
+ * Protected (authenticated) procedure
142
+ *
143
+ * If you want a query or mutation to ONLY be accessible to logged in users, use this. It verifies
144
+ * the session is valid and guarantees `ctx.session.user` is not null.
145
+ *
146
+ * @see https://trpc.io/docs/procedures
147
+ */
148
+ export const protectedProcedure = t.procedure
149
+ .use(timingMiddleware)
150
+ .use(({ ctx, next }) => {
151
+ if (!ctx.session || !ctx.session.user) {
152
+ throw new TRPCError({ code: "UNAUTHORIZED" });
153
+ }
154
+ return next({
155
+ ctx: {
156
+ // infers the `session` as non-nullable
157
+ session: { ...ctx.session, user: ctx.session.user },
158
+ },
159
+ });
160
+ });