Skip to content

Commit

Permalink
fix(cli): detectedFramework CLI context type
Browse files Browse the repository at this point in the history
  • Loading branch information
juice49 committed Oct 23, 2024
1 parent 4e2206f commit 5a5a7e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/@sanity/cli/src/actions/init-project/initProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import path from 'node:path'

import {type DatasetAclMode, type SanityProject} from '@sanity/client'
import {type Framework} from '@vercel/frameworks'
import {type detectFrameworkRecord} from '@vercel/fs-detectors'
import dotenv from 'dotenv'
import execa, {type CommonOptions} from 'execa'
import {deburr, noop} from 'lodash'
Expand Down Expand Up @@ -112,7 +113,9 @@ export interface ProjectOrganization {
// eslint-disable-next-line max-statements, complexity
export default async function initSanity(
args: CliCommandArguments<InitFlags>,
context: CliCommandContext & {detectedFramework: Framework | null},
context: CliCommandContext & {
detectedFramework: Awaited<ReturnType<typeof detectFrameworkRecord>>
},
): Promise<void> {
const {
output,
Expand Down Expand Up @@ -336,7 +339,6 @@ export default async function initSanity(
const isUsingReact19 = semver.coerce(reactVersion)?.major === 19
if (
detectedFramework?.slug === 'nextjs' &&
// @ts-expect-error - Detected version is not typed into Framework interface
detectedFramework?.detectedVersion?.startsWith('15') &&
isUsingReact19
) {
Expand Down

0 comments on commit 5a5a7e4

Please sign in to comment.