Skip to content

Commit

Permalink
chore(sanity): added codegen script
Browse files Browse the repository at this point in the history
  • Loading branch information
scottrippey committed Jul 15, 2024
1 parent 8f61abf commit a91807e
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 33 deletions.
5 changes: 3 additions & 2 deletions packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
"test:unit": "jest",
"test:unit:watch": "jest --watch",
"lint": "next lint --quiet",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"codegen": "cd sanity-studio && sanity schema extract && mv schema.json generated/schema.json && sanity typegen generate"
},
"dependencies": {
"@sanity/client": "^6.20.2",
"@sanity/client": "^6.21.0",
"@sanity/dashboard": "^3.1.6",
"@sanity/image-url": "^1.0.2",
"@sanity/schema": "^3.49.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/nextjs/sanity-studio/sanity-typegen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"schema": "./generated/schema.json",
"generates": "./generated/sanity.types.ts"
}
3 changes: 3 additions & 0 deletions packages/nextjs/sanity.cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ export default defineCliConfig({
projectId: "5bsv02jj",
dataset: "production",
},
project: {
basePath: "./sanity-studio",
},
});
62 changes: 31 additions & 31 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a91807e

Please sign in to comment.