Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen-jj committed Jul 19, 2021
1 parent 0695241 commit 171e89b
Show file tree
Hide file tree
Showing 21 changed files with 419 additions and 180 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,12 @@ require(\\"./taro\\");
var patchNeedPromiseApis = config.needPromiseApis || [];
var _needPromiseApis = new Set([].concat(_toConsumableArray(patchNeedPromiseApis), _toConsumableArray(needPromiseApis)));
var preserved = [ \\"getEnv\\", \\"interceptors\\", \\"Current\\", \\"getCurrentInstance\\", \\"options\\", \\"nextTick\\", \\"eventCenter\\", \\"Events\\", \\"preload\\", \\"webpackJsonp\\" ];
var apis = Object.keys(global).filter((function(api) {
var apis = new Set(Object.keys(global).filter((function(api) {
return preserved.indexOf(api) === -1;
}));
})));
if (config.modifyApis) {
config.modifyApis(apis);
}
apis.forEach((function(key) {
if (_needPromiseApis.has(key)) {
var originKey = key;
Expand Down Expand Up @@ -784,7 +787,11 @@ require(\\"./taro\\");
return p;
};
} else {
if (!global.hasOwnProperty(key)) {
var platformKey = key;
if (config.transformMeta) {
platformKey = config.transformMeta(key, {}).key;
}
if (!global.hasOwnProperty(platformKey)) {
taro[key] = unsupport(key);
return;
}
Expand All @@ -796,11 +803,11 @@ require(\\"./taro\\");
if (config.handleSyncApis) {
return config.handleSyncApis(key, global, args);
} else {
return global[key].apply(global, args);
return global[platformKey].apply(global, args);
}
};
} else {
taro[key] = global[key];
taro[key] = global[platformKey];
}
}
}));
Expand Down Expand Up @@ -1132,6 +1139,16 @@ require(\\"./taro\\");
options: options
};
}
function modifyApis(apis) {
Object.keys(apiDiff).map((function(key) {
apis.add(key);
var platformKey = apiDiff[key].alias;
platformKey && apis.delete(platformKey);
}));
apis.add(\\"showModal\\");
apis.delete(\\"confirm\\");
apis.delete(\\"alert\\");
}
function modifyAsyncResult(key, res) {
if (key === \\"saveFile\\") {
res.savedFilePath = res.apFilePath;
Expand Down Expand Up @@ -1172,6 +1189,7 @@ require(\\"./taro\\");
needPromiseApis: needPromiseApis,
handleSyncApis: handleSyncApis,
transformMeta: transformMeta,
modifyApis: modifyApis,
modifyAsyncResult: modifyAsyncResult,
request: request
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,9 +700,12 @@ require(\\"./taro\\");
var patchNeedPromiseApis = config.needPromiseApis || [];
var _needPromiseApis = new Set([].concat(_toConsumableArray(patchNeedPromiseApis), _toConsumableArray(needPromiseApis)));
var preserved = [ \\"getEnv\\", \\"interceptors\\", \\"Current\\", \\"getCurrentInstance\\", \\"options\\", \\"nextTick\\", \\"eventCenter\\", \\"Events\\", \\"preload\\", \\"webpackJsonp\\" ];
var apis = Object.keys(global).filter((function(api) {
var apis = new Set(Object.keys(global).filter((function(api) {
return preserved.indexOf(api) === -1;
}));
})));
if (config.modifyApis) {
config.modifyApis(apis);
}
apis.forEach((function(key) {
if (_needPromiseApis.has(key)) {
var originKey = key;
Expand Down Expand Up @@ -771,7 +774,11 @@ require(\\"./taro\\");
return p;
};
} else {
if (!global.hasOwnProperty(key)) {
var platformKey = key;
if (config.transformMeta) {
platformKey = config.transformMeta(key, {}).key;
}
if (!global.hasOwnProperty(platformKey)) {
taro[key] = unsupport(key);
return;
}
Expand All @@ -783,11 +790,11 @@ require(\\"./taro\\");
if (config.handleSyncApis) {
return config.handleSyncApis(key, global, args);
} else {
return global[key].apply(global, args);
return global[platformKey].apply(global, args);
}
};
} else {
taro[key] = global[key];
taro[key] = global[platformKey];
}
}
}));
Expand All @@ -814,7 +821,7 @@ require(\\"./taro\\");
taro.cleanInterceptors = link.cleanInterceptors.bind(link);
taro.miniGlobal = taro.options.miniGlobal = global;
}
var runtime_needPromiseApis = new Set([ \\"authPrivateMessage\\", \\"disableAlertBeforeUnload\\", \\"enableAlertBeforeUnload\\", \\"getBackgroundFetchData\\", \\"getGroupEnterInfo\\", \\"getShareInfo\\", \\"getWeRunData\\", \\"join1v1Chat\\", \\"openVideoEditor\\", \\"saveFileToDisk\\", \\"scanItem\\", \\"setEnable1v1Chat\\", \\"setWindowSize\\", \\"sendBizRedPacket\\", \\"startFacialRecognitionVerify\\" ]);
var runtime_needPromiseApis = new Set([ \\"addCard\\", \\"authPrivateMessage\\", \\"checkIsOpenAccessibility\\", \\"checkIsSoterEnrolledInDevice\\", \\"checkIsSupportSoterAuthentication\\", \\"chooseInvoice\\", \\"chooseMedia\\", \\"chooseMessageFile\\", \\"compressVideo\\", \\"connectWifi\\", \\"createBLEPeripheralServer\\", \\"disableAlertBeforeUnload\\", \\"enableAlertBeforeUnload\\", \\"exitVoIPChat\\", \\"getBLEDeviceRSSI\\", \\"getBackgroundAudioPlayerState\\", \\"getBackgroundFetchData\\", \\"getBackgroundFetchToken\\", \\"getGroupEnterInfo\\", \\"getHCEState\\", \\"getSelectedTextRange\\", \\"getShareInfo\\", \\"getVideoInfo\\", \\"getWeRunData\\", \\"join1v1Chat\\", \\"joinVoIPChat\\", \\"makeBluetoothPair\\", \\"openCard\\", \\"openVideoEditor\\", \\"playBackgroundAudio\\", \\"playVoice\\", \\"previewMedia\\", \\"requestPayment\\", \\"saveFileToDisk\\", \\"scanItem\\", \\"seekBackgroundAudio\\", \\"sendHCEMessage\\", \\"setBLEMTU\\", \\"setBackgroundFetchToken\\", \\"setEnable1v1Chat\\", \\"setTopBarText\\", \\"setWifiList\\", \\"setWindowSize\\", \\"showRedPackage\\", \\"startGyroscope\\", \\"startHCE\\", \\"startLocalServiceDiscovery\\", \\"startLocationUpdate\\", \\"startLocationUpdateBackground\\", \\"startRecord\\", \\"startSoterAuthentication\\", \\"startWifi\\", \\"stopGyroscope\\", \\"stopHCE\\", \\"stopLocalServiceDiscovery\\", \\"stopLocationUpdate\\", \\"stopWifi\\", \\"subscribeVoIPVideoMembers\\", \\"updateShareMenu\\", \\"updateVoIPChatMuteConfig\\", \\"updateWeChatApp\\", \\"sendBizRedPacket\\", \\"getUserProfile\\", \\"stopBluetoothDevicesDiscovery\\", \\"startBluetoothDevicesDiscovery\\", \\"openBluetoothAdapter\\", \\"getConnectedBluetoothDevices\\", \\"getBluetoothDevices\\", \\"getBluetoothAdapterState\\", \\"closeBluetoothAdapter\\", \\"writeBLECharacteristicValue\\", \\"readBLECharacteristicValue\\", \\"notifyBLECharacteristicValueChange\\", \\"getBLEDeviceServices\\", \\"getBLEDeviceCharacteristics\\", \\"createBLEConnection\\", \\"closeBLEConnection\\", \\"startFacialRecognitionVerify\\", \\"choosePoi\\" ]);
function initNativeApi(taro) {
processApis(taro, wx, {
needPromiseApis: runtime_needPromiseApis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,9 +700,12 @@ require(\\"./taro\\");
var patchNeedPromiseApis = config.needPromiseApis || [];
var _needPromiseApis = new Set([].concat(_toConsumableArray(patchNeedPromiseApis), _toConsumableArray(needPromiseApis)));
var preserved = [ \\"getEnv\\", \\"interceptors\\", \\"Current\\", \\"getCurrentInstance\\", \\"options\\", \\"nextTick\\", \\"eventCenter\\", \\"Events\\", \\"preload\\", \\"webpackJsonp\\" ];
var apis = Object.keys(global).filter((function(api) {
var apis = new Set(Object.keys(global).filter((function(api) {
return preserved.indexOf(api) === -1;
}));
})));
if (config.modifyApis) {
config.modifyApis(apis);
}
apis.forEach((function(key) {
if (_needPromiseApis.has(key)) {
var originKey = key;
Expand Down Expand Up @@ -771,7 +774,11 @@ require(\\"./taro\\");
return p;
};
} else {
if (!global.hasOwnProperty(key)) {
var platformKey = key;
if (config.transformMeta) {
platformKey = config.transformMeta(key, {}).key;
}
if (!global.hasOwnProperty(platformKey)) {
taro[key] = unsupport(key);
return;
}
Expand All @@ -783,11 +790,11 @@ require(\\"./taro\\");
if (config.handleSyncApis) {
return config.handleSyncApis(key, global, args);
} else {
return global[key].apply(global, args);
return global[platformKey].apply(global, args);
}
};
} else {
taro[key] = global[key];
taro[key] = global[platformKey];
}
}
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,9 +700,12 @@ require(\\"./taro\\");
var patchNeedPromiseApis = config.needPromiseApis || [];
var _needPromiseApis = new Set([].concat(_toConsumableArray(patchNeedPromiseApis), _toConsumableArray(needPromiseApis)));
var preserved = [ \\"getEnv\\", \\"interceptors\\", \\"Current\\", \\"getCurrentInstance\\", \\"options\\", \\"nextTick\\", \\"eventCenter\\", \\"Events\\", \\"preload\\", \\"webpackJsonp\\" ];
var apis = Object.keys(global).filter((function(api) {
var apis = new Set(Object.keys(global).filter((function(api) {
return preserved.indexOf(api) === -1;
}));
})));
if (config.modifyApis) {
config.modifyApis(apis);
}
apis.forEach((function(key) {
if (_needPromiseApis.has(key)) {
var originKey = key;
Expand Down Expand Up @@ -771,7 +774,11 @@ require(\\"./taro\\");
return p;
};
} else {
if (!global.hasOwnProperty(key)) {
var platformKey = key;
if (config.transformMeta) {
platformKey = config.transformMeta(key, {}).key;
}
if (!global.hasOwnProperty(platformKey)) {
taro[key] = unsupport(key);
return;
}
Expand All @@ -783,11 +790,11 @@ require(\\"./taro\\");
if (config.handleSyncApis) {
return config.handleSyncApis(key, global, args);
} else {
return global[key].apply(global, args);
return global[platformKey].apply(global, args);
}
};
} else {
taro[key] = global[key];
taro[key] = global[platformKey];
}
}
}));
Expand All @@ -814,7 +821,7 @@ require(\\"./taro\\");
taro.cleanInterceptors = link.cleanInterceptors.bind(link);
taro.miniGlobal = taro.options.miniGlobal = global;
}
var runtime_needPromiseApis = new Set([ \\"authPrivateMessage\\", \\"disableAlertBeforeUnload\\", \\"enableAlertBeforeUnload\\", \\"getBackgroundFetchData\\", \\"getGroupEnterInfo\\", \\"getShareInfo\\", \\"getWeRunData\\", \\"join1v1Chat\\", \\"openVideoEditor\\", \\"saveFileToDisk\\", \\"scanItem\\", \\"setEnable1v1Chat\\", \\"setWindowSize\\", \\"sendBizRedPacket\\", \\"startFacialRecognitionVerify\\" ]);
var runtime_needPromiseApis = new Set([ \\"addCard\\", \\"authPrivateMessage\\", \\"checkIsOpenAccessibility\\", \\"checkIsSoterEnrolledInDevice\\", \\"checkIsSupportSoterAuthentication\\", \\"chooseInvoice\\", \\"chooseMedia\\", \\"chooseMessageFile\\", \\"compressVideo\\", \\"connectWifi\\", \\"createBLEPeripheralServer\\", \\"disableAlertBeforeUnload\\", \\"enableAlertBeforeUnload\\", \\"exitVoIPChat\\", \\"getBLEDeviceRSSI\\", \\"getBackgroundAudioPlayerState\\", \\"getBackgroundFetchData\\", \\"getBackgroundFetchToken\\", \\"getGroupEnterInfo\\", \\"getHCEState\\", \\"getSelectedTextRange\\", \\"getShareInfo\\", \\"getVideoInfo\\", \\"getWeRunData\\", \\"join1v1Chat\\", \\"joinVoIPChat\\", \\"makeBluetoothPair\\", \\"openCard\\", \\"openVideoEditor\\", \\"playBackgroundAudio\\", \\"playVoice\\", \\"previewMedia\\", \\"requestPayment\\", \\"saveFileToDisk\\", \\"scanItem\\", \\"seekBackgroundAudio\\", \\"sendHCEMessage\\", \\"setBLEMTU\\", \\"setBackgroundFetchToken\\", \\"setEnable1v1Chat\\", \\"setTopBarText\\", \\"setWifiList\\", \\"setWindowSize\\", \\"showRedPackage\\", \\"startGyroscope\\", \\"startHCE\\", \\"startLocalServiceDiscovery\\", \\"startLocationUpdate\\", \\"startLocationUpdateBackground\\", \\"startRecord\\", \\"startSoterAuthentication\\", \\"startWifi\\", \\"stopGyroscope\\", \\"stopHCE\\", \\"stopLocalServiceDiscovery\\", \\"stopLocationUpdate\\", \\"stopWifi\\", \\"subscribeVoIPVideoMembers\\", \\"updateShareMenu\\", \\"updateVoIPChatMuteConfig\\", \\"updateWeChatApp\\", \\"sendBizRedPacket\\", \\"getUserProfile\\", \\"stopBluetoothDevicesDiscovery\\", \\"startBluetoothDevicesDiscovery\\", \\"openBluetoothAdapter\\", \\"getConnectedBluetoothDevices\\", \\"getBluetoothDevices\\", \\"getBluetoothAdapterState\\", \\"closeBluetoothAdapter\\", \\"writeBLECharacteristicValue\\", \\"readBLECharacteristicValue\\", \\"notifyBLECharacteristicValueChange\\", \\"getBLEDeviceServices\\", \\"getBLEDeviceCharacteristics\\", \\"createBLEConnection\\", \\"closeBLEConnection\\", \\"startFacialRecognitionVerify\\", \\"choosePoi\\" ]);
function initNativeApi(taro) {
processApis(taro, wx, {
needPromiseApis: runtime_needPromiseApis
Expand Down
Loading

0 comments on commit 171e89b

Please sign in to comment.