zod-compiler 1.23.0 → 1.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (494) hide show
  1. package/README.md +9 -6
  2. package/dist/cli/commands/check.d.ts +10 -7
  3. package/dist/cli/commands/check.d.ts.map +1 -1
  4. package/dist/cli/commands/check.js +125 -148
  5. package/dist/cli/commands/check.js.map +1 -1
  6. package/dist/cli/commands/generate.d.ts +22 -19
  7. package/dist/cli/commands/generate.d.ts.map +1 -1
  8. package/dist/cli/commands/generate.js +102 -133
  9. package/dist/cli/commands/generate.js.map +1 -1
  10. package/dist/cli/commands/watch.d.ts +17 -15
  11. package/dist/cli/commands/watch.d.ts.map +1 -1
  12. package/dist/cli/commands/watch.js +126 -154
  13. package/dist/cli/commands/watch.js.map +1 -1
  14. package/dist/cli/emitter.d.ts +19 -16
  15. package/dist/cli/emitter.d.ts.map +1 -1
  16. package/dist/cli/emitter.js +55 -71
  17. package/dist/cli/emitter.js.map +1 -1
  18. package/dist/cli/errors.d.ts +4 -1
  19. package/dist/cli/errors.d.ts.map +1 -1
  20. package/dist/cli/errors.js +6 -2
  21. package/dist/cli/errors.js.map +1 -1
  22. package/dist/cli/index.d.ts +1 -3
  23. package/dist/cli/index.js +147 -160
  24. package/dist/cli/index.js.map +1 -1
  25. package/dist/cli/logger.d.ts +18 -15
  26. package/dist/cli/logger.d.ts.map +1 -1
  27. package/dist/cli/logger.js +38 -37
  28. package/dist/cli/logger.js.map +1 -1
  29. package/dist/core/codegen/build-path.d.ts +7 -41
  30. package/dist/core/codegen/build-path.d.ts.map +1 -1
  31. package/dist/core/codegen/build-path.js +481 -570
  32. package/dist/core/codegen/build-path.js.map +1 -1
  33. package/dist/core/codegen/context.d.ts +256 -253
  34. package/dist/core/codegen/context.d.ts.map +1 -1
  35. package/dist/core/codegen/context.js +363 -437
  36. package/dist/core/codegen/context.js.map +1 -1
  37. package/dist/core/codegen/dedupe.d.ts +22 -56
  38. package/dist/core/codegen/dedupe.d.ts.map +1 -1
  39. package/dist/core/codegen/dedupe.js +150 -242
  40. package/dist/core/codegen/dedupe.js.map +1 -1
  41. package/dist/core/codegen/emit-issue.d.ts +44 -68
  42. package/dist/core/codegen/emit-issue.d.ts.map +1 -1
  43. package/dist/core/codegen/emit-issue.js +76 -108
  44. package/dist/core/codegen/emit-issue.js.map +1 -1
  45. package/dist/core/codegen/emit.d.ts +4 -1
  46. package/dist/core/codegen/emit.d.ts.map +1 -1
  47. package/dist/core/codegen/emit.js +16 -13
  48. package/dist/core/codegen/emit.js.map +1 -1
  49. package/dist/core/codegen/fast-path.d.ts +7 -12
  50. package/dist/core/codegen/fast-path.d.ts.map +1 -1
  51. package/dist/core/codegen/fast-path.js +116 -145
  52. package/dist/core/codegen/fast-path.js.map +1 -1
  53. package/dist/core/codegen/fast-size.d.ts +12 -26
  54. package/dist/core/codegen/fast-size.d.ts.map +1 -1
  55. package/dist/core/codegen/fast-size.js +169 -244
  56. package/dist/core/codegen/fast-size.js.map +1 -1
  57. package/dist/core/codegen/index.d.ts +25 -23
  58. package/dist/core/codegen/index.d.ts.map +1 -1
  59. package/dist/core/codegen/index.js +239 -405
  60. package/dist/core/codegen/index.js.map +1 -1
  61. package/dist/core/codegen/issue-decls.d.ts +15 -12
  62. package/dist/core/codegen/issue-decls.d.ts.map +1 -1
  63. package/dist/core/codegen/issue-decls.js +131 -162
  64. package/dist/core/codegen/issue-decls.js.map +1 -1
  65. package/dist/core/codegen/regex-unroll.d.ts +4 -1
  66. package/dist/core/codegen/regex-unroll.d.ts.map +1 -1
  67. package/dist/core/codegen/regex-unroll.js +173 -197
  68. package/dist/core/codegen/regex-unroll.js.map +1 -1
  69. package/dist/core/codegen/schemas/any.d.ts +7 -4
  70. package/dist/core/codegen/schemas/any.d.ts.map +1 -1
  71. package/dist/core/codegen/schemas/any.js +8 -4
  72. package/dist/core/codegen/schemas/any.js.map +1 -1
  73. package/dist/core/codegen/schemas/array.d.ts +8 -5
  74. package/dist/core/codegen/schemas/array.d.ts.map +1 -1
  75. package/dist/core/codegen/schemas/array.js +77 -95
  76. package/dist/core/codegen/schemas/array.js.map +1 -1
  77. package/dist/core/codegen/schemas/bigint.d.ts +7 -4
  78. package/dist/core/codegen/schemas/bigint.d.ts.map +1 -1
  79. package/dist/core/codegen/schemas/bigint.js +44 -56
  80. package/dist/core/codegen/schemas/bigint.js.map +1 -1
  81. package/dist/core/codegen/schemas/boolean.d.ts +7 -4
  82. package/dist/core/codegen/schemas/boolean.d.ts.map +1 -1
  83. package/dist/core/codegen/schemas/boolean.js +12 -11
  84. package/dist/core/codegen/schemas/boolean.js.map +1 -1
  85. package/dist/core/codegen/schemas/catch.d.ts +8 -5
  86. package/dist/core/codegen/schemas/catch.d.ts.map +1 -1
  87. package/dist/core/codegen/schemas/catch.js +23 -23
  88. package/dist/core/codegen/schemas/catch.js.map +1 -1
  89. package/dist/core/codegen/schemas/date.d.ts +7 -4
  90. package/dist/core/codegen/schemas/date.d.ts.map +1 -1
  91. package/dist/core/codegen/schemas/date.js +49 -68
  92. package/dist/core/codegen/schemas/date.js.map +1 -1
  93. package/dist/core/codegen/schemas/default.d.ts +9 -6
  94. package/dist/core/codegen/schemas/default.d.ts.map +1 -1
  95. package/dist/core/codegen/schemas/default.js +29 -27
  96. package/dist/core/codegen/schemas/default.js.map +1 -1
  97. package/dist/core/codegen/schemas/discriminated-union.d.ts +12 -10
  98. package/dist/core/codegen/schemas/discriminated-union.d.ts.map +1 -1
  99. package/dist/core/codegen/schemas/discriminated-union.js +153 -178
  100. package/dist/core/codegen/schemas/discriminated-union.js.map +1 -1
  101. package/dist/core/codegen/schemas/effect.d.ts +9 -6
  102. package/dist/core/codegen/schemas/effect.d.ts.map +1 -1
  103. package/dist/core/codegen/schemas/effect.js +54 -67
  104. package/dist/core/codegen/schemas/effect.js.map +1 -1
  105. package/dist/core/codegen/schemas/enum.d.ts +7 -4
  106. package/dist/core/codegen/schemas/enum.d.ts.map +1 -1
  107. package/dist/core/codegen/schemas/enum.js +15 -21
  108. package/dist/core/codegen/schemas/enum.js.map +1 -1
  109. package/dist/core/codegen/schemas/fallback.d.ts +6 -3
  110. package/dist/core/codegen/schemas/fallback.d.ts.map +1 -1
  111. package/dist/core/codegen/schemas/fallback.js +14 -13
  112. package/dist/core/codegen/schemas/fallback.js.map +1 -1
  113. package/dist/core/codegen/schemas/file.d.ts +7 -4
  114. package/dist/core/codegen/schemas/file.d.ts.map +1 -1
  115. package/dist/core/codegen/schemas/file.js +51 -57
  116. package/dist/core/codegen/schemas/file.js.map +1 -1
  117. package/dist/core/codegen/schemas/intersection.d.ts +8 -5
  118. package/dist/core/codegen/schemas/intersection.d.ts.map +1 -1
  119. package/dist/core/codegen/schemas/intersection.js +16 -13
  120. package/dist/core/codegen/schemas/intersection.js.map +1 -1
  121. package/dist/core/codegen/schemas/literal.d.ts +7 -4
  122. package/dist/core/codegen/schemas/literal.d.ts.map +1 -1
  123. package/dist/core/codegen/schemas/literal.js +20 -23
  124. package/dist/core/codegen/schemas/literal.js.map +1 -1
  125. package/dist/core/codegen/schemas/map.d.ts +8 -5
  126. package/dist/core/codegen/schemas/map.d.ts.map +1 -1
  127. package/dist/core/codegen/schemas/map.js +61 -67
  128. package/dist/core/codegen/schemas/map.js.map +1 -1
  129. package/dist/core/codegen/schemas/nan.d.ts +7 -4
  130. package/dist/core/codegen/schemas/nan.d.ts.map +1 -1
  131. package/dist/core/codegen/schemas/nan.js +8 -4
  132. package/dist/core/codegen/schemas/nan.js.map +1 -1
  133. package/dist/core/codegen/schemas/never.d.ts +7 -4
  134. package/dist/core/codegen/schemas/never.d.ts.map +1 -1
  135. package/dist/core/codegen/schemas/never.js +8 -4
  136. package/dist/core/codegen/schemas/never.js.map +1 -1
  137. package/dist/core/codegen/schemas/null.d.ts +7 -4
  138. package/dist/core/codegen/schemas/null.d.ts.map +1 -1
  139. package/dist/core/codegen/schemas/null.js +8 -4
  140. package/dist/core/codegen/schemas/null.js.map +1 -1
  141. package/dist/core/codegen/schemas/nullable.d.ts +8 -5
  142. package/dist/core/codegen/schemas/nullable.d.ts.map +1 -1
  143. package/dist/core/codegen/schemas/nullable.js +8 -5
  144. package/dist/core/codegen/schemas/nullable.js.map +1 -1
  145. package/dist/core/codegen/schemas/number.d.ts +7 -4
  146. package/dist/core/codegen/schemas/number.d.ts.map +1 -1
  147. package/dist/core/codegen/schemas/number.js +120 -176
  148. package/dist/core/codegen/schemas/number.js.map +1 -1
  149. package/dist/core/codegen/schemas/object.d.ts +8 -5
  150. package/dist/core/codegen/schemas/object.d.ts.map +1 -1
  151. package/dist/core/codegen/schemas/object.js +144 -231
  152. package/dist/core/codegen/schemas/object.js.map +1 -1
  153. package/dist/core/codegen/schemas/optional.d.ts +9 -6
  154. package/dist/core/codegen/schemas/optional.d.ts.map +1 -1
  155. package/dist/core/codegen/schemas/optional.js +23 -31
  156. package/dist/core/codegen/schemas/optional.js.map +1 -1
  157. package/dist/core/codegen/schemas/pipe.d.ts +8 -5
  158. package/dist/core/codegen/schemas/pipe.d.ts.map +1 -1
  159. package/dist/core/codegen/schemas/pipe.js +20 -27
  160. package/dist/core/codegen/schemas/pipe.js.map +1 -1
  161. package/dist/core/codegen/schemas/readonly.d.ts +8 -5
  162. package/dist/core/codegen/schemas/readonly.d.ts.map +1 -1
  163. package/dist/core/codegen/schemas/readonly.js +8 -5
  164. package/dist/core/codegen/schemas/readonly.js.map +1 -1
  165. package/dist/core/codegen/schemas/record.d.ts +8 -5
  166. package/dist/core/codegen/schemas/record.d.ts.map +1 -1
  167. package/dist/core/codegen/schemas/record.js +52 -65
  168. package/dist/core/codegen/schemas/record.js.map +1 -1
  169. package/dist/core/codegen/schemas/recursive-ref.d.ts +9 -6
  170. package/dist/core/codegen/schemas/recursive-ref.d.ts.map +1 -1
  171. package/dist/core/codegen/schemas/recursive-ref.js +44 -44
  172. package/dist/core/codegen/schemas/recursive-ref.js.map +1 -1
  173. package/dist/core/codegen/schemas/set.d.ts +8 -5
  174. package/dist/core/codegen/schemas/set.d.ts.map +1 -1
  175. package/dist/core/codegen/schemas/set.js +61 -73
  176. package/dist/core/codegen/schemas/set.js.map +1 -1
  177. package/dist/core/codegen/schemas/string-bool.d.ts +6 -3
  178. package/dist/core/codegen/schemas/string-bool.d.ts.map +1 -1
  179. package/dist/core/codegen/schemas/string-bool.js +22 -23
  180. package/dist/core/codegen/schemas/string-bool.js.map +1 -1
  181. package/dist/core/codegen/schemas/string.d.ts +8 -5
  182. package/dist/core/codegen/schemas/string.d.ts.map +1 -1
  183. package/dist/core/codegen/schemas/string.js +168 -207
  184. package/dist/core/codegen/schemas/string.js.map +1 -1
  185. package/dist/core/codegen/schemas/symbol.d.ts +7 -4
  186. package/dist/core/codegen/schemas/symbol.d.ts.map +1 -1
  187. package/dist/core/codegen/schemas/symbol.js +8 -4
  188. package/dist/core/codegen/schemas/symbol.js.map +1 -1
  189. package/dist/core/codegen/schemas/template-literal.d.ts +7 -4
  190. package/dist/core/codegen/schemas/template-literal.d.ts.map +1 -1
  191. package/dist/core/codegen/schemas/template-literal.js +12 -13
  192. package/dist/core/codegen/schemas/template-literal.js.map +1 -1
  193. package/dist/core/codegen/schemas/tuple.d.ts +8 -5
  194. package/dist/core/codegen/schemas/tuple.d.ts.map +1 -1
  195. package/dist/core/codegen/schemas/tuple.js +84 -94
  196. package/dist/core/codegen/schemas/tuple.js.map +1 -1
  197. package/dist/core/codegen/schemas/undefined.d.ts +7 -4
  198. package/dist/core/codegen/schemas/undefined.d.ts.map +1 -1
  199. package/dist/core/codegen/schemas/undefined.js +8 -4
  200. package/dist/core/codegen/schemas/undefined.js.map +1 -1
  201. package/dist/core/codegen/schemas/union.d.ts +8 -5
  202. package/dist/core/codegen/schemas/union.d.ts.map +1 -1
  203. package/dist/core/codegen/schemas/union.js +49 -69
  204. package/dist/core/codegen/schemas/union.js.map +1 -1
  205. package/dist/core/codegen/schemas/unknown.d.ts +7 -4
  206. package/dist/core/codegen/schemas/unknown.d.ts.map +1 -1
  207. package/dist/core/codegen/schemas/unknown.js +8 -4
  208. package/dist/core/codegen/schemas/unknown.js.map +1 -1
  209. package/dist/core/codegen/schemas/void.d.ts +7 -4
  210. package/dist/core/codegen/schemas/void.d.ts.map +1 -1
  211. package/dist/core/codegen/schemas/void.js +8 -4
  212. package/dist/core/codegen/schemas/void.js.map +1 -1
  213. package/dist/core/codegen/slow-path.d.ts +7 -4
  214. package/dist/core/codegen/slow-path.d.ts.map +1 -1
  215. package/dist/core/codegen/slow-path.js +71 -96
  216. package/dist/core/codegen/slow-path.js.map +1 -1
  217. package/dist/core/codegen/well-known-regex.d.ts +22 -19
  218. package/dist/core/codegen/well-known-regex.d.ts.map +1 -1
  219. package/dist/core/codegen/well-known-regex.js +127 -96
  220. package/dist/core/codegen/well-known-regex.js.map +1 -1
  221. package/dist/core/compile.d.ts +7 -4
  222. package/dist/core/compile.d.ts.map +1 -1
  223. package/dist/core/compile.js +48 -48
  224. package/dist/core/compile.js.map +1 -1
  225. package/dist/core/diagnostic.d.ts +38 -39
  226. package/dist/core/diagnostic.d.ts.map +1 -1
  227. package/dist/core/diagnostic.js +140 -164
  228. package/dist/core/diagnostic.js.map +1 -1
  229. package/dist/core/extract/checks.d.ts +18 -15
  230. package/dist/core/extract/checks.d.ts.map +1 -1
  231. package/dist/core/extract/checks.js +318 -311
  232. package/dist/core/extract/checks.js.map +1 -1
  233. package/dist/core/extract/effects.d.ts +13 -10
  234. package/dist/core/extract/effects.d.ts.map +1 -1
  235. package/dist/core/extract/effects.js +153 -222
  236. package/dist/core/extract/effects.js.map +1 -1
  237. package/dist/core/extract/extractors/any.d.ts +5 -2
  238. package/dist/core/extract/extractors/any.d.ts.map +1 -1
  239. package/dist/core/extract/extractors/any.js +5 -1
  240. package/dist/core/extract/extractors/any.js.map +1 -1
  241. package/dist/core/extract/extractors/array.d.ts +6 -3
  242. package/dist/core/extract/extractors/array.d.ts.map +1 -1
  243. package/dist/core/extract/extractors/array.js +25 -20
  244. package/dist/core/extract/extractors/array.js.map +1 -1
  245. package/dist/core/extract/extractors/bigint.d.ts +6 -3
  246. package/dist/core/extract/extractors/bigint.d.ts.map +1 -1
  247. package/dist/core/extract/extractors/bigint.js +66 -64
  248. package/dist/core/extract/extractors/bigint.js.map +1 -1
  249. package/dist/core/extract/extractors/boolean.d.ts +5 -2
  250. package/dist/core/extract/extractors/boolean.d.ts.map +1 -1
  251. package/dist/core/extract/extractors/boolean.js +7 -3
  252. package/dist/core/extract/extractors/boolean.js.map +1 -1
  253. package/dist/core/extract/extractors/catch.d.ts +6 -3
  254. package/dist/core/extract/extractors/catch.d.ts.map +1 -1
  255. package/dist/core/extract/extractors/catch.js +26 -17
  256. package/dist/core/extract/extractors/catch.js.map +1 -1
  257. package/dist/core/extract/extractors/date.d.ts +6 -3
  258. package/dist/core/extract/extractors/date.d.ts.map +1 -1
  259. package/dist/core/extract/extractors/date.js +42 -46
  260. package/dist/core/extract/extractors/date.js.map +1 -1
  261. package/dist/core/extract/extractors/default.d.ts +6 -3
  262. package/dist/core/extract/extractors/default.d.ts.map +1 -1
  263. package/dist/core/extract/extractors/default.js +20 -14
  264. package/dist/core/extract/extractors/default.js.map +1 -1
  265. package/dist/core/extract/extractors/enum.d.ts +5 -2
  266. package/dist/core/extract/extractors/enum.d.ts.map +1 -1
  267. package/dist/core/extract/extractors/enum.js +12 -13
  268. package/dist/core/extract/extractors/enum.js.map +1 -1
  269. package/dist/core/extract/extractors/file.d.ts +6 -3
  270. package/dist/core/extract/extractors/file.d.ts.map +1 -1
  271. package/dist/core/extract/extractors/file.js +34 -28
  272. package/dist/core/extract/extractors/file.js.map +1 -1
  273. package/dist/core/extract/extractors/intersection.d.ts +5 -2
  274. package/dist/core/extract/extractors/intersection.d.ts.map +1 -1
  275. package/dist/core/extract/extractors/intersection.js +13 -11
  276. package/dist/core/extract/extractors/intersection.js.map +1 -1
  277. package/dist/core/extract/extractors/lazy.d.ts +6 -3
  278. package/dist/core/extract/extractors/lazy.d.ts.map +1 -1
  279. package/dist/core/extract/extractors/lazy.js +21 -30
  280. package/dist/core/extract/extractors/lazy.js.map +1 -1
  281. package/dist/core/extract/extractors/literal.d.ts +5 -2
  282. package/dist/core/extract/extractors/literal.d.ts.map +1 -1
  283. package/dist/core/extract/extractors/literal.js +8 -1
  284. package/dist/core/extract/extractors/literal.js.map +1 -1
  285. package/dist/core/extract/extractors/map.d.ts +6 -3
  286. package/dist/core/extract/extractors/map.d.ts.map +1 -1
  287. package/dist/core/extract/extractors/map.js +10 -4
  288. package/dist/core/extract/extractors/map.js.map +1 -1
  289. package/dist/core/extract/extractors/nan.d.ts +5 -2
  290. package/dist/core/extract/extractors/nan.d.ts.map +1 -1
  291. package/dist/core/extract/extractors/nan.js +5 -1
  292. package/dist/core/extract/extractors/nan.js.map +1 -1
  293. package/dist/core/extract/extractors/never.d.ts +5 -2
  294. package/dist/core/extract/extractors/never.d.ts.map +1 -1
  295. package/dist/core/extract/extractors/never.js +5 -1
  296. package/dist/core/extract/extractors/never.js.map +1 -1
  297. package/dist/core/extract/extractors/null.d.ts +5 -2
  298. package/dist/core/extract/extractors/null.d.ts.map +1 -1
  299. package/dist/core/extract/extractors/null.js +5 -1
  300. package/dist/core/extract/extractors/null.js.map +1 -1
  301. package/dist/core/extract/extractors/nullable.d.ts +5 -2
  302. package/dist/core/extract/extractors/nullable.d.ts.map +1 -1
  303. package/dist/core/extract/extractors/nullable.js +7 -3
  304. package/dist/core/extract/extractors/nullable.js.map +1 -1
  305. package/dist/core/extract/extractors/number.d.ts +6 -3
  306. package/dist/core/extract/extractors/number.d.ts.map +1 -1
  307. package/dist/core/extract/extractors/number.js +35 -35
  308. package/dist/core/extract/extractors/number.js.map +1 -1
  309. package/dist/core/extract/extractors/object.d.ts +6 -3
  310. package/dist/core/extract/extractors/object.d.ts.map +1 -1
  311. package/dist/core/extract/extractors/object.js +49 -76
  312. package/dist/core/extract/extractors/object.js.map +1 -1
  313. package/dist/core/extract/extractors/optional.d.ts +5 -2
  314. package/dist/core/extract/extractors/optional.d.ts.map +1 -1
  315. package/dist/core/extract/extractors/optional.js +10 -12
  316. package/dist/core/extract/extractors/optional.js.map +1 -1
  317. package/dist/core/extract/extractors/pipe.d.ts +6 -3
  318. package/dist/core/extract/extractors/pipe.d.ts.map +1 -1
  319. package/dist/core/extract/extractors/pipe.js +40 -41
  320. package/dist/core/extract/extractors/pipe.js.map +1 -1
  321. package/dist/core/extract/extractors/readonly.d.ts +5 -2
  322. package/dist/core/extract/extractors/readonly.d.ts.map +1 -1
  323. package/dist/core/extract/extractors/readonly.js +10 -6
  324. package/dist/core/extract/extractors/readonly.js.map +1 -1
  325. package/dist/core/extract/extractors/record.d.ts +6 -3
  326. package/dist/core/extract/extractors/record.d.ts.map +1 -1
  327. package/dist/core/extract/extractors/record.js +24 -35
  328. package/dist/core/extract/extractors/record.js.map +1 -1
  329. package/dist/core/extract/extractors/set.d.ts +6 -3
  330. package/dist/core/extract/extractors/set.d.ts.map +1 -1
  331. package/dist/core/extract/extractors/set.js +36 -30
  332. package/dist/core/extract/extractors/set.js.map +1 -1
  333. package/dist/core/extract/extractors/string-bool.d.ts +7 -4
  334. package/dist/core/extract/extractors/string-bool.d.ts.map +1 -1
  335. package/dist/core/extract/extractors/string-bool.js +66 -84
  336. package/dist/core/extract/extractors/string-bool.js.map +1 -1
  337. package/dist/core/extract/extractors/string.d.ts +6 -3
  338. package/dist/core/extract/extractors/string.d.ts.map +1 -1
  339. package/dist/core/extract/extractors/string.js +34 -37
  340. package/dist/core/extract/extractors/string.js.map +1 -1
  341. package/dist/core/extract/extractors/symbol.d.ts +5 -2
  342. package/dist/core/extract/extractors/symbol.d.ts.map +1 -1
  343. package/dist/core/extract/extractors/symbol.js +5 -1
  344. package/dist/core/extract/extractors/symbol.js.map +1 -1
  345. package/dist/core/extract/extractors/template-literal.d.ts +6 -3
  346. package/dist/core/extract/extractors/template-literal.d.ts.map +1 -1
  347. package/dist/core/extract/extractors/template-literal.js +11 -6
  348. package/dist/core/extract/extractors/template-literal.js.map +1 -1
  349. package/dist/core/extract/extractors/tuple.d.ts +6 -3
  350. package/dist/core/extract/extractors/tuple.d.ts.map +1 -1
  351. package/dist/core/extract/extractors/tuple.js +10 -4
  352. package/dist/core/extract/extractors/tuple.js.map +1 -1
  353. package/dist/core/extract/extractors/undefined.d.ts +5 -2
  354. package/dist/core/extract/extractors/undefined.d.ts.map +1 -1
  355. package/dist/core/extract/extractors/undefined.js +5 -1
  356. package/dist/core/extract/extractors/undefined.js.map +1 -1
  357. package/dist/core/extract/extractors/union.d.ts +6 -3
  358. package/dist/core/extract/extractors/union.d.ts.map +1 -1
  359. package/dist/core/extract/extractors/union.js +38 -64
  360. package/dist/core/extract/extractors/union.js.map +1 -1
  361. package/dist/core/extract/extractors/unknown.d.ts +5 -2
  362. package/dist/core/extract/extractors/unknown.d.ts.map +1 -1
  363. package/dist/core/extract/extractors/unknown.js +5 -1
  364. package/dist/core/extract/extractors/unknown.js.map +1 -1
  365. package/dist/core/extract/extractors/void.d.ts +5 -2
  366. package/dist/core/extract/extractors/void.d.ts.map +1 -1
  367. package/dist/core/extract/extractors/void.js +5 -1
  368. package/dist/core/extract/extractors/void.js.map +1 -1
  369. package/dist/core/extract/fallback.d.ts +6 -3
  370. package/dist/core/extract/fallback.d.ts.map +1 -1
  371. package/dist/core/extract/fallback.js +21 -7
  372. package/dist/core/extract/fallback.js.map +1 -1
  373. package/dist/core/extract/index.d.ts +6 -4
  374. package/dist/core/extract/index.d.ts.map +1 -1
  375. package/dist/core/extract/index.js +15 -15
  376. package/dist/core/extract/index.js.map +1 -1
  377. package/dist/core/extract/registry.d.ts +39 -36
  378. package/dist/core/extract/registry.d.ts.map +1 -1
  379. package/dist/core/extract/registry.js +96 -123
  380. package/dist/core/extract/registry.js.map +1 -1
  381. package/dist/core/extract/types.d.ts +124 -120
  382. package/dist/core/extract/types.d.ts.map +1 -1
  383. package/dist/core/extract/types.js +0 -1
  384. package/dist/core/iife.d.ts +14 -15
  385. package/dist/core/iife.d.ts.map +1 -1
  386. package/dist/core/iife.js +182 -206
  387. package/dist/core/iife.js.map +1 -1
  388. package/dist/core/pipeline.d.ts +33 -30
  389. package/dist/core/pipeline.d.ts.map +1 -1
  390. package/dist/core/pipeline.js +67 -74
  391. package/dist/core/pipeline.js.map +1 -1
  392. package/dist/core/types.d.ts +430 -427
  393. package/dist/core/types.d.ts.map +1 -1
  394. package/dist/core/types.js +0 -5
  395. package/dist/discovery.d.ts +8 -5
  396. package/dist/discovery.d.ts.map +1 -1
  397. package/dist/discovery.js +31 -32
  398. package/dist/discovery.js.map +1 -1
  399. package/dist/index.d.ts +4 -4
  400. package/dist/index.js +2 -2
  401. package/dist/jit.d.ts +15 -42
  402. package/dist/jit.d.ts.map +1 -1
  403. package/dist/jit.js +187 -216
  404. package/dist/jit.js.map +1 -1
  405. package/dist/loader.d.ts +14 -11
  406. package/dist/loader.d.ts.map +1 -1
  407. package/dist/loader.js +226 -258
  408. package/dist/loader.js.map +1 -1
  409. package/dist/static-filter.d.ts +4 -1
  410. package/dist/static-filter.d.ts.map +1 -1
  411. package/dist/static-filter.js +240 -367
  412. package/dist/static-filter.js.map +1 -1
  413. package/dist/swc.d.ts +38 -35
  414. package/dist/swc.d.ts.map +1 -1
  415. package/dist/swc.js +83 -76
  416. package/dist/swc.js.map +1 -1
  417. package/dist/unplugin/bun.d.ts +5 -2
  418. package/dist/unplugin/bun.d.ts.map +1 -1
  419. package/dist/unplugin/bun.js +5 -1
  420. package/dist/unplugin/bun.js.map +1 -1
  421. package/dist/unplugin/dep-graph.d.ts +10 -7
  422. package/dist/unplugin/dep-graph.d.ts.map +1 -1
  423. package/dist/unplugin/dep-graph.js +216 -252
  424. package/dist/unplugin/dep-graph.js.map +1 -1
  425. package/dist/unplugin/disk-cache.d.ts +121 -92
  426. package/dist/unplugin/disk-cache.d.ts.map +1 -1
  427. package/dist/unplugin/disk-cache.js +425 -444
  428. package/dist/unplugin/disk-cache.js.map +1 -1
  429. package/dist/unplugin/edits.d.ts +15 -12
  430. package/dist/unplugin/edits.d.ts.map +1 -1
  431. package/dist/unplugin/edits.js +24 -37
  432. package/dist/unplugin/edits.js.map +1 -1
  433. package/dist/unplugin/esbuild.d.ts +5 -2
  434. package/dist/unplugin/esbuild.d.ts.map +1 -1
  435. package/dist/unplugin/esbuild.js +5 -1
  436. package/dist/unplugin/esbuild.js.map +1 -1
  437. package/dist/unplugin/farm.d.ts +5 -2
  438. package/dist/unplugin/farm.d.ts.map +1 -1
  439. package/dist/unplugin/farm.js +5 -1
  440. package/dist/unplugin/farm.js.map +1 -1
  441. package/dist/unplugin/hoist-compile.d.ts +14 -42
  442. package/dist/unplugin/hoist-compile.d.ts.map +1 -1
  443. package/dist/unplugin/hoist-compile.js +67 -112
  444. package/dist/unplugin/hoist-compile.js.map +1 -1
  445. package/dist/unplugin/hoist.d.ts +56 -54
  446. package/dist/unplugin/hoist.d.ts.map +1 -1
  447. package/dist/unplugin/hoist.js +945 -1170
  448. package/dist/unplugin/hoist.js.map +1 -1
  449. package/dist/unplugin/index.d.ts +5 -3
  450. package/dist/unplugin/index.d.ts.map +1 -1
  451. package/dist/unplugin/index.js +175 -250
  452. package/dist/unplugin/index.js.map +1 -1
  453. package/dist/unplugin/rolldown.d.ts +5 -2
  454. package/dist/unplugin/rolldown.d.ts.map +1 -1
  455. package/dist/unplugin/rolldown.js +5 -1
  456. package/dist/unplugin/rolldown.js.map +1 -1
  457. package/dist/unplugin/rollup.d.ts +5 -2
  458. package/dist/unplugin/rollup.d.ts.map +1 -1
  459. package/dist/unplugin/rollup.js +5 -1
  460. package/dist/unplugin/rollup.js.map +1 -1
  461. package/dist/unplugin/rsbuild.d.ts +6 -3
  462. package/dist/unplugin/rsbuild.d.ts.map +1 -1
  463. package/dist/unplugin/rsbuild.js +15 -11
  464. package/dist/unplugin/rsbuild.js.map +1 -1
  465. package/dist/unplugin/rspack.d.ts +5 -2
  466. package/dist/unplugin/rspack.d.ts.map +1 -1
  467. package/dist/unplugin/rspack.js +5 -1
  468. package/dist/unplugin/rspack.js.map +1 -1
  469. package/dist/unplugin/transform.d.ts +30 -27
  470. package/dist/unplugin/transform.d.ts.map +1 -1
  471. package/dist/unplugin/transform.js +433 -620
  472. package/dist/unplugin/transform.js.map +1 -1
  473. package/dist/unplugin/types.d.ts +189 -184
  474. package/dist/unplugin/types.d.ts.map +1 -1
  475. package/dist/unplugin/types.js +22 -18
  476. package/dist/unplugin/types.js.map +1 -1
  477. package/dist/unplugin/virtual.d.ts +11 -8
  478. package/dist/unplugin/virtual.d.ts.map +1 -1
  479. package/dist/unplugin/virtual.js +65 -83
  480. package/dist/unplugin/virtual.js.map +1 -1
  481. package/dist/unplugin/vite.d.ts +5 -2
  482. package/dist/unplugin/vite.d.ts.map +1 -1
  483. package/dist/unplugin/vite.js +5 -1
  484. package/dist/unplugin/vite.js.map +1 -1
  485. package/dist/unplugin/webpack.d.ts +5 -2
  486. package/dist/unplugin/webpack.d.ts.map +1 -1
  487. package/dist/unplugin/webpack.js +5 -1
  488. package/dist/unplugin/webpack.js.map +1 -1
  489. package/package.json +23 -14
  490. package/dist/cli/index.d.ts.map +0 -1
  491. package/dist/core/extract/types.js.map +0 -1
  492. package/dist/core/types.js.map +0 -1
  493. package/dist/index.d.ts.map +0 -1
  494. package/dist/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/unplugin/types.ts"],"names":[],"mappings":"AA4CA,MAAM,OAAO,qBAAqB;IAChC,KAAK,GAAG,CAAC,CAAC;IACV,OAAO,GAAG,CAAC,CAAC;IACZ,SAAS,GAAG,CAAC,CAAC;IACd,MAAM,GAAG,CAAC,CAAC;IAEX,GAAG,CAAC,CAAa;QACf,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC;QACtB,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC;QAC1B,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,SAAS,CAAC;QAC9B,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAClB,CAAC;CACF"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/unplugin/types.ts"],"sourcesContent":["import type { CodegenMode } from \"../core/codegen/context.js\";\nimport type { HoistOptions } from \"./hoist.js\";\n\nexport interface TransformOptions {\n mode: CodegenMode;\n runtimeId?: string;\n zodCompat?: boolean | undefined;\n /** Compact output: compile only the fast path; delegate cold errors to the retained Zod schema. */\n compact?: boolean | undefined;\n verbose?: boolean | undefined;\n autoDiscover?: boolean | undefined;\n hoist?: boolean | HoistOptions | undefined;\n onBuildStats?: (stats: BuildStats) => void;\n /** Fired when discovery (file execution) is about to run — used by the disk cache to decide which results are worth persisting. */\n onDiscovery?: () => void;\n /**\n * Fired when the transform did parse-level work short of discovery (hoist\n * source scan, static export filter). The disk cache persists even null\n * results for these files: re-deriving \"no transform needed\" costs a full\n * scan per zod-importing file per run (a field report measured 35.8s/run\n * of hoist scans in hoist-only mode, all producing never-cached nulls).\n * Purely textual bail-outs never fire this — caching those would trade a\n * substring check for a disk entry per source file in the project.\n */\n onSubstantialWork?: () => void;\n /**\n * Fired when discovery was aborted by a build-time `process.exit` (an\n * env-validation guard in a secret-less build). The recovered result is a\n * function of the *environment*, not the file content, so the disk cache\n * must NOT persist it keyed on content hashes: a later build with secrets\n * present would otherwise be served the stale \"nothing compiled\" entry and\n * silently ship un-optimized schemas. The in-memory (content-keyed, single-\n * process) cache is unaffected.\n */\n onUncacheableResult?: () => void;\n}\n\nexport interface BuildStats {\n files: number;\n schemas: number;\n optimized: number;\n failed: number;\n}\n\nexport class BuildStatsAccumulator implements BuildStats {\n files = 0;\n schemas = 0;\n optimized = 0;\n failed = 0;\n\n add(s: BuildStats): void {\n this.files += s.files;\n this.schemas += s.schemas;\n this.optimized += s.optimized;\n this.failed += s.failed;\n }\n\n reset(): void {\n this.files = 0;\n this.schemas = 0;\n this.optimized = 0;\n this.failed = 0;\n }\n}\n\nexport interface ZodCompilerPluginOptions {\n /** Glob patterns to include (default: [\"**\\/*.ts\", \"**\\/*.tsx\"]) */\n include?: string[];\n /** Glob patterns to exclude (default: [\"node_modules/**\", \"**\\/*.d.ts\"]) */\n exclude?: string[];\n /**\n * How schemas are found.\n *\n * - `\"auto\"` (default): every exported plain Zod schema compiles — no\n * wrappers, no zod-compiler imports in source. Detection scans files\n * with a runtime `import ... from \"zod\"`, statically pre-filters ones\n * whose exports provably aren't schemas, and executes the remaining\n * candidates to check exports for `_zod.def`. Also enables build-time\n * compilation of hoisted in-function schemas (anonymous schemas like\n * `sql.type(z.object(...))` — there is no exported name to opt in with).\n * - `\"explicit\"`: only schemas wrapped in `compile()` from zod-compiler\n * are compiled; build-time file execution is limited to files that\n * import it. Hoisting still applies, but hoisted schemas stay plain Zod.\n *\n * **Note:** in `\"auto\"` mode, candidate files are executed at build time\n * via `loadSourceFile()`. Use `include` to limit scope if your project\n * has schema-shaped files with side effects. A module that calls\n * `process.exit()` during this execution (e.g. an env-validation guard in a\n * secret-less CI build) is caught — the file falls back to runtime Zod\n * instead of crashing the build. Guard the exit on `process.env.ZOD_COMPILER`\n * to keep such schemas compiled.\n * @default \"auto\"\n */\n schemas?: \"explicit\" | \"auto\" | undefined;\n /**\n * What a compiled schema export evaluates to.\n *\n * - `\"schema\"` (default): the original Zod schema object with the compiled\n * `parse`/`safeParse`/`parseAsync`/`safeParseAsync` installed as own\n * properties — identity is preserved, so `.shape`, `.meta()`,\n * `z.toJSONSchema()`, `instanceof`, Standard Schema, and libraries like\n * @hono/zod-validator and tRPC keep working.\n * - `\"bag\"`: a minimal plain object with just the compiled methods —\n * smaller bundles (the Zod construction can tree-shake away), but\n * anything expecting a real Zod schema breaks.\n * - `\"compact\"`: like `\"schema\"` (Zod identity preserved, full API), but only\n * the fast validation path is compiled. The cold error path is delegated to\n * the retained Zod schema's own `safeParse`, dropping the compiled slow walk\n * (64–77% of generated bytes). Errors are byte-identical to Zod's (no second\n * validation engine). The hot path — `parse`/`safeParse` of valid input and\n * `.is()` — is unchanged; only error *reporting* on invalid input runs Zod\n * (deferred until `.error` is read, so `.success`/`.is()` checks stay fast).\n * Modelled rewrites (`default`/`coerce`/`transform`/string overwrites) keep\n * their compiled build pass and delegate only issue production; unmodelled\n * mutations such as `catch`, URL normalization and `superRefine` keep the\n * fully compiled path. Best for large schema sets where bundle size dominates.\n * @default \"schema\"\n */\n output?: \"schema\" | \"bag\" | \"compact\" | undefined;\n /**\n * Enable verbose logging during build.\n * Logs per-schema compilation status and a build summary.\n * @default false\n */\n verbose?: boolean | undefined;\n /**\n * Hoist Zod schema construction out of function bodies to module scope\n * (the babel-plugin-zod-hoist optimization). A schema defined inside a\n * function — a React component, a request handler — is otherwise rebuilt\n * on every call:\n *\n * ```typescript\n * function getSchema() {\n * return z.object({ name: z.string() }); // rebuilt per call\n * }\n * // becomes\n * const _zh_94b7f5c1 = z.object({ name: z.string() });\n * function getSchema() {\n * return _zh_94b7f5c1; // built once\n * }\n * ```\n *\n * Only expressions built purely from imported bindings and literals are\n * hoisted — anything referencing local variables, module-level bindings,\n * `this`, or globals stays put (safe globals like `Number` are allowed\n * inside callbacks, which run per call regardless). Identical schemas\n * dedupe to one binding.\n *\n * Pass an object to configure `schemaNamePattern` (default `/ZodSchema$/`):\n * imported identifiers matching it are hoistable combinator-chain roots\n * even without an inline z.* reference (`UserZodSchema.partial()`). Set it\n * to `null` to disable name-based matching.\n * @default true\n */\n hoist?: boolean | { schemaNamePattern?: RegExp | string | null | undefined } | undefined;\n /**\n * **Vite only** (other bundlers ignore this option): when the plugin runs.\n *\n * By default the plugin compiles production builds **and test runs**\n * (Vitest is detected via the `VITEST` env var / `\"test\"` mode), so tests\n * exercise — and benefit from — the same compiled validators that ship.\n * Plain dev servers skip AOT compilation cost; `compile()` transparently\n * falls back to Zod's runtime validation there, so behavior stays correct.\n *\n * Set `\"build\"` to also skip tests, `\"serve\"` for dev/test-only, or\n * `\"all\"` to compile everywhere including the dev server.\n * @default builds + Vitest\n */\n apply?: \"build\" | \"serve\" | \"all\" | undefined;\n /**\n * Override the codegen mode used by the plugin.\n *\n * - `\"lean\"` (default for bundlers): runtime helpers are imported from\n * `virtual:zod-compiler/runtime`, which the bundler resolves via its\n * `onResolve`/`onLoad` hooks. Produces smaller per-file output and lets\n * the bundler tree-shake unused helpers.\n * - `\"inline\"`: runtime helpers are emitted directly into each transformed\n * file. Use this for transpile-only builds (e.g. `esbuild` without\n * `--bundle`, `astro-scripts build`) where the bundler's module hooks\n * never fire for already-transformed output and the `virtual:` specifier\n * would survive into `dist/` causing `ERR_UNSUPPORTED_ESM_URL_SCHEME`.\n *\n * @default determined by bundler\n */\n codegenMode?: \"lean\" | \"inline\" | undefined;\n /**\n * Persistent transform-result cache (Node.js only).\n *\n * Schema discovery executes schema files (and their import graphs) inside\n * the bundler process; without a disk cache that cost is re-paid on every\n * `vitest run` / build even when nothing changed. Entries are validated\n * against content hashes of every first-party module the discovery\n * executed, so edits to a schema file *or any file it imports* invalidate\n * exactly as the in-memory watch invalidation does — but across processes.\n *\n * Caveat: module-scope dynamism in schema files (schemas derived from\n * `process.env`, `Date.now()`, …) is frozen until a watched source file\n * changes. Disable the cache for such setups.\n *\n * Pass a string to use a custom cache directory.\n * @default true (node_modules/.cache/zod-compiler)\n */\n cache?: boolean | string | undefined;\n}\n"],"mappings":";AA4CA,IAAa,wBAAb,MAAyD;CACvD,QAAQ;CACR,UAAU;CACV,YAAY;CACZ,SAAS;CAET,IAAI,GAAqB;EACvB,KAAK,SAAS,EAAE;EAChB,KAAK,WAAW,EAAE;EAClB,KAAK,aAAa,EAAE;EACpB,KAAK,UAAU,EAAE;CACnB;CAEA,QAAc;EACZ,KAAK,QAAQ;EACb,KAAK,UAAU;EACf,KAAK,YAAY;EACjB,KAAK,SAAS;CAChB;AACF"}
@@ -1,3 +1,4 @@
1
+ //#region src/unplugin/virtual.d.ts
1
2
  /**
2
3
  * Virtual module "virtual:zod-compiler/runtime".
3
4
  *
@@ -12,17 +13,19 @@
12
13
  * static (no per-build state), so caching the source string is safe.
13
14
  */
14
15
  /** Public virtual module ID used by Vite / Rollup / esbuild and other `virtual:`-compatible bundlers. */
15
- export declare const VIRTUAL_RUNTIME_ID = "virtual:zod-compiler/runtime";
16
+ declare const VIRTUAL_RUNTIME_ID = "virtual:zod-compiler/runtime";
16
17
  /** Bare-specifier alias for webpack/rspack, which reject the `virtual:` URI scheme. */
17
- export declare const WP_RUNTIME_ID = "__zod-compiler-runtime__";
18
+ declare const WP_RUNTIME_ID = "__zod-compiler-runtime__";
18
19
  /** Resolved id (Rollup convention: leading null byte hides the module from other plugins). */
19
- export declare const RESOLVED_RUNTIME_ID = "\0zod-compiler-runtime";
20
+ declare const RESOLVED_RUNTIME_ID = "\0zod-compiler-runtime";
20
21
  /** `id` filter for the resolveId hook: the runtime module's public specifiers. */
21
- export declare const RUNTIME_SPECIFIER_FILTER: RegExp[];
22
+ declare const RUNTIME_SPECIFIER_FILTER: RegExp[];
22
23
  /** `id` filter for the load hook: the resolved (`\0`-prefixed) runtime id. */
23
- export declare const RESOLVED_RUNTIME_ID_FILTER: RegExp;
24
- export declare function resolveVirtualId(id: string): string | null;
25
- export declare function loadVirtual(id: string): string | null;
24
+ declare const RESOLVED_RUNTIME_ID_FILTER: RegExp;
25
+ declare function resolveVirtualId(id: string): string | null;
26
+ declare function loadVirtual(id: string): string | null;
26
27
  /** Names of all helpers exported by the virtual module. */
27
- export declare const ALL_HELPER_NAMES: readonly string[];
28
+ declare const ALL_HELPER_NAMES: readonly string[];
29
+ //#endregion
30
+ export { ALL_HELPER_NAMES, RESOLVED_RUNTIME_ID, RESOLVED_RUNTIME_ID_FILTER, RUNTIME_SPECIFIER_FILTER, VIRTUAL_RUNTIME_ID, WP_RUNTIME_ID, loadVirtual, resolveVirtualId };
28
31
  //# sourceMappingURL=virtual.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"virtual.d.ts","sourceRoot":"","sources":["../../src/unplugin/virtual.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAeH,yGAAyG;AACzG,eAAO,MAAM,kBAAkB,iCAAiC,CAAC;AACjE,uFAAuF;AACvF,eAAO,MAAM,aAAa,6BAA6B,CAAC;AACxD,8FAA8F;AAC9F,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAuD5D,kFAAkF;AAClF,eAAO,MAAM,wBAAwB,EAAE,MAAM,EAG5C,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,0BAA0B,EAAE,MAA4C,CAAC;AAEtF,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG1D;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGrD;AAED,2DAA2D;AAC3D,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAU7C,CAAC"}
1
+ {"version":3,"file":"virtual.d.ts","names":[],"sources":["../../src/unplugin/virtual.ts"],"mappings":";;;;;;;;;;;;;;;cA4Ba;;cAEA;;cAEA;;cAwDA,0BAA0B;;cAM1B,4BAA4B;iBAEzB,iBAAiB;iBAKjB,YAAY;;cAMf"}
@@ -1,100 +1,82 @@
1
- /**
2
- * Virtual module "virtual:zod-compiler/runtime".
3
- *
4
- * Hosts shared helpers and well-known regexes so that lean-mode generated code
5
- * (emitted by the unplugin transform) can `import { __zcMkv, __zcTS, __zcReEmail }`
6
- * instead of inlining these declarations per IIFE.
7
- *
8
- * Bundlers tree-shake unused exports during minification, so the virtual module
9
- * never bloats the final bundle with helpers that no schema actually references.
10
- *
11
- * The virtual module is rebuilt on each plugin instantiation but its content is
12
- * static (no per-build state), so caching the source string is safe.
13
- */
1
+ import { FAILZ_CLASS_DECL, FAIL_CLASS_DECL, FINZ_DECL, FIN_DECL, FIN_DEFERRED_DECL, MK_VALIDATOR_DECL, ZOD_CONFIG_IMPORT, ZOD_MSG_DECLARATION } from "../core/iife.js";
2
+ import { WELL_KNOWN_REGEXES, fastTestSource } from "../core/codegen/well-known-regex.js";
14
3
  import { ISSUE_DECLS, RUNTIME_HELPER_DECLS, ZC_SR_RUN_DECL } from "../core/codegen/issue-decls.js";
15
- import { fastTestSource, WELL_KNOWN_REGEXES } from "../core/codegen/well-known-regex.js";
16
- import { FAIL_CLASS_DECL, FAILZ_CLASS_DECL, FIN_DECL, FIN_DEFERRED_DECL, FINZ_DECL, MK_VALIDATOR_DECL, ZOD_CONFIG_IMPORT, ZOD_MSG_DECLARATION, } from "../core/iife.js";
4
+ //#region src/unplugin/virtual.ts
5
+ /**
6
+ * Virtual module "virtual:zod-compiler/runtime".
7
+ *
8
+ * Hosts shared helpers and well-known regexes so that lean-mode generated code
9
+ * (emitted by the unplugin transform) can `import { __zcMkv, __zcTS, __zcReEmail }`
10
+ * instead of inlining these declarations per IIFE.
11
+ *
12
+ * Bundlers tree-shake unused exports during minification, so the virtual module
13
+ * never bloats the final bundle with helpers that no schema actually references.
14
+ *
15
+ * The virtual module is rebuilt on each plugin instantiation but its content is
16
+ * static (no per-build state), so caching the source string is safe.
17
+ */
17
18
  /** Public virtual module ID used by Vite / Rollup / esbuild and other `virtual:`-compatible bundlers. */
18
- export const VIRTUAL_RUNTIME_ID = "virtual:zod-compiler/runtime";
19
+ const VIRTUAL_RUNTIME_ID = "virtual:zod-compiler/runtime";
19
20
  /** Bare-specifier alias for webpack/rspack, which reject the `virtual:` URI scheme. */
20
- export const WP_RUNTIME_ID = "__zod-compiler-runtime__";
21
+ const WP_RUNTIME_ID = "__zod-compiler-runtime__";
21
22
  /** Resolved id (Rollup convention: leading null byte hides the module from other plugins). */
22
- export const RESOLVED_RUNTIME_ID = "\0zod-compiler-runtime";
23
+ const RESOLVED_RUNTIME_ID = "\0zod-compiler-runtime";
23
24
  function buildRuntimeSource() {
24
- // ISSUE_DECLS / RUNTIME_HELPER_DECLS registries are the single source of
25
- // truth — never enumerate individual decl constants here. A decl present in
26
- // the registry (and therefore in ALL_HELPER_NAMES and in codegen's
27
- // usedHelpers imports) but missing from this source is a build-breaking
28
- // MISSING_EXPORT in every consumer bundle (field incident: __zcUK).
29
- const parts = [
30
- ZOD_CONFIG_IMPORT,
31
- ZOD_MSG_DECLARATION,
32
- // Module-local (never imported by generated code) — __zcFin/__zcFinD below
33
- // construct it. Must precede them; both reference __ZcFail by closure.
34
- FAIL_CLASS_DECL,
35
- // Module-local (never imported by generated code) — __zcFinZ constructs it.
36
- FAILZ_CLASS_DECL,
37
- `export ${MK_VALIDATOR_DECL}`,
38
- `export ${FIN_DECL}`,
39
- `export ${FIN_DEFERRED_DECL}`,
40
- `export ${FINZ_DECL}`,
41
- // Module-local (never imported by generated code) — __zcSr/__zcSrOk call it.
42
- ZC_SR_RUN_DECL,
43
- ...Object.values(ISSUE_DECLS).map((decl) => `export ${decl}`),
44
- ...Object.values(RUNTIME_HELPER_DECLS).map((decl) => `export ${decl}`),
45
- ];
46
- for (const r of WELL_KNOWN_REGEXES) {
47
- // fastTestSource is a behavior-equivalent faster pattern used for the
48
- // runtime regex (table rewrite and/or repeat unrolling); issue sites
49
- // reference the paired `<name>Src` string so reported patterns stay
50
- // byte-identical to zod's (single bundle-wide copy of each). It is the same
51
- // function emitRegex consults, so the virtual module and inline mode can
52
- // never disagree about which pattern a format actually runs.
53
- const testSource = fastTestSource(r.source);
54
- parts.push(`export const ${r.name}=new RegExp(${JSON.stringify(testSource ?? r.source)});`);
55
- if (testSource !== null) {
56
- parts.push(`export const ${r.name}Src=${JSON.stringify(`/${r.source}/`)};`);
57
- }
58
- }
59
- return parts.join("\n");
25
+ const parts = [
26
+ ZOD_CONFIG_IMPORT,
27
+ ZOD_MSG_DECLARATION,
28
+ FAIL_CLASS_DECL,
29
+ FAILZ_CLASS_DECL,
30
+ `export ${MK_VALIDATOR_DECL}`,
31
+ `export ${FIN_DECL}`,
32
+ `export ${FIN_DEFERRED_DECL}`,
33
+ `export ${FINZ_DECL}`,
34
+ ZC_SR_RUN_DECL,
35
+ ...Object.values(ISSUE_DECLS).map((decl) => `export ${decl}`),
36
+ ...Object.values(RUNTIME_HELPER_DECLS).map((decl) => `export ${decl}`)
37
+ ];
38
+ for (const r of WELL_KNOWN_REGEXES) {
39
+ const testSource = fastTestSource(r.source);
40
+ parts.push(`export const ${r.name}=new RegExp(${JSON.stringify(testSource ?? r.source)});`);
41
+ if (testSource !== null) parts.push(`export const ${r.name}Src=${JSON.stringify(`/${r.source}/`)};`);
42
+ }
43
+ return parts.join("\n");
60
44
  }
61
45
  const RUNTIME_SOURCE = buildRuntimeSource();
62
46
  /**
63
- * Anchored, literal-safe pattern for an exact id match. Hook filters take
64
- * globs or regexes, and a bare string is treated as a glob resolved against
65
- * cwd — which never matches a `virtual:` specifier — so the ids are escaped
66
- * into patterns instead. NUL is written as `\x00` because the pattern is
67
- * recompiled outside JS by bundlers with native filters (Rolldown).
68
- */
47
+ * Anchored, literal-safe pattern for an exact id match. Hook filters take
48
+ * globs or regexes, and a bare string is treated as a glob resolved against
49
+ * cwd — which never matches a `virtual:` specifier — so the ids are escaped
50
+ * into patterns instead. NUL is written as `\x00` because the pattern is
51
+ * recompiled outside JS by bundlers with native filters (Rolldown).
52
+ */
69
53
  function exactIdPattern(id) {
70
- const escaped = id.replace(/[$()*+.?[\\\]^{|}]/g, "\\$&").replaceAll("\0", "\\x00");
71
- return new RegExp(`^${escaped}$`);
54
+ const escaped = id.replace(/[$()*+.?[\\\]^{|}]/g, "\\$&").replaceAll("\0", "\\x00");
55
+ return new RegExp(`^${escaped}$`);
72
56
  }
73
57
  /** `id` filter for the resolveId hook: the runtime module's public specifiers. */
74
- export const RUNTIME_SPECIFIER_FILTER = [
75
- exactIdPattern(VIRTUAL_RUNTIME_ID),
76
- exactIdPattern(WP_RUNTIME_ID),
77
- ];
58
+ const RUNTIME_SPECIFIER_FILTER = [exactIdPattern(VIRTUAL_RUNTIME_ID), exactIdPattern(WP_RUNTIME_ID)];
78
59
  /** `id` filter for the load hook: the resolved (`\0`-prefixed) runtime id. */
79
- export const RESOLVED_RUNTIME_ID_FILTER = exactIdPattern(RESOLVED_RUNTIME_ID);
80
- export function resolveVirtualId(id) {
81
- if (id === VIRTUAL_RUNTIME_ID || id === WP_RUNTIME_ID)
82
- return RESOLVED_RUNTIME_ID;
83
- return null;
60
+ const RESOLVED_RUNTIME_ID_FILTER = exactIdPattern(RESOLVED_RUNTIME_ID);
61
+ function resolveVirtualId(id) {
62
+ if (id === "virtual:zod-compiler/runtime" || id === "__zod-compiler-runtime__") return RESOLVED_RUNTIME_ID;
63
+ return null;
84
64
  }
85
- export function loadVirtual(id) {
86
- if (id === RESOLVED_RUNTIME_ID)
87
- return RUNTIME_SOURCE;
88
- return null;
65
+ function loadVirtual(id) {
66
+ if (id === "\0zod-compiler-runtime") return RUNTIME_SOURCE;
67
+ return null;
89
68
  }
90
69
  /** Names of all helpers exported by the virtual module. */
91
- export const ALL_HELPER_NAMES = [
92
- "__zcMkv",
93
- "__zcFin",
94
- "__zcFinD",
95
- "__zcFinZ",
96
- ...Object.keys(ISSUE_DECLS),
97
- ...Object.keys(RUNTIME_HELPER_DECLS),
98
- ...WELL_KNOWN_REGEXES.flatMap((r) => fastTestSource(r.source) !== null ? [r.name, `${r.name}Src`] : [r.name]),
70
+ const ALL_HELPER_NAMES = [
71
+ "__zcMkv",
72
+ "__zcFin",
73
+ "__zcFinD",
74
+ "__zcFinZ",
75
+ ...Object.keys(ISSUE_DECLS),
76
+ ...Object.keys(RUNTIME_HELPER_DECLS),
77
+ ...WELL_KNOWN_REGEXES.flatMap((r) => fastTestSource(r.source) !== null ? [r.name, `${r.name}Src`] : [r.name])
99
78
  ];
79
+ //#endregion
80
+ export { ALL_HELPER_NAMES, RESOLVED_RUNTIME_ID, RESOLVED_RUNTIME_ID_FILTER, RUNTIME_SPECIFIER_FILTER, VIRTUAL_RUNTIME_ID, WP_RUNTIME_ID, loadVirtual, resolveVirtualId };
81
+
100
82
  //# sourceMappingURL=virtual.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"virtual.js","sourceRoot":"","sources":["../../src/unplugin/virtual.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzF,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AAEzB,yGAAyG;AACzG,MAAM,CAAC,MAAM,kBAAkB,GAAG,8BAA8B,CAAC;AACjE,uFAAuF;AACvF,MAAM,CAAC,MAAM,aAAa,GAAG,0BAA0B,CAAC;AACxD,8FAA8F;AAC9F,MAAM,CAAC,MAAM,mBAAmB,GAAG,wBAAwB,CAAC;AAE5D,SAAS,kBAAkB;IACzB,yEAAyE;IACzE,4EAA4E;IAC5E,mEAAmE;IACnE,wEAAwE;IACxE,oEAAoE;IACpE,MAAM,KAAK,GAAa;QACtB,iBAAiB;QACjB,mBAAmB;QACnB,2EAA2E;QAC3E,uEAAuE;QACvE,eAAe;QACf,4EAA4E;QAC5E,gBAAgB;QAChB,UAAU,iBAAiB,EAAE;QAC7B,UAAU,QAAQ,EAAE;QACpB,UAAU,iBAAiB,EAAE;QAC7B,UAAU,SAAS,EAAE;QACrB,6EAA6E;QAC7E,cAAc;QACd,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,IAAI,EAAE,CAAC;QAC7D,GAAG,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,IAAI,EAAE,CAAC;KACvE,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,kBAAkB,EAAE,CAAC;QACnC,sEAAsE;QACtE,qEAAqE;QACrE,oEAAoE;QACpE,4EAA4E;QAC5E,yEAAyE;QACzE,6DAA6D;QAC7D,MAAM,UAAU,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAC5C,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,eAAe,IAAI,CAAC,SAAS,CAAC,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC5F,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,cAAc,GAAG,kBAAkB,EAAE,CAAC;AAE5C;;;;;;GAMG;AACH,SAAS,cAAc,CAAC,EAAU;IAChC,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpF,OAAO,IAAI,MAAM,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,wBAAwB,GAAa;IAChD,cAAc,CAAC,kBAAkB,CAAC;IAClC,cAAc,CAAC,aAAa,CAAC;CAC9B,CAAC;AAEF,8EAA8E;AAC9E,MAAM,CAAC,MAAM,0BAA0B,GAAW,cAAc,CAAC,mBAAmB,CAAC,CAAC;AAEtF,MAAM,UAAU,gBAAgB,CAAC,EAAU;IACzC,IAAI,EAAE,KAAK,kBAAkB,IAAI,EAAE,KAAK,aAAa;QAAE,OAAO,mBAAmB,CAAC;IAClF,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAAU;IACpC,IAAI,EAAE,KAAK,mBAAmB;QAAE,OAAO,cAAc,CAAC;IACtD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,SAAS;IACT,SAAS;IACT,UAAU;IACV,UAAU;IACV,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;IAC3B,GAAG,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC;IACpC,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAClC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CACxE;CACF,CAAC"}
1
+ {"version":3,"file":"virtual.js","names":[],"sources":["../../src/unplugin/virtual.ts"],"sourcesContent":["/**\n * Virtual module \"virtual:zod-compiler/runtime\".\n *\n * Hosts shared helpers and well-known regexes so that lean-mode generated code\n * (emitted by the unplugin transform) can `import { __zcMkv, __zcTS, __zcReEmail }`\n * instead of inlining these declarations per IIFE.\n *\n * Bundlers tree-shake unused exports during minification, so the virtual module\n * never bloats the final bundle with helpers that no schema actually references.\n *\n * The virtual module is rebuilt on each plugin instantiation but its content is\n * static (no per-build state), so caching the source string is safe.\n */\n\nimport { ISSUE_DECLS, RUNTIME_HELPER_DECLS, ZC_SR_RUN_DECL } from \"../core/codegen/issue-decls.js\";\nimport { fastTestSource, WELL_KNOWN_REGEXES } from \"../core/codegen/well-known-regex.js\";\nimport {\n FAIL_CLASS_DECL,\n FAILZ_CLASS_DECL,\n FIN_DECL,\n FIN_DEFERRED_DECL,\n FINZ_DECL,\n MK_VALIDATOR_DECL,\n ZOD_CONFIG_IMPORT,\n ZOD_MSG_DECLARATION,\n} from \"../core/iife.js\";\n\n/** Public virtual module ID used by Vite / Rollup / esbuild and other `virtual:`-compatible bundlers. */\nexport const VIRTUAL_RUNTIME_ID = \"virtual:zod-compiler/runtime\";\n/** Bare-specifier alias for webpack/rspack, which reject the `virtual:` URI scheme. */\nexport const WP_RUNTIME_ID = \"__zod-compiler-runtime__\";\n/** Resolved id (Rollup convention: leading null byte hides the module from other plugins). */\nexport const RESOLVED_RUNTIME_ID = \"\\0zod-compiler-runtime\";\n\nfunction buildRuntimeSource(): string {\n // ISSUE_DECLS / RUNTIME_HELPER_DECLS registries are the single source of\n // truth — never enumerate individual decl constants here. A decl present in\n // the registry (and therefore in ALL_HELPER_NAMES and in codegen's\n // usedHelpers imports) but missing from this source is a build-breaking\n // MISSING_EXPORT in every consumer bundle (field incident: __zcUK).\n const parts: string[] = [\n ZOD_CONFIG_IMPORT,\n ZOD_MSG_DECLARATION,\n // Module-local (never imported by generated code) — __zcFin/__zcFinD below\n // construct it. Must precede them; both reference __ZcFail by closure.\n FAIL_CLASS_DECL,\n // Module-local (never imported by generated code) — __zcFinZ constructs it.\n FAILZ_CLASS_DECL,\n `export ${MK_VALIDATOR_DECL}`,\n `export ${FIN_DECL}`,\n `export ${FIN_DEFERRED_DECL}`,\n `export ${FINZ_DECL}`,\n // Module-local (never imported by generated code) — __zcSr/__zcSrOk call it.\n ZC_SR_RUN_DECL,\n ...Object.values(ISSUE_DECLS).map((decl) => `export ${decl}`),\n ...Object.values(RUNTIME_HELPER_DECLS).map((decl) => `export ${decl}`),\n ];\n for (const r of WELL_KNOWN_REGEXES) {\n // fastTestSource is a behavior-equivalent faster pattern used for the\n // runtime regex (table rewrite and/or repeat unrolling); issue sites\n // reference the paired `<name>Src` string so reported patterns stay\n // byte-identical to zod's (single bundle-wide copy of each). It is the same\n // function emitRegex consults, so the virtual module and inline mode can\n // never disagree about which pattern a format actually runs.\n const testSource = fastTestSource(r.source);\n parts.push(`export const ${r.name}=new RegExp(${JSON.stringify(testSource ?? r.source)});`);\n if (testSource !== null) {\n parts.push(`export const ${r.name}Src=${JSON.stringify(`/${r.source}/`)};`);\n }\n }\n return parts.join(\"\\n\");\n}\n\nconst RUNTIME_SOURCE = buildRuntimeSource();\n\n/**\n * Anchored, literal-safe pattern for an exact id match. Hook filters take\n * globs or regexes, and a bare string is treated as a glob resolved against\n * cwd — which never matches a `virtual:` specifier — so the ids are escaped\n * into patterns instead. NUL is written as `\\x00` because the pattern is\n * recompiled outside JS by bundlers with native filters (Rolldown).\n */\nfunction exactIdPattern(id: string): RegExp {\n const escaped = id.replace(/[$()*+.?[\\\\\\]^{|}]/g, \"\\\\$&\").replaceAll(\"\\0\", \"\\\\x00\");\n return new RegExp(`^${escaped}$`);\n}\n\n/** `id` filter for the resolveId hook: the runtime module's public specifiers. */\nexport const RUNTIME_SPECIFIER_FILTER: RegExp[] = [\n exactIdPattern(VIRTUAL_RUNTIME_ID),\n exactIdPattern(WP_RUNTIME_ID),\n];\n\n/** `id` filter for the load hook: the resolved (`\\0`-prefixed) runtime id. */\nexport const RESOLVED_RUNTIME_ID_FILTER: RegExp = exactIdPattern(RESOLVED_RUNTIME_ID);\n\nexport function resolveVirtualId(id: string): string | null {\n if (id === VIRTUAL_RUNTIME_ID || id === WP_RUNTIME_ID) return RESOLVED_RUNTIME_ID;\n return null;\n}\n\nexport function loadVirtual(id: string): string | null {\n if (id === RESOLVED_RUNTIME_ID) return RUNTIME_SOURCE;\n return null;\n}\n\n/** Names of all helpers exported by the virtual module. */\nexport const ALL_HELPER_NAMES: readonly string[] = [\n \"__zcMkv\",\n \"__zcFin\",\n \"__zcFinD\",\n \"__zcFinZ\",\n ...Object.keys(ISSUE_DECLS),\n ...Object.keys(RUNTIME_HELPER_DECLS),\n ...WELL_KNOWN_REGEXES.flatMap((r) =>\n fastTestSource(r.source) !== null ? [r.name, `${r.name}Src`] : [r.name],\n ),\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,MAAa,qBAAqB;;AAElC,MAAa,gBAAgB;;AAE7B,MAAa,sBAAsB;AAEnC,SAAS,qBAA6B;CAMpC,MAAM,QAAkB;EACtB;EACA;EAGA;EAEA;EACA,UAAU;EACV,UAAU;EACV,UAAU;EACV,UAAU;EAEV;EACA,GAAG,OAAO,OAAO,WAAW,CAAC,CAAC,KAAK,SAAS,UAAU,MAAM;EAC5D,GAAG,OAAO,OAAO,oBAAoB,CAAC,CAAC,KAAK,SAAS,UAAU,MAAM;CACvE;CACA,KAAK,MAAM,KAAK,oBAAoB;EAOlC,MAAM,aAAa,eAAe,EAAE,MAAM;EAC1C,MAAM,KAAK,gBAAgB,EAAE,KAAK,cAAc,KAAK,UAAU,cAAc,EAAE,MAAM,EAAE,GAAG;EAC1F,IAAI,eAAe,MACjB,MAAM,KAAK,gBAAgB,EAAE,KAAK,MAAM,KAAK,UAAU,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;CAE9E;CACA,OAAO,MAAM,KAAK,IAAI;AACxB;AAEA,MAAM,iBAAiB,mBAAmB;;;;;;;;AAS1C,SAAS,eAAe,IAAoB;CAC1C,MAAM,UAAU,GAAG,QAAQ,uBAAuB,MAAM,CAAC,CAAC,WAAW,MAAM,OAAO;CAClF,OAAO,IAAI,OAAO,IAAI,QAAQ,EAAE;AAClC;;AAGA,MAAa,2BAAqC,CAChD,eAAe,kBAAkB,GACjC,eAAe,aAAa,CAC9B;;AAGA,MAAa,6BAAqC,eAAe,mBAAmB;AAEpF,SAAgB,iBAAiB,IAA2B;CAC1D,IAAI,OAAA,kCAA6B,OAAA,4BAAsB,OAAO;CAC9D,OAAO;AACT;AAEA,SAAgB,YAAY,IAA2B;CACrD,IAAI,OAAA,0BAA4B,OAAO;CACvC,OAAO;AACT;;AAGA,MAAa,mBAAsC;CACjD;CACA;CACA;CACA;CACA,GAAG,OAAO,KAAK,WAAW;CAC1B,GAAG,OAAO,KAAK,oBAAoB;CACnC,GAAG,mBAAmB,SAAS,MAC7B,eAAe,EAAE,MAAM,MAAM,OAAO,CAAC,EAAE,MAAM,GAAG,EAAE,KAAK,IAAI,IAAI,CAAC,EAAE,IAAI,CACxE;AACF"}
@@ -1,3 +1,6 @@
1
- declare const _default: (options?: import("./types.js").ZodCompilerPluginOptions | undefined) => import("unplugin").VitePlugin<any> | import("unplugin").VitePlugin<any>[];
2
- export default _default;
1
+ import { ZodCompilerPluginOptions } from "./types.js";
2
+ //#region src/unplugin/vite.d.ts
3
+ declare const _default: (options?: ZodCompilerPluginOptions | undefined) => import("vite").Plugin<any> | import("vite").Plugin<any>[];
4
+ //#endregion
5
+ export { _default as default };
3
6
  //# sourceMappingURL=vite.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../src/unplugin/vite.ts"],"names":[],"mappings":";AAEA,wBAA6B"}
1
+ {"version":3,"file":"vite.d.ts","names":[],"sources":["../../src/unplugin/vite.ts"],"mappings":""}
@@ -1,3 +1,7 @@
1
1
  import { unplugin } from "./index.js";
2
- export default unplugin.vite;
2
+ //#region src/unplugin/vite.ts
3
+ var vite_default = unplugin.vite;
4
+ //#endregion
5
+ export { vite_default as default };
6
+
3
7
  //# sourceMappingURL=vite.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vite.js","sourceRoot":"","sources":["../../src/unplugin/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAe,QAAQ,CAAC,IAAI,CAAC"}
1
+ {"version":3,"file":"vite.js","names":[],"sources":["../../src/unplugin/vite.ts"],"sourcesContent":["import { unplugin } from \"./index.js\";\n\nexport default unplugin.vite;\n"],"mappings":";;AAEA,IAAA,eAAe,SAAS"}
@@ -1,3 +1,6 @@
1
- declare const _default: (options?: import("./types.js").ZodCompilerPluginOptions | undefined) => WebpackPluginInstance;
2
- export default _default;
1
+ import { ZodCompilerPluginOptions } from "./types.js";
2
+ //#region src/unplugin/webpack.d.ts
3
+ declare const _default: (options?: ZodCompilerPluginOptions | undefined) => WebpackPluginInstance;
4
+ //#endregion
5
+ export { _default as default };
3
6
  //# sourceMappingURL=webpack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../../src/unplugin/webpack.ts"],"names":[],"mappings":";AAEA,wBAAgC"}
1
+ {"version":3,"file":"webpack.d.ts","names":[],"sources":["../../src/unplugin/webpack.ts"],"mappings":""}
@@ -1,3 +1,7 @@
1
1
  import { unplugin } from "./index.js";
2
- export default unplugin.webpack;
2
+ //#region src/unplugin/webpack.ts
3
+ var webpack_default = unplugin.webpack;
4
+ //#endregion
5
+ export { webpack_default as default };
6
+
3
7
  //# sourceMappingURL=webpack.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"webpack.js","sourceRoot":"","sources":["../../src/unplugin/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAe,QAAQ,CAAC,OAAO,CAAC"}
1
+ {"version":3,"file":"webpack.js","names":[],"sources":["../../src/unplugin/webpack.ts"],"sourcesContent":["import { unplugin } from \"./index.js\";\n\nexport default unplugin.webpack;\n"],"mappings":";;AAEA,IAAA,kBAAe,SAAS"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zod-compiler",
3
- "version": "1.23.0",
3
+ "version": "1.23.2",
4
4
  "description": "Compile Zod schemas into zero-overhead validation functions",
5
5
  "keywords": [
6
6
  "aot",
@@ -12,9 +12,10 @@
12
12
  "validation",
13
13
  "zod"
14
14
  ],
15
+ "license": "BSD-3-Clause",
15
16
  "repository": {
16
17
  "type": "git",
17
- "url": "https://github.com/gajus/zod-compiler.git"
18
+ "url": "git+https://github.com/gajus/zod-compiler.git"
18
19
  },
19
20
  "bin": {
20
21
  "zod-compiler": "./dist/cli/index.js"
@@ -100,13 +101,14 @@
100
101
  }
101
102
  },
102
103
  "scripts": {
103
- "benchmark": "pnpm build && vitest bench --config benchmarks/vitest.config.ts",
104
- "build": "rm -fr ./dist && tsc",
105
- "dev": "tsc --watch",
106
- "lint": "oxlint --type-aware && oxfmt --check && tsc --noEmit && knip",
107
- "size:cli": "pnpm --filter @zod-compiler/benchmarks size:cli",
108
- "size:unplugin": "pnpm --filter @zod-compiler/benchmarks size:unplugin",
109
- "test": "vitest run"
104
+ "benchmark": "vp pack && vp test bench --config benchmarks/vite.config.ts",
105
+ "build": "vp pack",
106
+ "dev": "vp pack --watch",
107
+ "lint": "vp check && vp exec knip",
108
+ "size:cli": "vp run --filter @zod-compiler/benchmarks size:cli",
109
+ "size:unplugin": "vp run --filter @zod-compiler/benchmarks size:unplugin",
110
+ "test": "vp test run",
111
+ "prepare": "vp config"
110
112
  },
111
113
  "dependencies": {
112
114
  "@jridgewell/remapping": "^2.3.5",
@@ -123,13 +125,13 @@
123
125
  "@swc/core": "^1.15.43",
124
126
  "@types/node": "catalog:",
125
127
  "@types/picomatch": "^4.0.3",
126
- "@vitest/coverage-v8": "4.1.4",
127
- "knip": "^6.16.1",
128
- "oxfmt": "^0.54.0",
129
- "oxlint": "^1.69.0",
130
- "oxlint-tsgolint": "^0.23.0",
128
+ "@vitest/coverage-v8": "catalog:",
129
+ "knip": "^6.29.0",
130
+ "publint": "^0.3.22",
131
131
  "semantic-release": "^25.0.3",
132
132
  "typescript": "catalog:",
133
+ "vite": "catalog:",
134
+ "vite-plus": "catalog:",
133
135
  "vitest": "catalog:",
134
136
  "zod": "catalog:"
135
137
  },
@@ -146,5 +148,12 @@
146
148
  "optional": true
147
149
  }
148
150
  },
151
+ "devEngines": {
152
+ "runtime": {
153
+ "name": "node",
154
+ "version": "24.18.0",
155
+ "onFail": "download"
156
+ }
157
+ },
149
158
  "packageManager": "pnpm@10.33.1"
150
159
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/extract/types.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,YAAY,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}