@nullix/zod-mongoose-studio 3.3.1 → 3.3.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 (40) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{DA0pQuyP.js → B6lqezyA.js} +3 -3
  3. package/.output/public/_nuxt/{BCIlnd0g.js → B7ScFmDB.js} +1 -1
  4. package/.output/public/_nuxt/{DsnIpnT9.js → B8gqXD2U.js} +1 -1
  5. package/.output/public/_nuxt/{BNDnV2op.js → BC9tFNFa.js} +3 -3
  6. package/.output/public/_nuxt/{sKEJiAHO.js → Bbi9UBvi.js} +1 -1
  7. package/.output/public/_nuxt/{I3Ucam2s.js → BcYnCaqL.js} +1 -1
  8. package/.output/public/_nuxt/{C2BHp-MG.js → BlZ0x31M.js} +1 -1
  9. package/.output/public/_nuxt/{ypRHVLFO.js → Bw82IGM8.js} +1 -1
  10. package/.output/public/_nuxt/{5Tu2WUJz.js → C8xmwXC2.js} +1 -1
  11. package/.output/public/_nuxt/{BO4hqv6q.js → C919AVYR.js} +1 -1
  12. package/.output/public/_nuxt/{o-NCh2rp.js → CsQL5F-l.js} +1 -1
  13. package/.output/public/_nuxt/{B9paGgN0.js → Czp4_2o-.js} +3 -3
  14. package/.output/public/_nuxt/{D87QMS6j.js → DJa7_7Hz.js} +1 -1
  15. package/.output/public/_nuxt/{B0N6xv5E.js → DKK0Mrrg.js} +1 -1
  16. package/.output/public/_nuxt/{CMH9iX_E.js → DbUZZZZu.js} +2 -2
  17. package/.output/public/_nuxt/{DcJ7oPvZ.js → DbqvVYbv.js} +1 -1
  18. package/.output/public/_nuxt/{Dce9SnGa.js → JkiDMdYG.js} +1 -1
  19. package/.output/public/_nuxt/{tqQNlhT9.js → OVQ3C2Ge.js} +1 -1
  20. package/.output/public/_nuxt/{CKULsFUz.js → PXBhK7S_.js} +1 -1
  21. package/.output/public/_nuxt/{DpKrXpkK.js → YC-RLggm.js} +1 -1
  22. package/.output/public/_nuxt/builds/latest.json +1 -1
  23. package/.output/public/_nuxt/builds/meta/46174b5e-cab6-4a73-95f8-66a1c9b1be2b.json +1 -0
  24. package/.output/public/_nuxt/{CzbCpNnc.js → d1NBz903.js} +1 -1
  25. package/.output/public/_nuxt/{entry.B-vs1tRH.css → entry.DaqrxXuH.css} +1 -1
  26. package/.output/public/_nuxt/{BOsJJ_ZU.js → iGzUozbF.js} +1 -1
  27. package/.output/public/_nuxt/{B0cUlOSM.js → iKW_mt0p.js} +1 -1
  28. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  29. package/.output/server/chunks/nitro/nitro.mjs +348 -348
  30. package/.output/server/chunks/routes/api/editor-types.get.mjs +91 -22
  31. package/.output/server/chunks/routes/api/editor-types.get.mjs.map +1 -1
  32. package/.output/server/chunks/routes/api/studio/run.post.mjs +9 -4
  33. package/.output/server/chunks/routes/api/studio/run.post.mjs.map +1 -1
  34. package/.output/server/package.json +1 -1
  35. package/README.md +3 -1
  36. package/package.json +4 -3
  37. package/server/api/editor-types.get.ts +2 -23
  38. package/server/api/studio/run.post.ts +18 -6
  39. package/server/utils/editor-types.json +1 -0
  40. package/.output/public/_nuxt/builds/meta/51f1351c-0667-4235-9ddc-16582a51ce03.json +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"editor-types.get.mjs","sources":["../../../../../server/api/editor-types.get.ts"],"names":["require"],"mappings":";;;;;;;;;;;;;;;;;;;;AAKA,MAAAA,SAAA,GAAA,aAAA,CAAA,UAAA,CAAA,YAAA,CAAA,GAAA,CAAA;AACA,MAAA,UAAA,OAAA,CAAA,OAAA,CAAAA,UAAA,OAAA,CAAA,QAAA,CAAA,CAAA,CAAA;AACA,IAAA,WAAA;AAEA,eAAA,OAAA,CAAA,WAAA,KAAA,EAAA;AACA,EAAA,KAAA,MAAA,KAAA,IAAA,MAAA,OAAA,CAAA,SAAA,EAAA,EAAA,aAAA,EAAA,IAAA,EAAA,CAAA,EAAA;AACA,IAAA,MAAA,IAAA,GAAA,IAAA,CAAA,SAAA,EAAA,KAAA,CAAA,IAAA,CAAA;AACA,IAAA,IAAA,MAAA,WAAA,EAAA,EAAA,MAAA,OAAA,CAAA,MAAA,KAAA,CAAA;AAAA,SAAA,IACA,KAAA,CAAA,IAAA,CAAA,QAAA,CAAA,OAAA,CAAA,EAAA;AACA,MAAA,KAAA,CAAA,CAAA,yBAAA,EAAA,QAAA,CAAA,OAAA,EAAA,IAAA,EAAA,UAAA,CAAA,IAAA,EAAA,GAAA,CAAA,CAAA,CAAA,CAAA,GAAA,MAAA,QAAA,CAAA,MAAA,MAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;AAEA,wBAAA,kBAAA,CAAA,CAAA,KAAA,KAAA;AACA,EAAA,SAAA,CAAA,KAAA,EAAA,iBAAA,sBAAA,CAAA;AACA,EAAA,WAAA,KAAA,WAAA,GAAA,CAAA,YAAA;AACA,IAAA,MAAA,QAAA,EAAA;AACA,IAAA,MAAA,OAAA,CAAA,IAAA,CAAA,OAAA,EAAA,IAAA,GAAA,KAAA,CAAA;AACA,IAAA,OAAA,KAAA;AAAA,EACA,CAAA,GAAA,CAAA;AACA,EAAA,OAAA,WAAA;AACA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"editor-types.get.mjs","sources":["../../../../../server/api/editor-types.get.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,wBAAA,kBAAA,CAAA,CAAA,KAAA,KAAA;AACA,EAAA,SAAA,CAAA,KAAA,EAAA,iBAAA,sBAAA,CAAA;AACA,EAAA,OAAA,WAAA;AACA,CAAA,CAAA;;;;"}
@@ -18,16 +18,21 @@ import 'consola';
18
18
 
19
19
  const run_post = defineEventHandler(async (event) => {
20
20
  if (!useRuntimeConfig(event).public.isDocsMode) {
21
- throw createError({ statusCode: 403, message: "Use the local Studio endpoint in CLI mode." });
21
+ throw createError({
22
+ statusCode: 403,
23
+ message: "Use the local Studio endpoint in CLI mode."
24
+ });
22
25
  }
23
- const socketPath = process.env.STUDIO_RUNNER_SOCKET;
24
- if (!socketPath) throw createError({ statusCode: 503, message: "Studio runner is not configured." });
26
+ const socketPath = process.env.STUDIO_RUNNER_SOCKET || "/run/zod-studio/runner.sock";
25
27
  const body = await readStudioRequest(event);
26
28
  try {
27
29
  return await runInContainer(body, socketPath);
28
30
  } catch (error) {
29
31
  if (error == null ? void 0 : error.statusCode) throw error;
30
- throw createError({ statusCode: 503, message: "Studio runner is unavailable. Try again shortly." });
32
+ throw createError({
33
+ statusCode: 503,
34
+ message: "Studio runner is unavailable. Try again shortly."
35
+ });
31
36
  }
32
37
  });
33
38
 
@@ -1 +1 @@
1
- {"version":3,"file":"run.post.mjs","sources":["../../../../../../server/api/studio/run.post.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAIA,iBAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;AACA,EAAA,IAAA,CAAA,gBAAA,CAAA,KAAA,CAAA,CAAA,OAAA,UAAA,EAAA;AACA,IAAA,MAAA,YAAA,EAAA,UAAA,EAAA,GAAA,EAAA,OAAA,EAAA,8CAAA,CAAA;AAAA,EACA;AACA,EAAA,MAAA,UAAA,GAAA,QAAA,GAAA,CAAA,oBAAA;AACA,EAAA,IAAA,CAAA,YAAA,MAAA,WAAA,CAAA,EAAA,UAAA,EAAA,GAAA,EAAA,OAAA,EAAA,kCAAA,EAAA,CAAA;AACA,EAAA,MAAA,IAAA,GAAA,MAAA,iBAAA,CAAA,KAAA,CAAA;AACA,EAAA,IAAA;AAAA,IAAA,OAAA,MAAA,cAAA,CAAA,IAAA,EAAA,UAAA,CAAA;AAAA,EAAA,SACA,KAAA,EAAA;AACA,IAAA,IAAA,KAAA,IAAA,IAAA,GAAA,MAAA,GAAA,KAAA,CAAA,YAAA,MAAA,KAAA;AACA,IAAA,MAAA,YAAA,EAAA,UAAA,EAAA,GAAA,EAAA,OAAA,EAAA,oDAAA,CAAA;AAAA,EACA;AACA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"run.post.mjs","sources":["../../../../../../server/api/studio/run.post.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAIA,iBAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;AACA,EAAA,IAAA,CAAA,gBAAA,CAAA,KAAA,CAAA,CAAA,OAAA,UAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,OAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AACA,EAAA,MAAA,UAAA,GACA,OAAA,CAAA,GAAA,CAAA,oBAAA,IAAA,6BAAA;AAMA,EAAA,MAAA,IAAA,GAAA,MAAA,iBAAA,CAAA,KAAA,CAAA;AACA,EAAA,IAAA;AACA,IAAA,OAAA,MAAA,cAAA,CAAA,IAAA,EAAA,UAAA,CAAA;AAAA,EACA,SAAA,KAAA,EAAA;AACA,IAAA,IAAA,KAAA,IAAA,IAAA,GAAA,MAAA,GAAA,KAAA,CAAA,YAAA,MAAA,KAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,OAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AACA,CAAA,CAAA;;;;"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nullix/zod-mongoose-studio-prod",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "dependencies": {
package/README.md CHANGED
@@ -153,6 +153,8 @@ Local CLI mode continues to run directly, binds to `127.0.0.1`, and checks API h
153
153
 
154
154
  Running `pnpm --filter @nullix/zod-mongoose-studio dev` also uses the local parse endpoint, without Docker. In docs mode the editors remain usable without a runner, but Run reports that the runner is unavailable until the container and `STUDIO_RUNNER_SOCKET` are configured.
155
155
 
156
+ The Monaco Zod declarations are bundled from `server/utils/editor-types.json`; production does not read declaration files from `node_modules`. After updating Zod, regenerate that file with `pnpm --filter @nullix/zod-mongoose-studio generate:editor-types` and commit it with the dependency update.
157
+
156
158
  ## Project Structure
157
159
 
158
160
  ```text
@@ -178,4 +180,4 @@ Please refer to the monorepo root for development and contribution guidelines.
178
180
 
179
181
  ## License
180
182
 
181
- MIT
183
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nullix/zod-mongoose-studio",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "description": "Monaco-powered TypeScript playground for @nullix/zod-mongoose",
5
5
  "main": "./nuxt.config.ts",
6
6
  "bin": {
@@ -45,7 +45,7 @@
45
45
  "mongoose": "9.6.3",
46
46
  "open": "11.0.0",
47
47
  "zod": "4.3.6",
48
- "@nullix/zod-mongoose": "3.3.1"
48
+ "@nullix/zod-mongoose": "3.3.2"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@nuxt/ui": "4.6.0",
@@ -58,7 +58,8 @@
58
58
  "vue-tsc": "3.2.6"
59
59
  },
60
60
  "scripts": {
61
- "build": "nuxt build || echo 'Build finished with warnings'",
61
+ "generate:editor-types": "node scripts/generate-editor-types.mjs",
62
+ "build": "nuxt build",
62
63
  "dev": "nuxt dev -p 34003",
63
64
  "generate": "nuxt generate",
64
65
  "preview": "nuxt preview",
@@ -1,28 +1,7 @@
1
- import { readdir, readFile } from "node:fs/promises";
2
- import { dirname, join, relative } from "node:path";
3
- import { createRequire } from "node:module";
4
1
  import { setHeader } from "h3";
5
-
6
- const require = createRequire(import.meta.url);
7
- const zodRoot = dirname(dirname(require.resolve("zod/v4")));
8
- let cachedTypes: Promise<Record<string, string>> | undefined;
9
-
10
- async function collect(directory: string, files: Record<string, string>) {
11
- for (const entry of await readdir(directory, { withFileTypes: true })) {
12
- const path = join(directory, entry.name);
13
- if (entry.isDirectory()) await collect(path, files);
14
- else if (entry.name.endsWith(".d.ts")) {
15
- files[`file:///node_modules/zod/${relative(zodRoot, path).replaceAll("\\", "/")}`] = await readFile(path, "utf8");
16
- }
17
- }
18
- }
2
+ import editorTypes from "../utils/editor-types.json";
19
3
 
20
4
  export default defineEventHandler((event) => {
21
5
  setHeader(event, "Cache-Control", "public, max-age=3600");
22
- cachedTypes ||= (async () => {
23
- const files: Record<string, string> = {};
24
- await collect(join(zodRoot, "v4"), files);
25
- return files;
26
- })();
27
- return cachedTypes;
6
+ return editorTypes;
28
7
  });
@@ -4,14 +4,26 @@ import { runInContainer } from "../../utils/runner-client";
4
4
 
5
5
  export default defineEventHandler(async (event) => {
6
6
  if (!useRuntimeConfig(event).public.isDocsMode) {
7
- throw createError({ statusCode: 403, message: "Use the local Studio endpoint in CLI mode." });
7
+ throw createError({
8
+ statusCode: 403,
9
+ message: "Use the local Studio endpoint in CLI mode.",
10
+ });
8
11
  }
9
- const socketPath = process.env.STUDIO_RUNNER_SOCKET;
10
- if (!socketPath) throw createError({ statusCode: 503, message: "Studio runner is not configured." });
12
+ const socketPath =
13
+ process.env.STUDIO_RUNNER_SOCKET || "/run/zod-studio/runner.sock";
14
+ if (!socketPath)
15
+ throw createError({
16
+ statusCode: 503,
17
+ message: "Studio runner is not configured.",
18
+ });
11
19
  const body = await readStudioRequest(event);
12
- try { return await runInContainer(body, socketPath); }
13
- catch (error: any) {
20
+ try {
21
+ return await runInContainer(body, socketPath);
22
+ } catch (error: any) {
14
23
  if (error?.statusCode) throw error;
15
- throw createError({ statusCode: 503, message: "Studio runner is unavailable. Try again shortly." });
24
+ throw createError({
25
+ statusCode: 503,
26
+ message: "Studio runner is unavailable. Try again shortly.",
27
+ });
16
28
  }
17
29
  });