@uni-helper/uni-env 0.1.6 → 0.1.8

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 CHANGED
@@ -20,8 +20,8 @@ const platform = process.env.UNI_PLATFORM;
20
20
  const appPlatform = stdEnv.env.UNI_APP_PLATFORM;
21
21
  const subPlatform = process.env.UNI_SUB_PLATFORM;
22
22
  const utsPlatform = stdEnv.env.UNI_UTS_PLATFORM;
23
- const isH5 = platform === "h5";
24
- const isWeb = platform === "web";
23
+ const isH5 = platform === "h5" || platform === "web";
24
+ const isWeb = platform === "web" || platform === "h5";
25
25
  const isApp = platform === "app";
26
26
  const isAppPlus = platform === "app-plus";
27
27
  const isAppHarmony = platform === "app-harmony";
@@ -55,7 +55,7 @@ const nvueCompiler = stdEnv.env.UNI_NVUE_COMPILER;
55
55
  const nvueStyleCompiler = stdEnv.env.UNI_NVUE_STYLE_COMPILER;
56
56
  const appCodeSpliting = stdEnv.env.UNI_APP_CODE_SPLITING;
57
57
  const automatorWsEndpoint = process.env.UNI_AUTOMATOR_WS_ENDPOINT;
58
- const automatorAppWebview = process.env.UNI_AUTOMATOR_APP_WEBVIEW;
58
+ const automatorAppWebview = stdEnv.env.UNI_AUTOMATOR_APP_WEBVIEW;
59
59
  const automatorAppWebviewSrc = process.env.UNI_AUTOMATOR_APP_WEBVIEW_SRC;
60
60
  const h5Base = stdEnv.env.UNI_H5_BASE;
61
61
  const h5Browser = stdEnv.env.UNI_H5_BROWSER;
package/dist/index.d.cts CHANGED
@@ -57,9 +57,9 @@ type UtsPlatform = BuiltInPlatform | 'app-android' | 'app-ios' | 'web';
57
57
  * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L12}
58
58
  */
59
59
  declare const utsPlatform: UtsPlatform;
60
- /** Detect if `process.env.UNI_PLATFORM` is `h5` */
60
+ /** Detect if `process.env.UNI_PLATFORM` is `h5` or if `process.env.UNI_PLATFORM` is `web` */
61
61
  declare const isH5: boolean;
62
- /** Detect if `process.env.UNI_PLATFORM` is `web` */
62
+ /** Detect if `process.env.UNI_PLATFORM` is `web` or if `process.env.UNI_PLATFORM` is `h5` */
63
63
  declare const isWeb: boolean;
64
64
  /** Detect if `process.env.UNI_PLATFORM` is `app` */
65
65
  declare const isApp: boolean;
@@ -155,14 +155,14 @@ declare const cliContext: OptionalString;
155
155
  * `process.env.UNI_SUBPACKAGE`
156
156
  *
157
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#L31C18-L33}
158
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L31-L33}
159
159
  */
160
160
  declare const subpackage: OptionalString;
161
161
  /**
162
162
  * `process.env.UNI_MP_PLUGIN`
163
163
  *
164
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#L28C18-L30}
165
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L28-L30}
166
166
  */
167
167
  declare const mpPlugin: OptionalBooleanString;
168
168
  /** Detect if `process.env.UNI_MP_PLUGIN` is set */
@@ -171,7 +171,7 @@ declare const isMpPlugin: boolean;
171
171
  * `process.env.UNI_COMPILER_VERSION`
172
172
  *
173
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#L34C18-L36}
174
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L34-L36}
175
175
  */
176
176
  declare const compilerVersion: OptionalString;
177
177
  /**
@@ -238,21 +238,20 @@ declare const appCodeSpliting: OptionalBooleanString;
238
238
  * `process.env.UNI_AUTOMATOR_WS_ENDPOINT`
239
239
  *
240
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#L40C18-L42}
241
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L40-L42}
242
242
  */
243
243
  declare const automatorWsEndpoint: OptionalString;
244
244
  /**
245
245
  * `process.env.UNI_AUTOMATOR_APP_WEBVIEW`
246
246
  *
247
247
  * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L32}
248
- * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L40C18-L42}
249
248
  */
250
249
  declare const automatorAppWebview: OptionalString;
251
250
  /**
252
251
  * `process.env.UNI_AUTOMATOR_APP_WEBVIEW_SRC`
253
252
  *
254
253
  * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L33}
255
- * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L43C18-L45}
254
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L43-L45}
256
255
  */
257
256
  declare const automatorAppWebviewSrc: OptionalString;
258
257
  /**
@@ -365,7 +364,7 @@ declare const appChangedPages: OptionalString;
365
364
  * `process.env.VUE_APP_DARK_MODE`
366
365
  *
367
366
  * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L47}
368
- * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L56C18-L58}
367
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L56-L58}
369
368
  */
370
369
  declare const darkMode: OptionalBooleanString;
371
370
  /** Detect if `process.env.VUE_APP_DARK_MODE` is set */
package/dist/index.d.mts CHANGED
@@ -57,9 +57,9 @@ type UtsPlatform = BuiltInPlatform | 'app-android' | 'app-ios' | 'web';
57
57
  * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L12}
58
58
  */
59
59
  declare const utsPlatform: UtsPlatform;
60
- /** Detect if `process.env.UNI_PLATFORM` is `h5` */
60
+ /** Detect if `process.env.UNI_PLATFORM` is `h5` or if `process.env.UNI_PLATFORM` is `web` */
61
61
  declare const isH5: boolean;
62
- /** Detect if `process.env.UNI_PLATFORM` is `web` */
62
+ /** Detect if `process.env.UNI_PLATFORM` is `web` or if `process.env.UNI_PLATFORM` is `h5` */
63
63
  declare const isWeb: boolean;
64
64
  /** Detect if `process.env.UNI_PLATFORM` is `app` */
65
65
  declare const isApp: boolean;
@@ -155,14 +155,14 @@ declare const cliContext: OptionalString;
155
155
  * `process.env.UNI_SUBPACKAGE`
156
156
  *
157
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#L31C18-L33}
158
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L31-L33}
159
159
  */
160
160
  declare const subpackage: OptionalString;
161
161
  /**
162
162
  * `process.env.UNI_MP_PLUGIN`
163
163
  *
164
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#L28C18-L30}
165
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L28-L30}
166
166
  */
167
167
  declare const mpPlugin: OptionalBooleanString;
168
168
  /** Detect if `process.env.UNI_MP_PLUGIN` is set */
@@ -171,7 +171,7 @@ declare const isMpPlugin: boolean;
171
171
  * `process.env.UNI_COMPILER_VERSION`
172
172
  *
173
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#L34C18-L36}
174
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L34-L36}
175
175
  */
176
176
  declare const compilerVersion: OptionalString;
177
177
  /**
@@ -238,21 +238,20 @@ declare const appCodeSpliting: OptionalBooleanString;
238
238
  * `process.env.UNI_AUTOMATOR_WS_ENDPOINT`
239
239
  *
240
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#L40C18-L42}
241
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L40-L42}
242
242
  */
243
243
  declare const automatorWsEndpoint: OptionalString;
244
244
  /**
245
245
  * `process.env.UNI_AUTOMATOR_APP_WEBVIEW`
246
246
  *
247
247
  * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L32}
248
- * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L40C18-L42}
249
248
  */
250
249
  declare const automatorAppWebview: OptionalString;
251
250
  /**
252
251
  * `process.env.UNI_AUTOMATOR_APP_WEBVIEW_SRC`
253
252
  *
254
253
  * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L33}
255
- * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L43C18-L45}
254
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L43-L45}
256
255
  */
257
256
  declare const automatorAppWebviewSrc: OptionalString;
258
257
  /**
@@ -365,7 +364,7 @@ declare const appChangedPages: OptionalString;
365
364
  * `process.env.VUE_APP_DARK_MODE`
366
365
  *
367
366
  * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L47}
368
- * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L56C18-L58}
367
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L56-L58}
369
368
  */
370
369
  declare const darkMode: OptionalBooleanString;
371
370
  /** Detect if `process.env.VUE_APP_DARK_MODE` is set */
package/dist/index.d.ts CHANGED
@@ -57,9 +57,9 @@ type UtsPlatform = BuiltInPlatform | 'app-android' | 'app-ios' | 'web';
57
57
  * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L12}
58
58
  */
59
59
  declare const utsPlatform: UtsPlatform;
60
- /** Detect if `process.env.UNI_PLATFORM` is `h5` */
60
+ /** Detect if `process.env.UNI_PLATFORM` is `h5` or if `process.env.UNI_PLATFORM` is `web` */
61
61
  declare const isH5: boolean;
62
- /** Detect if `process.env.UNI_PLATFORM` is `web` */
62
+ /** Detect if `process.env.UNI_PLATFORM` is `web` or if `process.env.UNI_PLATFORM` is `h5` */
63
63
  declare const isWeb: boolean;
64
64
  /** Detect if `process.env.UNI_PLATFORM` is `app` */
65
65
  declare const isApp: boolean;
@@ -155,14 +155,14 @@ declare const cliContext: OptionalString;
155
155
  * `process.env.UNI_SUBPACKAGE`
156
156
  *
157
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#L31C18-L33}
158
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L31-L33}
159
159
  */
160
160
  declare const subpackage: OptionalString;
161
161
  /**
162
162
  * `process.env.UNI_MP_PLUGIN`
163
163
  *
164
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#L28C18-L30}
165
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L28-L30}
166
166
  */
167
167
  declare const mpPlugin: OptionalBooleanString;
168
168
  /** Detect if `process.env.UNI_MP_PLUGIN` is set */
@@ -171,7 +171,7 @@ declare const isMpPlugin: boolean;
171
171
  * `process.env.UNI_COMPILER_VERSION`
172
172
  *
173
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#L34C18-L36}
174
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L34-L36}
175
175
  */
176
176
  declare const compilerVersion: OptionalString;
177
177
  /**
@@ -238,21 +238,20 @@ declare const appCodeSpliting: OptionalBooleanString;
238
238
  * `process.env.UNI_AUTOMATOR_WS_ENDPOINT`
239
239
  *
240
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#L40C18-L42}
241
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L40-L42}
242
242
  */
243
243
  declare const automatorWsEndpoint: OptionalString;
244
244
  /**
245
245
  * `process.env.UNI_AUTOMATOR_APP_WEBVIEW`
246
246
  *
247
247
  * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L32}
248
- * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L40C18-L42}
249
248
  */
250
249
  declare const automatorAppWebview: OptionalString;
251
250
  /**
252
251
  * `process.env.UNI_AUTOMATOR_APP_WEBVIEW_SRC`
253
252
  *
254
253
  * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L33}
255
- * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L43C18-L45}
254
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L43-L45}
256
255
  */
257
256
  declare const automatorAppWebviewSrc: OptionalString;
258
257
  /**
@@ -365,7 +364,7 @@ declare const appChangedPages: OptionalString;
365
364
  * `process.env.VUE_APP_DARK_MODE`
366
365
  *
367
366
  * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L47}
368
- * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L56C18-L58}
367
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/uni-cli-shared/src/env/define.ts#L56-L58}
369
368
  */
370
369
  declare const darkMode: OptionalBooleanString;
371
370
  /** Detect if `process.env.VUE_APP_DARK_MODE` is set */
package/dist/index.mjs CHANGED
@@ -18,8 +18,8 @@ const platform = process.env.UNI_PLATFORM;
18
18
  const appPlatform = env.UNI_APP_PLATFORM;
19
19
  const subPlatform = process.env.UNI_SUB_PLATFORM;
20
20
  const utsPlatform = env.UNI_UTS_PLATFORM;
21
- const isH5 = platform === "h5";
22
- const isWeb = platform === "web";
21
+ const isH5 = platform === "h5" || platform === "web";
22
+ const isWeb = platform === "web" || platform === "h5";
23
23
  const isApp = platform === "app";
24
24
  const isAppPlus = platform === "app-plus";
25
25
  const isAppHarmony = platform === "app-harmony";
@@ -53,7 +53,7 @@ const nvueCompiler = env.UNI_NVUE_COMPILER;
53
53
  const nvueStyleCompiler = env.UNI_NVUE_STYLE_COMPILER;
54
54
  const appCodeSpliting = env.UNI_APP_CODE_SPLITING;
55
55
  const automatorWsEndpoint = process.env.UNI_AUTOMATOR_WS_ENDPOINT;
56
- const automatorAppWebview = process.env.UNI_AUTOMATOR_APP_WEBVIEW;
56
+ const automatorAppWebview = env.UNI_AUTOMATOR_APP_WEBVIEW;
57
57
  const automatorAppWebviewSrc = process.env.UNI_AUTOMATOR_APP_WEBVIEW_SRC;
58
58
  const h5Base = env.UNI_H5_BASE;
59
59
  const h5Browser = env.UNI_H5_BROWSER;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uni-helper/uni-env",
3
3
  "type": "module",
4
- "version": "0.1.6",
4
+ "version": "0.1.8",
5
5
  "description": "在 uni-app 中优雅地判断当前环境。",
6
6
  "author": "KeJun",
7
7
  "maintainers": [