convex 1.46.0 → 1.47.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 (332) hide show
  1. package/CHANGELOG.md +58 -1
  2. package/dist/browser.bundle.js +7 -1
  3. package/dist/browser.bundle.js.map +2 -2
  4. package/dist/cjs/bundler/index.js +5 -4
  5. package/dist/cjs/bundler/index.js.map +2 -2
  6. package/dist/cjs/cli/codegen.js +0 -4
  7. package/dist/cjs/cli/codegen.js.map +2 -2
  8. package/dist/cjs/cli/configure.js +13 -4
  9. package/dist/cjs/cli/configure.js.map +2 -2
  10. package/dist/cjs/cli/deploy.js +27 -2
  11. package/dist/cjs/cli/deploy.js.map +2 -2
  12. package/dist/cjs/cli/deploymentSelect.js +2 -2
  13. package/dist/cjs/cli/deploymentSelect.js.map +2 -2
  14. package/dist/cjs/cli/dev.js +6 -0
  15. package/dist/cjs/cli/dev.js.map +2 -2
  16. package/dist/cjs/cli/env.js +10 -5
  17. package/dist/cjs/cli/env.js.map +2 -2
  18. package/dist/cjs/cli/envDefault.js +7 -2
  19. package/dist/cjs/cli/envDefault.js.map +2 -2
  20. package/dist/cjs/cli/generatedApi.js.map +1 -1
  21. package/dist/cjs/cli/lib/api.js +2 -0
  22. package/dist/cjs/cli/lib/api.js.map +2 -2
  23. package/dist/cjs/cli/lib/checkForLargeIndexBackfill.js +113 -0
  24. package/dist/cjs/cli/lib/checkForLargeIndexBackfill.js.map +7 -0
  25. package/dist/cjs/cli/lib/checkForLargeIndexDeletion.js +36 -47
  26. package/dist/cjs/cli/lib/checkForLargeIndexDeletion.js.map +2 -2
  27. package/dist/cjs/cli/lib/checkForSlowSchemaValidation.js +58 -39
  28. package/dist/cjs/cli/lib/checkForSlowSchemaValidation.js.map +2 -2
  29. package/dist/cjs/cli/lib/checkForStagedValidatorDeletion.js +90 -0
  30. package/dist/cjs/cli/lib/checkForStagedValidatorDeletion.js.map +7 -0
  31. package/dist/cjs/cli/lib/codegen.js.map +2 -2
  32. package/dist/cjs/cli/lib/command.js +2 -1
  33. package/dist/cjs/cli/lib/command.js.map +2 -2
  34. package/dist/cjs/cli/lib/components/definition/bundle.js +37 -11
  35. package/dist/cjs/cli/lib/components/definition/bundle.js.map +2 -2
  36. package/dist/cjs/cli/lib/components.js +48 -5
  37. package/dist/cjs/cli/lib/components.js.map +2 -2
  38. package/dist/cjs/cli/lib/config.js +56 -17
  39. package/dist/cjs/cli/lib/config.js.map +2 -2
  40. package/dist/cjs/cli/lib/deploy2.js +3 -1
  41. package/dist/cjs/cli/lib/deploy2.js.map +2 -2
  42. package/dist/cjs/cli/lib/deployApi/evaluateSchema.js +30 -2
  43. package/dist/cjs/cli/lib/deployApi/evaluateSchema.js.map +2 -2
  44. package/dist/cjs/cli/lib/dev.js +5 -0
  45. package/dist/cjs/cli/lib/dev.js.map +2 -2
  46. package/dist/cjs/cli/lib/formatValidationProgress.js +47 -0
  47. package/dist/cjs/cli/lib/formatValidationProgress.js.map +7 -0
  48. package/dist/cjs/cli/lib/indexes.js.map +1 -1
  49. package/dist/cjs/cli/lib/mcp/tools/env.js +10 -3
  50. package/dist/cjs/cli/lib/mcp/tools/env.js.map +2 -2
  51. package/dist/cjs/cli/lib/run.js +4 -0
  52. package/dist/cjs/cli/lib/run.js.map +2 -2
  53. package/dist/cjs/cli/lib/schemaEvaluation.js +62 -0
  54. package/dist/cjs/cli/lib/schemaEvaluation.js.map +7 -0
  55. package/dist/cjs/cli/lib/usageLimits.js +4 -2
  56. package/dist/cjs/cli/lib/usageLimits.js.map +2 -2
  57. package/dist/cjs/cli/lib/utils/mutex.js +9 -24
  58. package/dist/cjs/cli/lib/utils/mutex.js.map +2 -2
  59. package/dist/cjs/cli/lib/utils/utils.js +48 -18
  60. package/dist/cjs/cli/lib/utils/utils.js.map +2 -2
  61. package/dist/cjs/cli/projectCreate.js +1 -1
  62. package/dist/cjs/cli/projectCreate.js.map +1 -1
  63. package/dist/cjs/index.js +1 -1
  64. package/dist/cjs/index.js.map +1 -1
  65. package/dist/cjs/server/impl/actions_impl.js +8 -3
  66. package/dist/cjs/server/impl/actions_impl.js.map +2 -2
  67. package/dist/cjs/server/impl/storage_impl.js +29 -0
  68. package/dist/cjs/server/impl/storage_impl.js.map +2 -2
  69. package/dist/cjs/server/index.js +1 -0
  70. package/dist/cjs/server/index.js.map +2 -2
  71. package/dist/cjs/server/meta.js.map +1 -1
  72. package/dist/cjs/server/registration.js.map +1 -1
  73. package/dist/cjs/server/schema.js +34 -12
  74. package/dist/cjs/server/schema.js.map +2 -2
  75. package/dist/cjs/server/storage.js.map +1 -1
  76. package/dist/cjs/values/validators.js +1 -1
  77. package/dist/cjs/values/validators.js.map +2 -2
  78. package/dist/cjs/values/value.js +6 -0
  79. package/dist/cjs/values/value.js.map +2 -2
  80. package/dist/cjs-types/bundler/index.d.ts +9 -2
  81. package/dist/cjs-types/bundler/index.d.ts.map +1 -1
  82. package/dist/cjs-types/cli/codegen.d.ts.map +1 -1
  83. package/dist/cjs-types/cli/configure.d.ts +6 -0
  84. package/dist/cjs-types/cli/configure.d.ts.map +1 -1
  85. package/dist/cjs-types/cli/deploy.d.ts +2 -0
  86. package/dist/cjs-types/cli/deploy.d.ts.map +1 -1
  87. package/dist/cjs-types/cli/deploymentCreate.d.ts +6 -6
  88. package/dist/cjs-types/cli/deploymentSelect.d.ts.map +1 -1
  89. package/dist/cjs-types/cli/dev.d.ts +1 -0
  90. package/dist/cjs-types/cli/dev.d.ts.map +1 -1
  91. package/dist/cjs-types/cli/env.d.ts.map +1 -1
  92. package/dist/cjs-types/cli/envDefault.d.ts.map +1 -1
  93. package/dist/cjs-types/cli/generatedApi.d.ts +1 -1
  94. package/dist/cjs-types/cli/generatedApi.d.ts.map +1 -1
  95. package/dist/cjs-types/cli/lib/api.d.ts.map +1 -1
  96. package/dist/cjs-types/cli/lib/checkForLargeIndexBackfill.d.ts +30 -0
  97. package/dist/cjs-types/cli/lib/checkForLargeIndexBackfill.d.ts.map +1 -0
  98. package/dist/cjs-types/cli/lib/checkForLargeIndexDeletion.d.ts +5 -7
  99. package/dist/cjs-types/cli/lib/checkForLargeIndexDeletion.d.ts.map +1 -1
  100. package/dist/cjs-types/cli/lib/checkForSlowSchemaValidation.d.ts +4 -10
  101. package/dist/cjs-types/cli/lib/checkForSlowSchemaValidation.d.ts.map +1 -1
  102. package/dist/cjs-types/cli/lib/checkForStagedValidatorDeletion.d.ts +17 -0
  103. package/dist/cjs-types/cli/lib/checkForStagedValidatorDeletion.d.ts.map +1 -0
  104. package/dist/cjs-types/cli/lib/codegen.d.ts +0 -3
  105. package/dist/cjs-types/cli/lib/codegen.d.ts.map +1 -1
  106. package/dist/cjs-types/cli/lib/command.d.ts +2 -0
  107. package/dist/cjs-types/cli/lib/command.d.ts.map +1 -1
  108. package/dist/cjs-types/cli/lib/components/definition/bundle.d.ts +13 -0
  109. package/dist/cjs-types/cli/lib/components/definition/bundle.d.ts.map +1 -1
  110. package/dist/cjs-types/cli/lib/components.d.ts +4 -0
  111. package/dist/cjs-types/cli/lib/components.d.ts.map +1 -1
  112. package/dist/cjs-types/cli/lib/config.d.ts +2 -1
  113. package/dist/cjs-types/cli/lib/config.d.ts.map +1 -1
  114. package/dist/cjs-types/cli/lib/deploy2.d.ts +2 -0
  115. package/dist/cjs-types/cli/lib/deploy2.d.ts.map +1 -1
  116. package/dist/cjs-types/cli/lib/deployApi/evaluateSchema.d.ts +460 -16
  117. package/dist/cjs-types/cli/lib/deployApi/evaluateSchema.d.ts.map +1 -1
  118. package/dist/cjs-types/cli/lib/dev.d.ts +1 -0
  119. package/dist/cjs-types/cli/lib/dev.d.ts.map +1 -1
  120. package/dist/cjs-types/cli/lib/formatValidationProgress.d.ts +8 -0
  121. package/dist/cjs-types/cli/lib/formatValidationProgress.d.ts.map +1 -0
  122. package/dist/cjs-types/cli/lib/mcp/tools/env.d.ts +8 -5
  123. package/dist/cjs-types/cli/lib/mcp/tools/env.d.ts.map +1 -1
  124. package/dist/cjs-types/cli/lib/run.d.ts.map +1 -1
  125. package/dist/cjs-types/cli/lib/schemaEvaluation.d.ts +33 -0
  126. package/dist/cjs-types/cli/lib/schemaEvaluation.d.ts.map +1 -0
  127. package/dist/cjs-types/cli/lib/usageLimits.d.ts +1 -1
  128. package/dist/cjs-types/cli/lib/usageLimits.d.ts.map +1 -1
  129. package/dist/cjs-types/cli/lib/utils/mutex.d.ts +1 -3
  130. package/dist/cjs-types/cli/lib/utils/mutex.d.ts.map +1 -1
  131. package/dist/cjs-types/cli/lib/utils/utils.d.ts +10 -2
  132. package/dist/cjs-types/cli/lib/utils/utils.d.ts.map +1 -1
  133. package/dist/cjs-types/index.d.ts +1 -1
  134. package/dist/cjs-types/server/impl/actions_impl.d.ts +18 -3
  135. package/dist/cjs-types/server/impl/actions_impl.d.ts.map +1 -1
  136. package/dist/cjs-types/server/impl/storage_impl.d.ts.map +1 -1
  137. package/dist/cjs-types/server/index.d.ts +1 -1
  138. package/dist/cjs-types/server/index.d.ts.map +1 -1
  139. package/dist/cjs-types/server/meta.d.ts +63 -0
  140. package/dist/cjs-types/server/meta.d.ts.map +1 -1
  141. package/dist/cjs-types/server/registration.d.ts +10 -0
  142. package/dist/cjs-types/server/registration.d.ts.map +1 -1
  143. package/dist/cjs-types/server/schema.d.ts +33 -0
  144. package/dist/cjs-types/server/schema.d.ts.map +1 -1
  145. package/dist/cjs-types/server/storage.d.ts.map +1 -1
  146. package/dist/cjs-types/values/value.d.ts.map +1 -1
  147. package/dist/cli.bundle.cjs +2935 -2048
  148. package/dist/cli.bundle.cjs.map +4 -4
  149. package/dist/esm/bundler/index.js +5 -4
  150. package/dist/esm/bundler/index.js.map +2 -2
  151. package/dist/esm/cli/codegen.js +0 -4
  152. package/dist/esm/cli/codegen.js.map +2 -2
  153. package/dist/esm/cli/configure.js +12 -4
  154. package/dist/esm/cli/configure.js.map +2 -2
  155. package/dist/esm/cli/deploy.js +27 -2
  156. package/dist/esm/cli/deploy.js.map +2 -2
  157. package/dist/esm/cli/deploymentSelect.js +6 -3
  158. package/dist/esm/cli/deploymentSelect.js.map +2 -2
  159. package/dist/esm/cli/dev.js +6 -0
  160. package/dist/esm/cli/dev.js.map +2 -2
  161. package/dist/esm/cli/env.js +11 -6
  162. package/dist/esm/cli/env.js.map +2 -2
  163. package/dist/esm/cli/envDefault.js +7 -2
  164. package/dist/esm/cli/envDefault.js.map +2 -2
  165. package/dist/esm/cli/lib/api.js +2 -0
  166. package/dist/esm/cli/lib/api.js.map +2 -2
  167. package/dist/esm/cli/lib/checkForLargeIndexBackfill.js +95 -0
  168. package/dist/esm/cli/lib/checkForLargeIndexBackfill.js.map +7 -0
  169. package/dist/esm/cli/lib/checkForLargeIndexDeletion.js +37 -48
  170. package/dist/esm/cli/lib/checkForLargeIndexDeletion.js.map +2 -2
  171. package/dist/esm/cli/lib/checkForSlowSchemaValidation.js +63 -41
  172. package/dist/esm/cli/lib/checkForSlowSchemaValidation.js.map +2 -2
  173. package/dist/esm/cli/lib/checkForStagedValidatorDeletion.js +68 -0
  174. package/dist/esm/cli/lib/checkForStagedValidatorDeletion.js.map +7 -0
  175. package/dist/esm/cli/lib/codegen.js.map +2 -2
  176. package/dist/esm/cli/lib/command.js +2 -1
  177. package/dist/esm/cli/lib/command.js.map +2 -2
  178. package/dist/esm/cli/lib/components/definition/bundle.js +37 -11
  179. package/dist/esm/cli/lib/components/definition/bundle.js.map +2 -2
  180. package/dist/esm/cli/lib/components.js +55 -5
  181. package/dist/esm/cli/lib/components.js.map +2 -2
  182. package/dist/esm/cli/lib/config.js +55 -17
  183. package/dist/esm/cli/lib/config.js.map +2 -2
  184. package/dist/esm/cli/lib/deploy2.js +3 -1
  185. package/dist/esm/cli/lib/deploy2.js.map +2 -2
  186. package/dist/esm/cli/lib/deployApi/evaluateSchema.js +28 -2
  187. package/dist/esm/cli/lib/deployApi/evaluateSchema.js.map +2 -2
  188. package/dist/esm/cli/lib/dev.js +5 -0
  189. package/dist/esm/cli/lib/dev.js.map +2 -2
  190. package/dist/esm/cli/lib/formatValidationProgress.js +24 -0
  191. package/dist/esm/cli/lib/formatValidationProgress.js.map +7 -0
  192. package/dist/esm/cli/lib/indexes.js.map +1 -1
  193. package/dist/esm/cli/lib/mcp/tools/env.js +10 -3
  194. package/dist/esm/cli/lib/mcp/tools/env.js.map +2 -2
  195. package/dist/esm/cli/lib/run.js +4 -0
  196. package/dist/esm/cli/lib/run.js.map +2 -2
  197. package/dist/esm/cli/lib/schemaEvaluation.js +39 -0
  198. package/dist/esm/cli/lib/schemaEvaluation.js.map +7 -0
  199. package/dist/esm/cli/lib/usageLimits.js +4 -2
  200. package/dist/esm/cli/lib/usageLimits.js.map +2 -2
  201. package/dist/esm/cli/lib/utils/mutex.js +9 -24
  202. package/dist/esm/cli/lib/utils/mutex.js.map +2 -2
  203. package/dist/esm/cli/lib/utils/utils.js +47 -18
  204. package/dist/esm/cli/lib/utils/utils.js.map +2 -2
  205. package/dist/esm/cli/projectCreate.js +1 -1
  206. package/dist/esm/cli/projectCreate.js.map +1 -1
  207. package/dist/esm/index.js +1 -1
  208. package/dist/esm/index.js.map +1 -1
  209. package/dist/esm/server/impl/actions_impl.js +7 -3
  210. package/dist/esm/server/impl/actions_impl.js.map +2 -2
  211. package/dist/esm/server/impl/storage_impl.js +29 -0
  212. package/dist/esm/server/impl/storage_impl.js.map +2 -2
  213. package/dist/esm/server/index.js +4 -1
  214. package/dist/esm/server/index.js.map +2 -2
  215. package/dist/esm/server/schema.js +34 -12
  216. package/dist/esm/server/schema.js.map +2 -2
  217. package/dist/esm/values/validators.js +1 -1
  218. package/dist/esm/values/validators.js.map +2 -2
  219. package/dist/esm/values/value.js +6 -0
  220. package/dist/esm/values/value.js.map +2 -2
  221. package/dist/esm-types/bundler/index.d.ts +9 -2
  222. package/dist/esm-types/bundler/index.d.ts.map +1 -1
  223. package/dist/esm-types/cli/codegen.d.ts.map +1 -1
  224. package/dist/esm-types/cli/configure.d.ts +6 -0
  225. package/dist/esm-types/cli/configure.d.ts.map +1 -1
  226. package/dist/esm-types/cli/deploy.d.ts +2 -0
  227. package/dist/esm-types/cli/deploy.d.ts.map +1 -1
  228. package/dist/esm-types/cli/deploymentCreate.d.ts +6 -6
  229. package/dist/esm-types/cli/deploymentSelect.d.ts.map +1 -1
  230. package/dist/esm-types/cli/dev.d.ts +1 -0
  231. package/dist/esm-types/cli/dev.d.ts.map +1 -1
  232. package/dist/esm-types/cli/env.d.ts.map +1 -1
  233. package/dist/esm-types/cli/envDefault.d.ts.map +1 -1
  234. package/dist/esm-types/cli/generatedApi.d.ts +1 -1
  235. package/dist/esm-types/cli/generatedApi.d.ts.map +1 -1
  236. package/dist/esm-types/cli/lib/api.d.ts.map +1 -1
  237. package/dist/esm-types/cli/lib/checkForLargeIndexBackfill.d.ts +30 -0
  238. package/dist/esm-types/cli/lib/checkForLargeIndexBackfill.d.ts.map +1 -0
  239. package/dist/esm-types/cli/lib/checkForLargeIndexDeletion.d.ts +5 -7
  240. package/dist/esm-types/cli/lib/checkForLargeIndexDeletion.d.ts.map +1 -1
  241. package/dist/esm-types/cli/lib/checkForSlowSchemaValidation.d.ts +4 -10
  242. package/dist/esm-types/cli/lib/checkForSlowSchemaValidation.d.ts.map +1 -1
  243. package/dist/esm-types/cli/lib/checkForStagedValidatorDeletion.d.ts +17 -0
  244. package/dist/esm-types/cli/lib/checkForStagedValidatorDeletion.d.ts.map +1 -0
  245. package/dist/esm-types/cli/lib/codegen.d.ts +0 -3
  246. package/dist/esm-types/cli/lib/codegen.d.ts.map +1 -1
  247. package/dist/esm-types/cli/lib/command.d.ts +2 -0
  248. package/dist/esm-types/cli/lib/command.d.ts.map +1 -1
  249. package/dist/esm-types/cli/lib/components/definition/bundle.d.ts +13 -0
  250. package/dist/esm-types/cli/lib/components/definition/bundle.d.ts.map +1 -1
  251. package/dist/esm-types/cli/lib/components.d.ts +4 -0
  252. package/dist/esm-types/cli/lib/components.d.ts.map +1 -1
  253. package/dist/esm-types/cli/lib/config.d.ts +2 -1
  254. package/dist/esm-types/cli/lib/config.d.ts.map +1 -1
  255. package/dist/esm-types/cli/lib/deploy2.d.ts +2 -0
  256. package/dist/esm-types/cli/lib/deploy2.d.ts.map +1 -1
  257. package/dist/esm-types/cli/lib/deployApi/evaluateSchema.d.ts +460 -16
  258. package/dist/esm-types/cli/lib/deployApi/evaluateSchema.d.ts.map +1 -1
  259. package/dist/esm-types/cli/lib/dev.d.ts +1 -0
  260. package/dist/esm-types/cli/lib/dev.d.ts.map +1 -1
  261. package/dist/esm-types/cli/lib/formatValidationProgress.d.ts +8 -0
  262. package/dist/esm-types/cli/lib/formatValidationProgress.d.ts.map +1 -0
  263. package/dist/esm-types/cli/lib/mcp/tools/env.d.ts +8 -5
  264. package/dist/esm-types/cli/lib/mcp/tools/env.d.ts.map +1 -1
  265. package/dist/esm-types/cli/lib/run.d.ts.map +1 -1
  266. package/dist/esm-types/cli/lib/schemaEvaluation.d.ts +33 -0
  267. package/dist/esm-types/cli/lib/schemaEvaluation.d.ts.map +1 -0
  268. package/dist/esm-types/cli/lib/usageLimits.d.ts +1 -1
  269. package/dist/esm-types/cli/lib/usageLimits.d.ts.map +1 -1
  270. package/dist/esm-types/cli/lib/utils/mutex.d.ts +1 -3
  271. package/dist/esm-types/cli/lib/utils/mutex.d.ts.map +1 -1
  272. package/dist/esm-types/cli/lib/utils/utils.d.ts +10 -2
  273. package/dist/esm-types/cli/lib/utils/utils.d.ts.map +1 -1
  274. package/dist/esm-types/index.d.ts +1 -1
  275. package/dist/esm-types/server/impl/actions_impl.d.ts +18 -3
  276. package/dist/esm-types/server/impl/actions_impl.d.ts.map +1 -1
  277. package/dist/esm-types/server/impl/storage_impl.d.ts.map +1 -1
  278. package/dist/esm-types/server/index.d.ts +1 -1
  279. package/dist/esm-types/server/index.d.ts.map +1 -1
  280. package/dist/esm-types/server/meta.d.ts +63 -0
  281. package/dist/esm-types/server/meta.d.ts.map +1 -1
  282. package/dist/esm-types/server/registration.d.ts +10 -0
  283. package/dist/esm-types/server/registration.d.ts.map +1 -1
  284. package/dist/esm-types/server/schema.d.ts +33 -0
  285. package/dist/esm-types/server/schema.d.ts.map +1 -1
  286. package/dist/esm-types/server/storage.d.ts.map +1 -1
  287. package/dist/esm-types/values/value.d.ts.map +1 -1
  288. package/dist/react.bundle.js +7 -1
  289. package/dist/react.bundle.js.map +2 -2
  290. package/package.json +5 -5
  291. package/schemas/convex.schema.json +5 -5
  292. package/src/bundler/index.ts +9 -4
  293. package/src/cli/codegen.ts +0 -2
  294. package/src/cli/configure.ts +27 -7
  295. package/src/cli/deploy.ts +36 -5
  296. package/src/cli/deploymentSelect.ts +7 -4
  297. package/src/cli/dev.ts +9 -0
  298. package/src/cli/env.ts +12 -6
  299. package/src/cli/envDefault.ts +8 -2
  300. package/src/cli/generatedApi.ts +1 -1
  301. package/src/cli/lib/api.ts +5 -1
  302. package/src/cli/lib/checkForLargeIndexBackfill.ts +173 -0
  303. package/src/cli/lib/checkForLargeIndexDeletion.ts +45 -58
  304. package/src/cli/lib/checkForSlowSchemaValidation.ts +76 -65
  305. package/src/cli/lib/checkForStagedValidatorDeletion.ts +104 -0
  306. package/src/cli/lib/codegen.ts +0 -3
  307. package/src/cli/lib/command.ts +3 -0
  308. package/src/cli/lib/components/definition/bundle.ts +68 -14
  309. package/src/cli/lib/components.ts +71 -4
  310. package/src/cli/lib/config.ts +85 -18
  311. package/src/cli/lib/deploy2.ts +10 -1
  312. package/src/cli/lib/deployApi/evaluateSchema.ts +35 -0
  313. package/src/cli/lib/dev.ts +14 -0
  314. package/src/cli/lib/formatValidationProgress.ts +35 -0
  315. package/src/cli/lib/indexes.ts +1 -1
  316. package/src/cli/lib/mcp/tools/env.ts +17 -3
  317. package/src/cli/lib/run.ts +2 -0
  318. package/src/cli/lib/schemaEvaluation.ts +88 -0
  319. package/src/cli/lib/usageLimits.ts +2 -0
  320. package/src/cli/lib/utils/mutex.ts +9 -27
  321. package/src/cli/lib/utils/utils.ts +64 -21
  322. package/src/cli/projectCreate.ts +1 -1
  323. package/src/index.ts +1 -1
  324. package/src/server/impl/actions_impl.ts +26 -6
  325. package/src/server/impl/storage_impl.ts +30 -0
  326. package/src/server/index.ts +5 -1
  327. package/src/server/meta.ts +56 -2
  328. package/src/server/registration.ts +10 -0
  329. package/src/server/schema.ts +37 -15
  330. package/src/server/storage.ts +17 -0
  331. package/src/values/validators.ts +1 -1
  332. package/src/values/value.ts +9 -5
@@ -11,9 +11,12 @@ import { formatIndex } from "./indexes.js";
11
11
  import { promptYesNo } from "./utils/prompts.js";
12
12
  import { Span } from "./tracing.js";
13
13
  import { StartPushRequest } from "./deployApi/startPush.js";
14
- import { evaluatePush, evaluateSchema } from "./deploy2.js";
14
+ import { evaluatePush } from "./deploy2.js";
15
15
  import { DeveloperIndexConfig } from "./deployApi/finishPush.js";
16
+ import { EvaluateSchemaResponse } from "./deployApi/evaluateSchema.js";
16
17
  import { runSystemQuery } from "./run.js";
18
+ import { SchemaEvaluation } from "./schemaEvaluation.js";
19
+ import { integerFromEnv } from "./utils/utils.js";
17
20
 
18
21
  const MIN_DOCUMENTS_FOR_INDEX_DELETE_WARNING = 100_000;
19
22
 
@@ -37,24 +40,35 @@ export async function checkForLargeIndexDeletion({
37
40
  span,
38
41
  request,
39
42
  options,
43
+ schemaEvaluation,
40
44
  askForConfirmation,
41
45
  }: {
42
46
  ctx: Context;
43
47
  span: Span;
44
48
  request: StartPushRequest;
45
49
  options: CheckOptions;
50
+ schemaEvaluation: SchemaEvaluation;
46
51
  askForConfirmation: boolean;
47
52
  }): Promise<void> {
48
53
  changeSpinner("Verifying that the push isn’t deleting large indexes...");
49
54
 
50
- const deletedIndexes =
51
- (await deletedIndexesFromSchemaEvaluation({
55
+ const schemaEvaluationResponse = await schemaEvaluation(span);
56
+ let deletedIndexes: DeletedIndex[];
57
+ if (schemaEvaluationResponse !== null) {
58
+ deletedIndexes = deletedIndexesFromSchemaEvaluation(
59
+ schemaEvaluationResponse,
60
+ );
61
+ } else {
62
+ logVerbose(
63
+ "Schema evaluation unavailable, sizing deleted indexes per table",
64
+ );
65
+ deletedIndexes = await deletedIndexesFromTableSizes({
52
66
  ctx,
53
67
  span,
54
68
  request,
55
69
  options,
56
- })) ??
57
- (await deletedIndexesFromTableSizes({ ctx, span, request, options }));
70
+ });
71
+ }
58
72
 
59
73
  if (deletedIndexes.length === 0) {
60
74
  logFinishedStep("No indexes are deleted by this push");
@@ -84,9 +98,11 @@ The documents that are in the index won’t be deleted, but the index will need
84
98
  to be backfilled again if you want to restore it later.
85
99
  `);
86
100
 
101
+ // Either --skip-large-indexes-check or its deletion-only predecessor
102
+ // --allow-deleting-large-indexes gets here, so name neither.
87
103
  if (!askForConfirmation) {
88
104
  logFinishedStep(
89
- "Proceeding with push since --allow-deleting-large-indexes is set",
105
+ "Proceeding with push since deleting large indexes was allowed by flag",
90
106
  );
91
107
  return;
92
108
  }
@@ -97,7 +113,7 @@ to be backfilled again if you want to restore it later.
97
113
  errorType: "fatal",
98
114
  printedMessage: `To confirm the push:
99
115
  • run the deploy command in an ${chalkStderr.bold("interactive terminal")}
100
- • or run the deploy command with the ${chalkStderr.bold("--allow-deleting-large-indexes")} flag`,
116
+ • or run the deploy command with the ${chalkStderr.bold("--skip-large-indexes-check")} flag`,
101
117
  });
102
118
  }
103
119
 
@@ -120,49 +136,24 @@ to be backfilled again if you want to restore it later.
120
136
 
121
137
  // Preferred source: one schema evaluation reports every dropped index
122
138
  // together with its table's document count, requiring only the
123
- // `deployment:deploy` permission the push itself needs. Returns null when the
124
- // deployment doesn't support the endpoint, in which case the caller falls
125
- // back to sizing tables one system query at a time.
126
- export async function deletedIndexesFromSchemaEvaluation({
127
- ctx,
128
- span,
129
- request,
130
- options,
131
- }: {
132
- ctx: Context;
133
- span: Span;
134
- request: StartPushRequest;
135
- options: CheckOptions;
136
- }): Promise<DeletedIndex[] | null> {
137
- try {
138
- const response = await evaluateSchema(
139
- ctx,
140
- span,
141
- request,
142
- options,
143
- /* bestEffort */ true,
144
- );
145
- return Object.entries(response.componentSchemaEvaluations).flatMap(
146
- ([componentPath, prediction]) =>
147
- prediction.indexes
148
- .filter((index) => index.change === "dropped")
149
- .map((index) => ({
150
- componentPath,
151
- index,
152
- documentsCount: index.numDocs,
153
- replacedBy:
154
- prediction.indexes.find(
155
- (other) =>
156
- other.change === "added" && other.name === index.name,
157
- ) ?? null,
158
- })),
159
- );
160
- } catch (error: unknown) {
161
- logVerbose(
162
- `Schema evaluation unavailable, sizing deleted indexes per table: ${error instanceof Error ? error.message : String(error)}`,
163
- );
164
- return null;
165
- }
139
+ // `deployment:deploy` permission the push itself needs.
140
+ export function deletedIndexesFromSchemaEvaluation(
141
+ response: EvaluateSchemaResponse,
142
+ ): DeletedIndex[] {
143
+ return Object.entries(response.componentSchemaEvaluations).flatMap(
144
+ ([componentPath, prediction]) =>
145
+ prediction.indexes
146
+ .filter((index) => index.change === "dropped")
147
+ .map((index) => ({
148
+ componentPath,
149
+ index,
150
+ documentsCount: index.numDocs,
151
+ replacedBy:
152
+ prediction.indexes.find(
153
+ (other) => other.change === "added" && other.name === index.name,
154
+ ) ?? null,
155
+ })),
156
+ );
166
157
  }
167
158
 
168
159
  // Fallback for deployments without `evaluate_schema`: diff indexes with
@@ -268,12 +259,8 @@ function getTableName(index: DeveloperIndexConfig) {
268
259
  }
269
260
 
270
261
  function minDocumentsForIndexDeleteWarning(): number {
271
- const envValue = process.env.CONVEX_MIN_DOCUMENTS_FOR_INDEX_DELETE_WARNING;
272
- if (envValue !== undefined) {
273
- const parsed = parseInt(envValue, 10);
274
- if (!isNaN(parsed)) {
275
- return parsed;
276
- }
277
- }
278
- return MIN_DOCUMENTS_FOR_INDEX_DELETE_WARNING;
262
+ return integerFromEnv(
263
+ "CONVEX_MIN_DOCUMENTS_FOR_INDEX_DELETE_WARNING",
264
+ MIN_DOCUMENTS_FOR_INDEX_DELETE_WARNING,
265
+ );
279
266
  }
@@ -1,41 +1,36 @@
1
1
  import { chalkStderr } from "chalk";
2
- import { Context } from "../../bundler/context.js";
3
- import { logMessage, logVerbose } from "../../bundler/log.js";
2
+ import { logMessage } from "../../bundler/log.js";
4
3
  import { Span } from "./tracing.js";
5
- import { StartPushRequest } from "./deployApi/startPush.js";
6
4
  import {
7
5
  EvaluateSchemaResponse,
8
6
  TablePrediction,
9
7
  } from "./deployApi/evaluateSchema.js";
10
- import { evaluateSchema } from "./deploy2.js";
11
- import { formatSize } from "./utils/utils.js";
8
+ import { SchemaEvaluation } from "./schemaEvaluation.js";
9
+ import { formatSize, integerFromEnv } from "./utils/utils.js";
10
+ import {
11
+ formatDiscardedStagedValidator,
12
+ formatValidationProgress,
13
+ } from "./formatValidationProgress.js";
12
14
 
13
15
  const MIN_BYTES_FOR_SCHEMA_WALK_WARNING = 1 << 27; // 128 MiB
14
16
 
15
17
  export async function checkForSlowSchemaValidation({
16
- ctx,
17
18
  span,
18
- request,
19
- options,
19
+ schemaEvaluation,
20
+ dryRun,
20
21
  }: {
21
- ctx: Context;
22
22
  span: Span;
23
- request: StartPushRequest;
24
- options: {
25
- url: string;
26
- deploymentName: string | null;
27
- adminKey: string;
28
- };
23
+ schemaEvaluation: SchemaEvaluation;
24
+ dryRun: boolean;
29
25
  }): Promise<void> {
30
- const response = await evaluateSchemaBestEffort({
31
- ctx,
32
- span,
33
- request,
34
- options,
35
- });
26
+ const response = await schemaEvaluation(span);
36
27
  if (response === null) {
37
28
  return;
38
29
  }
30
+ reportStagedValidators(response);
31
+ if (!dryRun) {
32
+ return;
33
+ }
39
34
 
40
35
  const walkedTables = Object.entries(
41
36
  response.componentSchemaEvaluations,
@@ -56,6 +51,9 @@ export async function checkForSlowSchemaValidation({
56
51
  return;
57
52
  }
58
53
 
54
+ const shouldSuggestStaging = walkedTables.some(
55
+ ({ table }) => !table.canSkipAfterStagedValidation,
56
+ );
59
57
  logMessage(`⚠️ This schema change requires checking every document in the following ${walkedTables.length === 1 ? "table" : "tables"} against your new schema, totaling ${chalkStderr.yellowBright(formatSize(totalBytes))}. This deploy may take a while:
60
58
 
61
59
  ${walkedTables
@@ -63,45 +61,58 @@ ${walkedTables
63
61
  formatWalkedTable({ componentPath, table }),
64
62
  )
65
63
  .join("\n")}
66
- `);
64
+ ${
65
+ shouldSuggestStaging
66
+ ? `\nTip: stage the new validator (\`defineTable({...}).staged({...})\`) to validate it in the background without blocking deploys.`
67
+ : ""
68
+ }`);
67
69
  }
68
70
 
69
- // This warning is advisory: if evaluation fails, fall back to skipping it
70
- // rather than aborting the push over a check that isn't required for
71
- // correctness. Plausibly transient failures — network errors and 5xx
72
- // responses (e.g. table summaries still bootstrapping) — are retried with
73
- // backoff by the shared fetch wrapper (see `pushCode`); anything else is
74
- // deterministic, including a 2xx whose shape the CLI doesn't recognize, so
75
- // it skips the check immediately.
76
- async function evaluateSchemaBestEffort({
77
- ctx,
78
- span,
79
- request,
80
- options,
81
- }: {
82
- ctx: Context;
83
- span: Span;
84
- request: StartPushRequest;
85
- options: {
86
- url: string;
87
- deploymentName: string | null;
88
- adminKey: string;
89
- };
90
- }): Promise<EvaluateSchemaResponse | null> {
91
- try {
92
- return await evaluateSchema(
93
- ctx,
94
- span,
95
- request,
96
- options,
97
- /* bestEffort */ true,
98
- );
99
- } catch (error: unknown) {
100
- logVerbose(
101
- `Skipping slow schema validation check: ${error instanceof Error ? error.message : String(error)}`,
71
+ // The prediction includes staged validators from active and in-flight schemas.
72
+ function reportStagedValidators(response: EvaluateSchemaResponse) {
73
+ const stagedTables = Object.entries(
74
+ response.componentSchemaEvaluations,
75
+ ).flatMap(([componentPath, prediction]) => {
76
+ const discarded = new Map(
77
+ (prediction.discardedStagedValidators ?? []).map((validator) => [
78
+ validator.tableName,
79
+ validator,
80
+ ]),
102
81
  );
103
- return null;
82
+ return prediction.tables
83
+ .filter((table) => table.staged !== undefined)
84
+ .map((table) => ({
85
+ componentPath,
86
+ table,
87
+ discarded: discarded.get(table.name),
88
+ }));
89
+ });
90
+ if (stagedTables.length === 0) {
91
+ return;
104
92
  }
93
+ const lines = stagedTables.map(({ componentPath, table, discarded }) => {
94
+ const componentPrefix =
95
+ componentPath !== "" ? `${chalkStderr.gray(componentPath)}: ` : "";
96
+ // The state describes the validator this push discards, so advertising
97
+ // it as ready to promote would contradict the unstaging warning.
98
+ if (discarded !== undefined) {
99
+ return ` ${componentPrefix}${table.name}: ${formatDiscardedStagedValidator(discarded)}`;
100
+ }
101
+ const staged = table.staged!;
102
+ switch (staged.state) {
103
+ case "pending": {
104
+ return ` ${componentPrefix}${table.name}: validating in the background (${formatValidationProgress(staged)})`;
105
+ }
106
+ case "valid":
107
+ // `supersetOfStagedValidated` means this push already promotes it.
108
+ return table.outcome === "supersetOfStagedValidated"
109
+ ? ` ${componentPrefix}${table.name}: ${chalkStderr.green("validated")}. This deploy applies the staged schema without scanning the table.`
110
+ : ` ${componentPrefix}${table.name}: ${chalkStderr.green("validated")}. Safe to apply the staged schema changes and deploy.`;
111
+ case "failed":
112
+ return ` ${componentPrefix}${table.name}: ${chalkStderr.red("failed")}: ${staged.error}${chalkStderr.gray(" (fix the offending documents and redeploy to revalidate)")}`;
113
+ }
114
+ });
115
+ logMessage(`Staged schema validation status:\n${lines.join("\n")}\n`);
105
116
  }
106
117
 
107
118
  function formatWalkedTable({
@@ -115,16 +126,16 @@ function formatWalkedTable({
115
126
  componentPath !== "" ? `${chalkStderr.gray(componentPath)}: ` : "";
116
127
  const docsFormatted = `${table.numDocs.toLocaleString()} documents, `;
117
128
  const sizeFormatted = formatSize(table.sizeBytes);
118
- return ` ${componentPrefix}${table.name} (${docsFormatted}${sizeFormatted})`;
129
+ let stagedNote = "";
130
+ if (table.staged?.state === "pending" && table.canSkipAfterStagedValidation) {
131
+ stagedNote = `. Staged schema validation in progress. Wait for validation to complete before deploying with the staged changes. Deploying now will block on a full table revalidation scan.`;
132
+ }
133
+ return ` ${componentPrefix}${table.name} (${docsFormatted}${sizeFormatted})${stagedNote}`;
119
134
  }
120
135
 
121
136
  function minBytesForSchemaWalkWarning(): number {
122
- const envValue = process.env.CONVEX_MIN_BYTES_FOR_SCHEMA_WALK_WARNING;
123
- if (envValue !== undefined) {
124
- const parsed = parseInt(envValue, 10);
125
- if (!isNaN(parsed)) {
126
- return parsed;
127
- }
128
- }
129
- return MIN_BYTES_FOR_SCHEMA_WALK_WARNING;
137
+ return integerFromEnv(
138
+ "CONVEX_MIN_BYTES_FOR_SCHEMA_WALK_WARNING",
139
+ MIN_BYTES_FOR_SCHEMA_WALK_WARNING,
140
+ );
130
141
  }
@@ -0,0 +1,104 @@
1
+ import { chalkStderr } from "chalk";
2
+ import { Context } from "../../bundler/context.js";
3
+ import { logFinishedStep, logMessage, stopSpinner } from "../../bundler/log.js";
4
+ import { promptYesNo } from "./utils/prompts.js";
5
+ import {
6
+ DiscardedStagedValidator,
7
+ EvaluateSchemaResponse,
8
+ } from "./deployApi/evaluateSchema.js";
9
+ import { formatDiscardedStagedValidator } from "./formatValidationProgress.js";
10
+
11
+ export type StagedValidatorDeletionCheck =
12
+ | "ask for confirmation"
13
+ | "has confirmation"
14
+ | "no verification";
15
+
16
+ /**
17
+ * Confirm before discarding pending or successful staged validation. Unstaging
18
+ * stops write-time checks, so restaging requires a fresh scan.
19
+ *
20
+ * A dry run only reports what the push would discard, so `--dry-run` previews
21
+ * the confirmation the real push will ask for.
22
+ */
23
+ export async function checkForStagedValidatorDeletion({
24
+ ctx,
25
+ response,
26
+ askForConfirmation,
27
+ dryRun = false,
28
+ }: {
29
+ ctx: Context;
30
+ response: EvaluateSchemaResponse | null;
31
+ askForConfirmation: boolean;
32
+ dryRun?: boolean;
33
+ }): Promise<void> {
34
+ // `sharedSchemaEvaluation` has already logged why evaluation failed.
35
+ if (response === null) {
36
+ return;
37
+ }
38
+ const discarded = Object.entries(response.componentSchemaEvaluations).flatMap(
39
+ ([componentPath, prediction]) =>
40
+ (prediction.discardedStagedValidators ?? []).map((validator) => ({
41
+ componentPath,
42
+ validator,
43
+ })),
44
+ );
45
+ if (discarded.length === 0) {
46
+ return;
47
+ }
48
+
49
+ logMessage(`\u26a0\ufe0f This push ${chalkStderr.bold(dryRun ? "would discard" : "discards")} staged schema validation for the following ${discarded.length === 1 ? "table" : "tables"}:
50
+
51
+ ${discarded.map(formatDiscarded).join("\n")}
52
+
53
+ A discarded staged validator restarts validation from zero if staged again.
54
+ `);
55
+
56
+ if (dryRun) {
57
+ return;
58
+ }
59
+
60
+ if (!askForConfirmation) {
61
+ logFinishedStep(
62
+ "Proceeding with push since --allow-unstaging-schema is set",
63
+ );
64
+ return;
65
+ }
66
+
67
+ if (!process.stdin.isTTY) {
68
+ return ctx.crash({
69
+ exitCode: 1,
70
+ errorType: "fatal",
71
+ printedMessage: `To confirm the push:
72
+ \u2022 run the deploy command in an ${chalkStderr.bold("interactive terminal")}
73
+ \u2022 or run the deploy command with the ${chalkStderr.bold("--allow-unstaging-schema")} flag`,
74
+ });
75
+ }
76
+
77
+ stopSpinner();
78
+ if (
79
+ !(await promptYesNo(ctx, {
80
+ message: `Discard staged validation for ${discarded.length === 1 ? "this table" : "these tables"}?`,
81
+ default: false,
82
+ }))
83
+ ) {
84
+ return ctx.crash({
85
+ exitCode: 1,
86
+ errorType: "fatal",
87
+ printedMessage: `Canceling push`,
88
+ });
89
+ }
90
+
91
+ logFinishedStep("Proceeding with push.");
92
+ }
93
+
94
+ function formatDiscarded({
95
+ componentPath,
96
+ validator,
97
+ }: {
98
+ componentPath: string;
99
+ validator: DiscardedStagedValidator;
100
+ }): string {
101
+ const componentPrefix =
102
+ componentPath !== "" ? `${chalkStderr.gray(componentPath)}:` : "";
103
+ return `\u26d4 ${componentPrefix}${validator.tableName}: ${formatDiscardedStagedValidator(validator)}`;
104
+ }
@@ -46,7 +46,6 @@ import {
46
46
  rootComponentApiCJS,
47
47
  } from "../codegen_templates/component_api.js";
48
48
  import { functionsDir } from "./utils/utils.js";
49
- import { LargeIndexDeletionCheck } from "./indexes.js";
50
49
 
51
50
  const PRESERVED_GENERATED_ENTRIES = new Set(["ai"]);
52
51
 
@@ -81,8 +80,6 @@ export type CodegenOptions = {
81
80
  liveComponentSources: boolean;
82
81
  debugNodeApis: boolean;
83
82
  systemUdfs: boolean;
84
- largeIndexDeletionCheck: LargeIndexDeletionCheck;
85
- warnOnSlowSchemaValidation: boolean;
86
83
  codegenOnlyThisComponent?: string | undefined;
87
84
  };
88
85
 
@@ -260,6 +260,7 @@ export async function normalizeDevOptions(
260
260
  debugNodeApis?: boolean;
261
261
  liveComponentSources?: boolean;
262
262
  pushAllModules?: boolean;
263
+ allowUnstagingSchema?: boolean;
263
264
  while?: string;
264
265
  },
265
266
  ): Promise<{
@@ -279,6 +280,7 @@ export async function normalizeDevOptions(
279
280
  debugNodeApis: boolean;
280
281
  liveComponentSources: boolean;
281
282
  pushAllModules: boolean;
283
+ allowUnstagingSchema: boolean;
282
284
  }> {
283
285
  if (cmdOptions.runComponent && !cmdOptions.run) {
284
286
  return await ctx.crash({
@@ -332,6 +334,7 @@ export async function normalizeDevOptions(
332
334
  debugNodeApis: !!cmdOptions.debugNodeApis,
333
335
  liveComponentSources: !!cmdOptions.liveComponentSources,
334
336
  pushAllModules: !!cmdOptions.pushAllModules,
337
+ allowUnstagingSchema: !!cmdOptions.allowUnstagingSchema,
335
338
  };
336
339
  }
337
340
 
@@ -645,9 +645,11 @@ export async function bundleImplementations({
645
645
  functions: Bundle[];
646
646
  definitionPath: ComponentDefinitionPath;
647
647
  }[];
648
+ buildDebugInfos: BuildDebugInfo[];
648
649
  }> {
649
650
  let appImplementation;
650
651
  const componentImplementations = [];
652
+ const buildDebugInfos: BuildDebugInfo[] = [];
651
653
 
652
654
  // For --component-dir flag, skip bundling root implementations (no real code to bundle)
653
655
  const directoriesToBundle = rootComponentDirectory.syntheticComponentImport
@@ -660,13 +662,25 @@ export async function bundleImplementations({
660
662
  rootComponentDirectory.path,
661
663
  directory.path,
662
664
  );
665
+ // definitionPath is the canonical form
666
+ const definitionPath = toComponentDefinitionPath(
667
+ rootComponentDirectory,
668
+ directory,
669
+ );
663
670
  let schema;
664
- if (ctx.fs.exists(path.resolve(resolvedPath, "schema.ts"))) {
665
- schema =
666
- (await bundleSchema(ctx, resolvedPath, extraConditions))[0] || null;
667
- } else if (ctx.fs.exists(path.resolve(resolvedPath, "schema.js"))) {
668
- schema =
669
- (await bundleSchema(ctx, resolvedPath, extraConditions))[0] || null;
671
+ if (
672
+ ctx.fs.exists(path.resolve(resolvedPath, "schema.ts")) ||
673
+ ctx.fs.exists(path.resolve(resolvedPath, "schema.js"))
674
+ ) {
675
+ const schemaResult = await bundleSchema(
676
+ ctx,
677
+ resolvedPath,
678
+ extraConditions,
679
+ );
680
+ buildDebugInfos.push(
681
+ buildDebugInfo(directory, definitionPath, "schema", schemaResult),
682
+ );
683
+ schema = schemaResult.modules[0] || null;
670
684
  } else {
671
685
  schema = null;
672
686
  }
@@ -676,6 +690,7 @@ export async function bundleImplementations({
676
690
  modules: Bundle[];
677
691
  externalDependencies: Map<string, string>;
678
692
  bundledModuleNames: Set<string>;
693
+ metafile: Metafile | null;
679
694
  } = await bundle({
680
695
  ctx,
681
696
  dir: resolvedPath,
@@ -693,6 +708,9 @@ export async function bundleImplementations({
693
708
  printedMessage: "external dependencies not supported",
694
709
  });
695
710
  }
711
+ buildDebugInfos.push(
712
+ buildDebugInfo(directory, definitionPath, "convex", convexResult),
713
+ );
696
714
  const functions = convexResult.modules;
697
715
  if (isRoot) {
698
716
  if (verbose) {
@@ -702,6 +720,7 @@ export async function bundleImplementations({
702
720
  modules: Bundle[];
703
721
  externalDependencies: Map<string, string>;
704
722
  bundledModuleNames: Set<string>;
723
+ metafile: Metafile | null;
705
724
  } = await bundle({
706
725
  ctx,
707
726
  dir: resolvedPath,
@@ -713,6 +732,9 @@ export async function bundleImplementations({
713
732
  extraConditions,
714
733
  includeSourcesContent,
715
734
  });
735
+ buildDebugInfos.push(
736
+ buildDebugInfo(directory, definitionPath, "node", nodeResult),
737
+ );
716
738
 
717
739
  const externalNodeDependencies: NodeDependency[] = [];
718
740
  for (const [
@@ -724,10 +746,15 @@ export async function bundleImplementations({
724
746
  version: moduleVersion,
725
747
  });
726
748
  }
727
- const authBundle = await bundleAuthConfig(ctx, resolvedPath);
749
+ const authResult = await bundleAuthConfig(ctx, resolvedPath);
750
+ buildDebugInfos.push(
751
+ buildDebugInfo(directory, definitionPath, "auth", authResult),
752
+ );
728
753
  appImplementation = {
729
754
  schema,
730
- functions: functions.concat(nodeResult.modules).concat(authBundle),
755
+ functions: functions
756
+ .concat(nodeResult.modules)
757
+ .concat(authResult.modules),
731
758
  externalNodeDependencies,
732
759
  };
733
760
  } else {
@@ -757,11 +784,6 @@ export async function bundleImplementations({
757
784
  });
758
785
  }
759
786
  }
760
- // definitionPath is the canonical form
761
- const definitionPath = toComponentDefinitionPath(
762
- rootComponentDirectory,
763
- directory,
764
- );
765
787
  componentImplementations.push({ definitionPath, schema, functions });
766
788
  }
767
789
  }
@@ -783,7 +805,39 @@ export async function bundleImplementations({
783
805
  }
784
806
  }
785
807
 
786
- return { appImplementation, componentImplementations };
808
+ return { appImplementation, componentImplementations, buildDebugInfos };
809
+ }
810
+
811
+ /**
812
+ * Debug information for a build in a push.
813
+ */
814
+ export type BuildDebugInfo = {
815
+ directory: ComponentDirectory;
816
+ definitionPath: ComponentDefinitionPath;
817
+ kind: "convex" | "node" | "schema" | "auth";
818
+ metafile: Metafile | null;
819
+ modules: Bundle[];
820
+ externalDependencies: Map<string, string>;
821
+ };
822
+
823
+ function buildDebugInfo(
824
+ directory: ComponentDirectory,
825
+ definitionPath: ComponentDefinitionPath,
826
+ kind: BuildDebugInfo["kind"],
827
+ result: {
828
+ modules: Bundle[];
829
+ metafile: Metafile | null;
830
+ externalDependencies?: Map<string, string>;
831
+ },
832
+ ): BuildDebugInfo {
833
+ return {
834
+ directory,
835
+ definitionPath,
836
+ kind,
837
+ metafile: result.metafile,
838
+ modules: result.modules,
839
+ externalDependencies: result.externalDependencies ?? new Map(),
840
+ };
787
841
  }
788
842
 
789
843
  async function registerEsbuildReads(