@primocaredentgroup/convex-campaigns-component 0.3.22 → 0.3.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primocaredentgroup/convex-campaigns-component",
3
- "version": "0.3.22",
3
+ "version": "0.3.23",
4
4
  "description": "Convex Campaigns backend component for PrimoCore",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -13,9 +13,11 @@
13
13
  "convex.config.ts",
14
14
  "README.md",
15
15
  "CHANGELOG.md",
16
- "convex/**"
16
+ "convex/**",
17
+ "scripts/remove-zod-benchmarks.mjs"
17
18
  ],
18
19
  "scripts": {
20
+ "postinstall": "node ./scripts/remove-zod-benchmarks.mjs",
19
21
  "sync:from-repo": "node ./scripts/sync-from-repo.mjs",
20
22
  "prepack": "npm run sync:from-repo",
21
23
  "test": "tsx --test tests/**/*.test.ts",
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Zod v4 ships src/v3/benchmarks/*.ts files that import the "benchmark" package.
3
+ * The Convex bundler scans all .ts files in node_modules and fails because
4
+ * "benchmark" is not installed (it's a dev-only dependency of Zod's repo).
5
+ * This script removes those files after install to prevent the bundler error.
6
+ */
7
+ import { existsSync, rmSync } from "fs";
8
+ import { createRequire } from "module";
9
+ import { dirname, join } from "path";
10
+
11
+ const require = createRequire(import.meta.url);
12
+
13
+ try {
14
+ const zodPkgPath = require.resolve("zod/package.json");
15
+ const benchDir = join(dirname(zodPkgPath), "src", "v3", "benchmarks");
16
+ if (existsSync(benchDir)) {
17
+ rmSync(benchDir, { recursive: true, force: true });
18
+ console.log("[campaigns] Removed zod v3 benchmark files to fix Convex bundler compatibility.");
19
+ }
20
+ } catch {
21
+ // zod not installed yet or not resolvable — nothing to do
22
+ }