From bff1ec237b62e534ce5d5c5b42b6064dcffae9aa Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 7 May 2024 15:07:18 +0100 Subject: [PATCH] fix(nuxt): deprecate `process.*` flags (#27089) --- packages/nuxt/src/app/types/augments.d.ts | 29 +++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/packages/nuxt/src/app/types/augments.d.ts b/packages/nuxt/src/app/types/augments.d.ts index e9ea30b927..7779ba2420 100644 --- a/packages/nuxt/src/app/types/augments.d.ts +++ b/packages/nuxt/src/app/types/augments.d.ts @@ -1,20 +1,29 @@ import type { UseHeadInput } from '@unhead/vue' import type { NuxtApp, useNuxtApp } from '../nuxt' -interface NuxtStaticBuildFlags { - browser: boolean - client: boolean - dev: boolean - server: boolean - test: boolean -} - declare global { namespace NodeJS { - interface Process extends NuxtStaticBuildFlags {} + interface Process { + /** @deprecated Use `import.meta.browser` instead. This may be removed in Nuxt v5 or a future major version. */ + browser: boolean + /** @deprecated Use `import.meta.client` instead. This may be removed in Nuxt v5 or a future major version. */ + client: boolean + /** @deprecated Use `import.meta.dev` instead. This may be removed in Nuxt v5 or a future major version. */ + dev: boolean + /** @deprecated Use `import.meta.server` instead. This may be removed in Nuxt v5 or a future major version. */ + server: boolean + /** @deprecated Use `import.meta.test` instead. This may be removed in Nuxt v5 or a future major version. */ + test: boolean + } } - interface ImportMeta extends NuxtStaticBuildFlags {} + interface ImportMeta extends NuxtStaticBuildFlags { + browser: boolean + client: boolean + dev: boolean + server: boolean + test: boolean + } interface Window { __NUXT__?: Record