@uni-helper/uni-env 0.1.7 → 0.2.0
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 +10 -28
- package/dist/index.cjs +438 -68
- package/dist/index.d.cts +22 -5
- package/dist/index.d.ts +22 -5
- package/dist/index.js +440 -0
- package/package.json +17 -16
- package/dist/index.d.mts +0 -503
- package/dist/index.mjs +0 -99
package/dist/index.d.mts
DELETED
|
@@ -1,503 +0,0 @@
|
|
|
1
|
-
type OptionalBooleanString = 'true' | 'false' | undefined;
|
|
2
|
-
type OptionalString = string | undefined;
|
|
3
|
-
/**
|
|
4
|
-
* `process.env.UNI_PLATFORM`
|
|
5
|
-
*
|
|
6
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L9}
|
|
7
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-uni-app.d.ts#L24}
|
|
8
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-uni-app.d.ts#L193-L211}
|
|
9
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L24}
|
|
10
|
-
*/
|
|
11
|
-
type BuiltInPlatform = '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';
|
|
12
|
-
declare const builtInPlatforms: BuiltInPlatform[];
|
|
13
|
-
/**
|
|
14
|
-
* `process.env.UNI_PLATFORM`
|
|
15
|
-
*
|
|
16
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L9}
|
|
17
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-uni-app.d.ts#L24}
|
|
18
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-uni-app.d.ts#L193-L211}
|
|
19
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L24}
|
|
20
|
-
*/
|
|
21
|
-
declare const platform: BuiltInPlatform;
|
|
22
|
-
/**
|
|
23
|
-
* `process.env.UNI_APP_PLATFORM`
|
|
24
|
-
*
|
|
25
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L10}
|
|
26
|
-
*/
|
|
27
|
-
type AppPlatform = 'android' | 'ios' | 'harmony' | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* `process.env.UNI_APP_PLATFORM`
|
|
30
|
-
*
|
|
31
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L10}
|
|
32
|
-
*/
|
|
33
|
-
declare const appPlatform: AppPlatform;
|
|
34
|
-
/**
|
|
35
|
-
* `process.env.UNI_SUB_PLATFORM`
|
|
36
|
-
*
|
|
37
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L11}
|
|
38
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L25-L27}
|
|
39
|
-
*/
|
|
40
|
-
type SubPlatform = 'quickapp-webview-huawei' | 'quickapp-webview-union' | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* `process.env.UNI_SUB_PLATFORM`
|
|
43
|
-
*
|
|
44
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L11}
|
|
45
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L25-L27}
|
|
46
|
-
*/
|
|
47
|
-
declare const subPlatform: SubPlatform;
|
|
48
|
-
/**
|
|
49
|
-
* `process.env.UNI_UTS_PLATFORM`
|
|
50
|
-
*
|
|
51
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L12}
|
|
52
|
-
*/
|
|
53
|
-
type UtsPlatform = BuiltInPlatform | 'app-android' | 'app-ios' | 'web';
|
|
54
|
-
/**
|
|
55
|
-
* `process.env.UNI_UTS_PLATFORM`
|
|
56
|
-
*
|
|
57
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L12}
|
|
58
|
-
*/
|
|
59
|
-
declare const utsPlatform: UtsPlatform;
|
|
60
|
-
/** Detect if `process.env.UNI_PLATFORM` is `h5` */
|
|
61
|
-
declare const isH5: boolean;
|
|
62
|
-
/** Detect if `process.env.UNI_PLATFORM` is `web` */
|
|
63
|
-
declare const isWeb: boolean;
|
|
64
|
-
/** Detect if `process.env.UNI_PLATFORM` is `app` */
|
|
65
|
-
declare const isApp: boolean;
|
|
66
|
-
/** Detect if `process.env.UNI_PLATFORM` is `app-plus` */
|
|
67
|
-
declare const isAppPlus: boolean;
|
|
68
|
-
/** Detect if `process.env.UNI_PLATFORM` is `app-harmony` */
|
|
69
|
-
declare const isAppHarmony: boolean;
|
|
70
|
-
/** Detect if `process.env.UNI_APP_PLATFORM` is `android` or if `process.env.UNI_UTS_PLATFORM` is `app-android` */
|
|
71
|
-
declare const isAppAndroid: boolean;
|
|
72
|
-
/** Detect if `process.env.UNI_APP_PLATFORM` is `ios` or if `process.env.UNI_UTS_PLATFORM` is `app-ios` */
|
|
73
|
-
declare const isAppIOS: boolean;
|
|
74
|
-
/** Detect if `process.env.UNI_PLATFORM` is `mp-*` */
|
|
75
|
-
declare const isMp: boolean;
|
|
76
|
-
/** Detect if `process.env.UNI_PLATFORM` is `mp-weixin` */
|
|
77
|
-
declare const isMpWeixin: boolean;
|
|
78
|
-
/** Detect if `process.env.UNI_PLATFORM` is `mp-alipay` */
|
|
79
|
-
declare const isMpAlipay: boolean;
|
|
80
|
-
/** Detect if `process.env.UNI_PLATFORM` is `mp-baidu` */
|
|
81
|
-
declare const isMpBaidu: boolean;
|
|
82
|
-
/** Detect if `process.env.UNI_PLATFORM` is `mp-kuaishou` */
|
|
83
|
-
declare const isMpKuaishou: boolean;
|
|
84
|
-
/** Detect if `process.env.UNI_PLATFORM` is `mp-qq` */
|
|
85
|
-
declare const isMpQQ: boolean;
|
|
86
|
-
/** Detect if `process.env.UNI_PLATFORM` is `mp-toutiao` */
|
|
87
|
-
declare const isMpToutiao: boolean;
|
|
88
|
-
/** Detect if `process.env.UNI_PLATFORM` is `quickapp-webview*` */
|
|
89
|
-
declare const isQuickapp: boolean;
|
|
90
|
-
/** Detect if `process.env.UNI_PLATFORM` is `quickapp-webview-union` */
|
|
91
|
-
declare const isQuickappUnion: boolean;
|
|
92
|
-
/** Detect if `process.env.UNI_PLATFORM` is `quickapp-webview-huawei` */
|
|
93
|
-
declare const isQuickappHuawei: boolean;
|
|
94
|
-
/**
|
|
95
|
-
* `process.env.UNI_UTS_JS_CODE_FORMAT`
|
|
96
|
-
*
|
|
97
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L14}
|
|
98
|
-
*/
|
|
99
|
-
type UtsJsCodeFormat = 'cjs' | 'es' | undefined;
|
|
100
|
-
/**
|
|
101
|
-
* `process.env.UNI_UTS_JS_CODE_FORMAT`
|
|
102
|
-
*
|
|
103
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L14}
|
|
104
|
-
*/
|
|
105
|
-
declare const utsJsCodeFormat: UtsJsCodeFormat;
|
|
106
|
-
/**
|
|
107
|
-
* `process.env.UNI_UTS_MODULE_TYPE`
|
|
108
|
-
*
|
|
109
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L15}
|
|
110
|
-
*/
|
|
111
|
-
type UtsModuleType = 'built-in' | '' | undefined;
|
|
112
|
-
/**
|
|
113
|
-
* `process.env.UNI_UTS_MODULE_TYPE`
|
|
114
|
-
*
|
|
115
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L15}
|
|
116
|
-
*/
|
|
117
|
-
declare const utsModuleType: UtsModuleType;
|
|
118
|
-
/**
|
|
119
|
-
* `process.env.UNI_UTS_MODULE_PREFIX`
|
|
120
|
-
*
|
|
121
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L16}
|
|
122
|
-
*/
|
|
123
|
-
declare const utsModulePrefix: OptionalString;
|
|
124
|
-
/**
|
|
125
|
-
* `process.env.UNI_UTS_TARGET_LANGUAGE`
|
|
126
|
-
*
|
|
127
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L17}
|
|
128
|
-
*/
|
|
129
|
-
type UtsTargetLanguage = 'javascript' | 'kotlin' | 'swift' | 'arkts' | undefined;
|
|
130
|
-
/**
|
|
131
|
-
* `process.env.UNI_UTS_TARGET_LANGUAGE`
|
|
132
|
-
*
|
|
133
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L17}
|
|
134
|
-
*/
|
|
135
|
-
declare const utsTargetLanguage: UtsTargetLanguage;
|
|
136
|
-
/**
|
|
137
|
-
* `process.env.UNI_INPUT_DIR`
|
|
138
|
-
*
|
|
139
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L19}
|
|
140
|
-
*/
|
|
141
|
-
declare const inputDir: OptionalString;
|
|
142
|
-
/**
|
|
143
|
-
* `process.env.UNI_OUTPUT_DIR`
|
|
144
|
-
*
|
|
145
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L20}
|
|
146
|
-
*/
|
|
147
|
-
declare const outputDir: OptionalString;
|
|
148
|
-
/**
|
|
149
|
-
* `process.env.UNI_CLI_CONTEXT`
|
|
150
|
-
*
|
|
151
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L21}
|
|
152
|
-
*/
|
|
153
|
-
declare const cliContext: OptionalString;
|
|
154
|
-
/**
|
|
155
|
-
* `process.env.UNI_SUBPACKAGE`
|
|
156
|
-
*
|
|
157
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L22}
|
|
158
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L31-L33}
|
|
159
|
-
*/
|
|
160
|
-
declare const subpackage: OptionalString;
|
|
161
|
-
/**
|
|
162
|
-
* `process.env.UNI_MP_PLUGIN`
|
|
163
|
-
*
|
|
164
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L23}
|
|
165
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L28-L30}
|
|
166
|
-
*/
|
|
167
|
-
declare const mpPlugin: OptionalBooleanString;
|
|
168
|
-
/** Detect if `process.env.UNI_MP_PLUGIN` is set */
|
|
169
|
-
declare const isMpPlugin: boolean;
|
|
170
|
-
/**
|
|
171
|
-
* `process.env.UNI_COMPILER_VERSION`
|
|
172
|
-
*
|
|
173
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L24}
|
|
174
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L34-L36}
|
|
175
|
-
*/
|
|
176
|
-
declare const compilerVersion: OptionalString;
|
|
177
|
-
/**
|
|
178
|
-
* `process.env.UNI_COMPILER_VERSION_TYPE`
|
|
179
|
-
*
|
|
180
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L25}
|
|
181
|
-
*/
|
|
182
|
-
type CompilerVersionType = 'a' | 'r' | undefined;
|
|
183
|
-
/**
|
|
184
|
-
* `process.env.UNI_COMPILER_VERSION_TYPE`
|
|
185
|
-
*
|
|
186
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L25}
|
|
187
|
-
*/
|
|
188
|
-
declare const compilerVersionType: CompilerVersionType;
|
|
189
|
-
/**
|
|
190
|
-
* `process.env.UNI_HBUILDERX_PLUGINS`
|
|
191
|
-
*
|
|
192
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L26}
|
|
193
|
-
*/
|
|
194
|
-
declare const hbuilderxPlugins: OptionalString;
|
|
195
|
-
/**
|
|
196
|
-
* `process.env.UNI_RENDERER`
|
|
197
|
-
*
|
|
198
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L27}
|
|
199
|
-
*/
|
|
200
|
-
type Renderer = 'native' | undefined;
|
|
201
|
-
/**
|
|
202
|
-
* `process.env.UNI_RENDERER`
|
|
203
|
-
*
|
|
204
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L27}
|
|
205
|
-
*/
|
|
206
|
-
declare const renderer: Renderer;
|
|
207
|
-
/**
|
|
208
|
-
* `process.env.UNI_NVUE_COMPILER`
|
|
209
|
-
*
|
|
210
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L28}
|
|
211
|
-
*/
|
|
212
|
-
type NVueCompiler = 'uni-app' | 'weex' | 'vue' | 'vite' | undefined;
|
|
213
|
-
/**
|
|
214
|
-
* `process.env.UNI_NVUE_COMPILER`
|
|
215
|
-
*
|
|
216
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L28}
|
|
217
|
-
*/
|
|
218
|
-
declare const nvueCompiler: NVueCompiler;
|
|
219
|
-
/**
|
|
220
|
-
* `process.env.UNI_NVUE_STYLE_COMPILER`
|
|
221
|
-
*
|
|
222
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L29}
|
|
223
|
-
*/
|
|
224
|
-
type NVueStyleCompiler = 'uni-app' | 'weex' | undefined;
|
|
225
|
-
/**
|
|
226
|
-
* `process.env.UNI_NVUE_STYLE_COMPILER`
|
|
227
|
-
*
|
|
228
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L29}
|
|
229
|
-
*/
|
|
230
|
-
declare const nvueStyleCompiler: NVueStyleCompiler;
|
|
231
|
-
/**
|
|
232
|
-
* `process.env.UNI_APP_CODE_SPLITING`
|
|
233
|
-
*
|
|
234
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L30}
|
|
235
|
-
*/
|
|
236
|
-
declare const appCodeSpliting: OptionalBooleanString;
|
|
237
|
-
/**
|
|
238
|
-
* `process.env.UNI_AUTOMATOR_WS_ENDPOINT`
|
|
239
|
-
*
|
|
240
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L31}
|
|
241
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L40-L42}
|
|
242
|
-
*/
|
|
243
|
-
declare const automatorWsEndpoint: OptionalString;
|
|
244
|
-
/**
|
|
245
|
-
* `process.env.UNI_AUTOMATOR_APP_WEBVIEW`
|
|
246
|
-
*
|
|
247
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L32}
|
|
248
|
-
*/
|
|
249
|
-
declare const automatorAppWebview: OptionalString;
|
|
250
|
-
/**
|
|
251
|
-
* `process.env.UNI_AUTOMATOR_APP_WEBVIEW_SRC`
|
|
252
|
-
*
|
|
253
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L33}
|
|
254
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L43-L45}
|
|
255
|
-
*/
|
|
256
|
-
declare const automatorAppWebviewSrc: OptionalString;
|
|
257
|
-
/**
|
|
258
|
-
* `process.env.UNI_H5_BASE`
|
|
259
|
-
*
|
|
260
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L34}
|
|
261
|
-
*/
|
|
262
|
-
declare const h5Base: OptionalString;
|
|
263
|
-
/**
|
|
264
|
-
* `process.env.UNI_H5_BROWSER`
|
|
265
|
-
*
|
|
266
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L35}
|
|
267
|
-
*/
|
|
268
|
-
type H5Browser = 'builtin' | undefined;
|
|
269
|
-
/**
|
|
270
|
-
* `process.env.UNI_H5_BROWSER`
|
|
271
|
-
*
|
|
272
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L35}
|
|
273
|
-
*/
|
|
274
|
-
declare const h5Browser: H5Browser;
|
|
275
|
-
/**
|
|
276
|
-
* `process.env.UNI_CUSTOM_SCRIPT`
|
|
277
|
-
*
|
|
278
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L36}
|
|
279
|
-
*/
|
|
280
|
-
declare const customScript: OptionalString;
|
|
281
|
-
/**
|
|
282
|
-
* `process.env.UNI_CUSTOM_DEFINE`
|
|
283
|
-
*
|
|
284
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L37}
|
|
285
|
-
*/
|
|
286
|
-
declare const customDefine: OptionalString;
|
|
287
|
-
/**
|
|
288
|
-
* `process.env.UNI_CUSTOM_CONTEXT`
|
|
289
|
-
*
|
|
290
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L38}
|
|
291
|
-
*/
|
|
292
|
-
declare const customContext: OptionalString;
|
|
293
|
-
/**
|
|
294
|
-
* `process.env.UNI_MINIMIZE`
|
|
295
|
-
*
|
|
296
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L39}
|
|
297
|
-
*/
|
|
298
|
-
declare const minimize: OptionalBooleanString;
|
|
299
|
-
/** Detect if `process.env.UNI_MINIMIZE` is set */
|
|
300
|
-
declare const isMinimize: boolean;
|
|
301
|
-
/**
|
|
302
|
-
* `process.env.UNI_UVUE`
|
|
303
|
-
*
|
|
304
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L40}
|
|
305
|
-
*/
|
|
306
|
-
declare const uvue: OptionalBooleanString;
|
|
307
|
-
/** Detect if `process.env.UNI_UVUE` is set */
|
|
308
|
-
declare const isUVue: boolean;
|
|
309
|
-
/**
|
|
310
|
-
* `process.env.UNI_UVUE_TARGET_LANGUAGE`
|
|
311
|
-
*
|
|
312
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L41}
|
|
313
|
-
*/
|
|
314
|
-
type UVueTargetLanguage = 'kotlin' | 'swift' | 'javascript' | undefined;
|
|
315
|
-
/**
|
|
316
|
-
* `process.env.UNI_UVUE_TARGET_LANGUAGE`
|
|
317
|
-
*
|
|
318
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L41}
|
|
319
|
-
*/
|
|
320
|
-
declare const uvueTargetLanguage: UVueTargetLanguage;
|
|
321
|
-
/**
|
|
322
|
-
* `process.env.UNI_COMPILER`
|
|
323
|
-
*
|
|
324
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L42}
|
|
325
|
-
*/
|
|
326
|
-
type Compiler = 'vue' | 'nvue' | undefined;
|
|
327
|
-
/**
|
|
328
|
-
* `process.env.UNI_COMPILER`
|
|
329
|
-
*
|
|
330
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L42}
|
|
331
|
-
*/
|
|
332
|
-
declare const compiler: Compiler;
|
|
333
|
-
/**
|
|
334
|
-
* `process.env.UNI_RENDERER_NATIVE`
|
|
335
|
-
*
|
|
336
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L43}
|
|
337
|
-
*/
|
|
338
|
-
type RendererNative = 'appService' | 'pages' | undefined;
|
|
339
|
-
/**
|
|
340
|
-
* `process.env.UNI_RENDERER_NATIVE`
|
|
341
|
-
*
|
|
342
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L43}
|
|
343
|
-
*/
|
|
344
|
-
declare const rendererNative: RendererNative;
|
|
345
|
-
/**
|
|
346
|
-
* `process.env.UNI_NVUE_APP_STYLES`
|
|
347
|
-
*
|
|
348
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L44}
|
|
349
|
-
*/
|
|
350
|
-
declare const nvueAppStyles: OptionalString;
|
|
351
|
-
/**
|
|
352
|
-
* `process.env.UNI_APP_CHANGED_FILES`
|
|
353
|
-
*
|
|
354
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L45}
|
|
355
|
-
*/
|
|
356
|
-
declare const appChangedFiles: OptionalString;
|
|
357
|
-
/**
|
|
358
|
-
* `process.env.UNI_APP_CHANGED_PAGES`
|
|
359
|
-
*
|
|
360
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L46}
|
|
361
|
-
*/
|
|
362
|
-
declare const appChangedPages: OptionalString;
|
|
363
|
-
/**
|
|
364
|
-
* `process.env.VUE_APP_DARK_MODE`
|
|
365
|
-
*
|
|
366
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L47}
|
|
367
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L56-L58}
|
|
368
|
-
*/
|
|
369
|
-
declare const darkMode: OptionalBooleanString;
|
|
370
|
-
/** Detect if `process.env.VUE_APP_DARK_MODE` is set */
|
|
371
|
-
declare const hasDarkMode: boolean;
|
|
372
|
-
/**
|
|
373
|
-
* `process.env.HX_USE_BASE_TYPE`
|
|
374
|
-
*
|
|
375
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L48}
|
|
376
|
-
*/
|
|
377
|
-
type HxUseBaseType = 'standard' | 'custom' | undefined;
|
|
378
|
-
/**
|
|
379
|
-
* `process.env.HX_USE_BASE_TYPE`
|
|
380
|
-
*
|
|
381
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L48}
|
|
382
|
-
*/
|
|
383
|
-
declare const hxUseBaseType: HxUseBaseType;
|
|
384
|
-
/**
|
|
385
|
-
* `process.env.HX_DEPENDENCIES_DIR`
|
|
386
|
-
*
|
|
387
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L49}
|
|
388
|
-
*/
|
|
389
|
-
declare const hxDependenciesDir: OptionalString;
|
|
390
|
-
/**
|
|
391
|
-
* `process.env.UNI_APP_X`
|
|
392
|
-
*
|
|
393
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L55}
|
|
394
|
-
*/
|
|
395
|
-
declare const appX: OptionalBooleanString;
|
|
396
|
-
/** Detect if `process.env.UNI_APP_X` is set */
|
|
397
|
-
declare const isAppX: boolean;
|
|
398
|
-
/**
|
|
399
|
-
* `process.env.UNI_APP_X_CACHE_DIR`
|
|
400
|
-
*
|
|
401
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L56}
|
|
402
|
-
*/
|
|
403
|
-
declare const appXCacheDir: OptionalString;
|
|
404
|
-
/**
|
|
405
|
-
* `process.env.HX_VERSION`
|
|
406
|
-
*
|
|
407
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L58}
|
|
408
|
-
*/
|
|
409
|
-
declare const hxVersion: OptionalString;
|
|
410
|
-
/**
|
|
411
|
-
* `process.env.UNI_APP_X_PAGE_COUNT`
|
|
412
|
-
*
|
|
413
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L60}
|
|
414
|
-
*/
|
|
415
|
-
declare const appXPageCount: OptionalString;
|
|
416
|
-
/**
|
|
417
|
-
* `process.env.UNI_APP_X_TSC`
|
|
418
|
-
*
|
|
419
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L61}
|
|
420
|
-
*/
|
|
421
|
-
declare const appXTsc: OptionalString;
|
|
422
|
-
/**
|
|
423
|
-
* `process.env.UNI_APP_X_SINGLE_THREAD`
|
|
424
|
-
*
|
|
425
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L62}
|
|
426
|
-
*/
|
|
427
|
-
declare const appXSingleThread: OptionalString;
|
|
428
|
-
/**
|
|
429
|
-
* `process.env.UNI_APP_X_SETUP`
|
|
430
|
-
*
|
|
431
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L63}
|
|
432
|
-
*/
|
|
433
|
-
declare const appXSetup: OptionalString;
|
|
434
|
-
/**
|
|
435
|
-
* `process.env.UNI_APP_X_UVUE_SCRIPT_ENGINE`
|
|
436
|
-
*
|
|
437
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L64}
|
|
438
|
-
*/
|
|
439
|
-
type AppXUVueScriptEngine = 'native' | 'js' | undefined;
|
|
440
|
-
/**
|
|
441
|
-
* `process.env.UNI_APP_X_UVUE_SCRIPT_ENGINE`
|
|
442
|
-
*
|
|
443
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L64}
|
|
444
|
-
*/
|
|
445
|
-
declare const appXUVueScriptEngine: AppXUVueScriptEngine;
|
|
446
|
-
/**
|
|
447
|
-
* `process.env.UNI_COMPILE_TARGET`
|
|
448
|
-
*
|
|
449
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L66}
|
|
450
|
-
*/
|
|
451
|
-
type CompileTarget = 'uni_modules' | undefined;
|
|
452
|
-
/**
|
|
453
|
-
* `process.env.UNI_COMPILE_TARGET`
|
|
454
|
-
*
|
|
455
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L66}
|
|
456
|
-
*/
|
|
457
|
-
declare const compileTarget: CompileTarget;
|
|
458
|
-
/**
|
|
459
|
-
* `process.env.UNI_COMPILE_CLOUD_DIR`
|
|
460
|
-
*
|
|
461
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L67}
|
|
462
|
-
*/
|
|
463
|
-
declare const compileCloudDir: OptionalString;
|
|
464
|
-
/**
|
|
465
|
-
* `process.env.UNI_MODULES_ENCRYPT_CACHE_DIR`
|
|
466
|
-
*
|
|
467
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L68}
|
|
468
|
-
*/
|
|
469
|
-
declare const modulesEncryptCacheDir: OptionalString;
|
|
470
|
-
/**
|
|
471
|
-
* `process.env.UNI_APP_PACK_TYPE`
|
|
472
|
-
*
|
|
473
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L70}
|
|
474
|
-
*/
|
|
475
|
-
type AppPackType = 'release' | 'debug' | undefined;
|
|
476
|
-
/**
|
|
477
|
-
* `process.env.UNI_APP_PACK_TYPE`
|
|
478
|
-
*
|
|
479
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L70}
|
|
480
|
-
*/
|
|
481
|
-
declare const appPackType: AppPackType;
|
|
482
|
-
/**
|
|
483
|
-
* `process.env.UNI_APP_HARMONY_PROJECT_PATH`
|
|
484
|
-
*
|
|
485
|
-
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L72}
|
|
486
|
-
*/
|
|
487
|
-
declare const appHarmonyProjectPath: OptionalString;
|
|
488
|
-
/** `process.env.STAT_TITLE_JSON` */
|
|
489
|
-
declare const statTitleJson: Record<string, string>;
|
|
490
|
-
/** `process.env.SOURCEMAP` */
|
|
491
|
-
declare const sourcemap: OptionalBooleanString;
|
|
492
|
-
/** Detect if `process.env.SOURCEMAP` is set */
|
|
493
|
-
declare const hasSourcemap: boolean;
|
|
494
|
-
/** `process.env.UNI_SSR_CLIENT` */
|
|
495
|
-
declare const ssrClient: OptionalBooleanString;
|
|
496
|
-
/** Detect if `process.env.UNI_SSR_CLIENT` is set */
|
|
497
|
-
declare const isSSRClient: boolean;
|
|
498
|
-
/** `process.env.UNI_SSR_SERVER` */
|
|
499
|
-
declare const ssrServer: OptionalBooleanString;
|
|
500
|
-
/** Detect if `process.env.UNI_SSR_SERVER` is set */
|
|
501
|
-
declare const isSSRServer: boolean;
|
|
502
|
-
|
|
503
|
-
export { type AppPackType, type AppPlatform, type AppXUVueScriptEngine, type BuiltInPlatform, type CompileTarget, type Compiler, type CompilerVersionType, type H5Browser, type HxUseBaseType, type NVueCompiler, type NVueStyleCompiler, type OptionalBooleanString, type OptionalString, type Renderer, type RendererNative, type SubPlatform, type UVueTargetLanguage, type UtsJsCodeFormat, type UtsModuleType, type UtsPlatform, type UtsTargetLanguage, 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, isMinimize, isMp, isMpAlipay, isMpBaidu, isMpKuaishou, isMpPlugin, isMpQQ, isMpToutiao, isMpWeixin, 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/dist/index.mjs
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { env } from 'std-env';
|
|
2
|
-
|
|
3
|
-
function toBoolean(val) {
|
|
4
|
-
return val ? val !== "false" : false;
|
|
5
|
-
}
|
|
6
|
-
function parseJSON(val) {
|
|
7
|
-
let obj;
|
|
8
|
-
try {
|
|
9
|
-
obj = JSON.parse(val || "{}");
|
|
10
|
-
} catch (error) {
|
|
11
|
-
obj = {};
|
|
12
|
-
}
|
|
13
|
-
return obj;
|
|
14
|
-
}
|
|
15
|
-
|
|
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 = env.UNI_APP_PLATFORM;
|
|
19
|
-
const subPlatform = process.env.UNI_SUB_PLATFORM;
|
|
20
|
-
const utsPlatform = env.UNI_UTS_PLATFORM;
|
|
21
|
-
const isH5 = platform === "h5";
|
|
22
|
-
const isWeb = platform === "web";
|
|
23
|
-
const isApp = platform === "app";
|
|
24
|
-
const isAppPlus = platform === "app-plus";
|
|
25
|
-
const isAppHarmony = platform === "app-harmony";
|
|
26
|
-
const isAppAndroid = appPlatform === "android" || utsPlatform === "app-android";
|
|
27
|
-
const isAppIOS = appPlatform === "ios" || utsPlatform === "app-ios";
|
|
28
|
-
const isMp = /^mp-/i.test(platform);
|
|
29
|
-
const isMpWeixin = platform === "mp-weixin";
|
|
30
|
-
const isMpAlipay = platform === "mp-alipay";
|
|
31
|
-
const isMpBaidu = platform === "mp-baidu";
|
|
32
|
-
const isMpKuaishou = platform === "mp-kuaishou";
|
|
33
|
-
const isMpQQ = platform === "mp-qq";
|
|
34
|
-
const isMpToutiao = platform === "mp-toutiao";
|
|
35
|
-
const isQuickapp = /^quickapp-webview/i.test(platform);
|
|
36
|
-
const isQuickappUnion = platform === "quickapp-webview-union";
|
|
37
|
-
const isQuickappHuawei = platform === "quickapp-webview-huawei";
|
|
38
|
-
const utsJsCodeFormat = env.UNI_UTS_JS_CODE_FORMAT;
|
|
39
|
-
const utsModuleType = env.UNI_UTS_MODULE_TYPE;
|
|
40
|
-
const utsModulePrefix = env.UNI_UTS_MODULE_PREFIX;
|
|
41
|
-
const utsTargetLanguage = env.UNI_UTS_TARGET_LANGUAGE;
|
|
42
|
-
const inputDir = env.UNI_INPUT_DIR;
|
|
43
|
-
const outputDir = env.UNI_OUTPUT_DIR;
|
|
44
|
-
const cliContext = 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 = env.UNI_COMPILER_VERSION_TYPE;
|
|
50
|
-
const hbuilderxPlugins = env.UNI_HBUILDERX_PLUGINS;
|
|
51
|
-
const renderer = env.UNI_RENDERER;
|
|
52
|
-
const nvueCompiler = env.UNI_NVUE_COMPILER;
|
|
53
|
-
const nvueStyleCompiler = env.UNI_NVUE_STYLE_COMPILER;
|
|
54
|
-
const appCodeSpliting = env.UNI_APP_CODE_SPLITING;
|
|
55
|
-
const automatorWsEndpoint = process.env.UNI_AUTOMATOR_WS_ENDPOINT;
|
|
56
|
-
const automatorAppWebview = env.UNI_AUTOMATOR_APP_WEBVIEW;
|
|
57
|
-
const automatorAppWebviewSrc = process.env.UNI_AUTOMATOR_APP_WEBVIEW_SRC;
|
|
58
|
-
const h5Base = env.UNI_H5_BASE;
|
|
59
|
-
const h5Browser = env.UNI_H5_BROWSER;
|
|
60
|
-
const customScript = env.UNI_CUSTOM_SCRIPT;
|
|
61
|
-
const customDefine = env.UNI_CUSTOM_DEFINE;
|
|
62
|
-
const customContext = env.UNI_CUSTOM_CONTEXT;
|
|
63
|
-
const minimize = env.UNI_MINIMIZE;
|
|
64
|
-
const isMinimize = toBoolean(env.UNI_MINIMIZE);
|
|
65
|
-
const uvue = env.UNI_UVUE;
|
|
66
|
-
const isUVue = toBoolean(env.UNI_UVUE);
|
|
67
|
-
const uvueTargetLanguage = env.UNI_UVUE_TARGET_LANGUAGE;
|
|
68
|
-
const compiler = env.UNI_COMPILER;
|
|
69
|
-
const rendererNative = env.UNI_RENDERER_NATIVE;
|
|
70
|
-
const nvueAppStyles = env.UNI_NVUE_APP_STYLES;
|
|
71
|
-
const appChangedFiles = env.UNI_APP_CHANGED_FILES;
|
|
72
|
-
const appChangedPages = 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 = env.HX_USE_BASE_TYPE;
|
|
76
|
-
const hxDependenciesDir = env.HX_DEPENDENCIES_DIR;
|
|
77
|
-
const appX = env.UNI_APP_X;
|
|
78
|
-
const isAppX = toBoolean(env.UNI_APP_X);
|
|
79
|
-
const appXCacheDir = env.UNI_APP_X_CACHE_DIR;
|
|
80
|
-
const hxVersion = env.HX_VERSION;
|
|
81
|
-
const appXPageCount = env.UNI_APP_X_PAGE_COUNT;
|
|
82
|
-
const appXTsc = env.UNI_APP_X_TSC;
|
|
83
|
-
const appXSingleThread = env.UNI_APP_X_SINGLE_THREAD;
|
|
84
|
-
const appXSetup = env.UNI_APP_X_SETUP;
|
|
85
|
-
const appXUVueScriptEngine = env.UNI_APP_X_UVUE_SCRIPT_ENGINE;
|
|
86
|
-
const compileTarget = env.UNI_COMPILE_TARGET;
|
|
87
|
-
const compileCloudDir = env.UNI_COMPILE_CLOUD_DIR;
|
|
88
|
-
const modulesEncryptCacheDir = env.UNI_MODULES_ENCRYPT_CACHE_DIR;
|
|
89
|
-
const appPackType = env.UNI_APP_PACK_TYPE;
|
|
90
|
-
const appHarmonyProjectPath = env.UNI_APP_HARMONY_PROJECT_PATH;
|
|
91
|
-
const statTitleJson = parseJSON(env.STAT_TITLE_JSON);
|
|
92
|
-
const sourcemap = env.SOURCEMAP;
|
|
93
|
-
const hasSourcemap = toBoolean(env.SOURCEMAP);
|
|
94
|
-
const ssrClient = env.UNI_SSR_CLIENT;
|
|
95
|
-
const isSSRClient = toBoolean(env.UNI_SSR_CLIENT);
|
|
96
|
-
const ssrServer = env.UNI_SSR_SERVER;
|
|
97
|
-
const isSSRServer = toBoolean(env.UNI_SSR_SERVER);
|
|
98
|
-
|
|
99
|
-
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, isMinimize, isMp, isMpAlipay, isMpBaidu, isMpKuaishou, isMpPlugin, isMpQQ, isMpToutiao, isMpWeixin, 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 };
|