@tarojs/rn-runner 3.7.0-canary.6 → 4.0.0-alpha.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/__tests__/__snapshots__/components.spec.ts.snap +36 -22
- package/dist/index.js +1 -6
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/src/index.ts +1 -6
- package/templates/metro.config.js +6 -10
|
@@ -51,7 +51,7 @@ var _indexScssStyleSheet = StyleSheet.create({
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
function _mergeEleStyles(){return [].concat.apply([],arguments).reduce((pre,cur)=>Object.assign(pre,cur),{});}var _styleSheet=_indexScssStyleSheet;console.log({taro:taro});function Cell(_ref){var children=_ref.children,style=_ref.style;var childs=Array.isArray(children)?children:[children];return jsx(View,{style:_mergeEleStyles(_styleSheet["cellGroup"],Object.assign({},style)),children:childs.map(function(it,i){return [it].concat(i===children.length-1?[]:jsx(View,{style:_styleSheet["cellItem__line"]}
|
|
54
|
+
function _mergeEleStyles(){return [].concat.apply([],arguments).reduce((pre,cur)=>Object.assign(pre,cur),{});}var _styleSheet=_indexScssStyleSheet;console.log({taro:taro});function Cell(_ref){var children=_ref.children,style=_ref.style;var childs=Array.isArray(children)?children:[children];return jsx(View,{style:_mergeEleStyles(_styleSheet["cellGroup"],Object.assign({},style)),children:childs.map(function(it,i){return [it].concat(i===children.length-1?[]:jsx(View,{style:_styleSheet["cellItem__line"]},"line-"+i));})});}function Item(_ref2){var title=_ref2.title,children=_ref2.children,style=_ref2.style;return jsxs(View,{style:_mergeEleStyles(_styleSheet["cellItem"],Object.assign({},style)),children:[jsx(Text,{style:_styleSheet["cellItem__title"],children:title}),jsx(View,{style:_styleSheet["cellItem__content"],children:children})]});}Cell.Item=Item;
|
|
55
55
|
|
|
56
56
|
export { Cell as default };
|
|
57
57
|
",
|
|
@@ -146,7 +146,7 @@ var _indexScssStyleSheet = StyleSheet.create({
|
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
148
|
|
|
149
|
-
function _mergeEleStyles(){return [].concat.apply([],arguments).reduce((pre,cur)=>Object.assign(pre,cur),{});}var _styleSheet=_indexScssStyleSheet;console.log({taro:taro});function Cell(_ref){var children=_ref.children,style=_ref.style;var childs=Array.isArray(children)?children:[children];return jsx(View,{style:_mergeEleStyles(_styleSheet["cellGroup"],Object.assign({},style)),children:childs.map(function(it,i){return [it].concat(i===children.length-1?[]:jsx(View,{style:_styleSheet["cellItem__line"]}
|
|
149
|
+
function _mergeEleStyles(){return [].concat.apply([],arguments).reduce((pre,cur)=>Object.assign(pre,cur),{});}var _styleSheet=_indexScssStyleSheet;console.log({taro:taro});function Cell(_ref){var children=_ref.children,style=_ref.style;var childs=Array.isArray(children)?children:[children];return jsx(View,{style:_mergeEleStyles(_styleSheet["cellGroup"],Object.assign({},style)),children:childs.map(function(it,i){return [it].concat(i===children.length-1?[]:jsx(View,{style:_styleSheet["cellItem__line"]},"line-"+i));})});}function Item(_ref2){var title=_ref2.title,children=_ref2.children,style=_ref2.style;return jsxs(View,{style:_mergeEleStyles(_styleSheet["cellItem"],Object.assign({},style)),children:[jsx(Text,{style:_styleSheet["cellItem__title"],children:title}),jsx(View,{style:_styleSheet["cellItem__content"],children:children})]});}Cell.Item=Item;
|
|
150
150
|
|
|
151
151
|
export { Cell as default };
|
|
152
152
|
",
|
|
@@ -207,7 +207,9 @@ export { Navbar as default };
|
|
|
207
207
|
|
|
208
208
|
exports[`build_components named export 1`] = `
|
|
209
209
|
[
|
|
210
|
-
"import { Platform as Platform$
|
|
210
|
+
"import { Platform as Platform$1, NativeModules, NativeEventEmitter } from 'react-native';
|
|
211
|
+
import 'react';
|
|
212
|
+
import require$$0 from 'crypto';
|
|
211
213
|
|
|
212
214
|
function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}
|
|
213
215
|
|
|
@@ -233,12 +235,18 @@ function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var inf
|
|
|
233
235
|
|
|
234
236
|
function _defineProperty(obj,key,value){key=_toPropertyKey(key);if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else {obj[key]=value;}return obj;}
|
|
235
237
|
|
|
238
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
239
|
+
|
|
236
240
|
var invariant=function(condition,format,a,b,c,d,e,f){if(!condition){var error;if(format===undefined){error=new Error('Minified exception occurred; use the non-minified dev environment '+'for the full error message and additional helpful warnings.');}else {var args=[a,b,c,d,e,f];var argIndex=0;error=new Error(format.replace(/%s/g,function(){return args[argIndex++];}));error.name='Invariant Violation';}error.framesToPop=1;throw error;}};var invariant_1=invariant;
|
|
237
241
|
|
|
238
|
-
var nativeEmitterSubscriptionKey='@@nativeEmitterSubscription@@';var EventEmitter=function(){function EventEmitter(nativeModule){_classCallCheck(this,EventEmitter);this._listenerCount=0;if(nativeModule.__expo_module_name__&&NativeModules.EXReactNativeEventEmitter){nativeModule.addListener=function(){var _NativeModules$EXReac;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return (_NativeModules$EXReac=NativeModules.EXReactNativeEventEmitter).addProxiedListener.apply(_NativeModules$EXReac,[nativeModule.__expo_module_name__].concat(args));};nativeModule.removeListeners=function(){var _NativeModules$EXReac2;for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}return (_NativeModules$EXReac2=NativeModules.EXReactNativeEventEmitter).removeProxiedListeners.apply(_NativeModules$EXReac2,[nativeModule.__expo_module_name__].concat(args));};}this._nativeModule=nativeModule;this._eventEmitter=new NativeEventEmitter(nativeModule);}_createClass(EventEmitter,[{key:"addListener",value:function addListener(eventName,listener){var _this=this,_subscription;if(!this._listenerCount&&Platform$
|
|
242
|
+
var nativeEmitterSubscriptionKey='@@nativeEmitterSubscription@@';var EventEmitter=function(){function EventEmitter(nativeModule){_classCallCheck(this,EventEmitter);this._listenerCount=0;if(nativeModule.__expo_module_name__&&NativeModules.EXReactNativeEventEmitter){nativeModule.addListener=function(){var _NativeModules$EXReac;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return (_NativeModules$EXReac=NativeModules.EXReactNativeEventEmitter).addProxiedListener.apply(_NativeModules$EXReac,[nativeModule.__expo_module_name__].concat(args));};nativeModule.removeListeners=function(){var _NativeModules$EXReac2;for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}return (_NativeModules$EXReac2=NativeModules.EXReactNativeEventEmitter).removeProxiedListeners.apply(_NativeModules$EXReac2,[nativeModule.__expo_module_name__].concat(args));};}this._nativeModule=nativeModule;this._eventEmitter=new NativeEventEmitter(nativeModule);}_createClass(EventEmitter,[{key:"addListener",value:function addListener(eventName,listener){var _this=this,_subscription;if(!this._listenerCount&&Platform$1.OS!=='ios'&&this._nativeModule.startObserving){this._nativeModule.startObserving();}this._listenerCount++;var nativeEmitterSubscription=this._eventEmitter.addListener(eventName,listener);var subscription=(_subscription={},_defineProperty(_subscription,nativeEmitterSubscriptionKey,nativeEmitterSubscription),_defineProperty(_subscription,"remove",function remove(){_this.removeSubscription(subscription);}),_subscription);return subscription;}},{key:"removeAllListeners",value:function removeAllListeners(eventName){var removedListenerCount=this._eventEmitter.listenerCount?this._eventEmitter.listenerCount(eventName):this._eventEmitter.listeners(eventName).length;this._eventEmitter.removeAllListeners(eventName);this._listenerCount-=removedListenerCount;invariant_1(this._listenerCount>=0,"EventEmitter must have a non-negative number of listeners");if(!this._listenerCount&&Platform$1.OS!=='ios'&&this._nativeModule.stopObserving){this._nativeModule.stopObserving();}}},{key:"removeSubscription",value:function removeSubscription(subscription){var nativeEmitterSubscription=subscription[nativeEmitterSubscriptionKey];if(!nativeEmitterSubscription){return;}if('remove'in nativeEmitterSubscription){nativeEmitterSubscription.remove();}else if('removeSubscription'in this._eventEmitter){this._eventEmitter.removeSubscription(nativeEmitterSubscription);}this._listenerCount--;delete subscription[nativeEmitterSubscriptionKey];subscription.remove=function(){};if(!this._listenerCount&&Platform$1.OS!=='ios'&&this._nativeModule.stopObserving){this._nativeModule.stopObserving();}}},{key:"emit",value:function emit(eventName){var _this$_eventEmitter;for(var _len3=arguments.length,params=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){params[_key3-1]=arguments[_key3];}(_this$_eventEmitter=this._eventEmitter).emit.apply(_this$_eventEmitter,[eventName].concat(params));}}]);return EventEmitter;}();
|
|
239
243
|
|
|
240
244
|
var NativeModulesProxy = {};
|
|
241
245
|
|
|
246
|
+
var isDOMAvailable=false;var canUseEventListeners=false;var canUseViewport=false;var isAsyncDebugging=false;if(__DEV__){isAsyncDebugging=!global.nativeExtensions&&!global.nativeCallSyncHook&&!global.RN$Bridgeless;}
|
|
247
|
+
|
|
248
|
+
var Platform={OS:Platform$1.OS,select:Platform$1.select,isDOMAvailable:isDOMAvailable,canUseEventListeners:canUseEventListeners,canUseViewport:canUseViewport,isAsyncDebugging:isAsyncDebugging};
|
|
249
|
+
|
|
242
250
|
function _isNativeFunction(fn){return Function.toString.call(fn).indexOf("[native code]")!==-1;}
|
|
243
251
|
|
|
244
252
|
function _isNativeReflectConstruct$3(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}
|
|
@@ -249,36 +257,41 @@ function _wrapNativeSuper(Class){var _cache=typeof Map==="function"?new Map():un
|
|
|
249
257
|
|
|
250
258
|
function _createSuper$2(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct$2();return function(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else {result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct$2(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}var CodedError=function(_Error){_inherits(CodedError,_Error);var _super=_createSuper$2(CodedError);function CodedError(code,message){var _this;_classCallCheck(this,CodedError);_this=_super.call(this,message);_this.code=code;return _this;}return _createClass(CodedError);}(_wrapNativeSuper(Error));
|
|
251
259
|
|
|
252
|
-
var
|
|
260
|
+
function _createSuper$1(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct$1();return function(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else {result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct$1(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}var UnavailabilityError=function(_CodedError){_inherits(UnavailabilityError,_CodedError);var _super=_createSuper$1(UnavailabilityError);function UnavailabilityError(moduleName,propertyName){_classCallCheck(this,UnavailabilityError);return _super.call(this,'ERR_UNAVAILABLE',"The method or property "+moduleName+"."+propertyName+" is not available on "+Platform.OS+", are you sure you've linked all the native dependencies properly?");}return _createClass(UnavailabilityError);}(CodedError);
|
|
253
261
|
|
|
254
|
-
var
|
|
262
|
+
var NativeErrorManager = NativeModulesProxy.ExpoModulesCoreErrorManager;
|
|
255
263
|
|
|
256
|
-
|
|
264
|
+
if(__DEV__&&Platform.OS==='android'&&NativeErrorManager){var onNewException='ExpoModulesCoreErrorManager.onNewException';var eventEmitter=new EventEmitter(NativeErrorManager);eventEmitter.addListener(onNewException,function(_ref){var message=_ref.message;console.error(message);});}global.ExpoModulesCore_CodedError=CodedError;
|
|
257
265
|
|
|
258
|
-
var
|
|
266
|
+
var compareVersions = {exports: {}};
|
|
267
|
+
|
|
268
|
+
(function(module){(function(root,factory){module.exports=factory();})(commonjsGlobal,function(){var semver=/^v?(?:\\d+)(\\.(?:[x*]|\\d+)(\\.(?:[x*]|\\d+)(\\.(?:[x*]|\\d+))?(?:-[\\da-z\\-]+(?:\\.[\\da-z\\-]+)*)?(?:\\+[\\da-z\\-]+(?:\\.[\\da-z\\-]+)*)?)?)?$/i;function indexOrEnd(str,q){return str.indexOf(q)===-1?str.length:str.indexOf(q);}function split(v){var c=v.replace(/^v/,'').replace(/\\+.*$/,'');var patchIndex=indexOrEnd(c,'-');var arr=c.substring(0,patchIndex).split('.');arr.push(c.substring(patchIndex+1));return arr;}function tryParse(v){return isNaN(Number(v))?v:Number(v);}function validate(version){if(typeof version!=='string'){throw new TypeError('Invalid argument expected string');}if(!semver.test(version)){throw new Error('Invalid argument not valid semver (\\''+version+'\\' received)');}}function compareVersions(v1,v2){[v1,v2].forEach(validate);var s1=split(v1);var s2=split(v2);for(var i=0;i<Math.max(s1.length-1,s2.length-1);i++){var n1=parseInt(s1[i]||0,10);var n2=parseInt(s2[i]||0,10);if(n1>n2)return 1;if(n2>n1)return -1;}var sp1=s1[s1.length-1];var sp2=s2[s2.length-1];if(sp1&&sp2){var p1=sp1.split('.').map(tryParse);var p2=sp2.split('.').map(tryParse);for(i=0;i<Math.max(p1.length,p2.length);i++){if(p1[i]===undefined||typeof p2[i]==='string'&&typeof p1[i]==='number')return -1;if(p2[i]===undefined||typeof p1[i]==='string'&&typeof p2[i]==='number')return 1;if(p1[i]>p2[i])return 1;if(p2[i]>p1[i])return -1;}}else if(sp1||sp2){return sp1?-1:1;}return 0;}var allowedOperators=['>','>=','=','<','<='];var operatorResMap={'>':[1],'>=':[0,1],'=':[0],'<=':[-1,0],'<':[-1]};function validateOperator(op){if(typeof op!=='string'){throw new TypeError('Invalid operator type, expected string but got '+typeof op);}if(allowedOperators.indexOf(op)===-1){throw new TypeError('Invalid operator, expected one of '+allowedOperators.join('|'));}}compareVersions.validate=function(version){return typeof version==='string'&&semver.test(version);};compareVersions.compare=function(v1,v2,operator){validateOperator(operator);var res=compareVersions(v1,v2);return operatorResMap[operator].indexOf(res)>-1;};return compareVersions;});})(compareVersions);
|
|
269
|
+
|
|
270
|
+
var PermissionStatus;(function(PermissionStatus){PermissionStatus["GRANTED"]="granted";PermissionStatus["UNDETERMINED"]="undetermined";PermissionStatus["DENIED"]="denied";})(PermissionStatus||(PermissionStatus={}));
|
|
259
271
|
|
|
260
|
-
|
|
272
|
+
var crypto=require$$0;var rng$2=function(){return crypto.randomBytes(16);};
|
|
261
273
|
|
|
262
|
-
var byteToHex=[];for(var i=0;i<256;++i){byteToHex[i]=(i+0x100).toString(16).substr(1);}function bytesToUuid(buf,offset){var i=offset||0;var bth=byteToHex;return [bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],'-',bth[buf[i++]],bth[buf[i++]],'-',bth[buf[i++]],bth[buf[i++]],'-',bth[buf[i++]],bth[buf[i++]],'-',bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]]].join('');}
|
|
274
|
+
var byteToHex=[];for(var i=0;i<256;++i){byteToHex[i]=(i+0x100).toString(16).substr(1);}function bytesToUuid$2(buf,offset){var i=offset||0;var bth=byteToHex;return [bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],'-',bth[buf[i++]],bth[buf[i++]],'-',bth[buf[i++]],bth[buf[i++]],'-',bth[buf[i++]],bth[buf[i++]],'-',bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]]].join('');}var bytesToUuid_1=bytesToUuid$2;
|
|
263
275
|
|
|
264
|
-
var
|
|
276
|
+
var rng$1=rng$2;var bytesToUuid$1=bytesToUuid_1;var _nodeId;var _clockseq;var _lastMSecs=0;var _lastNSecs=0;function v1$1(options,buf,offset){var i=buf&&offset||0;var b=buf||[];options=options||{};var node=options.node||_nodeId;var clockseq=options.clockseq!==undefined?options.clockseq:_clockseq;if(node==null||clockseq==null){var seedBytes=rng$1();if(node==null){node=_nodeId=[seedBytes[0]|0x01,seedBytes[1],seedBytes[2],seedBytes[3],seedBytes[4],seedBytes[5]];}if(clockseq==null){clockseq=_clockseq=(seedBytes[6]<<8|seedBytes[7])&0x3fff;}}var msecs=options.msecs!==undefined?options.msecs:new Date().getTime();var nsecs=options.nsecs!==undefined?options.nsecs:_lastNSecs+1;var dt=msecs-_lastMSecs+(nsecs-_lastNSecs)/10000;if(dt<0&&options.clockseq===undefined){clockseq=clockseq+1&0x3fff;}if((dt<0||msecs>_lastMSecs)&&options.nsecs===undefined){nsecs=0;}if(nsecs>=10000){throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');}_lastMSecs=msecs;_lastNSecs=nsecs;_clockseq=clockseq;msecs+=12219292800000;var tl=((msecs&0xfffffff)*10000+nsecs)%0x100000000;b[i++]=tl>>>24&0xff;b[i++]=tl>>>16&0xff;b[i++]=tl>>>8&0xff;b[i++]=tl&0xff;var tmh=msecs/0x100000000*10000&0xfffffff;b[i++]=tmh>>>8&0xff;b[i++]=tmh&0xff;b[i++]=tmh>>>24&0xf|0x10;b[i++]=tmh>>>16&0xff;b[i++]=clockseq>>>8|0x80;b[i++]=clockseq&0xff;for(var n=0;n<6;++n){b[i+n]=node[n];}return buf?buf:bytesToUuid$1(b);}var v1_1=v1$1;
|
|
265
277
|
|
|
266
|
-
var
|
|
278
|
+
var rng=rng$2;var bytesToUuid=bytesToUuid_1;function v4$1(options,buf,offset){var i=buf&&offset||0;if(typeof options=='string'){buf=options==='binary'?new Array(16):null;options=null;}options=options||{};var rnds=options.random||(options.rng||rng)();rnds[6]=rnds[6]&0x0f|0x40;rnds[8]=rnds[8]&0x3f|0x80;if(buf){for(var ii=0;ii<16;++ii){buf[i+ii]=rnds[ii];}}return buf||bytesToUuid(rnds);}var v4_1=v4$1;
|
|
267
279
|
|
|
268
|
-
|
|
280
|
+
var v1=v1_1;var v4=v4_1;var uuid=v4;uuid.v1=v1;uuid.v4=v4;var uuid_1=uuid;
|
|
269
281
|
|
|
270
|
-
var platformModule={get name(){return 'ExponentFileSystem';},get documentDirectory(){return null;},get cacheDirectory(){return null;},get bundleDirectory(){return null;},addListener:function addListener(){},removeListeners:function removeListeners(){}};var ExponentFileSystemShim = platformModule;
|
|
282
|
+
var platformModule$1={get name(){return 'ExponentFileSystem';},get documentDirectory(){return null;},get cacheDirectory(){return null;},get bundledAssets(){return null;},get bundleDirectory(){return null;},addListener:function addListener(){},removeListeners:function removeListeners(){}};var ExponentFileSystemShim = platformModule$1;
|
|
271
283
|
|
|
272
|
-
var
|
|
284
|
+
var platformModule;if(NativeModulesProxy.ExponentFileSystem){platformModule=NativeModulesProxy.ExponentFileSystem;}else {platformModule=ExponentFileSystemShim;}var ExponentFileSystem = platformModule;
|
|
273
285
|
|
|
274
286
|
var FileSystemSessionType;(function(FileSystemSessionType){FileSystemSessionType[FileSystemSessionType["BACKGROUND"]=0]="BACKGROUND";FileSystemSessionType[FileSystemSessionType["FOREGROUND"]=1]="FOREGROUND";})(FileSystemSessionType||(FileSystemSessionType={}));var FileSystemUploadType;(function(FileSystemUploadType){FileSystemUploadType[FileSystemUploadType["BINARY_CONTENT"]=0]="BINARY_CONTENT";FileSystemUploadType[FileSystemUploadType["MULTIPART"]=1]="MULTIPART";})(FileSystemUploadType||(FileSystemUploadType={}));var EncodingType;(function(EncodingType){EncodingType["UTF8"]="utf8";EncodingType["Base64"]="base64";})(EncodingType||(EncodingType={}));
|
|
275
287
|
|
|
276
|
-
function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else {result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}if(!ExponentFileSystem){console.warn("No native ExponentFileSystem module found, are you sure the expo-file-system's module is linked properly?");}new EventEmitter(ExponentFileSystem);function normalizeEndingSlash(p){if(p!=null){return p.replace(/\\/*$/,'')+'/';}return null;}var documentDirectory=normalizeEndingSlash(ExponentFileSystem.documentDirectory);var cacheDirectory=normalizeEndingSlash(ExponentFileSystem.cacheDirectory);var bundleDirectory=normalizeEndingSlash(ExponentFileSystem.bundleDirectory);function getInfoAsync(){return _getInfoAsync.apply(this,arguments);}function _getInfoAsync(){_getInfoAsync=_asyncToGenerator(function*(fileUri){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!ExponentFileSystem.getInfoAsync){throw new UnavailabilityError('expo-file-system','getInfoAsync');}return yield ExponentFileSystem.getInfoAsync(fileUri,options);});return _getInfoAsync.apply(this,arguments);}function readAsStringAsync(){return _readAsStringAsync.apply(this,arguments);}function _readAsStringAsync(){_readAsStringAsync=_asyncToGenerator(function*(fileUri){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!ExponentFileSystem.readAsStringAsync){throw new UnavailabilityError('expo-file-system','readAsStringAsync');}return yield ExponentFileSystem.readAsStringAsync(fileUri,options);});return _readAsStringAsync.apply(this,arguments);}function getContentUriAsync(){return _getContentUriAsync.apply(this,arguments);}function _getContentUriAsync(){_getContentUriAsync=_asyncToGenerator(function*(fileUri){if(Platform$2.OS==='android'){if(!ExponentFileSystem.getContentUriAsync){throw new UnavailabilityError('expo-file-system','getContentUriAsync');}return yield ExponentFileSystem.getContentUriAsync(fileUri);}else {return fileUri;}});return _getContentUriAsync.apply(this,arguments);}function writeAsStringAsync(){return _writeAsStringAsync.apply(this,arguments);}function _writeAsStringAsync(){_writeAsStringAsync=_asyncToGenerator(function*(fileUri,contents){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(!ExponentFileSystem.writeAsStringAsync){throw new UnavailabilityError('expo-file-system','writeAsStringAsync');}return yield ExponentFileSystem.writeAsStringAsync(fileUri,contents,options);});return _writeAsStringAsync.apply(this,arguments);}function deleteAsync(){return _deleteAsync.apply(this,arguments);}function _deleteAsync(){_deleteAsync=_asyncToGenerator(function*(fileUri){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!ExponentFileSystem.deleteAsync){throw new UnavailabilityError('expo-file-system','deleteAsync');}return yield ExponentFileSystem.deleteAsync(fileUri,options);});return _deleteAsync.apply(this,arguments);}function deleteLegacyDocumentDirectoryAndroid(){return _deleteLegacyDocumentDirectoryAndroid.apply(this,arguments);}function _deleteLegacyDocumentDirectoryAndroid(){_deleteLegacyDocumentDirectoryAndroid=_asyncToGenerator(function*(){if(Platform$2.OS!=='android'||documentDirectory==null){return;}return yield deleteAsync(\`\${documentDirectory}ExperienceData/\`,{idempotent:true});});return _deleteLegacyDocumentDirectoryAndroid.apply(this,arguments);}function moveAsync(){return _moveAsync.apply(this,arguments);}function _moveAsync(){_moveAsync=_asyncToGenerator(function*(options){if(!ExponentFileSystem.moveAsync){throw new UnavailabilityError('expo-file-system','moveAsync');}return yield ExponentFileSystem.moveAsync(options);});return _moveAsync.apply(this,arguments);}function copyAsync(){return _copyAsync.apply(this,arguments);}function _copyAsync(){_copyAsync=_asyncToGenerator(function*(options){if(!ExponentFileSystem.copyAsync){throw new UnavailabilityError('expo-file-system','copyAsync');}return yield ExponentFileSystem.copyAsync(options);});return _copyAsync.apply(this,arguments);}function makeDirectoryAsync(){return _makeDirectoryAsync.apply(this,arguments);}function _makeDirectoryAsync(){_makeDirectoryAsync=_asyncToGenerator(function*(fileUri){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!ExponentFileSystem.makeDirectoryAsync){throw new UnavailabilityError('expo-file-system','makeDirectoryAsync');}return yield ExponentFileSystem.makeDirectoryAsync(fileUri,options);});return _makeDirectoryAsync.apply(this,arguments);}function readDirectoryAsync(){return _readDirectoryAsync.apply(this,arguments);}function _readDirectoryAsync(){_readDirectoryAsync=_asyncToGenerator(function*(fileUri){if(!ExponentFileSystem.readDirectoryAsync){throw new UnavailabilityError('expo-file-system','readDirectoryAsync');}return yield ExponentFileSystem.readDirectoryAsync(fileUri);});return _readDirectoryAsync.apply(this,arguments);}function getFreeDiskStorageAsync(){return _getFreeDiskStorageAsync.apply(this,arguments);}function _getFreeDiskStorageAsync(){_getFreeDiskStorageAsync=_asyncToGenerator(function*(){if(!ExponentFileSystem.getFreeDiskStorageAsync){throw new UnavailabilityError('expo-file-system','getFreeDiskStorageAsync');}return yield ExponentFileSystem.getFreeDiskStorageAsync();});return _getFreeDiskStorageAsync.apply(this,arguments);}function getTotalDiskCapacityAsync(){return _getTotalDiskCapacityAsync.apply(this,arguments);}function _getTotalDiskCapacityAsync(){_getTotalDiskCapacityAsync=_asyncToGenerator(function*(){if(!ExponentFileSystem.getTotalDiskCapacityAsync){throw new UnavailabilityError('expo-file-system','getTotalDiskCapacityAsync');}return yield ExponentFileSystem.getTotalDiskCapacityAsync();});return _getTotalDiskCapacityAsync.apply(this,arguments);}function downloadAsync(){return _downloadAsync.apply(this,arguments);}function _downloadAsync(){_downloadAsync=_asyncToGenerator(function*(uri,fileUri){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(!ExponentFileSystem.downloadAsync){throw new UnavailabilityError('expo-file-system','downloadAsync');}return yield ExponentFileSystem.downloadAsync(uri,fileUri,Object.assign({sessionType:FileSystemSessionType.BACKGROUND},options));});return _downloadAsync.apply(this,arguments);}function uploadAsync(){return _uploadAsync.apply(this,arguments);}function _uploadAsync(){_uploadAsync=_asyncToGenerator(function*(url,fileUri){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(!ExponentFileSystem.uploadAsync){throw new UnavailabilityError('expo-file-system','uploadAsync');}return yield ExponentFileSystem.uploadAsync(url,fileUri,Object.assign({sessionType:FileSystemSessionType.BACKGROUND,uploadType:FileSystemUploadType.BINARY_CONTENT},options,{httpMethod:(options.httpMethod||'POST').toUpperCase()}));});return _uploadAsync.apply(this,arguments);}function createDownloadResumable(uri,fileUri,options,callback,resumeData){return new DownloadResumable(uri,fileUri,options,callback,resumeData);}function createUploadTask(url,fileUri,options,callback){return new UploadTask(url,fileUri,options,callback);}var FileSystemCancellableNetworkTask=function(){function FileSystemCancellableNetworkTask(){_classCallCheck(this,FileSystemCancellableNetworkTask);this._uuid=uuid$1.v4();this.taskWasCanceled=false;this.emitter=new EventEmitter(ExponentFileSystem);}_createClass(FileSystemCancellableNetworkTask,[{key:"cancelAsync",value:function(){var _cancelAsync=_asyncToGenerator(function*(){if(!ExponentFileSystem.networkTaskCancelAsync){throw new UnavailabilityError('expo-file-system','networkTaskCancelAsync');}this.removeSubscription();this.taskWasCanceled=true;return yield ExponentFileSystem.networkTaskCancelAsync(this.uuid);});function cancelAsync(){return _cancelAsync.apply(this,arguments);}return cancelAsync;}()},{key:"isTaskCancelled",value:function isTaskCancelled(){if(this.taskWasCanceled){console.warn('This task was already canceled.');return true;}return false;}},{key:"uuid",get:function get(){return this._uuid;}},{key:"addSubscription",value:function addSubscription(){var _this=this;if(this.subscription){return;}this.subscription=this.emitter.addListener(this.getEventName(),function(event){if(event.uuid===_this.uuid){var callback=_this.getCallback();if(callback){callback(event.data);}}});}},{key:"removeSubscription",value:function removeSubscription(){if(!this.subscription){return;}this.emitter.removeSubscription(this.subscription);this.subscription=null;}}]);return FileSystemCancellableNetworkTask;}();var UploadTask=function(_FileSystemCancellabl){_inherits(UploadTask,_FileSystemCancellabl);var _super=_createSuper(UploadTask);function UploadTask(url,fileUri,options,callback){var _options$httpMethod;var _this2;_classCallCheck(this,UploadTask);_this2=_super.call(this);_this2.url=url;_this2.fileUri=fileUri;_this2.callback=callback;var httpMethod=(options==null?void 0:(_options$httpMethod=options.httpMethod)==null?void 0:_options$httpMethod.toUpperCase())||'POST';_this2.options=Object.assign({sessionType:FileSystemSessionType.BACKGROUND,uploadType:FileSystemUploadType.BINARY_CONTENT},options,{httpMethod:httpMethod});return _this2;}_createClass(UploadTask,[{key:"getEventName",value:function getEventName(){return 'expo-file-system.uploadProgress';}},{key:"getCallback",value:function getCallback(){return this.callback;}},{key:"uploadAsync",value:function(){var _uploadAsync2=_asyncToGenerator(function*(){if(!ExponentFileSystem.uploadTaskStartAsync){throw new UnavailabilityError('expo-file-system','uploadTaskStartAsync');}if(this.isTaskCancelled()){return;}this.addSubscription();var result=yield ExponentFileSystem.uploadTaskStartAsync(this.url,this.fileUri,this.uuid,this.options);this.removeSubscription();return result;});function uploadAsync(){return _uploadAsync2.apply(this,arguments);}return uploadAsync;}()}]);return UploadTask;}(FileSystemCancellableNetworkTask);var DownloadResumable=function(_FileSystemCancellabl2){_inherits(DownloadResumable,_FileSystemCancellabl2);var _super2=_createSuper(DownloadResumable);function DownloadResumable(url,_fileUri){var _this3;var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var callback=arguments.length>3?arguments[3]:undefined;var resumeData=arguments.length>4?arguments[4]:undefined;_classCallCheck(this,DownloadResumable);_this3=_super2.call(this);_this3.url=url;_this3._fileUri=_fileUri;_this3.options=options;_this3.callback=callback;_this3.resumeData=resumeData;return _this3;}_createClass(DownloadResumable,[{key:"fileUri",get:function get(){return this._fileUri;}},{key:"getEventName",value:function getEventName(){return 'expo-file-system.downloadProgress';}},{key:"getCallback",value:function getCallback(){return this.callback;}},{key:"downloadAsync",value:function(){var _downloadAsync2=_asyncToGenerator(function*(){if(!ExponentFileSystem.downloadResumableStartAsync){throw new UnavailabilityError('expo-file-system','downloadResumableStartAsync');}if(this.isTaskCancelled()){return;}this.addSubscription();return yield ExponentFileSystem.downloadResumableStartAsync(this.url,this._fileUri,this.uuid,this.options,this.resumeData);});function downloadAsync(){return _downloadAsync2.apply(this,arguments);}return downloadAsync;}()},{key:"pauseAsync",value:function(){var _pauseAsync=_asyncToGenerator(function*(){if(!ExponentFileSystem.downloadResumablePauseAsync){throw new UnavailabilityError('expo-file-system','downloadResumablePauseAsync');}if(this.isTaskCancelled()){return {fileUri:this._fileUri,options:this.options,url:this.url};}var pauseResult=yield ExponentFileSystem.downloadResumablePauseAsync(this.uuid);this.removeSubscription();if(pauseResult){this.resumeData=pauseResult.resumeData;return this.savable();}else {throw new Error('Unable to generate a savable pause state');}});function pauseAsync(){return _pauseAsync.apply(this,arguments);}return pauseAsync;}()},{key:"resumeAsync",value:function(){var _resumeAsync=_asyncToGenerator(function*(){if(!ExponentFileSystem.downloadResumableStartAsync){throw new UnavailabilityError('expo-file-system','downloadResumableStartAsync');}if(this.isTaskCancelled()){return;}this.addSubscription();return yield ExponentFileSystem.downloadResumableStartAsync(this.url,this.fileUri,this.uuid,this.options,this.resumeData);});function resumeAsync(){return _resumeAsync.apply(this,arguments);}return resumeAsync;}()},{key:"savable",value:function savable(){return {url:this.url,fileUri:this.fileUri,options:this.options,resumeData:this.resumeData};}}]);return DownloadResumable;}(FileSystemCancellableNetworkTask);var baseReadAsStringAsync=readAsStringAsync;var baseWriteAsStringAsync=writeAsStringAsync;var baseDeleteAsync=deleteAsync;var baseMoveAsync=moveAsync;var baseCopyAsync=copyAsync;var StorageAccessFramework;(function(StorageAccessFramework){StorageAccessFramework.getUriForDirectoryInRoot=function getUriForDirectoryInRoot(folderName){return \`content://com.android.externalstorage.documents/tree/primary:\${folderName}/document/primary:\${folderName}\`;};function requestDirectoryPermissionsAsync(){return _requestDirectoryPermissionsAsync.apply(this,arguments);}function _requestDirectoryPermissionsAsync(){_requestDirectoryPermissionsAsync=_asyncToGenerator(function*(){var initialFileUrl=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;if(!ExponentFileSystem.requestDirectoryPermissionsAsync){throw new UnavailabilityError('expo-file-system','StorageAccessFramework.requestDirectoryPermissionsAsync');}return yield ExponentFileSystem.requestDirectoryPermissionsAsync(initialFileUrl);});return _requestDirectoryPermissionsAsync.apply(this,arguments);}StorageAccessFramework.requestDirectoryPermissionsAsync=requestDirectoryPermissionsAsync;function readDirectoryAsync(_x15){return _readDirectoryAsync2.apply(this,arguments);}function _readDirectoryAsync2(){_readDirectoryAsync2=_asyncToGenerator(function*(dirUri){if(!ExponentFileSystem.readSAFDirectoryAsync){throw new UnavailabilityError('expo-file-system','StorageAccessFramework.readDirectoryAsync');}return yield ExponentFileSystem.readSAFDirectoryAsync(dirUri);});return _readDirectoryAsync2.apply(this,arguments);}StorageAccessFramework.readDirectoryAsync=readDirectoryAsync;function makeDirectoryAsync(_x16,_x17){return _makeDirectoryAsync2.apply(this,arguments);}function _makeDirectoryAsync2(){_makeDirectoryAsync2=_asyncToGenerator(function*(parentUri,dirName){if(!ExponentFileSystem.makeSAFDirectoryAsync){throw new UnavailabilityError('expo-file-system','StorageAccessFramework.makeDirectoryAsync');}return yield ExponentFileSystem.makeSAFDirectoryAsync(parentUri,dirName);});return _makeDirectoryAsync2.apply(this,arguments);}StorageAccessFramework.makeDirectoryAsync=makeDirectoryAsync;function createFileAsync(_x18,_x19,_x20){return _createFileAsync.apply(this,arguments);}function _createFileAsync(){_createFileAsync=_asyncToGenerator(function*(parentUri,fileName,mimeType){if(!ExponentFileSystem.createSAFFileAsync){throw new UnavailabilityError('expo-file-system','StorageAccessFramework.createFileAsync');}return yield ExponentFileSystem.createSAFFileAsync(parentUri,fileName,mimeType);});return _createFileAsync.apply(this,arguments);}StorageAccessFramework.createFileAsync=createFileAsync;StorageAccessFramework.writeAsStringAsync=baseWriteAsStringAsync;StorageAccessFramework.readAsStringAsync=baseReadAsStringAsync;StorageAccessFramework.deleteAsync=baseDeleteAsync;StorageAccessFramework.moveAsync=baseMoveAsync;StorageAccessFramework.copyAsync=baseCopyAsync;})(StorageAccessFramework||(StorageAccessFramework={}));
|
|
288
|
+
function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else {result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}if(!ExponentFileSystem){console.warn("No native ExponentFileSystem module found, are you sure the expo-file-system's module is linked properly?");}new EventEmitter(ExponentFileSystem);function normalizeEndingSlash(p){if(p!=null){return p.replace(/\\/*$/,'')+'/';}return null;}var documentDirectory=normalizeEndingSlash(ExponentFileSystem.documentDirectory);var cacheDirectory=normalizeEndingSlash(ExponentFileSystem.cacheDirectory);var bundledAssets=ExponentFileSystem.bundledAssets,bundleDirectory=ExponentFileSystem.bundleDirectory;function getInfoAsync(){return _getInfoAsync.apply(this,arguments);}function _getInfoAsync(){_getInfoAsync=_asyncToGenerator(function*(fileUri){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!ExponentFileSystem.getInfoAsync){throw new UnavailabilityError('expo-file-system','getInfoAsync');}return yield ExponentFileSystem.getInfoAsync(fileUri,options);});return _getInfoAsync.apply(this,arguments);}function readAsStringAsync(){return _readAsStringAsync.apply(this,arguments);}function _readAsStringAsync(){_readAsStringAsync=_asyncToGenerator(function*(fileUri){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!ExponentFileSystem.readAsStringAsync){throw new UnavailabilityError('expo-file-system','readAsStringAsync');}return yield ExponentFileSystem.readAsStringAsync(fileUri,options);});return _readAsStringAsync.apply(this,arguments);}function getContentUriAsync(){return _getContentUriAsync.apply(this,arguments);}function _getContentUriAsync(){_getContentUriAsync=_asyncToGenerator(function*(fileUri){if(Platform$1.OS==='android'){if(!ExponentFileSystem.getContentUriAsync){throw new UnavailabilityError('expo-file-system','getContentUriAsync');}return yield ExponentFileSystem.getContentUriAsync(fileUri);}else {return fileUri;}});return _getContentUriAsync.apply(this,arguments);}function writeAsStringAsync(){return _writeAsStringAsync.apply(this,arguments);}function _writeAsStringAsync(){_writeAsStringAsync=_asyncToGenerator(function*(fileUri,contents){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(!ExponentFileSystem.writeAsStringAsync){throw new UnavailabilityError('expo-file-system','writeAsStringAsync');}return yield ExponentFileSystem.writeAsStringAsync(fileUri,contents,options);});return _writeAsStringAsync.apply(this,arguments);}function deleteAsync(){return _deleteAsync.apply(this,arguments);}function _deleteAsync(){_deleteAsync=_asyncToGenerator(function*(fileUri){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!ExponentFileSystem.deleteAsync){throw new UnavailabilityError('expo-file-system','deleteAsync');}return yield ExponentFileSystem.deleteAsync(fileUri,options);});return _deleteAsync.apply(this,arguments);}function deleteLegacyDocumentDirectoryAndroid(){return _deleteLegacyDocumentDirectoryAndroid.apply(this,arguments);}function _deleteLegacyDocumentDirectoryAndroid(){_deleteLegacyDocumentDirectoryAndroid=_asyncToGenerator(function*(){if(Platform$1.OS!=='android'||documentDirectory==null){return;}return yield deleteAsync(documentDirectory+"ExperienceData/",{idempotent:true});});return _deleteLegacyDocumentDirectoryAndroid.apply(this,arguments);}function moveAsync(){return _moveAsync.apply(this,arguments);}function _moveAsync(){_moveAsync=_asyncToGenerator(function*(options){if(!ExponentFileSystem.moveAsync){throw new UnavailabilityError('expo-file-system','moveAsync');}return yield ExponentFileSystem.moveAsync(options);});return _moveAsync.apply(this,arguments);}function copyAsync(){return _copyAsync.apply(this,arguments);}function _copyAsync(){_copyAsync=_asyncToGenerator(function*(options){if(!ExponentFileSystem.copyAsync){throw new UnavailabilityError('expo-file-system','copyAsync');}return yield ExponentFileSystem.copyAsync(options);});return _copyAsync.apply(this,arguments);}function makeDirectoryAsync(){return _makeDirectoryAsync.apply(this,arguments);}function _makeDirectoryAsync(){_makeDirectoryAsync=_asyncToGenerator(function*(fileUri){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!ExponentFileSystem.makeDirectoryAsync){throw new UnavailabilityError('expo-file-system','makeDirectoryAsync');}return yield ExponentFileSystem.makeDirectoryAsync(fileUri,options);});return _makeDirectoryAsync.apply(this,arguments);}function readDirectoryAsync(){return _readDirectoryAsync.apply(this,arguments);}function _readDirectoryAsync(){_readDirectoryAsync=_asyncToGenerator(function*(fileUri){if(!ExponentFileSystem.readDirectoryAsync){throw new UnavailabilityError('expo-file-system','readDirectoryAsync');}return yield ExponentFileSystem.readDirectoryAsync(fileUri,{});});return _readDirectoryAsync.apply(this,arguments);}function getFreeDiskStorageAsync(){return _getFreeDiskStorageAsync.apply(this,arguments);}function _getFreeDiskStorageAsync(){_getFreeDiskStorageAsync=_asyncToGenerator(function*(){if(!ExponentFileSystem.getFreeDiskStorageAsync){throw new UnavailabilityError('expo-file-system','getFreeDiskStorageAsync');}return yield ExponentFileSystem.getFreeDiskStorageAsync();});return _getFreeDiskStorageAsync.apply(this,arguments);}function getTotalDiskCapacityAsync(){return _getTotalDiskCapacityAsync.apply(this,arguments);}function _getTotalDiskCapacityAsync(){_getTotalDiskCapacityAsync=_asyncToGenerator(function*(){if(!ExponentFileSystem.getTotalDiskCapacityAsync){throw new UnavailabilityError('expo-file-system','getTotalDiskCapacityAsync');}return yield ExponentFileSystem.getTotalDiskCapacityAsync();});return _getTotalDiskCapacityAsync.apply(this,arguments);}function downloadAsync(){return _downloadAsync.apply(this,arguments);}function _downloadAsync(){_downloadAsync=_asyncToGenerator(function*(uri,fileUri){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(!ExponentFileSystem.downloadAsync){throw new UnavailabilityError('expo-file-system','downloadAsync');}return yield ExponentFileSystem.downloadAsync(uri,fileUri,Object.assign({sessionType:FileSystemSessionType.BACKGROUND},options));});return _downloadAsync.apply(this,arguments);}function uploadAsync(){return _uploadAsync.apply(this,arguments);}function _uploadAsync(){_uploadAsync=_asyncToGenerator(function*(url,fileUri){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(!ExponentFileSystem.uploadAsync){throw new UnavailabilityError('expo-file-system','uploadAsync');}return yield ExponentFileSystem.uploadAsync(url,fileUri,Object.assign({sessionType:FileSystemSessionType.BACKGROUND,uploadType:FileSystemUploadType.BINARY_CONTENT},options,{httpMethod:(options.httpMethod||'POST').toUpperCase()}));});return _uploadAsync.apply(this,arguments);}function createDownloadResumable(uri,fileUri,options,callback,resumeData){return new DownloadResumable(uri,fileUri,options,callback,resumeData);}function createUploadTask(url,fileUri,options,callback){return new UploadTask(url,fileUri,options,callback);}function isUploadProgressData(data){return 'totalBytesSent'in data;}var FileSystemCancellableNetworkTask=function(){function FileSystemCancellableNetworkTask(){_classCallCheck(this,FileSystemCancellableNetworkTask);this._uuid=uuid_1.v4();this.taskWasCanceled=false;this.emitter=new EventEmitter(ExponentFileSystem);}_createClass(FileSystemCancellableNetworkTask,[{key:"cancelAsync",value:function(){var _cancelAsync=_asyncToGenerator(function*(){if(!ExponentFileSystem.networkTaskCancelAsync){throw new UnavailabilityError('expo-file-system','networkTaskCancelAsync');}this.removeSubscription();this.taskWasCanceled=true;return yield ExponentFileSystem.networkTaskCancelAsync(this.uuid);});function cancelAsync(){return _cancelAsync.apply(this,arguments);}return cancelAsync;}()},{key:"isTaskCancelled",value:function isTaskCancelled(){if(this.taskWasCanceled){console.warn('This task was already canceled.');return true;}return false;}},{key:"uuid",get:function get(){return this._uuid;}},{key:"addSubscription",value:function addSubscription(){var _this=this;if(this.subscription){return;}this.subscription=this.emitter.addListener(this.getEventName(),function(event){if(event.uuid===_this.uuid){var callback=_this.getCallback();if(callback){if(isUploadProgressData(event.data)){var data=Object.assign({},event.data,{get totalByteSent(){console.warn('Key "totalByteSent" in File System UploadProgressData is deprecated and will be removed in SDK 49, use "totalBytesSent" instead');return this.totalBytesSent;}});return callback(data);}callback(event.data);}}});}},{key:"removeSubscription",value:function removeSubscription(){if(!this.subscription){return;}this.emitter.removeSubscription(this.subscription);this.subscription=null;}}]);return FileSystemCancellableNetworkTask;}();var UploadTask=function(_FileSystemCancellabl){_inherits(UploadTask,_FileSystemCancellabl);var _super=_createSuper(UploadTask);function UploadTask(url,fileUri,options,callback){var _options$httpMethod;var _this2;_classCallCheck(this,UploadTask);_this2=_super.call(this);_this2.url=url;_this2.fileUri=fileUri;_this2.callback=callback;var httpMethod=(options==null?void 0:(_options$httpMethod=options.httpMethod)==null?void 0:_options$httpMethod.toUpperCase())||'POST';_this2.options=Object.assign({sessionType:FileSystemSessionType.BACKGROUND,uploadType:FileSystemUploadType.BINARY_CONTENT},options,{httpMethod:httpMethod});return _this2;}_createClass(UploadTask,[{key:"getEventName",value:function getEventName(){return 'expo-file-system.uploadProgress';}},{key:"getCallback",value:function getCallback(){return this.callback;}},{key:"uploadAsync",value:function(){var _uploadAsync2=_asyncToGenerator(function*(){if(!ExponentFileSystem.uploadTaskStartAsync){throw new UnavailabilityError('expo-file-system','uploadTaskStartAsync');}if(this.isTaskCancelled()){return;}this.addSubscription();var result=yield ExponentFileSystem.uploadTaskStartAsync(this.url,this.fileUri,this.uuid,this.options);this.removeSubscription();return result;});function uploadAsync(){return _uploadAsync2.apply(this,arguments);}return uploadAsync;}()}]);return UploadTask;}(FileSystemCancellableNetworkTask);var DownloadResumable=function(_FileSystemCancellabl2){_inherits(DownloadResumable,_FileSystemCancellabl2);var _super2=_createSuper(DownloadResumable);function DownloadResumable(url,_fileUri){var _this3;var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var callback=arguments.length>3?arguments[3]:undefined;var resumeData=arguments.length>4?arguments[4]:undefined;_classCallCheck(this,DownloadResumable);_this3=_super2.call(this);_this3.url=url;_this3._fileUri=_fileUri;_this3.options=options;_this3.callback=callback;_this3.resumeData=resumeData;return _this3;}_createClass(DownloadResumable,[{key:"fileUri",get:function get(){return this._fileUri;}},{key:"getEventName",value:function getEventName(){return 'expo-file-system.downloadProgress';}},{key:"getCallback",value:function getCallback(){return this.callback;}},{key:"downloadAsync",value:function(){var _downloadAsync2=_asyncToGenerator(function*(){if(!ExponentFileSystem.downloadResumableStartAsync){throw new UnavailabilityError('expo-file-system','downloadResumableStartAsync');}if(this.isTaskCancelled()){return;}this.addSubscription();return yield ExponentFileSystem.downloadResumableStartAsync(this.url,this._fileUri,this.uuid,this.options,this.resumeData);});function downloadAsync(){return _downloadAsync2.apply(this,arguments);}return downloadAsync;}()},{key:"pauseAsync",value:function(){var _pauseAsync=_asyncToGenerator(function*(){if(!ExponentFileSystem.downloadResumablePauseAsync){throw new UnavailabilityError('expo-file-system','downloadResumablePauseAsync');}if(this.isTaskCancelled()){return {fileUri:this._fileUri,options:this.options,url:this.url};}var pauseResult=yield ExponentFileSystem.downloadResumablePauseAsync(this.uuid);this.removeSubscription();if(pauseResult){this.resumeData=pauseResult.resumeData;return this.savable();}else {throw new Error('Unable to generate a savable pause state');}});function pauseAsync(){return _pauseAsync.apply(this,arguments);}return pauseAsync;}()},{key:"resumeAsync",value:function(){var _resumeAsync=_asyncToGenerator(function*(){if(!ExponentFileSystem.downloadResumableStartAsync){throw new UnavailabilityError('expo-file-system','downloadResumableStartAsync');}if(this.isTaskCancelled()){return;}this.addSubscription();return yield ExponentFileSystem.downloadResumableStartAsync(this.url,this.fileUri,this.uuid,this.options,this.resumeData);});function resumeAsync(){return _resumeAsync.apply(this,arguments);}return resumeAsync;}()},{key:"savable",value:function savable(){return {url:this.url,fileUri:this.fileUri,options:this.options,resumeData:this.resumeData};}}]);return DownloadResumable;}(FileSystemCancellableNetworkTask);var baseReadAsStringAsync=readAsStringAsync;var baseWriteAsStringAsync=writeAsStringAsync;var baseDeleteAsync=deleteAsync;var baseMoveAsync=moveAsync;var baseCopyAsync=copyAsync;var StorageAccessFramework;(function(StorageAccessFramework){StorageAccessFramework.getUriForDirectoryInRoot=function getUriForDirectoryInRoot(folderName){return "content://com.android.externalstorage.documents/tree/primary:"+folderName+"/document/primary:"+folderName;};function requestDirectoryPermissionsAsync(){return _requestDirectoryPermissionsAsync.apply(this,arguments);}function _requestDirectoryPermissionsAsync(){_requestDirectoryPermissionsAsync=_asyncToGenerator(function*(){var initialFileUrl=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;if(!ExponentFileSystem.requestDirectoryPermissionsAsync){throw new UnavailabilityError('expo-file-system','StorageAccessFramework.requestDirectoryPermissionsAsync');}return yield ExponentFileSystem.requestDirectoryPermissionsAsync(initialFileUrl);});return _requestDirectoryPermissionsAsync.apply(this,arguments);}StorageAccessFramework.requestDirectoryPermissionsAsync=requestDirectoryPermissionsAsync;function readDirectoryAsync(_x15){return _readDirectoryAsync2.apply(this,arguments);}function _readDirectoryAsync2(){_readDirectoryAsync2=_asyncToGenerator(function*(dirUri){if(!ExponentFileSystem.readSAFDirectoryAsync){throw new UnavailabilityError('expo-file-system','StorageAccessFramework.readDirectoryAsync');}return yield ExponentFileSystem.readSAFDirectoryAsync(dirUri,{});});return _readDirectoryAsync2.apply(this,arguments);}StorageAccessFramework.readDirectoryAsync=readDirectoryAsync;function makeDirectoryAsync(_x16,_x17){return _makeDirectoryAsync2.apply(this,arguments);}function _makeDirectoryAsync2(){_makeDirectoryAsync2=_asyncToGenerator(function*(parentUri,dirName){if(!ExponentFileSystem.makeSAFDirectoryAsync){throw new UnavailabilityError('expo-file-system','StorageAccessFramework.makeDirectoryAsync');}return yield ExponentFileSystem.makeSAFDirectoryAsync(parentUri,dirName);});return _makeDirectoryAsync2.apply(this,arguments);}StorageAccessFramework.makeDirectoryAsync=makeDirectoryAsync;function createFileAsync(_x18,_x19,_x20){return _createFileAsync.apply(this,arguments);}function _createFileAsync(){_createFileAsync=_asyncToGenerator(function*(parentUri,fileName,mimeType){if(!ExponentFileSystem.createSAFFileAsync){throw new UnavailabilityError('expo-file-system','StorageAccessFramework.createFileAsync');}return yield ExponentFileSystem.createSAFFileAsync(parentUri,fileName,mimeType);});return _createFileAsync.apply(this,arguments);}StorageAccessFramework.createFileAsync=createFileAsync;StorageAccessFramework.writeAsStringAsync=baseWriteAsStringAsync;StorageAccessFramework.readAsStringAsync=baseReadAsStringAsync;StorageAccessFramework.deleteAsync=baseDeleteAsync;StorageAccessFramework.moveAsync=baseMoveAsync;StorageAccessFramework.copyAsync=baseCopyAsync;})(StorageAccessFramework||(StorageAccessFramework={}));
|
|
277
289
|
|
|
278
290
|
var fileBuild = /*#__PURE__*/Object.freeze({
|
|
279
291
|
__proto__: null,
|
|
280
292
|
documentDirectory: documentDirectory,
|
|
281
293
|
cacheDirectory: cacheDirectory,
|
|
294
|
+
bundledAssets: bundledAssets,
|
|
282
295
|
bundleDirectory: bundleDirectory,
|
|
283
296
|
getInfoAsync: getInfoAsync,
|
|
284
297
|
readAsStringAsync: readAsStringAsync,
|
|
@@ -343,7 +356,7 @@ var _indexScssStyleSheet = StyleSheet.create({
|
|
|
343
356
|
}
|
|
344
357
|
});
|
|
345
358
|
|
|
346
|
-
function _mergeEleStyles(){return [].concat.apply([],arguments).reduce((pre,cur)=>Object.assign(pre,cur),{});}var _styleSheet=_indexScssStyleSheet;console.log({taro:taro});function Cell(_ref){var children=_ref.children,style=_ref.style;var childs=Array.isArray(children)?children:[children];return jsx(View,{style:_mergeEleStyles(_styleSheet["cellGroup"],Object.assign({},style)),children:childs.map(function(it,i){return [it].concat(i===children.length-1?[]:jsx(View,{style:_styleSheet["cellItem__line"]}
|
|
359
|
+
function _mergeEleStyles(){return [].concat.apply([],arguments).reduce((pre,cur)=>Object.assign(pre,cur),{});}var _styleSheet=_indexScssStyleSheet;console.log({taro:taro});function Cell(_ref){var children=_ref.children,style=_ref.style;var childs=Array.isArray(children)?children:[children];return jsx(View,{style:_mergeEleStyles(_styleSheet["cellGroup"],Object.assign({},style)),children:childs.map(function(it,i){return [it].concat(i===children.length-1?[]:jsx(View,{style:_styleSheet["cellItem__line"]},"line-"+i));})});}function Item(_ref2){var title=_ref2.title,children=_ref2.children,style=_ref2.style;return jsxs(View,{style:_mergeEleStyles(_styleSheet["cellItem"],Object.assign({},style)),children:[jsx(Text,{style:_styleSheet["cellItem__title"],children:title}),jsx(View,{style:_styleSheet["cellItem__content"],children:children})]});}Cell.Item=Item;
|
|
347
360
|
|
|
348
361
|
export { Cell as default };
|
|
349
362
|
",
|
|
@@ -352,8 +365,9 @@ export { Cell as default };
|
|
|
352
365
|
|
|
353
366
|
exports[`build_components require react-native component 1`] = `
|
|
354
367
|
[
|
|
355
|
-
"import {
|
|
356
|
-
import {
|
|
368
|
+
"import { Children, Component } from 'react';
|
|
369
|
+
import { AppRegistry } from 'react-native';
|
|
370
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
357
371
|
|
|
358
372
|
function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}
|
|
359
373
|
|
|
@@ -381,11 +395,11 @@ function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getProt
|
|
|
381
395
|
|
|
382
396
|
function _createSuper$1(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct$1();return function(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else {result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct$1(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}var _default$1=function(_Component){_inherits(_default,_Component);var _super=_createSuper$1(_default);function _default(){_classCallCheck(this,_default);return _super.apply(this,arguments);}_createClass(_default,[{key:"shouldComponentUpdate",value:function shouldComponentUpdate(nextProps){return nextProps.shouldUpdate;}},{key:"render",value:function render(){var child=this.props.children;return child===null||child===false?null:Children.only(child);}}]);return _default;}(Component);
|
|
383
397
|
|
|
384
|
-
function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else {result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}var _default=function(_Component){_inherits(_default,_Component);var _super=_createSuper(_default);function _default(props){var _this;_classCallCheck(this,_default);_this=_super.call(this,props);_this.updatedSiblings=new Set();_this.
|
|
398
|
+
function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else {result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}var _default=function(_Component){_inherits(_default,_Component);var _super=_createSuper(_default);function _default(props){var _this;_classCallCheck(this,_default);_this=_super.call(this,props);_this.siblingsPool=[];_this.updatedSiblings=new Set();_this.unmounted=false;_this.state={siblings:[]};return _this;}_createClass(_default,[{key:"componentDidMount",value:function componentDidMount(){var _this2=this;this.props.controller.setCallback(function(id,change){setImmediate(function(){return _this2.commitChange(id,change);});});}},{key:"componentDidUpdate",value:function componentDidUpdate(){this.updatedSiblings.clear();}},{key:"componentWillUnmount",value:function componentWillUnmount(){this.unmounted=true;}},{key:"commitChange",value:function commitChange(id,_ref){var _this3=this;var change=_ref.change,element=_ref.element,updateCallback=_ref.updateCallback;if(this.unmounted){return;}var siblings=Array.from(this.siblingsPool);var index=siblings.findIndex(function(sibling){return sibling.id===id;});if(change===RootControllerChanges.Remove){if(index>-1){siblings.splice(index,1);}else {this.invokeCallback(updateCallback);return;}}else if(change===RootControllerChanges.Update){if(index>-1){siblings.splice(index,1,{element:element,id:id});this.updatedSiblings.add(id);}else {this.invokeCallback(updateCallback);return;}}else {if(index>-1){siblings.splice(index,1);}siblings.push({element:element,id:id});this.updatedSiblings.add(id);}this.siblingsPool=siblings;this.setState({siblings:siblings},function(){return _this3.invokeCallback(updateCallback);});}},{key:"invokeCallback",value:function invokeCallback(callback){if(callback){callback();}}},{key:"renderSiblings",value:function renderSiblings(){var _this4=this;return this.state.siblings.map(function(_ref2){var id=_ref2.id,element=_ref2.element;return jsx(_default$1,{shouldUpdate:_this4.updatedSiblings.has(id),children:_this4.wrapSibling(element)},"root-sibling-"+id);});}},{key:"wrapSibling",value:function wrapSibling(element){var renderSibling=this.props.renderSibling;if(renderSibling){return renderSibling(element);}else {return element;}}},{key:"render",value:function render(){return jsxs(Fragment,{children:[this.props.children,this.renderSiblings()]});}}]);return _default;}(Component);
|
|
385
399
|
|
|
386
400
|
function wrapRootComponent(_Root,renderSibling){var controller=new RootController();return {Root:function Root(props){return jsx(_default,{controller:controller,renderSibling:renderSibling,children:jsx(_Root,Object.assign({},props))});},manager:{update:function update(id,element,callback){controller.update(id,element,callback);},destroy:function destroy(id,callback){controller.destroy(id,callback);}}};}
|
|
387
401
|
|
|
388
|
-
var siblingWrapper=function(sibling){return sibling;};function renderSibling(sibling){return siblingWrapper(sibling);}var _wrapRootComponent=wrapRootComponent(ChildrenWrapper,renderSibling),defaultManager=_wrapRootComponent.manager;var uuid=0;var managerStack=[defaultManager];var inactiveManagers=new Set();function getActiveManager(){for(var i=managerStack.length-1;i>=0;i--){var manager=managerStack[i];if(!inactiveManagers.has(manager)){return manager;}}return defaultManager;}var RootSiblingsManager=function(){function RootSiblingsManager(element,callback){_classCallCheck(this,RootSiblingsManager);this.id
|
|
402
|
+
var siblingWrapper=function(sibling){return sibling;};function renderSibling(sibling){return siblingWrapper(sibling);}if(!global.__rootSiblingsInjected&&!global.__rootSiblingsDisabled){AppRegistry.setWrapperComponentProvider(function(){return Root;});global.__rootSiblingsInjected=true;}var _wrapRootComponent=wrapRootComponent(ChildrenWrapper,renderSibling),Root=_wrapRootComponent.Root,defaultManager=_wrapRootComponent.manager;var uuid=0;var managerStack=[defaultManager];var inactiveManagers=new Set();function getActiveManager(){for(var i=managerStack.length-1;i>=0;i--){var manager=managerStack[i];if(!inactiveManagers.has(manager)){return manager;}}return defaultManager;}var RootSiblingsManager=function(){function RootSiblingsManager(element,callback){_classCallCheck(this,RootSiblingsManager);this.id="root-sibling-"+(uuid+1);this.manager=getActiveManager();this.manager.update(this.id,element,callback);uuid++;}_createClass(RootSiblingsManager,[{key:"update",value:function update(element,callback){this.manager.update(this.id,element,callback);}},{key:"destroy",value:function destroy(callback){this.manager.destroy(this.id,callback);}}]);return RootSiblingsManager;}();
|
|
389
403
|
|
|
390
404
|
console.log({silblings:RootSiblingsManager});
|
|
391
405
|
",
|
|
@@ -428,7 +442,7 @@ var _indexScssStyleSheet = StyleSheet.create({
|
|
|
428
442
|
}
|
|
429
443
|
});
|
|
430
444
|
|
|
431
|
-
function _mergeEleStyles(){return [].concat.apply([],arguments).reduce((pre,cur)=>Object.assign(pre,cur),{});}var _styleSheet=_indexScssStyleSheet;console.log({taro:taro});function Cell(_ref){var children=_ref.children,style=_ref.style;var childs=Array.isArray(children)?children:[children];return jsx(View,{style:_mergeEleStyles(_styleSheet["cellGroup"],Object.assign({},style)),children:childs.map(function(it,i){return [it].concat(i===children.length-1?[]:jsx(View,{style:_styleSheet["cellItem__line"]}
|
|
445
|
+
function _mergeEleStyles(){return [].concat.apply([],arguments).reduce((pre,cur)=>Object.assign(pre,cur),{});}var _styleSheet=_indexScssStyleSheet;console.log({taro:taro});function Cell(_ref){var children=_ref.children,style=_ref.style;var childs=Array.isArray(children)?children:[children];return jsx(View,{style:_mergeEleStyles(_styleSheet["cellGroup"],Object.assign({},style)),children:childs.map(function(it,i){return [it].concat(i===children.length-1?[]:jsx(View,{style:_styleSheet["cellItem__line"]},"line-"+i));})});}function Item(_ref2){var title=_ref2.title,children=_ref2.children,style=_ref2.style;return jsxs(View,{style:_mergeEleStyles(_styleSheet["cellItem"],Object.assign({},style)),children:[jsx(Text,{style:_styleSheet["cellItem__title"],children:title}),jsx(View,{style:_styleSheet["cellItem__content"],children:children})]});}Cell.Item=Item;
|
|
432
446
|
|
|
433
447
|
export { Cell as default };
|
|
434
448
|
",
|
package/dist/index.js
CHANGED
|
@@ -67,12 +67,7 @@ function build(_appPath, config) {
|
|
|
67
67
|
cliParams.push('--port', config.port);
|
|
68
68
|
}
|
|
69
69
|
try {
|
|
70
|
-
(0, child_process_1.spawn)(npxCmd, [
|
|
71
|
-
'react-native',
|
|
72
|
-
'start',
|
|
73
|
-
'--custom-log-reporter-path',
|
|
74
|
-
'@tarojs/rn-supporter/TerminalReporter'
|
|
75
|
-
].concat(cliParams), {
|
|
70
|
+
(0, child_process_1.spawn)(npxCmd, ['react-native', 'start'].concat(cliParams), {
|
|
76
71
|
stdio: 'inherit'
|
|
77
72
|
});
|
|
78
73
|
if (config.qr) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uDAA8D;AAC9D,iDAAqC;AACrC,2BAAwC;AACxC,gCAA+B;AAC/B,+BAAoC;AAEpC,8DAAqD;AAErD,uCAAuC;AACvC,MAAM,KAAK,GAAG,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAA;AAC7C,SAAS,YAAY;IACnB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,MAAM,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cAAc;oBACd,QAAQ;oBACR,YAAY;oBACZ,MAAM,CAAC,UAAU;oBACjB,OAAO;oBACP,OAAO;oBACP,cAAc;oBACd,UAAU;iBACX,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;oBACnB,KAAK,EAAE,SAAS;iBACjB,CAAC,CAAA;gBACF,IAAI,MAAM,CAAC,EAAE,EAAE;oBACb,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;wBAC5B,IAAA,0BAAW,EAAC;4BACV,GAAG,EAAE,YAAY;4BACjB,QAAQ,EAAE,MAAM,CAAC,UAAU;4BAC3B,UAAU,EAAE,UAAU;yBACvB,CAAC,CAAA;oBACJ,CAAC,CAAC,CAAA;iBACH;gBACD,QAAQ,CAAC,IAAI,CAAC,CAAA;aACf;YAAC,OAAO,CAAC,EAAE;gBACV,QAAQ,CAAC,CAAC,CAAC,CAAA;aACZ;SACF;IACH,CAAC;CAAA;AAjGD,wBAiGC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/rn-runner",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.0",
|
|
4
4
|
"description": "ReactNative build tool for taro",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"fs-extra": "^8.0.1",
|
|
31
31
|
"lodash": "^4.17.21",
|
|
32
32
|
"rollup-plugin-image-file": "^1.0.2",
|
|
33
|
-
"@tarojs/
|
|
34
|
-
"@tarojs/
|
|
35
|
-
"@tarojs/rn-style-transformer": "
|
|
36
|
-
"@tarojs/rn-transformer": "
|
|
33
|
+
"@tarojs/rn-supporter": "4.0.0-alpha.0",
|
|
34
|
+
"@tarojs/helper": "4.0.0-alpha.0",
|
|
35
|
+
"@tarojs/rn-style-transformer": "4.0.0-alpha.0",
|
|
36
|
+
"@tarojs/rn-transformer": "4.0.0-alpha.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@babel/core": "^7.14.5",
|
|
@@ -41,20 +41,20 @@
|
|
|
41
41
|
"acorn": "^8.0.4",
|
|
42
42
|
"babel-plugin-global-define": "1.0.3",
|
|
43
43
|
"babel-plugin-jsx-attributes-array-to-object": "0.3.0",
|
|
44
|
-
"expo": "~
|
|
45
|
-
"expo-file-system": "~
|
|
44
|
+
"expo": "~48.0.0",
|
|
45
|
+
"expo-file-system": "~15.2.2",
|
|
46
46
|
"jest": "^29.3.1",
|
|
47
47
|
"jest-cli": "^29.3.1",
|
|
48
48
|
"jest-environment-node": "^29.5.0",
|
|
49
49
|
"react": "18.2.0",
|
|
50
50
|
"react-is": "^16.13.0",
|
|
51
|
-
"react-native": "^0.
|
|
52
|
-
"react-native-root-siblings": "^
|
|
51
|
+
"react-native": "^0.71.3",
|
|
52
|
+
"react-native-root-siblings": "^4.1.1",
|
|
53
53
|
"react-test-renderer": "18.2.0",
|
|
54
54
|
"rollup": "^2.79.0",
|
|
55
55
|
"ts-jest": "^29.0.5",
|
|
56
56
|
"typescript": "^4.7.4",
|
|
57
|
-
"babel-plugin-transform-react-jsx-to-rn-stylesheet": "
|
|
57
|
+
"babel-plugin-transform-react-jsx-to-rn-stylesheet": "4.0.0-alpha.0"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "tsc",
|
package/src/index.ts
CHANGED
|
@@ -60,12 +60,7 @@ export default async function build (_appPath: string, config: any): Promise<any
|
|
|
60
60
|
cliParams.push('--port', config.port)
|
|
61
61
|
}
|
|
62
62
|
try {
|
|
63
|
-
spawn(npxCmd, [
|
|
64
|
-
'react-native',
|
|
65
|
-
'start',
|
|
66
|
-
'--custom-log-reporter-path',
|
|
67
|
-
'@tarojs/rn-supporter/TerminalReporter'
|
|
68
|
-
].concat(cliParams), {
|
|
63
|
+
spawn(npxCmd, ['react-native', 'start'].concat(cliParams), {
|
|
69
64
|
stdio: 'inherit'
|
|
70
65
|
})
|
|
71
66
|
if (config.qr) {
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { mergeConfig } = require('metro-config')
|
|
2
2
|
const { getMetroConfig } = require('@tarojs/rn-supporter')
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Metro configuration
|
|
6
|
-
* https://facebook.github.io/metro/docs/configuration
|
|
7
|
-
*
|
|
8
|
-
* @type {import('metro-config').MetroConfig}
|
|
9
|
-
*/
|
|
10
|
-
const config = {};
|
|
11
|
-
|
|
12
4
|
module.exports = (async function (){
|
|
13
|
-
|
|
5
|
+
return mergeConfig({
|
|
6
|
+
// custom your metro config here
|
|
7
|
+
// https://facebook.github.io/metro/docs/configuration
|
|
8
|
+
resolver: {}
|
|
9
|
+
}, await getMetroConfig())
|
|
14
10
|
})()
|