@tarojs/rn-runner 4.0.0-beta.12 → 4.0.0-beta.120
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 +8 -8
- package/README.md +1 -1
- package/__tests__/__snapshots__/components.spec.ts.snap +83 -79
- package/__tests__/components.spec.ts +14 -19
- package/__tests__/mock/src/app.tsx +1 -1
- package/__tests__/mock/src/components/cell/index.tsx +0 -1
- package/__tests__/mock/src/components/navbar/index.tsx +0 -1
- package/__tests__/mock/src/components/svg/index.tsx +0 -1
- package/__tests__/mock/src/utils/requireLodash/index.ts +4 -4
- package/__tests__/tsconfig.json +3 -2
- package/dist/config/build-component.js +16 -3
- package/dist/config/build-component.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +46 -44
- package/src/config/build-component.ts +16 -3
- package/templates/index.js +1 -1
- package/templates/metro.config.js +2 -2
- package/tsconfig.json +1 -0
- package/jest.config.js +0 -6
package/LICENSE
CHANGED
|
@@ -154,15 +154,8 @@ 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
|
-
|
|
164
157
|
MIT (weui):
|
|
165
|
-
The following files embed [
|
|
158
|
+
The following files embed [weui](https://github.com/Tencent/weui) MIT:
|
|
166
159
|
`/packages/taro-components/src/components/*.scss`
|
|
167
160
|
See `/LICENSE.txt` for details of the license.
|
|
168
161
|
|
|
@@ -172,3 +165,10 @@ Apache-2.0 (intersection-observer):
|
|
|
172
165
|
The following files embed [intersection-observer](https://github.com/GoogleChromeLabs/intersection-observer) Apache-2.0:
|
|
173
166
|
`/packages/taro-api/src/polyfill/intersection-observer.ts`
|
|
174
167
|
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/
|
|
5
|
+
`@tarojs/rn-runner` 从 `@tarojs/cli` 接受 [Taro 编译配置](https://taro-docs.jd.com/taro/docs/config.html),把编译配置分解成 Webpack 配置,并刚启动 Webpack 把项目源码编译为适配 React Native 目录结构的代码。
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`build_components dynamic require 1`] = `
|
|
3
|
+
exports[`build_components > dynamic require 1`] = `
|
|
4
4
|
[
|
|
5
|
-
"
|
|
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: {}};
|
|
6
10
|
|
|
7
11
|
var reactIs_production_min = {};
|
|
8
12
|
|
|
9
|
-
var b=
|
|
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;
|
|
10
14
|
|
|
11
|
-
reactIs$1.exports=reactIs_production_min;var
|
|
15
|
+
reactIs$1.exports=reactIs_production_min;var reactIsExports=reactIs$1.exports;var reactIs = getDefaultExportFromCjs(reactIsExports);
|
|
12
16
|
|
|
13
17
|
console.log({reactIs:reactIs});
|
|
14
18
|
",
|
|
15
19
|
]
|
|
16
20
|
`;
|
|
17
21
|
|
|
18
|
-
exports[`build_components modify rollup config 1`] = `
|
|
22
|
+
exports[`build_components > modify rollup config 1`] = `
|
|
19
23
|
[
|
|
20
|
-
"import '
|
|
21
|
-
import View from '@tarojs/components-rn/dist/components/View';
|
|
24
|
+
"import View from '@tarojs/components-rn/dist/components/View';
|
|
22
25
|
import Text from '@tarojs/components-rn/dist/components/Text';
|
|
23
26
|
import taro from '@tarojs/taro-rn';
|
|
24
27
|
import { StyleSheet } from 'react-native';
|
|
@@ -55,8 +58,7 @@ function _mergeEleStyles(){return [].concat.apply([],arguments).reduce((pre,cur)
|
|
|
55
58
|
|
|
56
59
|
export { Cell as default };
|
|
57
60
|
",
|
|
58
|
-
"import '
|
|
59
|
-
import { navigateBack } from '@tarojs/taro-rn/dist/api';
|
|
61
|
+
"import { navigateBack } from '@tarojs/taro-rn/dist/api';
|
|
60
62
|
import View from '@tarojs/components-rn/dist/components/View';
|
|
61
63
|
import Text from '@tarojs/components-rn/dist/components/Text';
|
|
62
64
|
import Image from '@tarojs/components-rn/dist/components/Image';
|
|
@@ -64,7 +66,7 @@ import { StyleSheet } from 'react-native';
|
|
|
64
66
|
import { scalePx2dp } from '@tarojs/runtime-rn';
|
|
65
67
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
66
68
|
|
|
67
|
-
var iconBack = require('../assets/icon_back-
|
|
69
|
+
var iconBack = require('../assets/icon_back-K9-Z_a7i.webp');
|
|
68
70
|
|
|
69
71
|
var _indexScssStyleSheet = StyleSheet.create({
|
|
70
72
|
"navbar": {
|
|
@@ -110,10 +112,9 @@ export { Navbar as default };
|
|
|
110
112
|
]
|
|
111
113
|
`;
|
|
112
114
|
|
|
113
|
-
exports[`build_components multiple components 1`] = `
|
|
115
|
+
exports[`build_components > multiple components 1`] = `
|
|
114
116
|
[
|
|
115
|
-
"import '
|
|
116
|
-
import View from '@tarojs/components-rn/dist/components/View';
|
|
117
|
+
"import View from '@tarojs/components-rn/dist/components/View';
|
|
117
118
|
import Text from '@tarojs/components-rn/dist/components/Text';
|
|
118
119
|
import taro from '@tarojs/taro-rn';
|
|
119
120
|
import { StyleSheet } from 'react-native';
|
|
@@ -150,8 +151,7 @@ function _mergeEleStyles(){return [].concat.apply([],arguments).reduce((pre,cur)
|
|
|
150
151
|
|
|
151
152
|
export { Cell as default };
|
|
152
153
|
",
|
|
153
|
-
"import '
|
|
154
|
-
import { navigateBack } from '@tarojs/taro-rn/dist/api';
|
|
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-
|
|
162
|
+
var iconBack = require('../../assets/icon_back-K9-Z_a7i.webp');
|
|
163
163
|
|
|
164
164
|
var _indexScssStyleSheet = StyleSheet.create({
|
|
165
165
|
"navbar": {
|
|
@@ -205,15 +205,11 @@ 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$
|
|
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);}
|
|
210
|
+
"import { Platform as Platform$1, NativeEventEmitter, NativeModules } from 'react-native';
|
|
215
211
|
|
|
216
|
-
function _typeof(
|
|
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);}
|
|
217
213
|
|
|
218
214
|
function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}
|
|
219
215
|
|
|
@@ -221,85 +217,95 @@ function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object
|
|
|
221
217
|
|
|
222
218
|
function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}
|
|
223
219
|
|
|
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
|
|
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);}
|
|
227
227
|
|
|
228
|
-
function
|
|
228
|
+
function toPropertyKey(t){var i=toPrimitive(t,"string");return "symbol"==_typeof(i)?i:i+"";}
|
|
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,
|
|
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;}
|
|
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=
|
|
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
|
-
|
|
236
|
+
function getDefaultExportFromCjs (x) {
|
|
237
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
238
|
+
}
|
|
237
239
|
|
|
238
|
-
var
|
|
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}\`);}}
|
|
239
245
|
|
|
240
246
|
var NativeModulesProxy = {};
|
|
241
247
|
|
|
242
|
-
function _isNativeFunction(fn){return Function.toString.call(fn).indexOf("[native code]")!==-1;}
|
|
248
|
+
function _isNativeFunction(fn){try{return Function.toString.call(fn).indexOf("[native code]")!==-1;}catch(e){return typeof fn==="function";}}
|
|
243
249
|
|
|
244
|
-
function _isNativeReflectConstruct$3(){
|
|
250
|
+
function _isNativeReflectConstruct$3(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return (_isNativeReflectConstruct$3=function(){return !!t;})();}
|
|
245
251
|
|
|
246
|
-
function _construct(){if(_isNativeReflectConstruct$3())
|
|
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;}
|
|
247
253
|
|
|
248
254
|
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);}
|
|
249
255
|
|
|
250
|
-
function
|
|
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));
|
|
251
257
|
|
|
252
258
|
var isDOMAvailable=false;var canUseEventListeners=false;var canUseViewport=false;var isAsyncDebugging=false;if(__DEV__){isAsyncDebugging=!global.nativeExtensions&&!global.nativeCallSyncHook&&!global.RN$Bridgeless;}
|
|
253
259
|
|
|
254
|
-
var Platform={OS:Platform$
|
|
260
|
+
var Platform={OS:Platform$1.OS,select:Platform$1.select,isDOMAvailable:isDOMAvailable,canUseEventListeners:canUseEventListeners,canUseViewport:canUseViewport,isAsyncDebugging:isAsyncDebugging};
|
|
255
261
|
|
|
256
|
-
function
|
|
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);
|
|
257
263
|
|
|
258
264
|
var NativeErrorManager = NativeModulesProxy.ExpoModulesCoreErrorManager;
|
|
259
265
|
|
|
260
|
-
if(__DEV__&&Platform
|
|
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;
|
|
261
267
|
|
|
262
|
-
var byteToHex=[];for(var i=0;i<256;++i){byteToHex[i]=(i+0x100).toString(16).substr(1);}function bytesToUuid(buf,offset){var i=
|
|
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('');}
|
|
263
269
|
|
|
264
270
|
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={}));
|
|
265
271
|
|
|
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};
|
|
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};
|
|
267
273
|
|
|
268
|
-
function requireOptionalNativeModule(moduleName){var _ref,
|
|
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;}
|
|
269
275
|
|
|
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(){}};
|
|
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(){}};
|
|
271
277
|
|
|
272
|
-
var _requireOptionalNativ;var ExponentFileSystem = (_requireOptionalNativ=requireOptionalNativeModule('ExponentFileSystem'))!=null?_requireOptionalNativ:
|
|
278
|
+
var _requireOptionalNativ;var ExponentFileSystem = (_requireOptionalNativ=requireOptionalNativeModule('ExponentFileSystem'))!=null?_requireOptionalNativ:platformModule;
|
|
273
279
|
|
|
274
280
|
var FileSystemSessionType;(function(FileSystemSessionType){FileSystemSessionType[FileSystemSessionType["BACKGROUND"]=0]="BACKGROUND";FileSystemSessionType[FileSystemSessionType["FOREGROUND"]=1]="FOREGROUND";})(FileSystemSessionType||(FileSystemSessionType={}));var FileSystemUploadType;(function(FileSystemUploadType){FileSystemUploadType[FileSystemUploadType["BINARY_CONTENT"]=0]="BINARY_CONTENT";FileSystemUploadType[FileSystemUploadType["MULTIPART"]=1]="MULTIPART";})(FileSystemUploadType||(FileSystemUploadType={}));var EncodingType;(function(EncodingType){EncodingType["UTF8"]="utf8";EncodingType["Base64"]="base64";})(EncodingType||(EncodingType={}));
|
|
275
281
|
|
|
276
|
-
function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else {result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}if(!ExponentFileSystem){console.warn("No native ExponentFileSystem module found, are you sure the expo-file-system's module is linked properly?");}new EventEmitter(ExponentFileSystem);function normalizeEndingSlash(p){if(p!=null){return p.replace(/\\/*$/,'')+'/';}return null;}var documentDirectory=normalizeEndingSlash(ExponentFileSystem.documentDirectory);var cacheDirectory=normalizeEndingSlash(ExponentFileSystem.cacheDirectory);var bundleDirectory=normalizeEndingSlash(ExponentFileSystem.bundleDirectory);function getInfoAsync(){return _getInfoAsync.apply(this,arguments);}function _getInfoAsync(){_getInfoAsync=_asyncToGenerator(function*(fileUri){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!ExponentFileSystem.getInfoAsync){throw new UnavailabilityError('expo-file-system','getInfoAsync');}return yield ExponentFileSystem.getInfoAsync(fileUri,options);});return _getInfoAsync.apply(this,arguments);}function readAsStringAsync(){return _readAsStringAsync.apply(this,arguments);}function _readAsStringAsync(){_readAsStringAsync=_asyncToGenerator(function*(fileUri){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!ExponentFileSystem.readAsStringAsync){throw new UnavailabilityError('expo-file-system','readAsStringAsync');}return yield ExponentFileSystem.readAsStringAsync(fileUri,options);});return _readAsStringAsync.apply(this,arguments);}function getContentUriAsync(){return _getContentUriAsync.apply(this,arguments);}function _getContentUriAsync(){_getContentUriAsync=_asyncToGenerator(function*(fileUri){if(Platform$2.OS==='android'){if(!ExponentFileSystem.getContentUriAsync){throw new UnavailabilityError('expo-file-system','getContentUriAsync');}return yield ExponentFileSystem.getContentUriAsync(fileUri);}else {return fileUri;}});return _getContentUriAsync.apply(this,arguments);}function writeAsStringAsync(){return _writeAsStringAsync.apply(this,arguments);}function _writeAsStringAsync(){_writeAsStringAsync=_asyncToGenerator(function*(fileUri,contents){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(!ExponentFileSystem.writeAsStringAsync){throw new UnavailabilityError('expo-file-system','writeAsStringAsync');}return yield ExponentFileSystem.writeAsStringAsync(fileUri,contents,options);});return _writeAsStringAsync.apply(this,arguments);}function deleteAsync(){return _deleteAsync.apply(this,arguments);}function _deleteAsync(){_deleteAsync=_asyncToGenerator(function*(fileUri){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!ExponentFileSystem.deleteAsync){throw new UnavailabilityError('expo-file-system','deleteAsync');}return yield ExponentFileSystem.deleteAsync(fileUri,options);});return _deleteAsync.apply(this,arguments);}function deleteLegacyDocumentDirectoryAndroid(){return _deleteLegacyDocumentDirectoryAndroid.apply(this,arguments);}function _deleteLegacyDocumentDirectoryAndroid(){_deleteLegacyDocumentDirectoryAndroid=_asyncToGenerator(function*(){if(Platform$2.OS!=='android'||documentDirectory==null){return;}return yield deleteAsync(\`\${documentDirectory}ExperienceData/\`,{idempotent:true});});return _deleteLegacyDocumentDirectoryAndroid.apply(this,arguments);}function moveAsync(){return _moveAsync.apply(this,arguments);}function _moveAsync(){_moveAsync=_asyncToGenerator(function*(options){if(!ExponentFileSystem.moveAsync){throw new UnavailabilityError('expo-file-system','moveAsync');}return yield ExponentFileSystem.moveAsync(options);});return _moveAsync.apply(this,arguments);}function copyAsync(){return _copyAsync.apply(this,arguments);}function _copyAsync(){_copyAsync=_asyncToGenerator(function*(options){if(!ExponentFileSystem.copyAsync){throw new UnavailabilityError('expo-file-system','copyAsync');}return yield ExponentFileSystem.copyAsync(options);});return _copyAsync.apply(this,arguments);}function makeDirectoryAsync(){return _makeDirectoryAsync.apply(this,arguments);}function _makeDirectoryAsync(){_makeDirectoryAsync=_asyncToGenerator(function*(fileUri){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!ExponentFileSystem.makeDirectoryAsync){throw new UnavailabilityError('expo-file-system','makeDirectoryAsync');}return yield ExponentFileSystem.makeDirectoryAsync(fileUri,options);});return _makeDirectoryAsync.apply(this,arguments);}function readDirectoryAsync(){return _readDirectoryAsync.apply(this,arguments);}function _readDirectoryAsync(){_readDirectoryAsync=_asyncToGenerator(function*(fileUri){if(!ExponentFileSystem.readDirectoryAsync){throw new UnavailabilityError('expo-file-system','readDirectoryAsync');}return yield ExponentFileSystem.readDirectoryAsync(fileUri);});return _readDirectoryAsync.apply(this,arguments);}function getFreeDiskStorageAsync(){return _getFreeDiskStorageAsync.apply(this,arguments);}function _getFreeDiskStorageAsync(){_getFreeDiskStorageAsync=_asyncToGenerator(function*(){if(!ExponentFileSystem.getFreeDiskStorageAsync){throw new UnavailabilityError('expo-file-system','getFreeDiskStorageAsync');}return yield ExponentFileSystem.getFreeDiskStorageAsync();});return _getFreeDiskStorageAsync.apply(this,arguments);}function getTotalDiskCapacityAsync(){return _getTotalDiskCapacityAsync.apply(this,arguments);}function _getTotalDiskCapacityAsync(){_getTotalDiskCapacityAsync=_asyncToGenerator(function*(){if(!ExponentFileSystem.getTotalDiskCapacityAsync){throw new UnavailabilityError('expo-file-system','getTotalDiskCapacityAsync');}return yield ExponentFileSystem.getTotalDiskCapacityAsync();});return _getTotalDiskCapacityAsync.apply(this,arguments);}function downloadAsync(){return _downloadAsync.apply(this,arguments);}function _downloadAsync(){_downloadAsync=_asyncToGenerator(function*(uri,fileUri){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(!ExponentFileSystem.downloadAsync){throw new UnavailabilityError('expo-file-system','downloadAsync');}return yield ExponentFileSystem.downloadAsync(uri,fileUri,Object.assign({sessionType:FileSystemSessionType.BACKGROUND},options));});return _downloadAsync.apply(this,arguments);}function uploadAsync(){return _uploadAsync.apply(this,arguments);}function _uploadAsync(){_uploadAsync=_asyncToGenerator(function*(url,fileUri){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(!ExponentFileSystem.uploadAsync){throw new UnavailabilityError('expo-file-system','uploadAsync');}return yield ExponentFileSystem.uploadAsync(url,fileUri,Object.assign({sessionType:FileSystemSessionType.BACKGROUND,uploadType:FileSystemUploadType.BINARY_CONTENT},options,{httpMethod:(options.httpMethod||'POST').toUpperCase()}));});return _uploadAsync.apply(this,arguments);}function createDownloadResumable(uri,fileUri,options,callback,resumeData){return new DownloadResumable(uri,fileUri,options,callback,resumeData);}function createUploadTask(url,fileUri,options,callback){return new UploadTask(url,fileUri,options,callback);}var FileSystemCancellableNetworkTask=function(){function FileSystemCancellableNetworkTask(){_classCallCheck(this,FileSystemCancellableNetworkTask);this._uuid=uuid$1.v4();this.taskWasCanceled=false;this.emitter=new EventEmitter(ExponentFileSystem);}_createClass(FileSystemCancellableNetworkTask,[{key:"cancelAsync",value:function(){var _cancelAsync=_asyncToGenerator(function*(){if(!ExponentFileSystem.networkTaskCancelAsync){throw new UnavailabilityError('expo-file-system','networkTaskCancelAsync');}this.removeSubscription();this.taskWasCanceled=true;return yield ExponentFileSystem.networkTaskCancelAsync(this.uuid);});function cancelAsync(){return _cancelAsync.apply(this,arguments);}return cancelAsync;}()},{key:"isTaskCancelled",value:function isTaskCancelled(){if(this.taskWasCanceled){console.warn('This task was already canceled.');return true;}return false;}},{key:"uuid",get:function get(){return this._uuid;}},{key:"addSubscription",value:function addSubscription(){var _this=this;if(this.subscription){return;}this.subscription=this.emitter.addListener(this.getEventName(),function(event){if(event.uuid===_this.uuid){var callback=_this.getCallback();if(callback){callback(event.data);}}});}},{key:"removeSubscription",value:function removeSubscription(){if(!this.subscription){return;}this.emitter.removeSubscription(this.subscription);this.subscription=null;}}]);return FileSystemCancellableNetworkTask;}();var UploadTask=function(_FileSystemCancellabl){_inherits(UploadTask,_FileSystemCancellabl);var _super=_createSuper(UploadTask);function UploadTask(url,fileUri,options,callback){var _options$httpMethod;var _this2;_classCallCheck(this,UploadTask);_this2=_super.call(this);_this2.url=url;_this2.fileUri=fileUri;_this2.callback=callback;var httpMethod=(options==null?void 0:(_options$httpMethod=options.httpMethod)==null?void 0:_options$httpMethod.toUpperCase())||'POST';_this2.options=Object.assign({sessionType:FileSystemSessionType.BACKGROUND,uploadType:FileSystemUploadType.BINARY_CONTENT},options,{httpMethod:httpMethod});return _this2;}_createClass(UploadTask,[{key:"getEventName",value:function getEventName(){return 'expo-file-system.uploadProgress';}},{key:"getCallback",value:function getCallback(){return this.callback;}},{key:"uploadAsync",value:function(){var _uploadAsync2=_asyncToGenerator(function*(){if(!ExponentFileSystem.uploadTaskStartAsync){throw new UnavailabilityError('expo-file-system','uploadTaskStartAsync');}if(this.isTaskCancelled()){return;}this.addSubscription();var result=yield ExponentFileSystem.uploadTaskStartAsync(this.url,this.fileUri,this.uuid,this.options);this.removeSubscription();return result;});function uploadAsync(){return _uploadAsync2.apply(this,arguments);}return uploadAsync;}()}]);return UploadTask;}(FileSystemCancellableNetworkTask);var DownloadResumable=function(_FileSystemCancellabl2){_inherits(DownloadResumable,_FileSystemCancellabl2);var _super2=_createSuper(DownloadResumable);function DownloadResumable(url,_fileUri){var _this3;var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var callback=arguments.length>3?arguments[3]:undefined;var resumeData=arguments.length>4?arguments[4]:undefined;_classCallCheck(this,DownloadResumable);_this3=_super2.call(this);_this3.url=url;_this3._fileUri=_fileUri;_this3.options=options;_this3.callback=callback;_this3.resumeData=resumeData;return _this3;}_createClass(DownloadResumable,[{key:"fileUri",get:function get(){return this._fileUri;}},{key:"getEventName",value:function getEventName(){return 'expo-file-system.downloadProgress';}},{key:"getCallback",value:function getCallback(){return this.callback;}},{key:"downloadAsync",value:function(){var _downloadAsync2=_asyncToGenerator(function*(){if(!ExponentFileSystem.downloadResumableStartAsync){throw new UnavailabilityError('expo-file-system','downloadResumableStartAsync');}if(this.isTaskCancelled()){return;}this.addSubscription();return yield ExponentFileSystem.downloadResumableStartAsync(this.url,this._fileUri,this.uuid,this.options,this.resumeData);});function downloadAsync(){return _downloadAsync2.apply(this,arguments);}return downloadAsync;}()},{key:"pauseAsync",value:function(){var _pauseAsync=_asyncToGenerator(function*(){if(!ExponentFileSystem.downloadResumablePauseAsync){throw new UnavailabilityError('expo-file-system','downloadResumablePauseAsync');}if(this.isTaskCancelled()){return {fileUri:this._fileUri,options:this.options,url:this.url};}var pauseResult=yield ExponentFileSystem.downloadResumablePauseAsync(this.uuid);this.removeSubscription();if(pauseResult){this.resumeData=pauseResult.resumeData;return this.savable();}else {throw new Error('Unable to generate a savable pause state');}});function pauseAsync(){return _pauseAsync.apply(this,arguments);}return pauseAsync;}()},{key:"resumeAsync",value:function(){var _resumeAsync=_asyncToGenerator(function*(){if(!ExponentFileSystem.downloadResumableStartAsync){throw new UnavailabilityError('expo-file-system','downloadResumableStartAsync');}if(this.isTaskCancelled()){return;}this.addSubscription();return yield ExponentFileSystem.downloadResumableStartAsync(this.url,this.fileUri,this.uuid,this.options,this.resumeData);});function resumeAsync(){return _resumeAsync.apply(this,arguments);}return resumeAsync;}()},{key:"savable",value:function savable(){return {url:this.url,fileUri:this.fileUri,options:this.options,resumeData:this.resumeData};}}]);return DownloadResumable;}(FileSystemCancellableNetworkTask);var baseReadAsStringAsync=readAsStringAsync;var baseWriteAsStringAsync=writeAsStringAsync;var baseDeleteAsync=deleteAsync;var baseMoveAsync=moveAsync;var baseCopyAsync=copyAsync;var StorageAccessFramework;(function(StorageAccessFramework){StorageAccessFramework.getUriForDirectoryInRoot=function getUriForDirectoryInRoot(folderName){return \`content://com.android.externalstorage.documents/tree/primary:\${folderName}/document/primary:\${folderName}\`;};function requestDirectoryPermissionsAsync(){return _requestDirectoryPermissionsAsync.apply(this,arguments);}function _requestDirectoryPermissionsAsync(){_requestDirectoryPermissionsAsync=_asyncToGenerator(function*(){var initialFileUrl=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;if(!ExponentFileSystem.requestDirectoryPermissionsAsync){throw new UnavailabilityError('expo-file-system','StorageAccessFramework.requestDirectoryPermissionsAsync');}return yield ExponentFileSystem.requestDirectoryPermissionsAsync(initialFileUrl);});return _requestDirectoryPermissionsAsync.apply(this,arguments);}StorageAccessFramework.requestDirectoryPermissionsAsync=requestDirectoryPermissionsAsync;function readDirectoryAsync(_x15){return _readDirectoryAsync2.apply(this,arguments);}function _readDirectoryAsync2(){_readDirectoryAsync2=_asyncToGenerator(function*(dirUri){if(!ExponentFileSystem.readSAFDirectoryAsync){throw new UnavailabilityError('expo-file-system','StorageAccessFramework.readDirectoryAsync');}return yield ExponentFileSystem.readSAFDirectoryAsync(dirUri);});return _readDirectoryAsync2.apply(this,arguments);}StorageAccessFramework.readDirectoryAsync=readDirectoryAsync;function makeDirectoryAsync(_x16,_x17){return _makeDirectoryAsync2.apply(this,arguments);}function _makeDirectoryAsync2(){_makeDirectoryAsync2=_asyncToGenerator(function*(parentUri,dirName){if(!ExponentFileSystem.makeSAFDirectoryAsync){throw new UnavailabilityError('expo-file-system','StorageAccessFramework.makeDirectoryAsync');}return yield ExponentFileSystem.makeSAFDirectoryAsync(parentUri,dirName);});return _makeDirectoryAsync2.apply(this,arguments);}StorageAccessFramework.makeDirectoryAsync=makeDirectoryAsync;function createFileAsync(_x18,_x19,_x20){return _createFileAsync.apply(this,arguments);}function _createFileAsync(){_createFileAsync=_asyncToGenerator(function*(parentUri,fileName,mimeType){if(!ExponentFileSystem.createSAFFileAsync){throw new UnavailabilityError('expo-file-system','StorageAccessFramework.createFileAsync');}return yield ExponentFileSystem.createSAFFileAsync(parentUri,fileName,mimeType);});return _createFileAsync.apply(this,arguments);}StorageAccessFramework.createFileAsync=createFileAsync;StorageAccessFramework.writeAsStringAsync=baseWriteAsStringAsync;StorageAccessFramework.readAsStringAsync=baseReadAsStringAsync;StorageAccessFramework.deleteAsync=baseDeleteAsync;StorageAccessFramework.moveAsync=baseMoveAsync;StorageAccessFramework.copyAsync=baseCopyAsync;})(StorageAccessFramework||(StorageAccessFramework={}));
|
|
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={}));
|
|
277
283
|
|
|
278
284
|
var fileBuild = /*#__PURE__*/Object.freeze({
|
|
279
285
|
__proto__: null,
|
|
280
|
-
|
|
281
|
-
|
|
286
|
+
DownloadResumable: DownloadResumable,
|
|
287
|
+
FileSystemCancellableNetworkTask: FileSystemCancellableNetworkTask,
|
|
288
|
+
get StorageAccessFramework () { return StorageAccessFramework; },
|
|
289
|
+
UploadTask: UploadTask,
|
|
282
290
|
bundleDirectory: bundleDirectory,
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
291
|
+
cacheDirectory: cacheDirectory,
|
|
292
|
+
copyAsync: copyAsync,
|
|
293
|
+
createDownloadResumable: createDownloadResumable,
|
|
294
|
+
createUploadTask: createUploadTask,
|
|
287
295
|
deleteAsync: deleteAsync,
|
|
288
296
|
deleteLegacyDocumentDirectoryAndroid: deleteLegacyDocumentDirectoryAndroid,
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
readDirectoryAsync: readDirectoryAsync,
|
|
297
|
+
documentDirectory: documentDirectory,
|
|
298
|
+
downloadAsync: downloadAsync,
|
|
299
|
+
getContentUriAsync: getContentUriAsync,
|
|
293
300
|
getFreeDiskStorageAsync: getFreeDiskStorageAsync,
|
|
301
|
+
getInfoAsync: getInfoAsync,
|
|
294
302
|
getTotalDiskCapacityAsync: getTotalDiskCapacityAsync,
|
|
295
|
-
|
|
303
|
+
makeDirectoryAsync: makeDirectoryAsync,
|
|
304
|
+
moveAsync: moveAsync,
|
|
305
|
+
readAsStringAsync: readAsStringAsync,
|
|
306
|
+
readDirectoryAsync: readDirectoryAsync,
|
|
296
307
|
uploadAsync: uploadAsync,
|
|
297
|
-
|
|
298
|
-
createUploadTask: createUploadTask,
|
|
299
|
-
FileSystemCancellableNetworkTask: FileSystemCancellableNetworkTask,
|
|
300
|
-
UploadTask: UploadTask,
|
|
301
|
-
DownloadResumable: DownloadResumable,
|
|
302
|
-
get StorageAccessFramework () { return StorageAccessFramework; }
|
|
308
|
+
writeAsStringAsync: writeAsStringAsync
|
|
303
309
|
});
|
|
304
310
|
|
|
305
311
|
console.log({fileBuild:fileBuild});
|
|
@@ -307,10 +313,9 @@ console.log({fileBuild:fileBuild});
|
|
|
307
313
|
]
|
|
308
314
|
`;
|
|
309
315
|
|
|
310
|
-
exports[`build_components nativeComponents
|
|
316
|
+
exports[`build_components > nativeComponents not set 1`] = `
|
|
311
317
|
[
|
|
312
|
-
"import '
|
|
313
|
-
import View from '@tarojs/components-rn/dist/components/View';
|
|
318
|
+
"import View from '@tarojs/components-rn/dist/components/View';
|
|
314
319
|
import Text from '@tarojs/components-rn/dist/components/Text';
|
|
315
320
|
import taro from '@tarojs/taro-rn';
|
|
316
321
|
import { StyleSheet } from 'react-native';
|
|
@@ -350,28 +355,24 @@ export { Cell as default };
|
|
|
350
355
|
]
|
|
351
356
|
`;
|
|
352
357
|
|
|
353
|
-
exports[`build_components require react-native component 1`] = `
|
|
358
|
+
exports[`build_components > require react-native component 1`] = `
|
|
354
359
|
[
|
|
355
360
|
"import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
356
361
|
import { Children, Component } from 'react';
|
|
357
362
|
|
|
358
363
|
function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}
|
|
359
364
|
|
|
360
|
-
function _typeof(
|
|
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);}
|
|
361
366
|
|
|
362
|
-
function
|
|
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);}
|
|
363
368
|
|
|
364
|
-
function
|
|
369
|
+
function toPropertyKey(t){var i=toPrimitive(t,"string");return "symbol"==_typeof(i)?i:i+"";}
|
|
365
370
|
|
|
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,
|
|
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;}
|
|
367
372
|
|
|
368
373
|
function ChildrenWrapper(props){return jsx(Fragment,{children:props.children});}
|
|
369
374
|
|
|
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});}}}]);
|
|
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);}
|
|
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});}}}]);}();
|
|
375
376
|
|
|
376
377
|
function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}
|
|
377
378
|
|
|
@@ -379,23 +380,26 @@ function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object
|
|
|
379
380
|
|
|
380
381
|
function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}
|
|
381
382
|
|
|
382
|
-
function
|
|
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);
|
|
383
388
|
|
|
384
|
-
function
|
|
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);
|
|
385
390
|
|
|
386
391
|
function wrapRootComponent(_Root,renderSibling){var controller=new RootController();return {Root:function Root(props){return jsx(_default,{controller:controller,renderSibling:renderSibling,children:jsx(_Root,Object.assign({},props))});},manager:{update:function update(id,element,callback){controller.update(id,element,callback);},destroy:function destroy(id,callback){controller.destroy(id,callback);}}};}
|
|
387
392
|
|
|
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);}}]);
|
|
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);}}]);}();
|
|
389
394
|
|
|
390
395
|
console.log({silblings:RootSiblingsManager});
|
|
391
396
|
",
|
|
392
397
|
]
|
|
393
398
|
`;
|
|
394
399
|
|
|
395
|
-
exports[`build_components single component 1`] = `
|
|
400
|
+
exports[`build_components > single component 1`] = `
|
|
396
401
|
[
|
|
397
|
-
"import '
|
|
398
|
-
import View from '@tarojs/components-rn/dist/components/View';
|
|
402
|
+
"import View from '@tarojs/components-rn/dist/components/View';
|
|
399
403
|
import Text from '@tarojs/components-rn/dist/components/Text';
|
|
400
404
|
import taro from '@tarojs/taro-rn';
|
|
401
405
|
import { StyleSheet } from 'react-native';
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import * as path from 'path'
|
|
2
|
+
import { describe, expect, test } from 'vitest'
|
|
2
3
|
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
4
|
+
import { build } from '../dist/config/build-component'
|
|
5
|
+
import { default as runner } from '../dist/index'
|
|
5
6
|
import { appPath, config } from './mock/components_testdata'
|
|
6
7
|
|
|
7
8
|
const getCode = (result) => result.output.map(chunk => chunk.code)
|
|
8
9
|
|
|
9
|
-
describe('build_components', () => {
|
|
10
|
-
|
|
11
|
-
spy.mockReturnValue(path.resolve(__dirname, '', 'mock'))
|
|
12
|
-
// metro runServer 容易超时
|
|
13
|
-
jest.setTimeout(300000)
|
|
14
|
-
|
|
15
|
-
it('single component', async () => {
|
|
10
|
+
describe.skip('build_components', () => {
|
|
11
|
+
test('single component', async () => {
|
|
16
12
|
const result = await runner(appPath, {
|
|
17
13
|
...config,
|
|
18
14
|
nativeComponents: {
|
|
@@ -20,17 +16,16 @@ describe('build_components', () => {
|
|
|
20
16
|
output: 'dist/single'
|
|
21
17
|
}
|
|
22
18
|
})
|
|
19
|
+
|
|
23
20
|
expect(getCode(result)).toMatchSnapshot()
|
|
24
21
|
})
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
const result = await runner(appPath, {
|
|
28
|
-
...config
|
|
29
|
-
})
|
|
23
|
+
test('nativeComponents not set', async () => {
|
|
24
|
+
const result = await runner(appPath, { ...config })
|
|
30
25
|
expect(getCode(result)).toMatchSnapshot()
|
|
31
26
|
})
|
|
32
27
|
|
|
33
|
-
|
|
28
|
+
test('multiple components', async () => {
|
|
34
29
|
const result = await build(config, {
|
|
35
30
|
input: ['components/cell/index', 'components/navbar/index'],
|
|
36
31
|
sourceRootPath: path.resolve(__dirname, './mock/src'),
|
|
@@ -41,7 +36,7 @@ describe('build_components', () => {
|
|
|
41
36
|
expect(getCode(result)).toMatchSnapshot()
|
|
42
37
|
})
|
|
43
38
|
|
|
44
|
-
|
|
39
|
+
test('modify rollup config', async () => {
|
|
45
40
|
const result = await build(config, {
|
|
46
41
|
input: ['components/cell/index', 'components/navbar/index'],
|
|
47
42
|
sourceRootPath: path.resolve(__dirname, './mock/src'),
|
|
@@ -60,7 +55,7 @@ describe('build_components', () => {
|
|
|
60
55
|
expect(getCode(result)).toMatchSnapshot()
|
|
61
56
|
})
|
|
62
57
|
|
|
63
|
-
|
|
58
|
+
test('svg transform', async () => {
|
|
64
59
|
const result = await build(config, {
|
|
65
60
|
input: ['components/svg/index'],
|
|
66
61
|
sourceRootPath: path.resolve(__dirname, './mock/src'),
|
|
@@ -71,7 +66,7 @@ describe('build_components', () => {
|
|
|
71
66
|
expect(getCode(result))
|
|
72
67
|
})
|
|
73
68
|
|
|
74
|
-
|
|
69
|
+
test('named export', async () => {
|
|
75
70
|
const result = await build(config, {
|
|
76
71
|
input: ['utils/namedExport/index'],
|
|
77
72
|
sourceRootPath: path.resolve(__dirname, './mock/src'),
|
|
@@ -81,7 +76,7 @@ describe('build_components', () => {
|
|
|
81
76
|
expect(getCode(result)).toMatchSnapshot()
|
|
82
77
|
})
|
|
83
78
|
|
|
84
|
-
|
|
79
|
+
test('dynamic require', async () => {
|
|
85
80
|
const result = await build(config, {
|
|
86
81
|
input: ['utils/dynamicImport/index'],
|
|
87
82
|
sourceRootPath: path.resolve(__dirname, './mock/src'),
|
|
@@ -91,7 +86,7 @@ describe('build_components', () => {
|
|
|
91
86
|
expect(getCode(result)).toMatchSnapshot()
|
|
92
87
|
})
|
|
93
88
|
|
|
94
|
-
|
|
89
|
+
test('require react-native component', async () => {
|
|
95
90
|
const result = await build(config, {
|
|
96
91
|
input: ['utils/requireReactNative/index'],
|
|
97
92
|
sourceRootPath: path.resolve(__dirname, './mock/src'),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { camelCase } from 'lodash'
|
|
2
|
-
import
|
|
3
|
-
const globalAny = global
|
|
1
|
+
import { camelCase } from 'lodash'
|
|
2
|
+
import queryString from 'query-string'
|
|
3
|
+
const globalAny = global
|
|
4
4
|
|
|
5
|
-
console.log(globalAny, camelCase,
|
|
5
|
+
console.log(globalAny, camelCase, queryString)
|
package/__tests__/tsconfig.json
CHANGED
|
@@ -104,7 +104,10 @@ const build = (projectConfig, componentConfig) => __awaiter(void 0, void 0, void
|
|
|
104
104
|
}),
|
|
105
105
|
// @ts-ignore
|
|
106
106
|
pluginReplace({
|
|
107
|
-
|
|
107
|
+
preventAssignment: true,
|
|
108
|
+
values: {
|
|
109
|
+
'process.env.NODE_ENV': JSON.stringify('production')
|
|
110
|
+
}
|
|
108
111
|
}),
|
|
109
112
|
// @ts-ignore
|
|
110
113
|
commonjs(),
|
|
@@ -164,10 +167,20 @@ exports.build = build;
|
|
|
164
167
|
function likeDependent(str) {
|
|
165
168
|
return !str.match(/^\.?\.\//) && !path.isAbsolute(str);
|
|
166
169
|
}
|
|
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
|
+
}
|
|
167
180
|
function default_1(projectPath, config) {
|
|
168
181
|
const { sourceRoot, entry, nativeComponents } = config;
|
|
169
|
-
const
|
|
170
|
-
const appConfig = (0, rn_transformer_1.getAppConfig)(
|
|
182
|
+
const appEntryPath = getEntryPath(entry);
|
|
183
|
+
const appConfig = (0, rn_transformer_1.getAppConfig)(appEntryPath);
|
|
171
184
|
const { output = DEFAULT_CONFIG.output } = nativeComponents || {};
|
|
172
185
|
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) });
|
|
173
186
|
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,kBAAkB,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM;CACrC,CAAA;AAEM,MAAM,KAAK,GAAG,CAAO,aAAa,EAAE,eAAiC,EAAE,EAAE;IAC9E,MAAM,YAAY,GAAG,IAAA,uBAAc,oBAAM,cAAc,GAAI,eAAe,CAAC,CAAA;IAC3E,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,kBAAkB,EAAE,GAAG,YAAY,CAAA;IAErG,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,MAAM,UAAU,GAAa,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,C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,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,GACnD,CAAA;IAED,OAAO,IAAA,aAAK,EAAC,MAAM,EAAE,eAAe,CAAC,CAAA;AACvC,CAAC;AAdD,4BAcC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uDAA8D;AAC9D,iDAAqC;AACrC,2BAAwC;AACxC,gCAA+B;AAC/B,+BAAoC;AAEpC,8DAAqD;AAErD,uCAAuC;AACvC,MAAM,KAAK,GAAG,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAA;AAC7C,SAAS,YAAY;IACnB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAA;QAC1C,IAAA,aAAQ,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,QAAQ,EAAE,cAAS,CAAC,aAAa,EAAE,GAAG,CAAC,EAAE;YAC1F,IAAI,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uDAA8D;AAC9D,iDAAqC;AACrC,2BAAwC;AACxC,gCAA+B;AAC/B,+BAAoC;AAEpC,8DAAqD;AAErD,uCAAuC;AACvC,MAAM,KAAK,GAAG,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAA;AAC7C,SAAS,YAAY;IACnB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAA;QAC1C,IAAA,aAAQ,EAAC,IAAA,WAAI,EAAC,SAAS,EAA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|
@@ -1,69 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/rn-runner",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.120",
|
|
4
4
|
"description": "ReactNative build tool for taro",
|
|
5
|
+
"author": "O2Team",
|
|
6
|
+
"license": "MIT",
|
|
5
7
|
"main": "index.js",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/NervJS/taro.git"
|
|
9
|
-
},
|
|
10
8
|
"keywords": [
|
|
11
9
|
"taro"
|
|
12
10
|
],
|
|
13
|
-
"author": "luckyadam",
|
|
14
|
-
"license": "MIT",
|
|
15
11
|
"bugs": {
|
|
16
12
|
"url": "https://github.com/NervJS/taro/issues"
|
|
17
13
|
},
|
|
18
|
-
"
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/NervJS/taro.git"
|
|
17
|
+
},
|
|
19
18
|
"engines": {
|
|
20
|
-
"node": ">= 18"
|
|
21
|
-
"npm": ">= 6"
|
|
19
|
+
"node": ">= 18"
|
|
22
20
|
},
|
|
23
21
|
"dependencies": {
|
|
24
|
-
"@rollup/plugin-babel": "^6.0.
|
|
25
|
-
"@rollup/plugin-commonjs": "^
|
|
26
|
-
"@rollup/plugin-json": "^
|
|
27
|
-
"@rollup/plugin-node-resolve": "^
|
|
28
|
-
"@rollup/plugin-replace": "^
|
|
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",
|
|
29
28
|
"acorn-jsx": "^5.3.2",
|
|
30
|
-
"fs-extra": "^
|
|
29
|
+
"fs-extra": "^11.2.0",
|
|
31
30
|
"lodash": "^4.17.21",
|
|
32
31
|
"rollup-plugin-image-file": "^1.0.2",
|
|
33
|
-
"@tarojs/helper": "4.0.0-beta.
|
|
34
|
-
"@tarojs/rn-style-transformer": "4.0.0-beta.
|
|
35
|
-
"@tarojs/rn-transformer": "4.0.0-beta.
|
|
36
|
-
"@tarojs/rn-supporter": "4.0.0-beta.
|
|
32
|
+
"@tarojs/helper": "4.0.0-beta.120",
|
|
33
|
+
"@tarojs/rn-style-transformer": "4.0.0-beta.120",
|
|
34
|
+
"@tarojs/rn-transformer": "4.0.0-beta.120",
|
|
35
|
+
"@tarojs/rn-supporter": "4.0.0-beta.120",
|
|
36
|
+
"stylelint-config-taro-rn": "4.0.0-beta.120"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@
|
|
40
|
-
"
|
|
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",
|
|
39
|
+
"@rnx-kit/metro-resolver-symlinks": "^0.1.36",
|
|
40
|
+
"expo": "~51.0.5",
|
|
45
41
|
"expo-file-system": "~16.0.0",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"react": "
|
|
50
|
-
"react-is": "^16.13.0",
|
|
51
|
-
"react-native": "^0.73.1",
|
|
42
|
+
"query-string": "^9.0.0",
|
|
43
|
+
"react": "^18.2.0",
|
|
44
|
+
"react-is": "^18.3.1",
|
|
45
|
+
"react-native": "^0.72.3",
|
|
52
46
|
"react-native-root-siblings": "^5.0.1",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"babel-plugin-transform-react-jsx-to-rn-stylesheet": "4.0.0-beta.
|
|
47
|
+
"rollup": "^4.16.4",
|
|
48
|
+
"babel-preset-taro": "4.0.0-beta.120",
|
|
49
|
+
"@tarojs/taro": "4.0.0-beta.120",
|
|
50
|
+
"@tarojs/components": "4.0.0-beta.120",
|
|
51
|
+
"babel-plugin-transform-react-jsx-to-rn-stylesheet": "4.0.0-beta.120"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"expo": ">= 51",
|
|
55
|
+
"react": ">= 18",
|
|
56
|
+
"react-native": ">= 0.63.0",
|
|
57
|
+
"babel-preset-taro": "4.0.0-beta.120"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
|
+
"prod": "pnpm run build",
|
|
61
|
+
"prebuild": "pnpm run clean",
|
|
62
|
+
"clean": "rimraf --impl=move-remove ./dist",
|
|
60
63
|
"build": "tsc",
|
|
61
|
-
"dev": "tsc
|
|
62
|
-
"lint": "eslint .",
|
|
63
|
-
"test": "
|
|
64
|
-
"test:ci": "
|
|
65
|
-
"test:
|
|
66
|
-
"test:
|
|
67
|
-
"updateSnapshot": "jest --updateSnapshot"
|
|
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"
|
|
68
70
|
}
|
|
69
71
|
}
|
|
@@ -108,7 +108,10 @@ export const build = async (projectConfig, componentConfig: IComponentConfig) =>
|
|
|
108
108
|
}),
|
|
109
109
|
// @ts-ignore
|
|
110
110
|
pluginReplace({
|
|
111
|
-
|
|
111
|
+
preventAssignment: true,
|
|
112
|
+
values: {
|
|
113
|
+
'process.env.NODE_ENV': JSON.stringify('production')
|
|
114
|
+
}
|
|
112
115
|
}),
|
|
113
116
|
// @ts-ignore
|
|
114
117
|
commonjs(),
|
|
@@ -171,10 +174,20 @@ function likeDependent (str: string) {
|
|
|
171
174
|
return !str.match(/^\.?\.\//) && !path.isAbsolute(str)
|
|
172
175
|
}
|
|
173
176
|
|
|
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
|
+
|
|
174
187
|
export default function (projectPath: string, config: any) {
|
|
175
188
|
const { sourceRoot, entry, nativeComponents } = config
|
|
176
|
-
const
|
|
177
|
-
const appConfig = getAppConfig(
|
|
189
|
+
const appEntryPath = getEntryPath(entry)
|
|
190
|
+
const appConfig = getAppConfig(appEntryPath)
|
|
178
191
|
const { output = DEFAULT_CONFIG.output } = nativeComponents || {}
|
|
179
192
|
|
|
180
193
|
const componentConfig = {
|
package/templates/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import '@tarojs/rn-supporter/entry-file.js'
|
|
1
|
+
import '@tarojs/rn-supporter/entry-file.js'
|
|
@@ -9,6 +9,6 @@ const { getMetroConfig } = require('@tarojs/rn-supporter')
|
|
|
9
9
|
*/
|
|
10
10
|
const config = {}
|
|
11
11
|
|
|
12
|
-
module.exports = (async function (){
|
|
12
|
+
module.exports = (async function () {
|
|
13
13
|
return mergeConfig(getDefaultConfig(__dirname), await getMetroConfig(), config)
|
|
14
|
-
})()
|
|
14
|
+
})()
|
package/tsconfig.json
CHANGED