Repository: nuxt/nuxt
File: packages/nuxt/src/core/nuxt.ts (TypeScript)

Code before:
  '@nuxt/kit': '@nuxt/kit-nightly',
}

export const keyDependencies = [
  '@nuxt/kit',
]

let warnedAboutCompatDate = false

async function initNuxt (nuxt: Nuxt) {
  // Register user hooks
  for (const config of nuxt.options._layers.map(layer => layer.config).reverse()) {
    if (config.hooks) {
      nuxt.hooks.addHooks(config.hooks)
    }
  }

  // Prompt to set compatibility date
  nuxt.options.compatibilityDate = resolveCompatibilityDatesFromEnv(nuxt.options.compatibilityDate)

  if (!nuxt.options.compatibilityDate.default) {
    nuxt.options.compatibilityDate.default = fallbackCompatibilityDate

    if (nuxt.options.dev && hasTTY && !isCI && !nuxt.options.test && !warnedAboutCompatDate) {
      warnedAboutCompatDate = true
      consola.warn(`Please add \`compatibilityDate: '${formatDate('latest')}'\` to your \`nuxt.config\` file or set the COMPATIBILITY_DATE environment variable.\nUsing \`${fallbackCompatibilityDate}\` as fallback. More info at: ${colors.underline('https://nitro.build/deploy#compatibility-date')}`)
    }
  }

  // Restart Nuxt when layer directories are added or removed
  const layersDir = withTrailingSlash(resolve(nuxt.options.rootDir, 'layers'))
  nuxt.hook('builder:watch', (event, relativePath) => {
    const path = resolve(nuxt.options.srcDir, relativePath)
    if (event === 'addDir' || event === 'unlinkDir') {
      if (path.startsWith(layersDir)) {
        return nuxt.callHook('restart', { hard: true })
      }
    }
  })
  const coreTypePackages = nuxt.options.typescript.hoist || []

  // Disable environment types entirely if `typescript.builder` is false
  if (nuxt.options.typescript.builder !== false) {
    const envMap = {
      // defaults from `builder` based on package name
      '@nuxt/rspack-builder': '@rspack/core/module',
      '@nuxt/vite-builder': 'vite/client',
      '@nuxt/webpack-builder': 'webpack/module',
      // simpler overrides from `typescript.builder` for better DX
      'rspack': '@rspack/core/module',
      'vite': 'vite/client',

Review comment (suggestion):
```suggestion
      consola.warn(`We recommend to add \`compatibilityDate: '${formatDate('latest')}'\` to your \`nuxt.config\` file or set the COMPATIBILITY_DATE environment variable.\nUsing \`${fallbackCompatibilityDate}\` as fallback. More info at: ${colors.underline('https://nitro.build/deploy#compatibility-date')}`)
```

Code after:
  '@nuxt/kit': '@nuxt/kit-nightly',
}

export const keyDependencies = [
  '@nuxt/kit',
]

let warnedAboutCompatDate = false

async function initNuxt (nuxt: Nuxt) {
  // Register user hooks
  for (const config of nuxt.options._layers.map(layer => layer.config).reverse()) {
    if (config.hooks) {
      nuxt.hooks.addHooks(config.hooks)
    }
  }

  // Prompt to set compatibility date
  nuxt.options.compatibilityDate = resolveCompatibilityDatesFromEnv(nuxt.options.compatibilityDate)

  if (!nuxt.options.compatibilityDate.default) {
    nuxt.options.compatibilityDate.default = fallbackCompatibilityDate

    if (nuxt.options.dev && hasTTY && !isCI && !nuxt.options.test && !warnedAboutCompatDate) {
      warnedAboutCompatDate = true
      consola.warn(`We recommend adding \`compatibilityDate: '${formatDate('latest')}'\` to your \`nuxt.config\` file.\nUsing \`${fallbackCompatibilityDate}\` as fallback. More info at: ${colors.underline('https://nitro.build/deploy#compatibility-date')}`)
    }
  }

  // Restart Nuxt when layer directories are added or removed
  const layersDir = withTrailingSlash(resolve(nuxt.options.rootDir, 'layers'))
  nuxt.hook('builder:watch', (event, relativePath) => {
    const path = resolve(nuxt.options.srcDir, relativePath)
    if (event === 'addDir' || event === 'unlinkDir') {
      if (path.startsWith(layersDir)) {
        return nuxt.callHook('restart', { hard: true })
      }
    }
  })
  const coreTypePackages = nuxt.options.typescript.hoist || []

  // Disable environment types entirely if `typescript.builder` is false
  if (nuxt.options.typescript.builder !== false) {
    const envMap = {
      // defaults from `builder` based on package name
      '@nuxt/rspack-builder': '@rspack/core/module',
      '@nuxt/vite-builder': 'vite/client',
      '@nuxt/webpack-builder': 'webpack/module',
      // simpler overrides from `typescript.builder` for better DX
      'rspack': '@rspack/core/module',
      'vite': 'vite/client',