diff --git a/src/commands/prepare.ts b/src/commands/prepare.ts index 4893027bd..e0768511b 100644 --- a/src/commands/prepare.ts +++ b/src/commands/prepare.ts @@ -1,7 +1,5 @@ import { relative, resolve } from 'pathe' import { consola } from 'consola' -// we are deliberately inlining this code as a backup in case user has `@nuxt/schema<3.7` -import { writeTypes as writeTypesLegacy } from '@nuxt/kit' import { defineCommand } from 'citty' import { clearBuildDir } from '../utils/fs' @@ -26,7 +24,7 @@ export default defineCommand({ const cwd = resolve(ctx.args.cwd || ctx.args.rootDir) - const { loadNuxt, buildNuxt, writeTypes = writeTypesLegacy } = await loadKit(cwd) + const { loadNuxt, buildNuxt, writeTypes } = await loadKit(cwd) const nuxt = await loadNuxt({ cwd, dotenv: { diff --git a/src/commands/typecheck.ts b/src/commands/typecheck.ts index e8cba01bf..7cfbaea46 100644 --- a/src/commands/typecheck.ts +++ b/src/commands/typecheck.ts @@ -5,9 +5,6 @@ import { defineCommand } from 'citty' import { isBun } from 'std-env' import { createJiti } from 'jiti' -// we are deliberately inlining this code as a backup in case user has `@nuxt/schema<3.7` -import { writeTypes as writeTypesLegacy } from '@nuxt/kit' - import { loadKit } from '../utils/kit' import { cwdArgs, legacyRootDirArgs, logLevelArgs } from './_shared' @@ -27,7 +24,7 @@ export default defineCommand({ const cwd = resolve(ctx.args.cwd || ctx.args.rootDir) - const { loadNuxt, buildNuxt, writeTypes = writeTypesLegacy } = await loadKit(cwd) + const { loadNuxt, buildNuxt, writeTypes } = await loadKit(cwd) const nuxt = await loadNuxt({ cwd, overrides: { diff --git a/src/utils/kit.ts b/src/utils/kit.ts index f87ea0bd4..eab772357 100644 --- a/src/utils/kit.ts +++ b/src/utils/kit.ts @@ -1,5 +1,3 @@ -// we are deliberately inlining this code as a backup in case user has `@nuxt/schema<3.7` -import { writeTypes as writeTypesLegacy } from '@nuxt/kit' import { createJiti } from 'jiti' export const loadKit = async (rootDir: string): Promise => { @@ -11,8 +9,12 @@ export const loadKit = async (rootDir: string): Promise { + throw new Error('`writeTypes` is not available in this version of `@nuxt/kit`. Please upgrade to v3.7 or newer.') + }, + } } return kit }