fix: add isPHA and isKraken env for backward compatibility

This commit is contained in:
ClarkXia 2025-07-24 11:41:28 +08:00
parent 0141336861
commit ea6b08f1f1
3 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
## 3.6.5
- hotfix: add isPHA and isKraken env for backward compatibility.
## 3.6.4 ## 3.6.4
### Patch Changes ### Patch Changes

View File

@ -1,6 +1,6 @@
{ {
"name": "@ice/app", "name": "@ice/app",
"version": "3.6.4", "version": "3.6.5",
"description": "provide scripts and configuration used by web framework ice", "description": "provide scripts and configuration used by web framework ice",
"type": "module", "type": "module",
"main": "./esm/index.js", "main": "./esm/index.js",

View File

@ -11,9 +11,11 @@ export const isKuaiShouMiniProgram = isClient && import.meta.target === 'kuaisho
export const isWeChatMiniProgram = isClient && import.meta.target === 'wechat-miniprogram'; export const isWeChatMiniProgram = isClient && import.meta.target === 'wechat-miniprogram';
export const isQuickApp = false; // Now ice.js will not implement quick app target. export const isQuickApp = false; // Now ice.js will not implement quick app target.
export const isMiniApp = isAliMiniApp; // in universal-env, isMiniApp is equals to isAliMiniApp export const isMiniApp = isAliMiniApp; // in universal-env, isMiniApp is equals to isAliMiniApp
export const isKraken = isClient && import.meta.target === 'kraken';
// Following variables are runtime executed envs. // Following variables are runtime executed envs.
// See also @uni/env. // See also @uni/env.
export const isPHA = isWeb && typeof pha === 'object';
const ua = typeof navigator === 'object' ? navigator.userAgent || navigator.swuserAgent : ''; const ua = typeof navigator === 'object' ? navigator.userAgent || navigator.swuserAgent : '';
export const isThemis = /Themis/.test(ua); export const isThemis = /Themis/.test(ua);
export const isWindVane = /WindVane/i.test(ua) && isWeb && typeof WindVane !== 'undefined' && typeof WindVane.call !== 'undefined'; export const isWindVane = /WindVane/i.test(ua) && isWeb && typeof WindVane !== 'undefined' && typeof WindVane.call !== 'undefined';
@ -25,6 +27,8 @@ export default {
isWeb, isWeb,
isNode, isNode,
isWeex, isWeex,
isKraken,
isPHA,
isThemis, isThemis,
isMiniApp, isMiniApp,
isByteDanceMicroApp, isByteDanceMicroApp,