@tarojs/rn-runner 4.0.0-beta.86 → 4.0.0-beta.88

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/LICENSE CHANGED
@@ -154,8 +154,15 @@ See `/LICENSE` for details of the license.
154
154
 
155
155
  ==================
156
156
 
157
+ MIT (stencil-vue2-output-target):
158
+ The following files embed [stencil-vue2-output-target](https://github.com/diondree/stencil-vue2-output-target) MIT:
159
+ `/packages/taro-components-library-vue2/src/vue-component-lib/utils.ts`
160
+ See `/LICENSE` for details of the license.
161
+
162
+ ==================
163
+
157
164
  MIT (weui):
158
- The following files embed [weui](https://github.com/Tencent/weui) MIT:
165
+ The following files embed [stencil-vue2-output-target](https://github.com/Tencent/weui) MIT:
159
166
  `/packages/taro-components/src/components/*.scss`
160
167
  See `/LICENSE.txt` for details of the license.
161
168
 
@@ -165,10 +172,3 @@ Apache-2.0 (intersection-observer):
165
172
  The following files embed [intersection-observer](https://github.com/GoogleChromeLabs/intersection-observer) Apache-2.0:
166
173
  `/packages/taro-api/src/polyfill/intersection-observer.ts`
167
174
  See `/LICENSE.txt` for details of the license.
168
-
169
- ==================
170
-
171
- MIT (babel-plugin-jsx-dom-expressions):
172
- The following files embed [babel-plugin-jsx-dom-expressions](https://github.com/ryansolid/dom-expressions/blob/main/packages/babel-plugin-jsx-dom-expressions) MIT:
173
- `/packages/babel-plugin-transform-solid-jsx/src/*`
174
- See `/LICENSE` for details of the license.
package/README.md CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  暴露给 `@tarojs/cli` 的 React Native Webpack 启动器。
4
4
 
5
- `@tarojs/rn-runner` 从 `@tarojs/cli` 接受 [Taro 编译配置](https://taro-docs.jd.com/taro/docs/config.html),把编译配置分解成 Webpack 配置,并刚启动 Webpack 把项目源码编译为适配 React Native 目录结构的代码。
5
+ `@tarojs/mini-runner` 从 `@tarojs/cli` 接受 [Taro 编译配置](https://taro-docs.jd.com/taro/docs/config.html),把编译配置分解成 Webpack 配置,并刚启动 Webpack 把项目源码编译为适配 React Native 目录结构的代码。
@@ -1,27 +1,24 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`build_components > dynamic require 1`] = `
3
+ exports[`build_components dynamic require 1`] = `
4
4
  [
5
- "function getDefaultExportFromCjs (x) {
6
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
7
- }
8
-
9
- var reactIs$1 = {exports: {}};
5
+ "var reactIs$1 = {exports: {}};
10
6
 
11
7
  var reactIs_production_min = {};
12
8
 
13
- var b=Symbol.for("react.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");function v(a){if("object"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r;}}case c:return r;}}}reactIs_production_min.ContextConsumer=h;reactIs_production_min.ContextProvider=g;reactIs_production_min.Element=b;reactIs_production_min.ForwardRef=l;reactIs_production_min.Fragment=d;reactIs_production_min.Lazy=q;reactIs_production_min.Memo=p;reactIs_production_min.Portal=c;reactIs_production_min.Profiler=f;reactIs_production_min.StrictMode=e;reactIs_production_min.Suspense=m;reactIs_production_min.SuspenseList=n;reactIs_production_min.isAsyncMode=function(){return !1;};reactIs_production_min.isConcurrentMode=function(){return !1;};reactIs_production_min.isContextConsumer=function(a){return v(a)===h;};reactIs_production_min.isContextProvider=function(a){return v(a)===g;};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===b;};reactIs_production_min.isForwardRef=function(a){return v(a)===l;};reactIs_production_min.isFragment=function(a){return v(a)===d;};reactIs_production_min.isLazy=function(a){return v(a)===q;};reactIs_production_min.isMemo=function(a){return v(a)===p;};reactIs_production_min.isPortal=function(a){return v(a)===c;};reactIs_production_min.isProfiler=function(a){return v(a)===f;};reactIs_production_min.isStrictMode=function(a){return v(a)===e;};reactIs_production_min.isSuspense=function(a){return v(a)===m;};reactIs_production_min.isSuspenseList=function(a){return v(a)===n;};reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1;};reactIs_production_min.typeOf=v;
9
+ var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u;}}case d:return u;}}}function A(a){return z(a)===m;}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l;};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k;};reactIs_production_min.isContextProvider=function(a){return z(a)===h;};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c;};reactIs_production_min.isForwardRef=function(a){return z(a)===n;};reactIs_production_min.isFragment=function(a){return z(a)===e;};reactIs_production_min.isLazy=function(a){return z(a)===t;};reactIs_production_min.isMemo=function(a){return z(a)===r;};reactIs_production_min.isPortal=function(a){return z(a)===d;};reactIs_production_min.isProfiler=function(a){return z(a)===g;};reactIs_production_min.isStrictMode=function(a){return z(a)===f;};reactIs_production_min.isSuspense=function(a){return z(a)===p;};reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v);};reactIs_production_min.typeOf=z;
14
10
 
15
- reactIs$1.exports=reactIs_production_min;var reactIsExports=reactIs$1.exports;var reactIs = getDefaultExportFromCjs(reactIsExports);
11
+ reactIs$1.exports=reactIs_production_min;var reactIs = reactIs$1.exports;
16
12
 
17
13
  console.log({reactIs:reactIs});
18
14
  ",
19
15
  ]
20
16
  `;
21
17
 
22
- exports[`build_components > modify rollup config 1`] = `
18
+ exports[`build_components modify rollup config 1`] = `
23
19
  [
24
- "import View from '@tarojs/components-rn/dist/components/View';
20
+ "import 'react';
21
+ import View from '@tarojs/components-rn/dist/components/View';
25
22
  import Text from '@tarojs/components-rn/dist/components/Text';
26
23
  import taro from '@tarojs/taro-rn';
27
24
  import { StyleSheet } from 'react-native';
@@ -58,7 +55,8 @@ function _mergeEleStyles(){return [].concat.apply([],arguments).reduce((pre,cur)
58
55
 
59
56
  export { Cell as default };
60
57
  ",
61
- "import { navigateBack } from '@tarojs/taro-rn/dist/api';
58
+ "import 'react';
59
+ import { navigateBack } from '@tarojs/taro-rn/dist/api';
62
60
  import View from '@tarojs/components-rn/dist/components/View';
63
61
  import Text from '@tarojs/components-rn/dist/components/Text';
64
62
  import Image from '@tarojs/components-rn/dist/components/Image';
@@ -66,7 +64,7 @@ import { StyleSheet } from 'react-native';
66
64
  import { scalePx2dp } from '@tarojs/runtime-rn';
67
65
  import { jsxs, jsx } from 'react/jsx-runtime';
68
66
 
69
- var iconBack = require('../assets/icon_back-K9-Z_a7i.webp');
67
+ var iconBack = require('../assets/icon_back-541a82be.webp');
70
68
 
71
69
  var _indexScssStyleSheet = StyleSheet.create({
72
70
  "navbar": {
@@ -112,9 +110,10 @@ export { Navbar as default };
112
110
  ]
113
111
  `;
114
112
 
115
- exports[`build_components > multiple components 1`] = `
113
+ exports[`build_components multiple components 1`] = `
116
114
  [
117
- "import View from '@tarojs/components-rn/dist/components/View';
115
+ "import 'react';
116
+ import View from '@tarojs/components-rn/dist/components/View';
118
117
  import Text from '@tarojs/components-rn/dist/components/Text';
119
118
  import taro from '@tarojs/taro-rn';
120
119
  import { StyleSheet } from 'react-native';
@@ -151,7 +150,8 @@ function _mergeEleStyles(){return [].concat.apply([],arguments).reduce((pre,cur)
151
150
 
152
151
  export { Cell as default };
153
152
  ",
154
- "import { navigateBack } from '@tarojs/taro-rn/dist/api';
153
+ "import 'react';
154
+ import { navigateBack } from '@tarojs/taro-rn/dist/api';
155
155
  import View from '@tarojs/components-rn/dist/components/View';
156
156
  import Text from '@tarojs/components-rn/dist/components/Text';
157
157
  import Image from '@tarojs/components-rn/dist/components/Image';
@@ -159,7 +159,7 @@ import { StyleSheet } from 'react-native';
159
159
  import { scalePx2dp } from '@tarojs/runtime-rn';
160
160
  import { jsxs, jsx } from 'react/jsx-runtime';
161
161
 
162
- var iconBack = require('../../assets/icon_back-K9-Z_a7i.webp');
162
+ var iconBack = require('../../assets/icon_back-541a82be.webp');
163
163
 
164
164
  var _indexScssStyleSheet = StyleSheet.create({
165
165
  "navbar": {
@@ -205,11 +205,15 @@ export { Navbar as default };
205
205
  ]
206
206
  `;
207
207
 
208
- exports[`build_components > named export 1`] = `
208
+ exports[`build_components named export 1`] = `
209
209
  [
210
- "import { Platform as Platform$1, NativeEventEmitter, NativeModules } from 'react-native';
210
+ "import { Platform as Platform$2, NativeModules, NativeEventEmitter } from 'react-native';
211
+
212
+ function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}
213
+
214
+ function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}
211
215
 
212
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}
216
+ function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}
213
217
 
214
218
  function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}
215
219
 
@@ -217,95 +221,85 @@ function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object
217
221
 
218
222
  function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}
219
223
 
220
- function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}
221
-
222
- function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}
223
-
224
224
  function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}
225
225
 
226
- function toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r);if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return (String)(t);}
226
+ function _toPrimitive(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return (hint==="string"?String:Number)(input);}
227
227
 
228
- function toPropertyKey(t){var i=toPrimitive(t,"string");return "symbol"==_typeof(i)?i:i+"";}
228
+ function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return _typeof(key)==="symbol"?key:String(key);}
229
229
 
230
- function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}
230
+ function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}
231
231
 
232
232
  function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else {Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}
233
233
 
234
- 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;}
234
+ 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
235
 
236
- function getDefaultExportFromCjs (x) {
237
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
238
- }
236
+ 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;
239
237
 
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;var invariant$1 = getDefaultExportFromCjs(invariant_1);
241
-
242
- var nativeEmitterSubscriptionKey='@@nativeEmitterSubscription@@';var EventEmitter=function(){function EventEmitter(nativeModule){_classCallCheck(this,EventEmitter);this._listenerCount=0;if(nativeModule.__expo_module_name__){return nativeModule;}this._nativeModule=nativeModule;this._eventEmitter=new NativeEventEmitter(nativeModule);}return _createClass(EventEmitter,[{key:"addListener",value:function addListener(eventName,listener){var _this=this;if(!this._listenerCount&&Platform$1.OS!=='ios'&&this._nativeModule.startObserving){this._nativeModule.startObserving();}this._listenerCount++;var nativeEmitterSubscription=this._eventEmitter.addListener(eventName,listener);var subscription=_defineProperty(_defineProperty({},nativeEmitterSubscriptionKey,nativeEmitterSubscription),"remove",function remove(){_this.removeSubscription(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();}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 _len=arguments.length,params=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){params[_key-1]=arguments[_key];}(_this$_eventEmitter=this._eventEmitter).emit.apply(_this$_eventEmitter,[eventName].concat(params));}}]);}();
243
-
244
- function ensureNativeModulesAreInstalled(){if(globalThis.expo){return;}try{if(Platform$1.OS==='web'){require('./web');}else {var _NativeModules$ExpoMo;(_NativeModules$ExpoMo=NativeModules.ExpoModulesCore)==null?void 0:_NativeModules$ExpoMo.installModules();}}catch(error){console.error(\`Unable to install Expo modules: \${error}\`);}}
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$2.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$2.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();}this._listenerCount--;delete subscription[nativeEmitterSubscriptionKey];subscription.remove=function(){};if(!this._listenerCount&&Platform$2.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;}();
245
239
 
246
240
  var NativeModulesProxy = {};
247
241
 
248
- function _isNativeFunction(fn){try{return Function.toString.call(fn).indexOf("[native code]")!==-1;}catch(e){return typeof fn==="function";}}
242
+ function _isNativeFunction(fn){return Function.toString.call(fn).indexOf("[native code]")!==-1;}
249
243
 
250
- function _isNativeReflectConstruct$3(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return (_isNativeReflectConstruct$3=function(){return !!t;})();}
244
+ 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;}}
251
245
 
252
- function _construct(t,e,r){if(_isNativeReflectConstruct$3())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf(p,r.prototype),p;}
246
+ function _construct(){if(_isNativeReflectConstruct$3()){_construct=Reflect.construct.bind();}else {_construct=function(Parent,args,Class){var a=[null];a.push.apply(a,args);var Constructor=Function.bind.apply(Parent,a);var instance=new Constructor();if(Class)_setPrototypeOf(instance,Class.prototype);return instance;};}return _construct.apply(null,arguments);}
253
247
 
254
248
  function _wrapNativeSuper(Class){var _cache=typeof Map==="function"?new Map():undefined;_wrapNativeSuper=function(Class){if(Class===null||!_isNativeFunction(Class))return Class;if(typeof Class!=="function"){throw new TypeError("Super expression must either be null or a function");}if(typeof _cache!=="undefined"){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper);}function Wrapper(){return _construct(Class,arguments,_getPrototypeOf(this).constructor);}Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,Class);};return _wrapNativeSuper(Class);}
255
249
 
256
- function _callSuper$2(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct$2()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _isNativeReflectConstruct$2(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return (_isNativeReflectConstruct$2=function _isNativeReflectConstruct(){return !!t;})();}var CodedError=function(_Error){function CodedError(code,message){var _this;_classCallCheck(this,CodedError);_this=_callSuper$2(this,CodedError,[message]);_this.code=code;return _this;}_inherits(CodedError,_Error);return _createClass(CodedError);}(_wrapNativeSuper(Error));
250
+ 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(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return (_isNativeReflectConstruct$2=function _isNativeReflectConstruct(){return !!t;})();}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));
257
251
 
258
252
  var isDOMAvailable=false;var canUseEventListeners=false;var canUseViewport=false;var isAsyncDebugging=false;if(__DEV__){isAsyncDebugging=!global.nativeExtensions&&!global.nativeCallSyncHook&&!global.RN$Bridgeless;}
259
253
 
260
- var Platform={OS:Platform$1.OS,select:Platform$1.select,isDOMAvailable:isDOMAvailable,canUseEventListeners:canUseEventListeners,canUseViewport:canUseViewport,isAsyncDebugging:isAsyncDebugging};
254
+ var Platform={OS:Platform$2.OS,select:Platform$2.select,isDOMAvailable:isDOMAvailable,canUseEventListeners:canUseEventListeners,canUseViewport:canUseViewport,isAsyncDebugging:isAsyncDebugging};var Platform$1 = Platform;
261
255
 
262
- function _callSuper$1(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct$1()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _isNativeReflectConstruct$1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return (_isNativeReflectConstruct$1=function _isNativeReflectConstruct(){return !!t;})();}var UnavailabilityError=function(_CodedError){function UnavailabilityError(moduleName,propertyName){_classCallCheck(this,UnavailabilityError);return _callSuper$1(this,UnavailabilityError,['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?\`]);}_inherits(UnavailabilityError,_CodedError);return _createClass(UnavailabilityError);}(CodedError);
256
+ 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(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return (_isNativeReflectConstruct$1=function _isNativeReflectConstruct(){return !!t;})();}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$1.OS}, are you sure you've linked all the native dependencies properly?\`);}return _createClass(UnavailabilityError);}(CodedError);
263
257
 
264
258
  var NativeErrorManager = NativeModulesProxy.ExpoModulesCoreErrorManager;
265
259
 
266
- if(__DEV__&&Platform.OS==='android'&&NativeErrorManager){var onNewException='ExpoModulesCoreErrorManager.onNewException';var onNewWarning='ExpoModulesCoreErrorManager.onNewWarning';var eventEmitter=new EventEmitter(NativeErrorManager);eventEmitter.addListener(onNewException,function(_ref){var message=_ref.message;console.error(message);});eventEmitter.addListener(onNewWarning,function(_ref2){var message=_ref2.message;console.warn(message);});}globalThis.ExpoModulesCore_CodedError=CodedError;
260
+ if(__DEV__&&Platform$1.OS==='android'&&NativeErrorManager){var onNewException='ExpoModulesCoreErrorManager.onNewException';var onNewWarning='ExpoModulesCoreErrorManager.onNewWarning';var eventEmitter=new EventEmitter(NativeErrorManager);eventEmitter.addListener(onNewException,function(_ref){var message=_ref.message;console.error(message);});eventEmitter.addListener(onNewWarning,function(_ref2){var message=_ref2.message;console.warn(message);});}globalThis.ExpoModulesCore_CodedError=CodedError;
267
261
 
268
- var byteToHex=[];for(var i=0;i<256;++i){byteToHex[i]=(i+0x100).toString(16).substr(1);}function bytesToUuid(buf,offset){var i=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('');}
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('');}
269
263
 
270
264
  var Uuidv5Namespace;(function(Uuidv5Namespace){Uuidv5Namespace["dns"]="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Uuidv5Namespace["url"]="6ba7b811-9dad-11d1-80b4-00c04fd430c8";Uuidv5Namespace["oid"]="6ba7b812-9dad-11d1-80b4-00c04fd430c8";Uuidv5Namespace["x500"]="6ba7b814-9dad-11d1-80b4-00c04fd430c8";})(Uuidv5Namespace||(Uuidv5Namespace={}));
271
265
 
272
- var _globalThis$expo,_globalThis$expo2;var nativeUuidv4=globalThis==null?void 0:(_globalThis$expo=globalThis.expo)==null?void 0:_globalThis$expo.uuidv4;var nativeUuidv5=globalThis==null?void 0:(_globalThis$expo2=globalThis.expo)==null?void 0:_globalThis$expo2.uuidv5;function uuidv4(){if(!nativeUuidv4){throw Error("Native UUID version 4 generator implementation wasn't found in \`expo-modules-core\`");}return nativeUuidv4();}function uuidv5(name,namespace){var parsedNamespace=Array.isArray(namespace)&&namespace.length===16?bytesToUuid(namespace):namespace;if(Array.isArray(parsedNamespace)){throw new Error('\`namespace\` must be a valid UUID string or an Array of 16 byte values');}if(!nativeUuidv5){throw Error("Native UUID type 5 generator implementation wasn't found in \`expo-modules-core\`");}return nativeUuidv5(name,parsedNamespace);}var uuid={v4:uuidv4,v5:uuidv5,namespace:Uuidv5Namespace};
266
+ var _globalThis$expo,_globalThis$expo2;var nativeUuidv4=globalThis==null?void 0:(_globalThis$expo=globalThis.expo)==null?void 0:_globalThis$expo.uuidv4;var nativeUuidv5=globalThis==null?void 0:(_globalThis$expo2=globalThis.expo)==null?void 0:_globalThis$expo2.uuidv5;function uuidv4(){if(!nativeUuidv4){throw Error("Native UUID version 4 generator implementation wasn't found in \`expo-modules-core\`");}return nativeUuidv4();}function uuidv5(name,namespace){var parsedNamespace=Array.isArray(namespace)&&namespace.length===16?bytesToUuid(namespace):namespace;if(Array.isArray(parsedNamespace)){throw new Error('\`namespace\` must be a valid UUID string or an Array of 16 byte values');}if(!nativeUuidv5){throw Error("Native UUID type 5 generator implementation wasn't found in \`expo-modules-core\`");}return nativeUuidv5(name,parsedNamespace);}var uuid={v4:uuidv4,v5:uuidv5,namespace:Uuidv5Namespace};var uuid$1 = uuid;
273
267
 
274
- function requireOptionalNativeModule(moduleName){var _ref,_globalThis$expo$modu,_globalThis$expo,_globalThis$expo$modu2;ensureNativeModulesAreInstalled();return (_ref=(_globalThis$expo$modu=(_globalThis$expo=globalThis.expo)==null?void 0:(_globalThis$expo$modu2=_globalThis$expo.modules)==null?void 0:_globalThis$expo$modu2[moduleName])!=null?_globalThis$expo$modu:NativeModulesProxy[moduleName])!=null?_ref:null;}
268
+ function requireOptionalNativeModule(moduleName){var _ref,_ref2,_globalThis$expo$modu,_globalThis$expo,_globalThis$expo$modu2,_globalThis$ExpoModul;ensureNativeModulesAreInstalled();return (_ref=(_ref2=(_globalThis$expo$modu=(_globalThis$expo=globalThis.expo)==null?void 0:(_globalThis$expo$modu2=_globalThis$expo.modules)==null?void 0:_globalThis$expo$modu2[moduleName])!=null?_globalThis$expo$modu:(_globalThis$ExpoModul=globalThis.ExpoModules)==null?void 0:_globalThis$ExpoModul[moduleName])!=null?_ref2:NativeModulesProxy[moduleName])!=null?_ref:null;}function ensureNativeModulesAreInstalled(){if(globalThis.expo){return;}try{var _NativeModules$ExpoMo;(_NativeModules$ExpoMo=NativeModules.ExpoModulesCore)==null?void 0:_NativeModules$ExpoMo.installModules();}catch(error){console.error(\`Unable to install Expo modules: \${error}\`);}}
275
269
 
276
- var platformModule={get name(){return 'ExponentFileSystem';},get documentDirectory(){return null;},get cacheDirectory(){return null;},get bundleDirectory(){return null;},addListener:function addListener(){},removeListeners:function removeListeners(){}};
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;
277
271
 
278
- var _requireOptionalNativ;var ExponentFileSystem = (_requireOptionalNativ=requireOptionalNativeModule('ExponentFileSystem'))!=null?_requireOptionalNativ:platformModule;
272
+ var _requireOptionalNativ;var ExponentFileSystem = (_requireOptionalNativ=requireOptionalNativeModule('ExponentFileSystem'))!=null?_requireOptionalNativ:ExponentFileSystemShim;
279
273
 
280
274
  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={}));
281
275
 
282
- function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return (_isNativeReflectConstruct=function _isNativeReflectConstruct(){return !!t;})();}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$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);}var FileSystemCancellableNetworkTask=function(){function FileSystemCancellableNetworkTask(){_classCallCheck(this,FileSystemCancellableNetworkTask);this._uuid=uuid.v4();this.taskWasCanceled=false;this.emitter=new EventEmitter(ExponentFileSystem);}return _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;}}]);}();var UploadTask=function(_FileSystemCancellabl){function UploadTask(url,fileUri,options,callback){var _options$httpMethod;var _this2;_classCallCheck(this,UploadTask);_this2=_callSuper(this,UploadTask);_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;}_inherits(UploadTask,_FileSystemCancellabl);return _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;}()}]);}(FileSystemCancellableNetworkTask);var DownloadResumable=function(_FileSystemCancellabl2){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=_callSuper(this,DownloadResumable);_this3.url=url;_this3._fileUri=_fileUri;_this3.options=options;_this3.callback=callback;_this3.resumeData=resumeData;return _this3;}_inherits(DownloadResumable,_FileSystemCancellabl2);return _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};}}]);}(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={}));
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(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return (_isNativeReflectConstruct=function _isNativeReflectConstruct(){return !!t;})();}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={}));
283
277
 
284
278
  var fileBuild = /*#__PURE__*/Object.freeze({
285
279
  __proto__: null,
286
- DownloadResumable: DownloadResumable,
287
- FileSystemCancellableNetworkTask: FileSystemCancellableNetworkTask,
288
- get StorageAccessFramework () { return StorageAccessFramework; },
289
- UploadTask: UploadTask,
290
- bundleDirectory: bundleDirectory,
280
+ documentDirectory: documentDirectory,
291
281
  cacheDirectory: cacheDirectory,
292
- copyAsync: copyAsync,
293
- createDownloadResumable: createDownloadResumable,
294
- createUploadTask: createUploadTask,
282
+ bundleDirectory: bundleDirectory,
283
+ getInfoAsync: getInfoAsync,
284
+ readAsStringAsync: readAsStringAsync,
285
+ getContentUriAsync: getContentUriAsync,
286
+ writeAsStringAsync: writeAsStringAsync,
295
287
  deleteAsync: deleteAsync,
296
288
  deleteLegacyDocumentDirectoryAndroid: deleteLegacyDocumentDirectoryAndroid,
297
- documentDirectory: documentDirectory,
298
- downloadAsync: downloadAsync,
299
- getContentUriAsync: getContentUriAsync,
300
- getFreeDiskStorageAsync: getFreeDiskStorageAsync,
301
- getInfoAsync: getInfoAsync,
302
- getTotalDiskCapacityAsync: getTotalDiskCapacityAsync,
303
- makeDirectoryAsync: makeDirectoryAsync,
304
289
  moveAsync: moveAsync,
305
- readAsStringAsync: readAsStringAsync,
290
+ copyAsync: copyAsync,
291
+ makeDirectoryAsync: makeDirectoryAsync,
306
292
  readDirectoryAsync: readDirectoryAsync,
293
+ getFreeDiskStorageAsync: getFreeDiskStorageAsync,
294
+ getTotalDiskCapacityAsync: getTotalDiskCapacityAsync,
295
+ downloadAsync: downloadAsync,
307
296
  uploadAsync: uploadAsync,
308
- writeAsStringAsync: writeAsStringAsync
297
+ createDownloadResumable: createDownloadResumable,
298
+ createUploadTask: createUploadTask,
299
+ FileSystemCancellableNetworkTask: FileSystemCancellableNetworkTask,
300
+ UploadTask: UploadTask,
301
+ DownloadResumable: DownloadResumable,
302
+ get StorageAccessFramework () { return StorageAccessFramework; }
309
303
  });
310
304
 
311
305
  console.log({fileBuild:fileBuild});
@@ -313,9 +307,10 @@ console.log({fileBuild:fileBuild});
313
307
  ]
314
308
  `;
315
309
 
316
- exports[`build_components > nativeComponents not set 1`] = `
310
+ exports[`build_components nativeComponents  not set 1`] = `
317
311
  [
318
- "import View from '@tarojs/components-rn/dist/components/View';
312
+ "import 'react';
313
+ import View from '@tarojs/components-rn/dist/components/View';
319
314
  import Text from '@tarojs/components-rn/dist/components/Text';
320
315
  import taro from '@tarojs/taro-rn';
321
316
  import { StyleSheet } from 'react-native';
@@ -355,24 +350,28 @@ export { Cell as default };
355
350
  ]
356
351
  `;
357
352
 
358
- exports[`build_components > require react-native component 1`] = `
353
+ exports[`build_components require react-native component 1`] = `
359
354
  [
360
355
  "import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
361
356
  import { Children, Component } from 'react';
362
357
 
363
358
  function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}
364
359
 
365
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}
360
+ function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}
366
361
 
367
- function toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r);if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return (String)(t);}
362
+ function _toPrimitive(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return (hint==="string"?String:Number)(input);}
368
363
 
369
- function toPropertyKey(t){var i=toPrimitive(t,"string");return "symbol"==_typeof(i)?i:i+"";}
364
+ function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return _typeof(key)==="symbol"?key:String(key);}
370
365
 
371
- function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}
366
+ function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}
372
367
 
373
368
  function ChildrenWrapper(props){return jsx(Fragment,{children:props.children});}
374
369
 
375
- var RootControllerChanges;(function(RootControllerChanges){RootControllerChanges[RootControllerChanges["Insert"]=0]="Insert";RootControllerChanges[RootControllerChanges["Update"]=1]="Update";RootControllerChanges[RootControllerChanges["Remove"]=2]="Remove";})(RootControllerChanges||(RootControllerChanges={}));var RootController=function(){function RootController(){_classCallCheck(this,RootController);this.siblings=new Set();this.pendingActions=[];this.callback=null;}return _createClass(RootController,[{key:"update",value:function update(id,element,callback){if(!this.siblings.has(id)){this.emit(id,{change:RootControllerChanges.Insert,element:element,updateCallback:callback});this.siblings.add(id);}else {this.emit(id,{change:RootControllerChanges.Update,element:element,updateCallback:callback});}}},{key:"destroy",value:function destroy(id,callback){if(this.siblings.has(id)){this.emit(id,{change:RootControllerChanges.Remove,element:null,updateCallback:callback});this.siblings.delete(id);}else if(callback){callback();}}},{key:"setCallback",value:function setCallback(callback){this.callback=callback;this.pendingActions.forEach(function(_ref){var id=_ref.id,action=_ref.action;callback(id,action);});}},{key:"emit",value:function emit(id,action){if(this.callback){this.callback(id,action);}else {this.pendingActions.push({action:action,id:id});}}}]);}();
370
+ var RootControllerChanges;(function(RootControllerChanges){RootControllerChanges[RootControllerChanges["Insert"]=0]="Insert";RootControllerChanges[RootControllerChanges["Update"]=1]="Update";RootControllerChanges[RootControllerChanges["Remove"]=2]="Remove";})(RootControllerChanges||(RootControllerChanges={}));var RootController=function(){function RootController(){_classCallCheck(this,RootController);this.siblings=new Set();this.pendingActions=[];this.callback=null;}_createClass(RootController,[{key:"update",value:function update(id,element,callback){if(!this.siblings.has(id)){this.emit(id,{change:RootControllerChanges.Insert,element:element,updateCallback:callback});this.siblings.add(id);}else {this.emit(id,{change:RootControllerChanges.Update,element:element,updateCallback:callback});}}},{key:"destroy",value:function destroy(id,callback){if(this.siblings.has(id)){this.emit(id,{change:RootControllerChanges.Remove,element:null,updateCallback:callback});this.siblings.delete(id);}else if(callback){callback();}}},{key:"setCallback",value:function setCallback(callback){this.callback=callback;this.pendingActions.forEach(function(_ref){var id=_ref.id,action=_ref.action;callback(id,action);});}},{key:"emit",value:function emit(id,action){if(this.callback){this.callback(id,action);}else {this.pendingActions.push({action:action,id:id});}}}]);return RootController;}();
371
+
372
+ function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}
373
+
374
+ function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}
376
375
 
377
376
  function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}
378
377
 
@@ -380,26 +379,23 @@ function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object
380
379
 
381
380
  function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}
382
381
 
383
- function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}
384
-
385
- function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}
386
-
387
- function _callSuper$1(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct$1()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _isNativeReflectConstruct$1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return (_isNativeReflectConstruct$1=function _isNativeReflectConstruct(){return !!t;})();}var _default$1=function(_Component){function _default(){_classCallCheck(this,_default);return _callSuper$1(this,_default,arguments);}_inherits(_default,_Component);return _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);}}]);}(Component);
382
+ 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(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return (_isNativeReflectConstruct$1=function _isNativeReflectConstruct(){return !!t;})();}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);
388
383
 
389
- function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return (_isNativeReflectConstruct=function _isNativeReflectConstruct(){return !!t;})();}var _default=function(_Component){function _default(props){var _this;_classCallCheck(this,_default);_this=_callSuper(this,_default,[props]);_this.updatedSiblings=new Set();_this.siblingsPool=[];_this.state={siblings:[]};return _this;}_inherits(_default,_Component);return _createClass(_default,[{key:"componentDidMount",value:function componentDidMount(){var _this2=this;this.props.controller.setCallback(function(id,change){setTimeout(function(){return _this2.commitChange(id,change);});});}},{key:"componentDidUpdate",value:function componentDidUpdate(){this.updatedSiblings.clear();}},{key:"render",value:function render(){return jsxs(Fragment,{children:[this.props.children,this.renderSiblings()]});}},{key:"commitChange",value:function commitChange(id,_ref){var _this3=this;var change=_ref.change,element=_ref.element,updateCallback=_ref.updateCallback;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;}}}]);}(Component);
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(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return (_isNativeReflectConstruct=function _isNativeReflectConstruct(){return !!t;})();}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.siblingsPool=[];_this.state={siblings:[]};return _this;}_createClass(_default,[{key:"componentDidMount",value:function componentDidMount(){var _this2=this;this.props.controller.setCallback(function(id,change){setTimeout(function(){return _this2.commitChange(id,change);});});}},{key:"componentDidUpdate",value:function componentDidUpdate(){this.updatedSiblings.clear();}},{key:"render",value:function render(){return jsxs(Fragment,{children:[this.props.children,this.renderSiblings()]});}},{key:"commitChange",value:function commitChange(id,_ref){var _this3=this;var change=_ref.change,element=_ref.element,updateCallback=_ref.updateCallback;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;}}}]);return _default;}(Component);
390
385
 
391
386
  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);}}};}
392
387
 
393
- 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=\`root-sibling-\${uuid+1}\`;this.manager=getActiveManager();this.manager.update(this.id,element,callback);uuid++;}return _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);}}]);}();
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=\`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;}();
394
389
 
395
390
  console.log({silblings:RootSiblingsManager});
396
391
  ",
397
392
  ]
398
393
  `;
399
394
 
400
- exports[`build_components > single component 1`] = `
395
+ exports[`build_components single component 1`] = `
401
396
  [
402
- "import View from '@tarojs/components-rn/dist/components/View';
397
+ "import 'react';
398
+ import View from '@tarojs/components-rn/dist/components/View';
403
399
  import Text from '@tarojs/components-rn/dist/components/Text';
404
400
  import taro from '@tarojs/taro-rn';
405
401
  import { StyleSheet } from 'react-native';
@@ -1,14 +1,18 @@
1
1
  import * as path from 'path'
2
- import { describe, expect, test } from 'vitest'
3
2
 
4
- import { build } from '../dist/config/build-component'
5
- import { default as runner } from '../dist/index'
3
+ import runner from '../dist/index'
4
+ import { build } from '../src/config/build-component'
6
5
  import { appPath, config } from './mock/components_testdata'
7
6
 
8
7
  const getCode = (result) => result.output.map(chunk => chunk.code)
9
8
 
10
- describe.skip('build_components', () => {
11
- test('single component', async () => {
9
+ describe('build_components', () => {
10
+ const spy = jest.spyOn(process, 'cwd')
11
+ spy.mockReturnValue(path.resolve(__dirname, '', 'mock'))
12
+ // metro runServer 容易超时
13
+ jest.setTimeout(300000)
14
+
15
+ it('single component', async () => {
12
16
  const result = await runner(appPath, {
13
17
  ...config,
14
18
  nativeComponents: {
@@ -16,16 +20,17 @@ describe.skip('build_components', () => {
16
20
  output: 'dist/single'
17
21
  }
18
22
  })
19
-
20
23
  expect(getCode(result)).toMatchSnapshot()
21
24
  })
22
25
 
23
- test('nativeComponents not set', async () => {
24
- const result = await runner(appPath, { ...config })
26
+ it('nativeComponents  not set', async () => {
27
+ const result = await runner(appPath, {
28
+ ...config
29
+ })
25
30
  expect(getCode(result)).toMatchSnapshot()
26
31
  })
27
32
 
28
- test('multiple components', async () => {
33
+ it('multiple components', async () => {
29
34
  const result = await build(config, {
30
35
  input: ['components/cell/index', 'components/navbar/index'],
31
36
  sourceRootPath: path.resolve(__dirname, './mock/src'),
@@ -36,7 +41,7 @@ describe.skip('build_components', () => {
36
41
  expect(getCode(result)).toMatchSnapshot()
37
42
  })
38
43
 
39
- test('modify rollup config', async () => {
44
+ it('modify rollup config', async () => {
40
45
  const result = await build(config, {
41
46
  input: ['components/cell/index', 'components/navbar/index'],
42
47
  sourceRootPath: path.resolve(__dirname, './mock/src'),
@@ -55,7 +60,7 @@ describe.skip('build_components', () => {
55
60
  expect(getCode(result)).toMatchSnapshot()
56
61
  })
57
62
 
58
- test('svg transform', async () => {
63
+ it('svg transform', async () => {
59
64
  const result = await build(config, {
60
65
  input: ['components/svg/index'],
61
66
  sourceRootPath: path.resolve(__dirname, './mock/src'),
@@ -66,7 +71,7 @@ describe.skip('build_components', () => {
66
71
  expect(getCode(result))
67
72
  })
68
73
 
69
- test('named export', async () => {
74
+ it('named export', async () => {
70
75
  const result = await build(config, {
71
76
  input: ['utils/namedExport/index'],
72
77
  sourceRootPath: path.resolve(__dirname, './mock/src'),
@@ -76,7 +81,7 @@ describe.skip('build_components', () => {
76
81
  expect(getCode(result)).toMatchSnapshot()
77
82
  })
78
83
 
79
- test('dynamic require', async () => {
84
+ it('dynamic require', async () => {
80
85
  const result = await build(config, {
81
86
  input: ['utils/dynamicImport/index'],
82
87
  sourceRootPath: path.resolve(__dirname, './mock/src'),
@@ -86,7 +91,7 @@ describe.skip('build_components', () => {
86
91
  expect(getCode(result)).toMatchSnapshot()
87
92
  })
88
93
 
89
- test('require react-native component', async () => {
94
+ it('require react-native component', async () => {
90
95
  const result = await build(config, {
91
96
  input: ['utils/requireReactNative/index'],
92
97
  sourceRootPath: path.resolve(__dirname, './mock/src'),
@@ -1,4 +1,4 @@
1
- import { Component } from 'react'
1
+ import React, { Component } from 'react'
2
2
  import { View } from '@tarojs/components'
3
3
  import './app.scss'
4
4
 
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { View, Text } from '@tarojs/components'
2
3
  import taro from '@tarojs/taro'
3
4
  import './index.scss'
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import Taro from '@tarojs/taro'
2
3
  import { View, Text, Image } from '@tarojs/components'
3
4
  import iconBack from './icon_back.webp'
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import Logo from "./rollup-logo.svg";
2
3
 
3
4
  export default function () {
@@ -1,5 +1,5 @@
1
- import { camelCase } from 'lodash'
2
- import queryString from 'query-string'
3
- const globalAny = global
1
+ import { camelCase } from 'lodash';
2
+ import { parseUrl } from 'query-string';
3
+ const globalAny = global;
4
4
 
5
- console.log(globalAny, camelCase, queryString)
5
+ console.log(globalAny, camelCase, parseUrl)
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "extends": "../../../tsconfig.root.json",
3
3
  "compilerOptions": {
4
- "jsx": "react-jsx",
4
+ "jsx": "react",
5
5
  "sourceMap": true,
6
- "module": "commonjs",
7
- "noUnusedLocals": false,
6
+ "module": "commonjs"
8
7
  }
9
8
  }
@@ -104,10 +104,7 @@ const build = (projectConfig, componentConfig) => __awaiter(void 0, void 0, void
104
104
  }),
105
105
  // @ts-ignore
106
106
  pluginReplace({
107
- preventAssignment: true,
108
- values: {
109
- 'process.env.NODE_ENV': JSON.stringify('production')
110
- }
107
+ 'process.env.NODE_ENV': JSON.stringify('production')
111
108
  }),
112
109
  // @ts-ignore
113
110
  commonjs(),
@@ -167,20 +164,10 @@ exports.build = build;
167
164
  function likeDependent(str) {
168
165
  return !str.match(/^\.?\.\//) && !path.isAbsolute(str);
169
166
  }
170
- function getEntryPath(entry) {
171
- const app = entry.app;
172
- if (Array.isArray(app)) {
173
- return app[0];
174
- }
175
- else if (Array.isArray(app.import)) {
176
- return app.import[0];
177
- }
178
- return app;
179
- }
180
167
  function default_1(projectPath, config) {
181
168
  const { sourceRoot, entry, nativeComponents } = config;
182
- const appEntryPath = getEntryPath(entry);
183
- const appConfig = (0, rn_transformer_1.getAppConfig)(appEntryPath);
169
+ const appPath = path.join(projectPath, sourceRoot, entry);
170
+ const appConfig = (0, rn_transformer_1.getAppConfig)(appPath);
184
171
  const { output = DEFAULT_CONFIG.output } = nativeComponents || {};
185
172
  const componentConfig = Object.assign(Object.assign({}, nativeComponents), { input: appConfig === null || appConfig === void 0 ? void 0 : appConfig.components, output: path.join(projectPath, output), sourceRootPath: path.join(projectPath, sourceRoot) });
186
173
  return (0, exports.build)(config, componentConfig);
@@ -1 +1 @@
1
- {"version":3,"file":"build-component.js","sourceRoot":"","sources":["../../src/config/build-component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AACxC,oDAAmD;AACnD,4CAA2C;AAC3C,qEAAqD;AACrD,wDAAuD;AACvD,2CAA+C;AAC/C,uEAAkF;AAClF,uDAAqG;AACrG,2DAAqD;AACrD,iCAAgC;AAChC,6BAA4B;AAC5B,mCAA8C;AAC9C,uEAA4C;AAgB5C,MAAM,cAAc,GAGhB;IACF,QAAQ,EAAE,CAAC,gBAAgB,EAAE,uBAAuB,EAAE,gBAAgB,CAAC;IACvE,MAAM,EAAE,MAAM;IACd,eAAe,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IACxE,cAAc,EAAE,OAAO,CAAC,GAAG,EAAE;IAC7B,k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YAC3C,GAAG,CAAC,aAAa,CAAC,UAAU,CAAC,CAAA;YAE7B,IAAI;gBACF,IAAA,qBAAK,EAAC,MAAM,EAAE;oBACZ,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,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;gBAChB,QAAQ,CAAC,CAAC,CAAC,CAAA;aACZ;SACF;IACH,CAAC;CAAA;AAxGD,wBAwGC"}
package/jest.config.js ADDED
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ coverageDirectory: 'coverage',
3
+ preset: 'ts-jest',
4
+ testEnvironment: 'node',
5
+ testRegex: '/__tests__/.*.spec.tsx?$'
6
+ }
package/package.json CHANGED
@@ -1,71 +1,69 @@
1
1
  {
2
2
  "name": "@tarojs/rn-runner",
3
- "version": "4.0.0-beta.86",
3
+ "version": "4.0.0-beta.88",
4
4
  "description": "ReactNative build tool for taro",
5
- "author": "O2Team",
6
- "license": "MIT",
7
5
  "main": "index.js",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/NervJS/taro.git"
9
+ },
8
10
  "keywords": [
9
11
  "taro"
10
12
  ],
13
+ "author": "luckyadam",
14
+ "license": "MIT",
11
15
  "bugs": {
12
16
  "url": "https://github.com/NervJS/taro/issues"
13
17
  },
14
- "repository": {
15
- "type": "git",
16
- "url": "git+https://github.com/NervJS/taro.git"
17
- },
18
+ "homepage": "https://github.com/NervJS/taro#readme",
18
19
  "engines": {
19
- "node": ">= 18"
20
+ "node": ">= 18",
21
+ "npm": ">= 6"
20
22
  },
21
23
  "dependencies": {
22
- "@rollup/plugin-babel": "^6.0.4",
23
- "@rollup/plugin-commonjs": "^25.0.7",
24
- "@rollup/plugin-json": "^6.1.0",
25
- "@rollup/plugin-node-resolve": "^15.2.3",
26
- "@rollup/plugin-replace": "^5.0.5",
27
- "acorn": "^8.11.3",
24
+ "@rollup/plugin-babel": "^6.0.3",
25
+ "@rollup/plugin-commonjs": "^20.0.0",
26
+ "@rollup/plugin-json": "^4.1.0",
27
+ "@rollup/plugin-node-resolve": "^13.3.0",
28
+ "@rollup/plugin-replace": "^4.0.0",
28
29
  "acorn-jsx": "^5.3.2",
29
- "fs-extra": "^11.2.0",
30
+ "fs-extra": "^8.0.1",
30
31
  "lodash": "^4.17.21",
31
32
  "rollup-plugin-image-file": "^1.0.2",
32
- "@tarojs/helper": "4.0.0-beta.86",
33
- "@tarojs/rn-style-transformer": "4.0.0-beta.86",
34
- "@tarojs/rn-supporter": "4.0.0-beta.86",
35
- "@tarojs/rn-transformer": "4.0.0-beta.86",
36
- "stylelint-config-taro-rn": "4.0.0-beta.86"
33
+ "@tarojs/rn-style-transformer": "4.0.0-beta.88",
34
+ "@tarojs/helper": "4.0.0-beta.88",
35
+ "@tarojs/rn-supporter": "4.0.0-beta.88",
36
+ "@tarojs/rn-transformer": "4.0.0-beta.88"
37
37
  },
38
38
  "devDependencies": {
39
- "@rnx-kit/metro-resolver-symlinks": "^0.1.36",
40
- "expo": "~51.0.5",
39
+ "@babel/core": "^7.23.0",
40
+ "@babel/preset-env": "^7.20.0",
41
+ "acorn": "^8.0.4",
42
+ "babel-plugin-global-define": "1.0.3",
43
+ "babel-plugin-jsx-attributes-array-to-object": "0.3.0",
44
+ "expo": "~50.0.2",
41
45
  "expo-file-system": "~16.0.0",
42
- "query-string": "^9.0.0",
43
- "react": "^18.2.0",
44
- "react-is": "^18.3.1",
45
- "react-native": "^0.72.3",
46
+ "jest": "^29.3.1",
47
+ "jest-cli": "^29.3.1",
48
+ "jest-environment-node": "^29.5.0",
49
+ "react": "18.2.0",
50
+ "react-is": "^16.13.0",
51
+ "react-native": "^0.73.1",
46
52
  "react-native-root-siblings": "^5.0.1",
47
- "rollup": "^4.16.4",
48
- "babel-preset-taro": "4.0.0-beta.86",
49
- "@tarojs/components": "4.0.0-beta.86",
50
- "@tarojs/taro": "4.0.0-beta.86",
51
- "babel-plugin-transform-react-jsx-to-rn-stylesheet": "4.0.0-beta.86"
52
- },
53
- "peerDependencies": {
54
- "expo": ">= 51",
55
- "react": ">= 18",
56
- "react-native": ">= 0.63.0",
57
- "babel-preset-taro": "4.0.0-beta.86"
53
+ "react-test-renderer": "18.2.0",
54
+ "rollup": "^2.79.0",
55
+ "ts-jest": "^29.0.5",
56
+ "typescript": "^4.7.4",
57
+ "babel-plugin-transform-react-jsx-to-rn-stylesheet": "4.0.0-beta.88"
58
58
  },
59
59
  "scripts": {
60
- "prod": "pnpm run build",
61
- "prebuild": "pnpm run clean",
62
- "clean": "rimraf --impl=move-remove ./dist",
63
60
  "build": "tsc",
64
- "dev": "tsc -w",
65
- "lint": "eslint src templates __tests__ --ext .js,.ts",
66
- "test": "vitest run",
67
- "test:ci": "vitest run --coverage",
68
- "test:dev": "vitest",
69
- "test:update": "vitest --update"
61
+ "dev": "tsc --watch",
62
+ "lint": "eslint .",
63
+ "test": "jest --silent",
64
+ "test:ci": "jest --ci -i --coverage --silent",
65
+ "test:coverage": "jest --coverage",
66
+ "test:dev": "jest --watch",
67
+ "updateSnapshot": "jest --updateSnapshot"
70
68
  }
71
69
  }
@@ -108,10 +108,7 @@ export const build = async (projectConfig, componentConfig: IComponentConfig) =>
108
108
  }),
109
109
  // @ts-ignore
110
110
  pluginReplace({
111
- preventAssignment: true,
112
- values: {
113
- 'process.env.NODE_ENV': JSON.stringify('production')
114
- }
111
+ 'process.env.NODE_ENV': JSON.stringify('production')
115
112
  }),
116
113
  // @ts-ignore
117
114
  commonjs(),
@@ -174,20 +171,10 @@ function likeDependent (str: string) {
174
171
  return !str.match(/^\.?\.\//) && !path.isAbsolute(str)
175
172
  }
176
173
 
177
- function getEntryPath (entry) {
178
- const app = entry.app
179
- if (Array.isArray(app)) {
180
- return app[0]
181
- } else if (Array.isArray(app.import)) {
182
- return app.import[0]
183
- }
184
- return app
185
- }
186
-
187
174
  export default function (projectPath: string, config: any) {
188
175
  const { sourceRoot, entry, nativeComponents } = config
189
- const appEntryPath = getEntryPath(entry)
190
- const appConfig = getAppConfig(appEntryPath)
176
+ const appPath = path.join(projectPath, sourceRoot, entry)
177
+ const appConfig = getAppConfig(appPath)
191
178
  const { output = DEFAULT_CONFIG.output } = nativeComponents || {}
192
179
 
193
180
  const componentConfig = {
package/tsconfig.json CHANGED
@@ -4,7 +4,6 @@
4
4
  "jsx": "react",
5
5
  "outDir": "./dist",
6
6
  "sourceMap": true,
7
- "noUnusedLocals": false,
8
7
  "module": "commonjs"
9
8
  },
10
9
  "include": ["./src"]