chore: upgrade to std-env 3 (#1665)

This commit is contained in:
pooya parsa 2021-11-03 15:39:38 +01:00 committed by GitHub
parent 6f934aa9d9
commit c8b07a6a1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 14 deletions

View File

@ -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"

View File

@ -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.

View File

@ -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.

View File

@ -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",

View File

@ -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

View File

@ -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
}

View File

@ -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: