diff --git a/build.config.ts b/build.config.ts index 4595e48..4732d79 100644 --- a/build.config.ts +++ b/build.config.ts @@ -7,7 +7,8 @@ export default defineBuildConfig({ rollup: { emitCJS: true, esbuild: { - minify: true, + minifySyntax: true, + minifyIdentifiers: true, }, }, entries: ["src/index"], diff --git a/src/env.ts b/src/env.ts index fada504..32e1222 100644 --- a/src/env.ts +++ b/src/env.ts @@ -5,11 +5,11 @@ export type EnvObject = Record; const _getEnv = (useShim?: boolean) => globalThis.process?.env || import.meta.env || - globalThis.Deno?.env.toObject() || + /* @__PURE__ */ globalThis.Deno?.env.toObject() || globalThis.__env__ || (useShim ? _envShim : globalThis); -export const env = new Proxy(_envShim, { +export const env = /* @__PURE__ */ new Proxy(_envShim, { get(_, prop) { const env = _getEnv(); return env[prop as any] ?? _envShim[prop]; diff --git a/src/flags.ts b/src/flags.ts index 3f2e964..3c9eb09 100644 --- a/src/flags.ts +++ b/src/flags.ts @@ -6,10 +6,11 @@ import { toBoolean } from "./_utils"; export const platform = globalThis.process?.platform || ""; /** Detect if `CI` environment variable is set or a provider CI detected */ -export const isCI = toBoolean(env.CI) || providerInfo.ci !== false; +export const isCI = + /* @__PURE__ */ toBoolean(env.CI) || providerInfo.ci !== false; /** Detect if stdout.TTY is available */ -export const hasTTY = toBoolean( +export const hasTTY = /* @__PURE__ */ toBoolean( globalThis.process?.stdout && globalThis.process?.stdout.isTTY, ); @@ -18,10 +19,10 @@ export const hasTTY = toBoolean( export const hasWindow = typeof window !== "undefined"; /** Detect if `DEBUG` environment variable is set */ -export const isDebug = toBoolean(env.DEBUG); +export const isDebug = /* @__PURE__ */ toBoolean(env.DEBUG); /** Detect if `NODE_ENV` environment variable is `test` */ -export const isTest = nodeENV === "test" || toBoolean(env.TEST); +export const isTest = nodeENV === "test" || /* @__PURE__ */ toBoolean(env.TEST); /** Detect if `NODE_ENV` environment variable is `production` */ export const isProduction = nodeENV === "production"; @@ -30,7 +31,8 @@ export const isProduction = nodeENV === "production"; export const isDevelopment = nodeENV === "dev" || nodeENV === "development"; /** Detect if MINIMAL environment variable is set, running in CI or test or TTY is unavailable */ -export const isMinimal = toBoolean(env.MINIMAL) || isCI || isTest || !hasTTY; +export const isMinimal = + /* @__PURE__ */ toBoolean(env.MINIMAL) || isCI || isTest || !hasTTY; /** Detect if process.platform is Windows */ export const isWindows = /^win/i.test(platform); @@ -43,12 +45,15 @@ export const isMacOS = /^darwin/i.test(platform); /** Color Support */ export const isColorSupported = - !toBoolean(env.NO_COLOR) && - (toBoolean(env.FORCE_COLOR) || + /* @__PURE__ */ !toBoolean(env.NO_COLOR) && + /* @__PURE__ */ (toBoolean(env.FORCE_COLOR) || ((hasTTY || isWindows) && env.TERM !== "dumb") || isCI); /** Node.js versions */ export const nodeVersion = - (globalThis.process?.versions?.node || "").replace(/^v/, "") || null; + /* @__PURE__ */ (globalThis.process?.versions?.node || "").replace( + /^v/, + "", + ) || null; export const nodeMajorVersion = Number(nodeVersion?.split(".")[0]) || null; diff --git a/src/process.ts b/src/process.ts index 7da7deb..4d2f822 100644 --- a/src/process.ts +++ b/src/process.ts @@ -13,7 +13,7 @@ const processShims: Partial = { versions: {}, }; -export const process = new Proxy(_process, { +export const process = /* @__PURE__ */ new Proxy(_process, { get(target, prop: keyof Process) { if (prop === "env") { return env; diff --git a/src/providers.ts b/src/providers.ts index 75441ec..6e55215 100644 --- a/src/providers.ts +++ b/src/providers.ts @@ -150,5 +150,5 @@ function _detectProvider(): ProviderInfo { } /** Current provider info */ -export const providerInfo = _detectProvider(); +export const providerInfo = /* @__PURE__ */ _detectProvider(); export const provider: ProviderName = providerInfo.name; diff --git a/src/runtimes.ts b/src/runtimes.ts index 644ccfc..9655617 100644 --- a/src/runtimes.ts +++ b/src/runtimes.ts @@ -71,6 +71,6 @@ function _detectRuntime(): RuntimeInfo | undefined { } } -export const runtimeInfo = _detectRuntime(); +export const runtimeInfo = /* @__PURE__ */ _detectRuntime(); export const runtime: RuntimeName = runtimeInfo?.name || "";