Sanity logosanity.ioAll Systems Operational© Sanity 2026
Change Site Theme
Sanity logo

Documentation

    • Overview
    • Platform introduction
    • Next.js quickstart
    • Nuxt.js quickstart
    • Astro quickstart
    • React Router quickstart
    • Studio quickstart
    • Build with AI
    • Content Lake
    • Functions
    • APIs and SDKs
    • Agent Actions
    • Visual Editing
    • Blueprints
    • Platform management
    • Dashboard
    • Studio
    • Canvas
    • Media Library
    • App SDK
    • Content Agent
    • HTTP API
    • CLI
    • Libraries
    • Specifications
    • Changelog
    • User guides
    • Developer guides
    • Courses and certifications
    • Join the community
    • Templates

Changelog

Track new features, improvements, and fixes across all Sanity products.

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

On this page

Back to Changelog
  1. Changelog
  2. Sanity Studio

Sanity Studio update: Enhancements to Studio initialization and migration commands, and bugfix for image/file assets in structure lists

Published: June 4, 2024

v3.45.0
Sanity Studio

Installation and upgrading

To initiate a new Studio without installing the CLI globally:

npm create sanity@latest
pnpm create sanity@latest
yarn create sanity@latest
bun create sanity@latest

To upgrade a v3 Studio, run this command in its folder:

npm install sanity@latest
pnpm add sanity@latest
yarn add sanity@latest
bun add sanity@latest

✨ Highlights

  • The studio initialization command now allows you to specify a package manager with a flag in a single line. This was previously only possible to do via an interactive CLI prompt. You can now skip this step:
npm create sanity@latest -- --package-manager pnpm
pnpm create sanity@latest --package-manager pnpm
yarn create sanity@latest --package-manager pnpm
bun create sanity@latest --package-manager pnpm
  • The dryRun parameter is now available in the context provided for the defineMigration command available from sanity/migrate. This allows developers to write scripts that skip certain actions (for example, mutating external data stores) if it is only a dry run. An example might look like this:
import { defineMigration } from "sanity/migrate"

/**
 * Run this migration with
 * `npx sanity migration run my-migration`
 */
export default defineMigration({
  title: "my-migration",

  // pass whether the migration is a dry-run as context
  async *migrate(documents, { dryRun }) {
    for await (const document of documents()) {
      if(dryRun) {
        // Only log the effect
        console.log(`Something happened`)
      } else {
        // Execute the side-effect
        await thirdPartyRequest()
      }
      // ... do something with the document, maybe yield patches
    }
  },
})

🐛 Notable bugfixes

  • Fixes an issue where image/file assets would not be listed in Structure lists, even if specified to do so.

Related documentation

  • Init

On this page

  • Installation and upgrading
Back to Changelog
npm create sanity@latest
pnpm create sanity@latest
yarn create sanity@latest
bun create sanity@latest
npm install sanity@latest
pnpm add sanity@latest
yarn add sanity@latest
bun add sanity@latest
npm create sanity@latest -- --package-manager pnpm
pnpm create sanity@latest --package-manager pnpm
yarn create sanity@latest --package-manager pnpm
bun create sanity@latest --package-manager pnpm

Related documentation

  • Init

npm create sanity@latest
npm create sanity@latest
pnpm create sanity@latest
pnpm create sanity@latest
yarn create sanity@latest
yarn create sanity@latest
bun create sanity@latest
bun create sanity@latest
npm install sanity@latest
npm install sanity@latest
pnpm add sanity@latest
pnpm add sanity@latest
yarn add sanity@latest
yarn add sanity@latest
bun add sanity@latest
bun add sanity@latest
npm create sanity@latest -- --package-manager pnpm
npm create sanity@latest -- --package-manager pnpm
pnpm create sanity@latest --package-manager pnpm
pnpm create sanity@latest --package-manager pnpm
yarn create sanity@latest --package-manager pnpm
yarn create sanity@latest --package-manager pnpm
bun create sanity@latest --package-manager pnpm
bun create sanity@latest --package-manager pnpm
import { defineMigration } from "sanity/migrate"

/**
 * Run this migration with
 * `npx sanity migration run my-migration`
 */
export default defineMigration({
  title: "my-migration",

  // pass whether the migration is a dry-run as context
  async *migrate(documents, { dryRun }) {
    for await (const document of documents()) {
      if(dryRun) {
        // Only log the effect
        console.log(`Something happened`)
      } else {
        // Execute the side-effect
        await thirdPartyRequest()
      }
      // ... do something with the document, maybe yield patches
    }
  },
})