Skip to content

Commit

Permalink
chore(mobx-h5): 修改mobx-h5的mainFields
Browse files Browse the repository at this point in the history
  • Loading branch information
Littly committed Mar 11, 2019
1 parent b54964b commit 85cbd5b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Taro.noop;
Taro.noop();"
`;

exports[`should not go wrong when use an api twice 1`] = `
exports[`should not go wrong when using an api twice 1`] = `
"
import { createAnimation as _createAnimation } from '@tarojs/taro-h5';
const animation = _createAnimation({
Expand All @@ -37,8 +37,8 @@ Taro.initPxTransform();"

exports[`should transform fullfilled apis to named import 1`] = `
"
import { request as _request, createAnimation as _createAnimation, createSelectorQuery as _createSelectorQuery, connectSocket as _connectSocket, onSocketOpen as _onSocketOpen, onSocketError as _onSocketError, sendSocketMessage as _sendSocketMessage, onSocketMessage as _onSocketMessage, closeSocket as _closeSocket, onSocketClose as _onSocketClose, setStorage as _setStorage, setStorageSync as _setStorageSync, getStorage as _getStorage, getStorageSync as _getStorageSync, getStorageInfo as _getStorageInfo, getStorageInfoSync as _getStorageInfoSync, removeStorage as _removeStorage, removeStorageSync as _removeStorageSync, clearStorage as _clearStorage, clearStorageSync as _clearStorageSync, showToast as _showToast, hideToast as _hideToast, showLoading as _showLoading, hideLoading as _hideLoading, showModal as _showModal, showActionSheet as _showActionSheet, initTabBarApis as _initTabBarApis, getSystemInfo as _getSystemInfo, getSystemInfoSync as _getSystemInfoSync, getNetworkType as _getNetworkType, onNetworkStatusChange as _onNetworkStatusChange, arrayBufferToBase64 as _arrayBufferToBase, base64ToArrayBuffer as _base64ToArrayBuffer, makePhoneCall as _makePhoneCall, setNavigationBarTitle as _setNavigationBarTitle } from '@tarojs/taro-h5';
_request();_createAnimation();_createSelectorQuery();_connectSocket();_onSocketOpen();_onSocketError();_sendSocketMessage();_onSocketMessage();_closeSocket();_onSocketClose();_setStorage();_setStorageSync();_getStorage();_getStorageSync();_getStorageInfo();_getStorageInfoSync();_removeStorage();_removeStorageSync();_clearStorage();_clearStorageSync();_showToast();_hideToast();_showLoading();_hideLoading();_showModal();_showActionSheet();_initTabBarApis();_getSystemInfo();_getSystemInfoSync();_getNetworkType();_onNetworkStatusChange();_arrayBufferToBase();_base64ToArrayBuffer();_makePhoneCall();_setNavigationBarTitle();"
import { onBackgroundAudioPlay as _onBackgroundAudioPlay, onBackgroundAudioPause as _onBackgroundAudioPause, onBackgroundAudioStop as _onBackgroundAudioStop, onAccelerometerChange as _onAccelerometerChange, onCompassChange as _onCompassChange, onBluetoothAdapterStateChange as _onBluetoothAdapterStateChange, onBluetoothDeviceFound as _onBluetoothDeviceFound, onBLEConnectionStateChange as _onBLEConnectionStateChange, onBLECharacteristicValueChange as _onBLECharacteristicValueChange, onBeaconUpdate as _onBeaconUpdate, onBeaconServiceChange as _onBeaconServiceChange, onUserCaptureScreen as _onUserCaptureScreen, onHCEMessage as _onHCEMessage, onGetWifiList as _onGetWifiList, onWifiConnected as _onWifiConnected, getExtConfigSync as _getExtConfigSync, getLogManager as _getLogManager, onMemoryWarning as _onMemoryWarning, reportAnalytics as _reportAnalytics, navigateToSmartGameProgram as _navigateToSmartGameProgram, getFileSystemManager as _getFileSystemManager, stopRecord as _stopRecord, getRecorderManager as _getRecorderManager, pauseVoice as _pauseVoice, stopVoice as _stopVoice, pauseBackgroundAudio as _pauseBackgroundAudio, stopBackgroundAudio as _stopBackgroundAudio, getBackgroundAudioManager as _getBackgroundAudioManager, createAudioContext as _createAudioContext, createInnerAudioContext as _createInnerAudioContext, createVideoContext as _createVideoContext, createCameraContext as _createCameraContext, createLivePlayerContext as _createLivePlayerContext, createLivePusherContext as _createLivePusherContext, createMapContext as _createMapContext, canIUse as _canIUse, startAccelerometer as _startAccelerometer, stopAccelerometer as _stopAccelerometer, startCompass as _startCompass, stopCompass as _stopCompass, showNavigationBarLoading as _showNavigationBarLoading, hideNavigationBarLoading as _hideNavigationBarLoading, pageScrollTo as _pageScrollTo, createCanvasContext as _createCanvasContext, createContext as _createContext, drawCanvas as _drawCanvas, hideKeyboard as _hideKeyboard, stopPullDownRefresh as _stopPullDownRefresh, createIntersectionObserver as _createIntersectionObserver, onWindowResize as _onWindowResize, offWindowResize as _offWindowResize, getAccountInfoSync as _getAccountInfoSync, getUpdateManager as _getUpdateManager, createWorker as _createWorker, uploadFile as _uploadFile, downloadFile as _downloadFile, previewImage as _previewImage, getImageInfo as _getImageInfo, saveImageToPhotosAlbum as _saveImageToPhotosAlbum, startRecord as _startRecord, playVoice as _playVoice, setInnerAudioOption as _setInnerAudioOption, getAvailableAudioSources as _getAvailableAudioSources, getBackgroundAudioPlayerState as _getBackgroundAudioPlayerState, playBackgroundAudio as _playBackgroundAudio, seekBackgroundAudio as _seekBackgroundAudio, chooseVideo as _chooseVideo, saveVideoToPhotosAlbum as _saveVideoToPhotosAlbum, loadFontFace as _loadFontFace, saveFile as _saveFile, getFileInfo as _getFileInfo, getSavedFileList as _getSavedFileList, getSavedFileInfo as _getSavedFileInfo, removeSavedFile as _removeSavedFile, openDocument as _openDocument, switchTab as _switchTab, reLaunch as _reLaunch, getLocation as _getLocation, chooseLocation as _chooseLocation, openLocation as _openLocation, scanCode as _scanCode, setClipboardData as _setClipboardData, getClipboardData as _getClipboardData, openBluetoothAdapter as _openBluetoothAdapter, closeBluetoothAdapter as _closeBluetoothAdapter, getBluetoothAdapterState as _getBluetoothAdapterState, startBluetoothDevicesDiscovery as _startBluetoothDevicesDiscovery, stopBluetoothDevicesDiscovery as _stopBluetoothDevicesDiscovery, getBluetoothDevices as _getBluetoothDevices, getConnectedBluetoothDevices as _getConnectedBluetoothDevices, createBLEConnection as _createBLEConnection, closeBLEConnection as _closeBLEConnection, getBLEDeviceServices as _getBLEDeviceServices, getBLEDeviceCharacteristics as _getBLEDeviceCharacteristics, readBLECharacteristicValue as _readBLECharacteristicValue, writeBLECharacteristicValue as _writeBLECharacteristicValue, notifyBLECharacteristicValueChange as _notifyBLECharacteristicValueChange, startBeaconDiscovery as _startBeaconDiscovery, stopBeaconDiscovery as _stopBeaconDiscovery, getBeacons as _getBeacons, setScreenBrightness as _setScreenBrightness, getScreenBrightness as _getScreenBrightness, setKeepScreenOn as _setKeepScreenOn, vibrateLong as _vibrateLong, vibrateShort as _vibrateShort, addPhoneContact as _addPhoneContact, getHCEState as _getHCEState, startHCE as _startHCE, stopHCE as _stopHCE, sendHCEMessage as _sendHCEMessage, startWifi as _startWifi, stopWifi as _stopWifi, connectWifi as _connectWifi, getWifiList as _getWifiList, setWifiList as _setWifiList, getConnectedWifi as _getConnectedWifi, setNavigationBarColor as _setNavigationBarColor, setTopBarText as _setTopBarText, startPullDownRefresh as _startPullDownRefresh, canvasToTempFilePath as _canvasToTempFilePath, canvasGetImageData as _canvasGetImageData, canvasPutImageData as _canvasPutImageData, setBackgroundColor as _setBackgroundColor, setBackgroundTextStyle as _setBackgroundTextStyle, getExtConfig as _getExtConfig, login as _login, checkSession as _checkSession, authorize as _authorize, getUserInfo as _getUserInfo, checkIsSupportFacialRecognition as _checkIsSupportFacialRecognition, startFacialRecognitionVerify as _startFacialRecognitionVerify, startFacialRecognitionVerifyAndUploadVideo as _startFacialRecognitionVerifyAndUploadVideo, faceVerifyForPay as _faceVerifyForPay, requestPayment as _requestPayment, showShareMenu as _showShareMenu, hideShareMenu as _hideShareMenu, updateShareMenu as _updateShareMenu, getShareInfo as _getShareInfo, chooseAddress as _chooseAddress, addCard as _addCard, openCard as _openCard, openSetting as _openSetting, getSetting as _getSetting, getWeRunData as _getWeRunData, navigateToMiniProgram as _navigateToMiniProgram, navigateBackMiniProgram as _navigateBackMiniProgram, chooseInvoice as _chooseInvoice, chooseInvoiceTitle as _chooseInvoiceTitle, checkIsSupportSoterAuthentication as _checkIsSupportSoterAuthentication, startSoterAuthentication as _startSoterAuthentication, checkIsSoterEnrolledInDevice as _checkIsSoterEnrolledInDevice, setEnableDebug as _setEnableDebug, ocrIdCard as _ocrIdCard, ocrBankCard as _ocrBankCard, ocrDrivingLicense as _ocrDrivingLicense, ocrVehicleLicense as _ocrVehicleLicense, textReview as _textReview, textToAudio as _textToAudio, imageAudit as _imageAudit, advancedGeneralIdentify as _advancedGeneralIdentify, objectDetectIdentify as _objectDetectIdentify, carClassify as _carClassify, dishClassify as _dishClassify, logoClassify as _logoClassify, animalClassify as _animalClassify, plantClassify as _plantClassify, getSwanId as _getSwanId, requestPolymerPayment as _requestPolymerPayment, navigateToSmartProgram as _navigateToSmartProgram, navigateBackSmartProgram as _navigateBackSmartProgram, preloadSubPackage as _preloadSubPackage, request as _request, createAnimation as _createAnimation, createSelectorQuery as _createSelectorQuery, connectSocket as _connectSocket, onSocketOpen as _onSocketOpen, onSocketError as _onSocketError, sendSocketMessage as _sendSocketMessage, onSocketMessage as _onSocketMessage, closeSocket as _closeSocket, onSocketClose as _onSocketClose, setStorage as _setStorage, setStorageSync as _setStorageSync, getStorage as _getStorage, getStorageSync as _getStorageSync, getStorageInfo as _getStorageInfo, getStorageInfoSync as _getStorageInfoSync, removeStorage as _removeStorage, removeStorageSync as _removeStorageSync, clearStorage as _clearStorage, clearStorageSync as _clearStorageSync, showToast as _showToast, hideToast as _hideToast, showLoading as _showLoading, hideLoading as _hideLoading, showModal as _showModal, showActionSheet as _showActionSheet, initTabBarApis as _initTabBarApis, setTabBarBadge as _setTabBarBadge, removeTabBarBadge as _removeTabBarBadge, showTabBarRedDot as _showTabBarRedDot, hideTabBarRedDot as _hideTabBarRedDot, showTabBar as _showTabBar, hideTabBar as _hideTabBar, setTabBarStyle as _setTabBarStyle, setTabBarItem as _setTabBarItem, getSystemInfo as _getSystemInfo, getSystemInfoSync as _getSystemInfoSync, getNetworkType as _getNetworkType, onNetworkStatusChange as _onNetworkStatusChange, arrayBufferToBase64 as _arrayBufferToBase, base64ToArrayBuffer as _base64ToArrayBuffer, makePhoneCall as _makePhoneCall, setNavigationBarTitle as _setNavigationBarTitle } from '@tarojs/taro-h5';
_onBackgroundAudioPlay();_onBackgroundAudioPause();_onBackgroundAudioStop();_onAccelerometerChange();_onCompassChange();_onBluetoothAdapterStateChange();_onBluetoothDeviceFound();_onBLEConnectionStateChange();_onBLECharacteristicValueChange();_onBeaconUpdate();_onBeaconServiceChange();_onUserCaptureScreen();_onHCEMessage();_onGetWifiList();_onWifiConnected();_getExtConfigSync();_getLogManager();_onMemoryWarning();_reportAnalytics();_navigateToSmartGameProgram();_getFileSystemManager();_stopRecord();_getRecorderManager();_pauseVoice();_stopVoice();_pauseBackgroundAudio();_stopBackgroundAudio();_getBackgroundAudioManager();_createAudioContext();_createInnerAudioContext();_createVideoContext();_createCameraContext();_createLivePlayerContext();_createLivePusherContext();_createMapContext();_canIUse();_startAccelerometer();_stopAccelerometer();_startCompass();_stopCompass();_showNavigationBarLoading();_hideNavigationBarLoading();_pageScrollTo();_createCanvasContext();_createContext();_drawCanvas();_hideKeyboard();_stopPullDownRefresh();_createIntersectionObserver();_onWindowResize();_offWindowResize();_getAccountInfoSync();_getUpdateManager();_createWorker();_uploadFile();_downloadFile();_previewImage();_getImageInfo();_saveImageToPhotosAlbum();_startRecord();_playVoice();_setInnerAudioOption();_getAvailableAudioSources();_getBackgroundAudioPlayerState();_playBackgroundAudio();_seekBackgroundAudio();_chooseVideo();_saveVideoToPhotosAlbum();_loadFontFace();_saveFile();_getFileInfo();_getSavedFileList();_getSavedFileInfo();_removeSavedFile();_openDocument();_switchTab();_reLaunch();_getLocation();_chooseLocation();_openLocation();_scanCode();_setClipboardData();_getClipboardData();_openBluetoothAdapter();_closeBluetoothAdapter();_getBluetoothAdapterState();_startBluetoothDevicesDiscovery();_stopBluetoothDevicesDiscovery();_getBluetoothDevices();_getConnectedBluetoothDevices();_createBLEConnection();_closeBLEConnection();_getBLEDeviceServices();_getBLEDeviceCharacteristics();_readBLECharacteristicValue();_writeBLECharacteristicValue();_notifyBLECharacteristicValueChange();_startBeaconDiscovery();_stopBeaconDiscovery();_getBeacons();_setScreenBrightness();_getScreenBrightness();_setKeepScreenOn();_vibrateLong();_vibrateShort();_addPhoneContact();_getHCEState();_startHCE();_stopHCE();_sendHCEMessage();_startWifi();_stopWifi();_connectWifi();_getWifiList();_setWifiList();_getConnectedWifi();_setNavigationBarColor();_setTopBarText();_startPullDownRefresh();_canvasToTempFilePath();_canvasGetImageData();_canvasPutImageData();_setBackgroundColor();_setBackgroundTextStyle();_getExtConfig();_login();_checkSession();_authorize();_getUserInfo();_checkIsSupportFacialRecognition();_startFacialRecognitionVerify();_startFacialRecognitionVerifyAndUploadVideo();_faceVerifyForPay();_requestPayment();_showShareMenu();_hideShareMenu();_updateShareMenu();_getShareInfo();_chooseAddress();_addCard();_openCard();_openSetting();_getSetting();_getWeRunData();_navigateToMiniProgram();_navigateBackMiniProgram();_chooseInvoice();_chooseInvoiceTitle();_checkIsSupportSoterAuthentication();_startSoterAuthentication();_checkIsSoterEnrolledInDevice();_setEnableDebug();_ocrIdCard();_ocrBankCard();_ocrDrivingLicense();_ocrVehicleLicense();_textReview();_textToAudio();_imageAudit();_advancedGeneralIdentify();_objectDetectIdentify();_carClassify();_dishClassify();_logoClassify();_animalClassify();_plantClassify();_getSwanId();_requestPolymerPayment();_navigateToSmartProgram();_navigateBackSmartProgram();_preloadSubPackage();_request();_createAnimation();_createSelectorQuery();_connectSocket();_onSocketOpen();_onSocketError();_sendSocketMessage();_onSocketMessage();_closeSocket();_onSocketClose();_setStorage();_setStorageSync();_getStorage();_getStorageSync();_getStorageInfo();_getStorageInfoSync();_removeStorage();_removeStorageSync();_clearStorage();_clearStorageSync();_showToast();_hideToast();_showLoading();_hideLoading();_showModal();_showActionSheet();_initTabBarApis();_setTabBarBadge();_removeTabBarBadge();_showTabBarRedDot();_hideTabBarRedDot();_showTabBar();_hideTabBar();_setTabBarStyle();_setTabBarItem();_getSystemInfo();_getSystemInfoSync();_getNetworkType();_onNetworkStatusChange();_arrayBufferToBase();_base64ToArrayBuffer();_makePhoneCall();_setNavigationBarTitle();"
`;

exports[`should work! 1`] = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ it('should not import taro duplicatly', function () {
expect(t.isExpressionStatement(body[2])).toBeTruthy()
})

it('should not go wrong when use an api twice', function () {
it('should not go wrong when using an api twice', function () {
const code = `
import Taro from '@tarojs/taro-h5';
const animation = Taro.createAnimation({
Expand All @@ -140,4 +140,4 @@ it('should not go wrong when use an api twice', function () {
const result = babel.transform(code, { plugins: [ pluginOptions ]})
expect(result.code).toMatchSnapshot();
}).not.toThrowError()
})
})
6 changes: 4 additions & 2 deletions packages/taro-mobx-h5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,22 @@
"build": "rollup -c rollup.config.js",
"dev": "rollup -c rollup.config.js --watch"
},
"main:h5": "dist/index.esm.js",
"main": "index.js",
"module": "dist/index.esm.js",
"files": [
"dist",
"index.js"
],
"peerDependencies": {
"@tarojs/taro-h5": "1.2.17",
"nervjs": "^1.3.0"
},
"dependencies": {
"@tarojs/mobx-common": "1.2.17",
"@tarojs/taro-h5": "1.1.7"
"@tarojs/mobx-common": "1.2.17"
},
"devDependencies": {
"@tarojs/taro-h5": "1.2.16",
"lodash": "4.17.11",
"rollup": "1.1.0",
"rollup-plugin-babel": "4.0.3",
Expand Down

0 comments on commit 85cbd5b

Please sign in to comment.