Skip to content

Commit

Permalink
chore(sanity): generated types with --enforce-required-fields
Browse files Browse the repository at this point in the history
  • Loading branch information
scottrippey committed Jul 15, 2024
1 parent 5af961d commit b207b7e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test:unit:watch": "jest --watch",
"lint": "next lint --quiet",
"typecheck": "tsc --noEmit",
"codegen": "cd sanity-studio && sanity schema extract && mv schema.json generated/schema.json && sanity typegen generate"
"codegen": "cd sanity-studio && sanity schema extract --enforce-required-fields && mv schema.json generated/schema.json && sanity typegen generate"
},
"dependencies": {
"@sanity/client": "^6.21.0",
Expand Down
30 changes: 15 additions & 15 deletions packages/nextjs/sanity-studio/generated/sanity.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export type Variant = {
_createdAt: string;
_updatedAt: string;
_rev: string;
name?: string;
slug?: Slug;
name: string;
slug: Slug;
description?: Array<{
children?: Array<{
marks?: Array<string>;
Expand All @@ -95,8 +95,8 @@ export type Variant = {
_key: string;
}>;
id?: string;
msrp?: number;
price?: number;
msrp: number;
price: number;
images?: Array<{
asset?: {
_ref: string;
Expand All @@ -106,7 +106,7 @@ export type Variant = {
};
hotspot?: SanityImageHotspot;
crop?: SanityImageCrop;
name?: string;
name: string;
description?: string;
_type: "productImage";
_key: string;
Expand Down Expand Up @@ -134,7 +134,7 @@ export type Style = {
_updatedAt: string;
_rev: string;
name?: string;
slug?: Slug;
slug: Slug;
};

export type SiteSettings = {
Expand All @@ -157,7 +157,7 @@ export type ProductImage = {
};
hotspot?: SanityImageHotspot;
crop?: SanityImageCrop;
name?: string;
name: string;
description?: string;
};

Expand All @@ -167,7 +167,7 @@ export type Product = {
_createdAt: string;
_updatedAt: string;
_rev: string;
name?: string;
name: string;
description?: Array<{
children?: Array<{
marks?: Array<string>;
Expand All @@ -186,7 +186,7 @@ export type Product = {
_type: "block";
_key: string;
}>;
slug?: Slug;
slug: Slug;
categories?: Array<{
_ref: string;
_type: "reference";
Expand Down Expand Up @@ -215,7 +215,7 @@ export type Flavour = {
_updatedAt: string;
_rev: string;
name?: string;
slug?: Slug;
slug: Slug;
};

export type Description = Array<{
Expand Down Expand Up @@ -243,9 +243,9 @@ export type CategoryImage = {
_createdAt: string;
_updatedAt: string;
_rev: string;
name?: string;
name: string;
description?: string;
images?: {
images: {
asset?: {
_ref: string;
_type: "reference";
Expand Down Expand Up @@ -321,9 +321,9 @@ export type Category = {
_createdAt: string;
_updatedAt: string;
_rev: string;
name?: string;
name: string;
description?: string;
slug?: Slug;
slug: Slug;
images?: Array<{
_ref: string;
_type: "reference";
Expand All @@ -335,7 +335,7 @@ export type Category = {

export type Slug = {
_type: "slug";
current?: string;
current: string;
source?: string;
};

Expand Down
30 changes: 15 additions & 15 deletions packages/nextjs/sanity-studio/generated/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,15 @@
"value": {
"type": "string"
},
"optional": true
"optional": false
},
"slug": {
"type": "objectAttribute",
"value": {
"type": "inline",
"name": "slug"
},
"optional": true
"optional": false
},
"description": {
"type": "objectAttribute",
Expand Down Expand Up @@ -566,14 +566,14 @@
"value": {
"type": "number"
},
"optional": true
"optional": false
},
"price": {
"type": "objectAttribute",
"value": {
"type": "number"
},
"optional": true
"optional": false
},
"images": {
"type": "objectAttribute",
Expand Down Expand Up @@ -633,7 +633,7 @@
"value": {
"type": "string"
},
"optional": true
"optional": false
},
"description": {
"type": "objectAttribute",
Expand Down Expand Up @@ -803,7 +803,7 @@
"type": "inline",
"name": "slug"
},
"optional": true
"optional": false
}
}
},
Expand Down Expand Up @@ -922,7 +922,7 @@
"value": {
"type": "string"
},
"optional": true
"optional": false
},
"description": {
"type": "objectAttribute",
Expand Down Expand Up @@ -974,7 +974,7 @@
"value": {
"type": "string"
},
"optional": true
"optional": false
},
"description": {
"type": "objectAttribute",
Expand Down Expand Up @@ -1161,7 +1161,7 @@
"type": "inline",
"name": "slug"
},
"optional": true
"optional": false
},
"categories": {
"type": "objectAttribute",
Expand Down Expand Up @@ -1323,7 +1323,7 @@
"type": "inline",
"name": "slug"
},
"optional": true
"optional": false
}
}
},
Expand Down Expand Up @@ -1546,7 +1546,7 @@
"value": {
"type": "string"
},
"optional": true
"optional": false
},
"description": {
"type": "objectAttribute",
Expand Down Expand Up @@ -1615,7 +1615,7 @@
}
}
},
"optional": true
"optional": false
}
}
},
Expand Down Expand Up @@ -1996,7 +1996,7 @@
"value": {
"type": "string"
},
"optional": true
"optional": false
},
"description": {
"type": "objectAttribute",
Expand All @@ -2011,7 +2011,7 @@
"type": "inline",
"name": "slug"
},
"optional": true
"optional": false
},
"images": {
"type": "objectAttribute",
Expand Down Expand Up @@ -2077,7 +2077,7 @@
"value": {
"type": "string"
},
"optional": true
"optional": false
},
"source": {
"type": "objectAttribute",
Expand Down

0 comments on commit b207b7e

Please sign in to comment.