@uni-helper/uni-env 0.1.3 → 0.1.5
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/dist/index.cjs +72 -62
- package/dist/index.d.cts +116 -72
- package/dist/index.d.mts +116 -72
- package/dist/index.d.ts +116 -72
- package/dist/index.mjs +67 -63
- package/package.json +16 -9
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const stdEnv = require('std-env');
|
|
4
|
-
|
|
5
3
|
function toBoolean(val) {
|
|
6
4
|
return val ? val !== "false" : false;
|
|
7
5
|
}
|
|
@@ -15,15 +13,16 @@ function parseJSON(val) {
|
|
|
15
13
|
return obj;
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
const builtInPlatforms = ["h5", "web", "app", "app-plus", "mp-360", "mp-alipay", "mp-baidu", "mp-qq", "mp-toutiao", "mp-weixin", "mp-kuaishou", "mp-lark", "mp-jd", "mp-xhs", "quickapp-webview", "quickapp-webview-huawei", "quickapp-webview-union"];
|
|
19
|
-
const platform =
|
|
20
|
-
const appPlatform =
|
|
21
|
-
const subPlatform =
|
|
22
|
-
const utsPlatform =
|
|
16
|
+
const builtInPlatforms = ["h5", "web", "app", "app-plus", "app-harmony", "mp-360", "mp-alipay", "mp-baidu", "mp-qq", "mp-toutiao", "mp-weixin", "mp-kuaishou", "mp-lark", "mp-jd", "mp-xhs", "quickapp-webview", "quickapp-webview-huawei", "quickapp-webview-union"];
|
|
17
|
+
const platform = process.env.UNI_PLATFORM;
|
|
18
|
+
const appPlatform = process.env.UNI_APP_PLATFORM;
|
|
19
|
+
const subPlatform = process.env.UNI_SUB_PLATFORM;
|
|
20
|
+
const utsPlatform = process.env.UNI_UTS_PLATFORM;
|
|
23
21
|
const isH5 = platform === "h5";
|
|
24
22
|
const isWeb = platform === "web";
|
|
25
23
|
const isApp = platform === "app";
|
|
26
24
|
const isAppPlus = platform === "app-plus";
|
|
25
|
+
const isAppHarmony = platform === "app-harmony";
|
|
27
26
|
const isAppAndroid = appPlatform === "android" || utsPlatform === "app-android";
|
|
28
27
|
const isAppIOS = appPlatform === "ios" || utsPlatform === "app-ios";
|
|
29
28
|
const isMp = /^mp-/i.test(platform);
|
|
@@ -36,65 +35,72 @@ const isMpToutiao = platform === "mp-toutiao";
|
|
|
36
35
|
const isQuickapp = /^quickapp-webview/i.test(platform);
|
|
37
36
|
const isQuickappUnion = platform === "quickapp-webview-union";
|
|
38
37
|
const isQuickappHuawei = platform === "quickapp-webview-huawei";
|
|
39
|
-
const utsJsCodeFormat =
|
|
40
|
-
const utsModuleType =
|
|
41
|
-
const utsModulePrefix =
|
|
42
|
-
const utsTargetLanguage =
|
|
43
|
-
const inputDir =
|
|
44
|
-
const outputDir =
|
|
45
|
-
const cliContext =
|
|
46
|
-
const subpackage =
|
|
47
|
-
const mpPlugin =
|
|
48
|
-
const isMpPlugin = toBoolean(
|
|
49
|
-
const compilerVersion =
|
|
50
|
-
const compilerVersionType =
|
|
51
|
-
const hbuilderxPlugins =
|
|
52
|
-
const renderer =
|
|
53
|
-
const nvueCompiler =
|
|
54
|
-
const nvueStyleCompiler =
|
|
55
|
-
const appCodeSpliting =
|
|
56
|
-
const automatorWsEndpoint =
|
|
57
|
-
const automatorAppWebview =
|
|
58
|
-
const automatorAppWebviewSrc =
|
|
59
|
-
const h5Base =
|
|
60
|
-
const h5Browser =
|
|
61
|
-
const customScript =
|
|
62
|
-
const customDefine =
|
|
63
|
-
const customContext =
|
|
64
|
-
const minimize =
|
|
65
|
-
const isMinimize = toBoolean(
|
|
66
|
-
const uvue =
|
|
67
|
-
const isUVue = toBoolean(
|
|
68
|
-
const uvueTargetLanguage =
|
|
69
|
-
const compiler =
|
|
70
|
-
const rendererNative =
|
|
71
|
-
const nvueAppStyles =
|
|
72
|
-
const appChangedFiles =
|
|
73
|
-
const appChangedPages =
|
|
74
|
-
const darkMode =
|
|
75
|
-
const hasDarkMode = toBoolean(
|
|
76
|
-
const hxUseBaseType =
|
|
77
|
-
const hxDependenciesDir =
|
|
78
|
-
const appX =
|
|
79
|
-
const isAppX = toBoolean(
|
|
80
|
-
const appXCacheDir =
|
|
81
|
-
const hxVersion =
|
|
82
|
-
const appXPageCount =
|
|
83
|
-
const appXTsc =
|
|
84
|
-
const appXSingleThread =
|
|
85
|
-
const appXSetup =
|
|
86
|
-
const appXUVueScriptEngine =
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
const
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
const
|
|
38
|
+
const utsJsCodeFormat = process.env.UNI_UTS_JS_CODE_FORMAT;
|
|
39
|
+
const utsModuleType = process.env.UNI_UTS_MODULE_TYPE;
|
|
40
|
+
const utsModulePrefix = process.env.UNI_UTS_MODULE_PREFIX;
|
|
41
|
+
const utsTargetLanguage = process.env.UNI_UTS_TARGET_LANGUAGE;
|
|
42
|
+
const inputDir = process.env.UNI_INPUT_DIR;
|
|
43
|
+
const outputDir = process.env.UNI_OUTPUT_DIR;
|
|
44
|
+
const cliContext = process.env.UNI_CLI_CONTEXT;
|
|
45
|
+
const subpackage = process.env.UNI_SUBPACKAGE;
|
|
46
|
+
const mpPlugin = process.env.UNI_MP_PLUGIN;
|
|
47
|
+
const isMpPlugin = toBoolean(process.env.UNI_MP_PLUGIN);
|
|
48
|
+
const compilerVersion = process.env.UNI_COMPILER_VERSION;
|
|
49
|
+
const compilerVersionType = process.env.UNI_COMPILER_VERSION_TYPE;
|
|
50
|
+
const hbuilderxPlugins = process.env.UNI_HBUILDERX_PLUGINS;
|
|
51
|
+
const renderer = process.env.UNI_RENDERER;
|
|
52
|
+
const nvueCompiler = process.env.UNI_NVUE_COMPILER;
|
|
53
|
+
const nvueStyleCompiler = process.env.UNI_NVUE_STYLE_COMPILER;
|
|
54
|
+
const appCodeSpliting = process.env.UNI_APP_CODE_SPLITING;
|
|
55
|
+
const automatorWsEndpoint = process.env.UNI_AUTOMATOR_WS_ENDPOINT;
|
|
56
|
+
const automatorAppWebview = process.env.UNI_AUTOMATOR_APP_WEBVIEW;
|
|
57
|
+
const automatorAppWebviewSrc = process.env.UNI_AUTOMATOR_APP_WEBVIEW_SRC;
|
|
58
|
+
const h5Base = process.env.UNI_H5_BASE;
|
|
59
|
+
const h5Browser = process.env.UNI_H5_BROWSER;
|
|
60
|
+
const customScript = process.env.UNI_CUSTOM_SCRIPT;
|
|
61
|
+
const customDefine = process.env.UNI_CUSTOM_DEFINE;
|
|
62
|
+
const customContext = process.env.UNI_CUSTOM_CONTEXT;
|
|
63
|
+
const minimize = process.env.UNI_MINIMIZE;
|
|
64
|
+
const isMinimize = toBoolean(process.env.UNI_MINIMIZE);
|
|
65
|
+
const uvue = process.env.UNI_UVUE;
|
|
66
|
+
const isUVue = toBoolean(process.env.UNI_MINIMIZE);
|
|
67
|
+
const uvueTargetLanguage = process.env.UNI_UVUE_TARGET_LANGUAGE;
|
|
68
|
+
const compiler = process.env.UNI_COMPILER;
|
|
69
|
+
const rendererNative = process.env.UNI_RENDERER_NATIVE;
|
|
70
|
+
const nvueAppStyles = process.env.UNI_NVUE_APP_STYLES;
|
|
71
|
+
const appChangedFiles = process.env.UNI_APP_CHANGED_FILES;
|
|
72
|
+
const appChangedPages = process.env.UNI_APP_CHANGED_PAGES;
|
|
73
|
+
const darkMode = process.env.VUE_APP_DARK_MODE;
|
|
74
|
+
const hasDarkMode = toBoolean(process.env.VUE_APP_DARK_MODE);
|
|
75
|
+
const hxUseBaseType = process.env.HX_USE_BASE_TYPE;
|
|
76
|
+
const hxDependenciesDir = process.env.HX_DEPENDENCIES_DIR;
|
|
77
|
+
const appX = process.env.UNI_APP_X;
|
|
78
|
+
const isAppX = toBoolean(process.env.UNI_APP_X);
|
|
79
|
+
const appXCacheDir = process.env.UNI_APP_X_CACHE_DIR;
|
|
80
|
+
const hxVersion = process.env.HX_VERSION;
|
|
81
|
+
const appXPageCount = process.env.UNI_APP_X_PAGE_COUNT;
|
|
82
|
+
const appXTsc = process.env.UNI_APP_X_TSC;
|
|
83
|
+
const appXSingleThread = process.env.UNI_APP_X_SINGLE_THREAD;
|
|
84
|
+
const appXSetup = process.env.UNI_APP_X_SETUP;
|
|
85
|
+
const appXUVueScriptEngine = process.env.UNI_APP_X_UVUE_SCRIPT_ENGINE;
|
|
86
|
+
const compileTarget = process.env.UNI_COMPILE_TARGET;
|
|
87
|
+
const compileCloudDir = process.env.UNI_COMPILE_CLOUD_DIR;
|
|
88
|
+
const modulesEncryptCacheDir = process.env.UNI_MODULES_ENCRYPT_CACHE_DIR;
|
|
89
|
+
const appPackType = process.env.UNI_APP_PACK_TYPE;
|
|
90
|
+
const appHarmonyProjectPath = process.env.UNI_APP_HARMONY_PROJECT_PATH;
|
|
91
|
+
const statTitleJson = parseJSON(process.env.STAT_TITLE_JSON);
|
|
92
|
+
const sourcemap = process.env.SOURCEMAP;
|
|
93
|
+
const hasSourcemap = toBoolean(process.env.SOURCEMAP);
|
|
94
|
+
const ssrClient = process.env.UNI_SSR_CLIENT;
|
|
95
|
+
const isSSRClient = toBoolean(process.env.UNI_SSR_CLIENT);
|
|
96
|
+
const ssrServer = process.env.UNI_SSR_SERVER;
|
|
97
|
+
const isSSRServer = toBoolean(process.env.UNI_SSR_SERVER);
|
|
94
98
|
|
|
95
99
|
exports.appChangedFiles = appChangedFiles;
|
|
96
100
|
exports.appChangedPages = appChangedPages;
|
|
97
101
|
exports.appCodeSpliting = appCodeSpliting;
|
|
102
|
+
exports.appHarmonyProjectPath = appHarmonyProjectPath;
|
|
103
|
+
exports.appPackType = appPackType;
|
|
98
104
|
exports.appPlatform = appPlatform;
|
|
99
105
|
exports.appX = appX;
|
|
100
106
|
exports.appXCacheDir = appXCacheDir;
|
|
@@ -108,6 +114,8 @@ exports.automatorAppWebviewSrc = automatorAppWebviewSrc;
|
|
|
108
114
|
exports.automatorWsEndpoint = automatorWsEndpoint;
|
|
109
115
|
exports.builtInPlatforms = builtInPlatforms;
|
|
110
116
|
exports.cliContext = cliContext;
|
|
117
|
+
exports.compileCloudDir = compileCloudDir;
|
|
118
|
+
exports.compileTarget = compileTarget;
|
|
111
119
|
exports.compiler = compiler;
|
|
112
120
|
exports.compilerVersion = compilerVersion;
|
|
113
121
|
exports.compilerVersionType = compilerVersionType;
|
|
@@ -126,6 +134,7 @@ exports.hxVersion = hxVersion;
|
|
|
126
134
|
exports.inputDir = inputDir;
|
|
127
135
|
exports.isApp = isApp;
|
|
128
136
|
exports.isAppAndroid = isAppAndroid;
|
|
137
|
+
exports.isAppHarmony = isAppHarmony;
|
|
129
138
|
exports.isAppIOS = isAppIOS;
|
|
130
139
|
exports.isAppPlus = isAppPlus;
|
|
131
140
|
exports.isAppX = isAppX;
|
|
@@ -147,6 +156,7 @@ exports.isSSRServer = isSSRServer;
|
|
|
147
156
|
exports.isUVue = isUVue;
|
|
148
157
|
exports.isWeb = isWeb;
|
|
149
158
|
exports.minimize = minimize;
|
|
159
|
+
exports.modulesEncryptCacheDir = modulesEncryptCacheDir;
|
|
150
160
|
exports.mpPlugin = mpPlugin;
|
|
151
161
|
exports.nvueAppStyles = nvueAppStyles;
|
|
152
162
|
exports.nvueCompiler = nvueCompiler;
|