@uni-helper/uni-env 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/index.cjs +3 -28
- package/dist/{index.js → index.mjs} +1 -4
- package/package.json +14 -14
- /package/dist/{index.d.ts → index.d.mts} +0 -0
package/README.md
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
<a href="https://www.npmjs.com/package/@uni-helper/uni-env"><img src="https://img.shields.io/npm/dm/@uni-helper/uni-env?colorA=005947&colorB=eee&style=for-the-badge"></a>
|
|
6
6
|
<a href="https://www.npmjs.com/package/@uni-helper/uni-env"><img src="https://img.shields.io/npm/v/@uni-helper/uni-env?colorA=005947&colorB=eee&style=for-the-badge"></a>
|
|
7
7
|
|
|
8
|
+
[](https://deepwiki.com/uni-helper/uni-env)
|
|
9
|
+
|
|
8
10
|
在 uni-app 中优雅地判断当前环境。
|
|
9
11
|
|
|
10
12
|
## 安装
|
package/dist/index.cjs
CHANGED
|
@@ -1,28 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
const std_env = __toESM(require("std-env"));
|
|
25
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let std_env = require("std-env");
|
|
26
3
|
//#region src/utils.ts
|
|
27
4
|
function toBoolean(val) {
|
|
28
5
|
return val ? val !== "false" : false;
|
|
@@ -36,7 +13,6 @@ function parseJSON(val) {
|
|
|
36
13
|
}
|
|
37
14
|
return obj;
|
|
38
15
|
}
|
|
39
|
-
|
|
40
16
|
//#endregion
|
|
41
17
|
//#region src/index.ts
|
|
42
18
|
const builtInPlatforms = [
|
|
@@ -458,7 +434,6 @@ const isSSRClient = toBoolean(std_env.env.UNI_SSR_CLIENT);
|
|
|
458
434
|
const ssrServer = std_env.env.UNI_SSR_SERVER;
|
|
459
435
|
/** Detect if `process.env.UNI_SSR_SERVER` is set */
|
|
460
436
|
const isSSRServer = toBoolean(std_env.env.UNI_SSR_SERVER);
|
|
461
|
-
|
|
462
437
|
//#endregion
|
|
463
438
|
exports.appChangedFiles = appChangedFiles;
|
|
464
439
|
exports.appChangedPages = appChangedPages;
|
|
@@ -549,4 +524,4 @@ exports.utsModuleType = utsModuleType;
|
|
|
549
524
|
exports.utsPlatform = utsPlatform;
|
|
550
525
|
exports.utsTargetLanguage = utsTargetLanguage;
|
|
551
526
|
exports.uvue = uvue;
|
|
552
|
-
exports.uvueTargetLanguage = uvueTargetLanguage;
|
|
527
|
+
exports.uvueTargetLanguage = uvueTargetLanguage;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { env } from "std-env";
|
|
2
|
-
|
|
3
2
|
//#region src/utils.ts
|
|
4
3
|
function toBoolean(val) {
|
|
5
4
|
return val ? val !== "false" : false;
|
|
@@ -13,7 +12,6 @@ function parseJSON(val) {
|
|
|
13
12
|
}
|
|
14
13
|
return obj;
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
//#endregion
|
|
18
16
|
//#region src/index.ts
|
|
19
17
|
const builtInPlatforms = [
|
|
@@ -435,6 +433,5 @@ const isSSRClient = toBoolean(env.UNI_SSR_CLIENT);
|
|
|
435
433
|
const ssrServer = env.UNI_SSR_SERVER;
|
|
436
434
|
/** Detect if `process.env.UNI_SSR_SERVER` is set */
|
|
437
435
|
const isSSRServer = toBoolean(env.UNI_SSR_SERVER);
|
|
438
|
-
|
|
439
436
|
//#endregion
|
|
440
|
-
export { appChangedFiles, appChangedPages, appCodeSpliting, appHarmonyProjectPath, appPackType, appPlatform, appX, appXCacheDir, appXPageCount, appXSetup, appXSingleThread, appXTsc, appXUVueScriptEngine, automatorAppWebview, automatorAppWebviewSrc, automatorWsEndpoint, builtInPlatforms, cliContext, compileCloudDir, compileTarget, compiler, compilerVersion, compilerVersionType, customContext, customDefine, customScript, darkMode, h5Base, h5Browser, hasDarkMode, hasSourcemap, hbuilderxPlugins, hxDependenciesDir, hxUseBaseType, hxVersion, inputDir, isApp, isAppAndroid, isAppHarmony, isAppIOS, isAppPlus, isAppX, isH5, isH5Alipay, isH5Weibo, isH5Weixin, isMinimize, isMp, isMp360, isMpAlipay, isMpBaidu, isMpHarmony, isMpJD, isMpKuaishou, isMpLark, isMpPlugin, isMpQQ, isMpToutiao, isMpWeixin, isMpXHS, isQuickapp, isQuickappHuawei, isQuickappUnion, isSSRClient, isSSRServer, isUVue, isWeb, minimize, modulesEncryptCacheDir, mpPlugin, nvueAppStyles, nvueCompiler, nvueStyleCompiler, outputDir, platform, renderer, rendererNative, sourcemap, ssrClient, ssrServer, statTitleJson, subPlatform, subpackage, utsJsCodeFormat, utsModulePrefix, utsModuleType, utsPlatform, utsTargetLanguage, uvue, uvueTargetLanguage };
|
|
437
|
+
export { appChangedFiles, appChangedPages, appCodeSpliting, appHarmonyProjectPath, appPackType, appPlatform, appX, appXCacheDir, appXPageCount, appXSetup, appXSingleThread, appXTsc, appXUVueScriptEngine, automatorAppWebview, automatorAppWebviewSrc, automatorWsEndpoint, builtInPlatforms, cliContext, compileCloudDir, compileTarget, compiler, compilerVersion, compilerVersionType, customContext, customDefine, customScript, darkMode, h5Base, h5Browser, hasDarkMode, hasSourcemap, hbuilderxPlugins, hxDependenciesDir, hxUseBaseType, hxVersion, inputDir, isApp, isAppAndroid, isAppHarmony, isAppIOS, isAppPlus, isAppX, isH5, isH5Alipay, isH5Weibo, isH5Weixin, isMinimize, isMp, isMp360, isMpAlipay, isMpBaidu, isMpHarmony, isMpJD, isMpKuaishou, isMpLark, isMpPlugin, isMpQQ, isMpToutiao, isMpWeixin, isMpXHS, isQuickapp, isQuickappHuawei, isQuickappUnion, isSSRClient, isSSRServer, isUVue, isWeb, minimize, modulesEncryptCacheDir, mpPlugin, nvueAppStyles, nvueCompiler, nvueStyleCompiler, outputDir, platform, renderer, rendererNative, sourcemap, ssrClient, ssrServer, statTitleJson, subPlatform, subpackage, utsJsCodeFormat, utsModulePrefix, utsModuleType, utsPlatform, utsTargetLanguage, uvue, uvueTargetLanguage };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uni-helper/uni-env",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.2",
|
|
5
5
|
"description": "在 uni-app 中优雅地判断当前环境。",
|
|
6
6
|
"author": "KeJun",
|
|
7
7
|
"maintainers": [
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
28
|
"import": {
|
|
29
|
-
"types": "./dist/index.d.
|
|
30
|
-
"default": "./dist/index.
|
|
29
|
+
"types": "./dist/index.d.mts",
|
|
30
|
+
"default": "./dist/index.mjs"
|
|
31
31
|
},
|
|
32
32
|
"require": {
|
|
33
33
|
"types": "./dist/index.d.cts",
|
|
@@ -35,24 +35,24 @@
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
-
"main": "./dist/index.
|
|
39
|
-
"module": "./dist/index.
|
|
40
|
-
"types": "./dist/index.d.
|
|
38
|
+
"main": "./dist/index.mjs",
|
|
39
|
+
"module": "./dist/index.mjs",
|
|
40
|
+
"types": "./dist/index.d.mts",
|
|
41
41
|
"files": [
|
|
42
42
|
"dist"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"std-env": "^3.
|
|
45
|
+
"std-env": "^3.10.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@antfu/eslint-config": "^
|
|
49
|
-
"@types/node": "^
|
|
50
|
-
"bumpp": "^
|
|
51
|
-
"eslint": "^
|
|
48
|
+
"@antfu/eslint-config": "^8.2.0",
|
|
49
|
+
"@types/node": "^24.12.3",
|
|
50
|
+
"bumpp": "^11.1.0",
|
|
51
|
+
"eslint": "^10.3.0",
|
|
52
52
|
"esno": "^4.8.0",
|
|
53
|
-
"tsdown": "^0.
|
|
54
|
-
"typescript": "^5.9.
|
|
55
|
-
"vitest": "^
|
|
53
|
+
"tsdown": "^0.22.0",
|
|
54
|
+
"typescript": "^5.9.3",
|
|
55
|
+
"vitest": "^4.1.5"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsdown",
|
|
File without changes
|