Skip to content

Commit

Permalink
chore(cli): rename auto updates flag
Browse files Browse the repository at this point in the history
  • Loading branch information
binoy14 committed May 31, 2024
1 parent 0f6e8e9 commit 88a4b62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/@sanity/cli/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ export interface CliConfig {

vite?: UserViteConfig

unstable_enableAutoUpdates?: boolean
autoUpdates?: boolean
}

export type UserViteConfig =
Expand Down
12 changes: 6 additions & 6 deletions packages/sanity/src/_internal/cli/actions/build/buildAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface BuildSanityStudioCommandFlags {
'minify'?: boolean
'stats'?: boolean
'source-maps'?: boolean
'enable-auto-updates'?: boolean
'auto-updates'?: boolean
}

export default async function buildSanityStudio(
Expand Down Expand Up @@ -54,11 +54,11 @@ export default async function buildSanityStudio(
return {didCompile: false}
}

const enableAutoUpdates =
flags['enable-auto-updates'] ||
(cliConfig && 'unstable_enableAutoUpdates' in cliConfig && cliConfig.unstable_enableAutoUpdates)
const autoUpdatesEnabled =
flags['auto-updates'] ||
(cliConfig && 'autoUpdates' in cliConfig && cliConfig.autoUpdates === true)

if (enableAutoUpdates) {
if (autoUpdatesEnabled) {
output.print(`${info} Building with auto-updates enabled`)
}

Expand Down Expand Up @@ -120,7 +120,7 @@ export default async function buildSanityStudio(

let importMap

if (enableAutoUpdates) {
if (autoUpdatesEnabled) {
const version = encodeURIComponent(`^${installedSanityVersion}`)
const autoUpdatesImports = {
'sanity': `https://api.sanity.work/v1/modules/sanity/default/${version}`,
Expand Down

0 comments on commit 88a4b62

Please sign in to comment.