diff --git a/packages/kit/package.json b/packages/kit/package.json index 7f460d9714..a1e9f91c1f 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -34,7 +34,7 @@ "rc9": "^1.2.0", "scule": "^0.2.1", "semver": "^7.3.5", - "std-env": "^2.3.1", + "std-env": "3.0.0-0", "ufo": "^0.7.9", "unctx": "^1.0.2", "untyped": "^0.2.11" diff --git a/packages/kit/src/config/schema/_common.ts b/packages/kit/src/config/schema/_common.ts index fe7d96937f..8883507c51 100644 --- a/packages/kit/src/config/schema/_common.ts +++ b/packages/kit/src/config/schema/_common.ts @@ -1,5 +1,5 @@ import { join, resolve } from 'pathe' -import env from 'std-env' +import { isDevelopment } from 'std-env' import createRequire from 'create-require' import { pascalCase } from 'scule' import jiti from 'jiti' @@ -81,13 +81,13 @@ export default { * @version 2 * @version 3 */ - dev: Boolean(env.dev), + dev: Boolean(isDevelopment), /** * Whether your app is being unit tested * @version 2 */ - test: Boolean(env.test), + test: Boolean(isDevelopment), /** * Set to true to enable debug mode. diff --git a/packages/kit/src/config/schema/build.ts b/packages/kit/src/config/schema/build.ts index e9bf6dfaae..08979e7103 100644 --- a/packages/kit/src/config/schema/build.ts +++ b/packages/kit/src/config/schema/build.ts @@ -1,4 +1,4 @@ -import env from 'std-env' +import { isCI, isTest } from 'std-env' import { hasProtocol } from 'ufo' export default { @@ -10,7 +10,7 @@ export default { * @see [std-env](https://github.com/unjs/std-env) * @version 2 */ - quiet: Boolean(env.ci || env.test), + quiet: Boolean(isCI || isTest), /** * Nuxt uses `webpack-bundle-analyzer` to visualize your bundles and how to optimize them. diff --git a/packages/nitro/package.json b/packages/nitro/package.json index 404024c8db..687a960731 100644 --- a/packages/nitro/package.json +++ b/packages/nitro/package.json @@ -63,7 +63,7 @@ "rollup-plugin-visualizer": "^5.5.2", "serve-placeholder": "^1.2.4", "serve-static": "^1.14.1", - "std-env": "^2.3.1", + "std-env": "3.0.0-0", "table": "^6.7.2", "ufo": "^0.7.9", "unenv": "^0.4.0", diff --git a/packages/nitro/src/rollup/plugins/middleware.ts b/packages/nitro/src/rollup/plugins/middleware.ts index d6ca60651f..86c071fad4 100644 --- a/packages/nitro/src/rollup/plugins/middleware.ts +++ b/packages/nitro/src/rollup/plugins/middleware.ts @@ -2,7 +2,7 @@ import hasha from 'hasha' import { relative } from 'pathe' import table from 'table' import isPrimitive from 'is-primitive' -import stdenv from 'std-env' +import { isDebug } from 'std-env' import type { ServerMiddleware } from '../../server/middleware' import virtual from './virtual' @@ -18,7 +18,7 @@ export function middleware (getMiddleware: () => ServerMiddleware[]) { load: () => { const middleware = getMiddleware() - if (stdenv.debug) { + if (isDebug) { const dumped = dumpMiddleware(middleware) if (dumped !== lastDump) { lastDump = dumped diff --git a/packages/nitro/src/utils/tree.ts b/packages/nitro/src/utils/tree.ts index 72ba7e4fb0..cc3f1c1648 100644 --- a/packages/nitro/src/utils/tree.ts +++ b/packages/nitro/src/utils/tree.ts @@ -4,10 +4,10 @@ import globby from 'globby' import prettyBytes from 'pretty-bytes' import gzipSize from 'gzip-size' import chalk from 'chalk' -import stdenv from 'std-env' +import { isTest } from 'std-env' export async function printFSTree (dir: string) { - if (stdenv.test) { + if (isTest) { return } diff --git a/yarn.lock b/yarn.lock index 114837855d..7fb7a565fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2893,7 +2893,7 @@ __metadata: rc9: ^1.2.0 scule: ^0.2.1 semver: ^7.3.5 - std-env: ^2.3.1 + std-env: 3.0.0-0 ufo: ^0.7.9 unbuild: latest unctx: ^1.0.2 @@ -2972,7 +2972,7 @@ __metadata: rollup-plugin-visualizer: ^5.5.2 serve-placeholder: ^1.2.4 serve-static: ^1.14.1 - std-env: ^2.3.1 + std-env: 3.0.0-0 table: ^6.7.2 ufo: ^0.7.9 unbuild: latest @@ -18931,7 +18931,14 @@ __metadata: languageName: node linkType: hard -"std-env@npm:^2.2.1, std-env@npm:^2.3.0, std-env@npm:^2.3.1": +"std-env@npm:3.0.0-0": + version: 3.0.0-0 + resolution: "std-env@npm:3.0.0-0" + checksum: 0a0b5daaafeadc570ebaa7b36603f3a04f43a6eb893feeeaaae3caa3d0a2fa6f3a5c0f9376bd8245c73d289b2c3b2176de0daa4f75de0f2c6c125e32a95880d8 + languageName: node + linkType: hard + +"std-env@npm:^2.2.1, std-env@npm:^2.3.0": version: 2.3.1 resolution: "std-env@npm:2.3.1" dependencies: