nuxtseo-shared 0.6.0 → 0.6.1

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.
@@ -1,9 +1,12 @@
1
+ import { z } from 'zod';
2
+
3
+ type Zod = typeof z;
1
4
  interface ContentSchemaOptions {
2
5
  /**
3
6
  * Pass the `z` instance from `@nuxt/content` to ensure `.editor()` works
4
7
  * across Zod versions. When omitted, the module's bundled `z` is used.
5
8
  */
6
- z?: any;
9
+ z?: Zod;
7
10
  }
8
11
  interface ContentEditorConfig {
9
12
  hidden?: boolean;
@@ -28,7 +31,7 @@ interface DefineContentSchemaConfig<TSchema = any, TDefineOptions extends Conten
28
31
  * Build the zod schema for this field. Receives the zod instance
29
32
  * (either the user's `@nuxt/content` patched version or the module's bundled one).
30
33
  */
31
- buildSchema: (z: any) => TSchema;
34
+ buildSchema: (z: Zod) => TSchema;
32
35
  /**
33
36
  * Module label for deprecation warnings (e.g. 'robots', 'sitemap').
34
37
  */
@@ -64,12 +67,16 @@ interface DefineContentSchemaConfig<TSchema = any, TDefineOptions extends Conten
64
67
  *
65
68
  * export { defineSchema as defineRobotsSchema, asCollection as asRobotsCollection, schema }
66
69
  */
67
- declare function createContentSchemaFactory<TSchema, TDefineOptions extends ContentSchemaOptions = ContentSchemaOptions>(config: DefineContentSchemaConfig<TSchema, TDefineOptions>, defaultZ: any): {
70
+ declare function createContentSchemaFactory<TSchema, TDefineOptions extends ContentSchemaOptions = ContentSchemaOptions>(config: DefineContentSchemaConfig<TSchema, TDefineOptions>, defaultZ: Zod): {
68
71
  defineSchema: (options?: TDefineOptions) => TSchema;
69
72
  asCollection: <T>(collection: any) => T;
70
- schema: any;
73
+ schema: z.ZodObject<z.ZodRawShape, "strip", z.ZodTypeAny, {
74
+ [x: string]: any;
75
+ }, {
76
+ [x: string]: any;
77
+ }>;
71
78
  fieldSchema: TSchema;
72
79
  };
73
80
 
74
81
  export { createContentSchemaFactory, withEditor, withEditorHidden };
75
- export type { ContentEditorConfig, ContentSchemaOptions, DefineContentSchemaConfig };
82
+ export type { ContentEditorConfig, ContentSchemaOptions, DefineContentSchemaConfig, Zod };
package/dist/content.d.ts CHANGED
@@ -1,9 +1,12 @@
1
+ import { z } from 'zod';
2
+
3
+ type Zod = typeof z;
1
4
  interface ContentSchemaOptions {
2
5
  /**
3
6
  * Pass the `z` instance from `@nuxt/content` to ensure `.editor()` works
4
7
  * across Zod versions. When omitted, the module's bundled `z` is used.
5
8
  */
6
- z?: any;
9
+ z?: Zod;
7
10
  }
8
11
  interface ContentEditorConfig {
9
12
  hidden?: boolean;
@@ -28,7 +31,7 @@ interface DefineContentSchemaConfig<TSchema = any, TDefineOptions extends Conten
28
31
  * Build the zod schema for this field. Receives the zod instance
29
32
  * (either the user's `@nuxt/content` patched version or the module's bundled one).
30
33
  */
31
- buildSchema: (z: any) => TSchema;
34
+ buildSchema: (z: Zod) => TSchema;
32
35
  /**
33
36
  * Module label for deprecation warnings (e.g. 'robots', 'sitemap').
34
37
  */
@@ -64,12 +67,16 @@ interface DefineContentSchemaConfig<TSchema = any, TDefineOptions extends Conten
64
67
  *
65
68
  * export { defineSchema as defineRobotsSchema, asCollection as asRobotsCollection, schema }
66
69
  */
67
- declare function createContentSchemaFactory<TSchema, TDefineOptions extends ContentSchemaOptions = ContentSchemaOptions>(config: DefineContentSchemaConfig<TSchema, TDefineOptions>, defaultZ: any): {
70
+ declare function createContentSchemaFactory<TSchema, TDefineOptions extends ContentSchemaOptions = ContentSchemaOptions>(config: DefineContentSchemaConfig<TSchema, TDefineOptions>, defaultZ: Zod): {
68
71
  defineSchema: (options?: TDefineOptions) => TSchema;
69
72
  asCollection: <T>(collection: any) => T;
70
- schema: any;
73
+ schema: z.ZodObject<z.ZodRawShape, "strip", z.ZodTypeAny, {
74
+ [x: string]: any;
75
+ }, {
76
+ [x: string]: any;
77
+ }>;
71
78
  fieldSchema: TSchema;
72
79
  };
73
80
 
74
81
  export { createContentSchemaFactory, withEditor, withEditorHidden };
75
- export type { ContentEditorConfig, ContentSchemaOptions, DefineContentSchemaConfig };
82
+ export type { ContentEditorConfig, ContentSchemaOptions, DefineContentSchemaConfig, Zod };
package/dist/devtools.mjs CHANGED
@@ -25,6 +25,7 @@ function setupDevToolsUI(config, resolve, nuxt = useNuxt()) {
25
25
  target: `http://localhost:${devPort}${route}`,
26
26
  changeOrigin: true,
27
27
  followRedirects: true,
28
+ ws: true,
28
29
  rewrite: (p) => p.replace(route, ""),
29
30
  configure: (proxy) => {
30
31
  proxy.on("error", (err, _req, res) => {
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.16.0"
6
6
  },
7
- "version": "0.6.0",
7
+ "version": "0.6.1",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxtseo-shared",
3
3
  "type": "module",
4
- "version": "0.6.0",
4
+ "version": "0.6.1",
5
5
  "description": "Shared utilities for Nuxt SEO modules.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",