-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Sanity example deps and implementation (#65744)
- Uses the new `presentationTool.resolve.locations` instead of `presentationTool.locate` API, which doesn't require wrangling `rxjs`. - Sets up the new `presentationTool.resolve.mainDocuments` API, which automatically opens up the post you're previewing on the left side in the editor on the right side. - Removes the `sanity-typegen.json` config file as `sanity typegen` now looks for top level `app` and `sanity` folders by default. - Enables `^` semver ranges for deps again now that our turbopack support is stable, so that we only have to send you PRs when bumping majors or changing the implementation itself. - Sets up `sanity.config.ts` so it's possible to use `npx sanity dev` for quickly iterating on schemas.
- Loading branch information
Showing
7 changed files
with
79 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,9 @@ | |
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
/studio/dist | ||
# sanity | ||
/.sanity/ | ||
/dist/ | ||
|
||
# misc | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
import { loadEnvConfig } from "@next/env"; | ||
import { defineCliConfig } from "sanity/cli"; | ||
|
||
const dev = process.env.NODE_ENV !== "production"; | ||
loadEnvConfig(__dirname, dev, { info: () => null, error: console.error }); | ||
|
||
const projectId = process.env.NEXT_PUBLIC_SANITY_PROJECT_ID; | ||
const dataset = process.env.NEXT_PUBLIC_SANITY_DATASET; | ||
|
||
export default defineCliConfig({ api: { projectId, dataset } }); | ||
export default defineCliConfig({ | ||
api: { projectId, dataset }, | ||
vite: { | ||
define: { | ||
"process.env.NEXT_PUBLIC_SANITY_PROJECT_ID": JSON.stringify(projectId), | ||
"process.env.NEXT_PUBLIC_SANITY_DATASET": JSON.stringify(dataset), | ||
}, | ||
resolve: { | ||
alias: { | ||
"@": __dirname, | ||
}, | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.