zod-compiler 1.15.0 → 1.16.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.
package/README.md CHANGED
@@ -140,6 +140,7 @@ npx zod-compiler generate src/ --strip-unknown-keys
140
140
  | SWC | `import zodCompiler from "zod-compiler/swc"` |
141
141
  | Rollup | `import zodCompiler from "zod-compiler/rollup"` |
142
142
  | Rolldown | `import zodCompiler from "zod-compiler/rolldown"` |
143
+ | Rsbuild | `import zodCompiler from "zod-compiler/rsbuild"` |
143
144
  | rspack | `import zodCompiler from "zod-compiler/rspack"` |
144
145
  | Bun | `import zodCompiler from "zod-compiler/bun"` |
145
146
  | Farm | `import zodCompiler from "zod-compiler/farm"` |
@@ -166,6 +167,17 @@ zodCompiler({
166
167
  });
167
168
  ```
168
169
 
170
+ **rsbuild.config.ts:**
171
+
172
+ ```typescript
173
+ import { defineConfig } from "@rsbuild/core";
174
+ import zodCompiler from "zod-compiler/rsbuild";
175
+
176
+ export default defineConfig({
177
+ plugins: [zodCompiler()],
178
+ });
179
+ ```
180
+
169
181
  > **Note:** Vitest is detected automatically (via the `VITEST` env var), so
170
182
  > tests compile and exercise the same validators that ship to production —
171
183
  > including their performance. Pass `apply: "build"` if you want tests to use
@@ -0,0 +1,4 @@
1
+ import type { RsbuildPlugin } from "@rsbuild/core";
2
+ import type { ZodCompilerPluginOptions } from "./types.js";
3
+ export default function zodCompiler(options?: ZodCompilerPluginOptions): RsbuildPlugin;
4
+ //# sourceMappingURL=rsbuild.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rsbuild.d.ts","sourceRoot":"","sources":["../../src/unplugin/rsbuild.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAG3D,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,aAAa,CAUrF"}
@@ -0,0 +1,13 @@
1
+ import zodCompilerRspack from "./rspack.js";
2
+ export default function zodCompiler(options) {
3
+ return {
4
+ name: "zod-compiler",
5
+ setup(api) {
6
+ api.modifyRspackConfig((config) => {
7
+ config.plugins ??= [];
8
+ config.plugins.push(zodCompilerRspack(options));
9
+ });
10
+ },
11
+ };
12
+ }
13
+ //# sourceMappingURL=rsbuild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rsbuild.js","sourceRoot":"","sources":["../../src/unplugin/rsbuild.ts"],"names":[],"mappings":"AAEA,OAAO,iBAAiB,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,OAAkC;IACpE,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,KAAK,CAAC,GAAG;YACP,GAAG,CAAC,kBAAkB,CAAC,CAAC,MAAM,EAAE,EAAE;gBAChC,MAAM,CAAC,OAAO,KAAK,EAAE,CAAC;gBACtB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;YAClD,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zod-compiler",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "description": "Compile Zod schemas into zero-overhead validation functions",
5
5
  "keywords": [
6
6
  "aot",
@@ -74,6 +74,12 @@
74
74
  "import": "./dist/unplugin/rspack.js",
75
75
  "default": "./dist/unplugin/rspack.js"
76
76
  },
77
+ "./rsbuild": {
78
+ "types": "./dist/unplugin/rsbuild.d.ts",
79
+ "source": "./src/unplugin/rsbuild.ts",
80
+ "import": "./dist/unplugin/rsbuild.js",
81
+ "default": "./dist/unplugin/rsbuild.js"
82
+ },
77
83
  "./farm": {
78
84
  "types": "./dist/unplugin/farm.d.ts",
79
85
  "source": "./src/unplugin/farm.ts",
@@ -107,6 +113,7 @@
107
113
  },
108
114
  "devDependencies": {
109
115
  "@jridgewell/trace-mapping": "^0.3.31",
116
+ "@rsbuild/core": "^2.1.7",
110
117
  "@swc/core": "^1.15.43",
111
118
  "@types/node": "catalog:",
112
119
  "@types/picomatch": "^4.0.3",
@@ -121,10 +128,14 @@
121
128
  "zod": "catalog:"
122
129
  },
123
130
  "peerDependencies": {
131
+ "@rsbuild/core": "^1.0.0 || ^2.0.0",
124
132
  "@swc/core": ">=1.3.0",
125
133
  "zod": "^4.0.0"
126
134
  },
127
135
  "peerDependenciesMeta": {
136
+ "@rsbuild/core": {
137
+ "optional": true
138
+ },
128
139
  "@swc/core": {
129
140
  "optional": true
130
141
  }