npm @sanity/cli 3.53.0

latest releases: 3.63.0, 3.59.2-corel.355, 3.59.2-corel.354...
3 months ago

Install or upgrade Sanity Studio

To initiate a new Sanity Studio project or upgrade an existing one, please refer to our comprehensive guide on Installing and Upgrading Sanity Studio.

If you are updating from a version earlier than 3.37.0, you should also check out this article to ensure your dependencies are up to date.

Improved Sanity Client and TypeGen integration

With the new defineQuery utility it is no longer necessary to pass generics into client.fetch calls for the sanity typegen command to generate type definitions for query results. 🥳
Update @sanity/client to v6.21.0 or later, then add "overloadClientMethods": true to your sanity-typegen.json configuration file, and finally wrap your query strings in the new defineQuery utility method from groq:

import {createClient} from '@sanity/client'
-import groq from 'groq'
+import {defineQuery} from 'groq'
-import type { SettingsQueryResult } from "~/sanity.types";

const client = createClient({ /* ... */ })

-const settingsQuery = groq`
+const settingsQuery = defineQuery(`
  *[_type == "settings"][0]
-`
+`)

-const settings = await client.fetch<SettingsQueryResult>(settingsQuery)
+const settings = await client.fetch(settingsQuery)

Huge thanks to @romeovs for championing this feature!

🐛 Notable bugfixes

  • Fixes default messaging in the environment variable file created by sanity init --env
  • Fixes an issue that could cause wrong list counts in the Portable Text Editor
  • Fixes an issue that could cause malformed strings to appear in documents passed to migration scripts
  • Fixes several issues that could cause "missing context" errors in certain environments
  • Fixes an issue causing the Presence avatar overlays on form fields not to appear when Sanity Studio is embedded in a React 19 app

📓 Full changelog

Author Message Commit
renovate[bot] fix(deps): update dependency react-rx to v4 (#7266) a9b9feb
Simeon Griggs feat: embellish nextjs blog starter (#7258) 0fc8216
renovate[bot] chore(deps): update linters (#7285) eebb27b
renovate[bot] chore(deps): update dependency turbo to ^2.0.10 (#7284) ecc74b4
Cody Olsen chore: remove agressive npmrc options (#7282) 8e99272
renovate[bot] chore(deps): update dependency @sanity/tsdoc to v1.0.87 (#7287) cade4c7
Cody Olsen fix: remove react hooks linter suppressions in PT hooks (#7222) f5cac7b
Cody Olsen fix: ensure search context provider value is memoized (#7200) edf7560
Espen Hovlandsdal chore(test-studio): add workspace for us based dataset (#7293) 9f60cdc
Simeon Griggs fix(cli): don't prepend message about .env.local if creating .env.local (#7288) ec27de0
renovate[bot] fix(deps): Update dev-non-major (#7294) 8d47f3e
renovate[bot] chore(deps): update dependency @sanity/pkg-utils to v6.10.8 (#7278) 9ac527f
renovate[bot] fix(deps): update dependency @portabletext/editor to ^1.0.10 (#7290) e5e2c89
renovate[bot] chore(deps): update dependency @sanity/tsdoc to v1.0.88 (#7296) b221828
renovate[bot] chore(deps): update dependency @bjoerge/mutiny to ^0.7.0 (#7274) 9edbcd9
renovate[bot] chore(deps): update dependency @sanity/tsdoc to v1.0.88 (#7295) e32932c
Christian Grøngaard fix(core): correctly reset PTE list counts (#7286) acbc351
renovate[bot] chore(deps): update dependency turbo to ^2.0.11 (#7300) 1b21691
renovate[bot] chore(deps): update dependency eslint-config-turbo to ^2.0.11 (#7299) 45bfdd0
Geoff Ball Update types.ts c041d28
renovate[bot] fix(deps): update dependency @sanity/presentation to v1.16.3 (#7302) cc744df
renovate[bot] chore(deps): update dependency @bjoerge/mutiny to ^0.7.1 (#7306) 6a6c4bf
renovate[bot] fix(deps): Update dev-non-major (#7307) fe40caf
Cody Olsen feat(codegen): generate SanityQueries interface in @sanity/codegen (#6997) (#7304) 886ab25
renovate[bot] chore(deps): update dependency @sanity/pkg-utils to v6.10.9 (#7313) 33c3c7b
renovate[bot] chore(deps): update dependency @sanity/tsdoc to v1.0.90 (#7314) ffaf81b
renovate[bot] chore(deps): update dependency @sanity/tsdoc to v1.0.90 (#7315) e5563b6
Rico Kahler fix(cli): dedupe styled-components in vite config (#7310) e82e815
Rico Kahler refactor: flatten _singletons and increase usage of sanity/_createContext (#7311) c512fa7
renovate[bot] fix(deps): update dependency @portabletext/editor to ^1.0.11 (#7316) cec7b12
Binoy Patel chore(deps): updates ora to ^8.0.1 (#7320) 327e5b4
renovate[bot] fix(deps): update dependency @portabletext/editor to ^1.0.11 (#7317) de01242
renovate[bot] chore(deps): update dependency lerna to ^8.1.8 (#7322) d53ab33
Cody Olsen refactor: remove prefersLatestPublished handling (#7305) 542b07b
Cody Olsen fix: support field presence avatars on react 19 (#7308) 8d003e8
Bjørge Næss fix(migrate): properly decode chunks of multibyte unicode strings (#7321) ba4d4a8
Sindre Gulseth feat(typegen): add location of discovered query (#7327) d77e3ad
Sindre Gulseth chore(typegen): trace overloadClientMethods usage (#7326) 68fe8cd

Don't miss a new cli release

NewReleases is sending notifications on new releases.