@tarojs/rn-runner 3.5.11 → 3.6.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/__snapshots__/components.spec.ts.snap +3 -3
- package/dist/index.js +82 -184
- package/dist/index.js.map +1 -1
- package/package.json +10 -23
- package/src/index.ts +81 -206
- package/templates/index.js +1 -0
- package/templates/metro.config.js +8 -0
- package/__tests__/build.spec.ts +0 -17
- package/__tests__/config.spec.ts +0 -35
- package/dist/config/conditional-file-store.js +0 -57
- package/dist/config/conditional-file-store.js.map +0 -1
- package/dist/config/config-holder.js +0 -76
- package/dist/config/config-holder.js.map +0 -1
- package/dist/config/index.js +0 -57
- package/dist/config/index.js.map +0 -1
- package/dist/config/preview.js +0 -102
- package/dist/config/preview.js.map +0 -1
- package/dist/config/terminal-reporter.js +0 -103
- package/dist/config/terminal-reporter.js.map +0 -1
- package/dist/utils.js +0 -29
- package/dist/utils.js.map +0 -1
- package/src/config/conditional-file-store.ts +0 -47
- package/src/config/config-holder.ts +0 -70
- package/src/config/index.ts +0 -76
- package/src/config/preview.ts +0 -114
- package/src/config/terminal-reporter.ts +0 -96
- package/src/utils.ts +0 -27
|
@@ -207,7 +207,7 @@ export { Navbar as default };
|
|
|
207
207
|
|
|
208
208
|
exports[`build_components named export 1`] = `
|
|
209
209
|
Array [
|
|
210
|
-
"import { Platform as Platform$1, NativeEventEmitter } from 'react-native';
|
|
210
|
+
"import { Platform as Platform$1, NativeModules, NativeEventEmitter } from 'react-native';
|
|
211
211
|
import 'react-native/Libraries/EventEmitter/RCTDeviceEventEmitter';
|
|
212
212
|
import 'react';
|
|
213
213
|
import require$$0 from 'crypto';
|
|
@@ -236,7 +236,7 @@ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof win
|
|
|
236
236
|
|
|
237
237
|
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;
|
|
238
238
|
|
|
239
|
-
var nativeEmitterSubscriptionKey='@@nativeEmitterSubscription@@';var EventEmitter=function(){function EventEmitter(nativeModule){_classCallCheck(this,EventEmitter);this._listenerCount=0;this._nativeModule=nativeModule;this._eventEmitter=new NativeEventEmitter(nativeModule);}_createClass(EventEmitter,[{key:\\"addListener\\",value:function addListener(eventName,listener){var _this=this,_subscription;if(!this._listenerCount&&Platform$1.OS!=='ios'&&this._nativeModule.startObserving){this._nativeModule.startObserving();}this._listenerCount++;var nativeEmitterSubscription=this._eventEmitter.addListener(eventName,listener);var subscription=(_subscription={},_defineProperty(_subscription,nativeEmitterSubscriptionKey,nativeEmitterSubscription),_defineProperty(_subscription,\\"remove\\",function remove(){_this.removeSubscription(subscription);}),_subscription);return subscription;}},{key:\\"removeAllListeners\\",value:function removeAllListeners(eventName){var removedListenerCount=this._eventEmitter.listenerCount?this._eventEmitter.listenerCount(eventName):this._eventEmitter.listeners(eventName).length;this._eventEmitter.removeAllListeners(eventName);this._listenerCount-=removedListenerCount;invariant_1(this._listenerCount>=0,\\"EventEmitter must have a non-negative number of listeners\\");if(!this._listenerCount&&Platform$1.OS!=='ios'&&this._nativeModule.stopObserving){this._nativeModule.stopObserving();}}},{key:\\"removeSubscription\\",value:function removeSubscription(subscription){var nativeEmitterSubscription=subscription[nativeEmitterSubscriptionKey];if(!nativeEmitterSubscription){return;}if('remove'in nativeEmitterSubscription){nativeEmitterSubscription.remove();}else if('removeSubscription'in this._eventEmitter){this._eventEmitter.removeSubscription(nativeEmitterSubscription);}this._listenerCount--;delete subscription[nativeEmitterSubscriptionKey];subscription.remove=function(){};if(!this._listenerCount&&Platform$1.OS!=='ios'&&this._nativeModule.stopObserving){this._nativeModule.stopObserving();}}},{key:\\"emit\\",value:function emit(eventName){var _this$_eventEmitter;for(var
|
|
239
|
+
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));};}if(Platform$1.OS==='android'){Object.defineProperties(nativeModule,{addListener:{value:function value(){},writable:true,enumerable:true},removeListeners:{value:function value(){},writable:true,enumerable:true}});}this._nativeModule=nativeModule;this._eventEmitter=new NativeEventEmitter(nativeModule);}_createClass(EventEmitter,[{key:\\"addListener\\",value:function addListener(eventName,listener){var _this=this,_subscription;if(!this._listenerCount&&Platform$1.OS!=='ios'&&this._nativeModule.startObserving){this._nativeModule.startObserving();}this._listenerCount++;var nativeEmitterSubscription=this._eventEmitter.addListener(eventName,listener);var subscription=(_subscription={},_defineProperty(_subscription,nativeEmitterSubscriptionKey,nativeEmitterSubscription),_defineProperty(_subscription,\\"remove\\",function remove(){_this.removeSubscription(subscription);}),_subscription);return subscription;}},{key:\\"removeAllListeners\\",value:function removeAllListeners(eventName){var removedListenerCount=this._eventEmitter.listenerCount?this._eventEmitter.listenerCount(eventName):this._eventEmitter.listeners(eventName).length;this._eventEmitter.removeAllListeners(eventName);this._listenerCount-=removedListenerCount;invariant_1(this._listenerCount>=0,\\"EventEmitter must have a non-negative number of listeners\\");if(!this._listenerCount&&Platform$1.OS!=='ios'&&this._nativeModule.stopObserving){this._nativeModule.stopObserving();}}},{key:\\"removeSubscription\\",value:function removeSubscription(subscription){var nativeEmitterSubscription=subscription[nativeEmitterSubscriptionKey];if(!nativeEmitterSubscription){return;}if('remove'in nativeEmitterSubscription){nativeEmitterSubscription.remove();}else if('removeSubscription'in this._eventEmitter){this._eventEmitter.removeSubscription(nativeEmitterSubscription);}this._listenerCount--;delete subscription[nativeEmitterSubscriptionKey];subscription.remove=function(){};if(!this._listenerCount&&Platform$1.OS!=='ios'&&this._nativeModule.stopObserving){this._nativeModule.stopObserving();}}},{key:\\"emit\\",value:function emit(eventName){var _this$_eventEmitter;for(var _len3=arguments.length,params=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){params[_key3-1]=arguments[_key3];}(_this$_eventEmitter=this._eventEmitter).emit.apply(_this$_eventEmitter,[eventName].concat(params));}}]);return EventEmitter;}();
|
|
240
240
|
|
|
241
241
|
var NativeModulesProxy = {};
|
|
242
242
|
|
|
@@ -258,7 +258,7 @@ function _createSuper$1(Derived){var hasNativeReflectConstruct=_isNativeReflectC
|
|
|
258
258
|
|
|
259
259
|
var NativeErrorManager = NativeModulesProxy.ExpoModulesCoreErrorManager;
|
|
260
260
|
|
|
261
|
-
if(__DEV__&&Platform.OS==='android'&&NativeErrorManager){var eventEmitter=new EventEmitter(NativeErrorManager);eventEmitter.addListener('ExpoModulesCoreErrorManager.onNewException',function(_ref){var message=_ref.message;console.error(message);});}
|
|
261
|
+
if(__DEV__&&Platform.OS==='android'&&NativeErrorManager){var eventEmitter=new EventEmitter(NativeErrorManager);eventEmitter.addListener('ExpoModulesCoreErrorManager.onNewException',function(_ref){var message=_ref.message;console.error(message);});}global.ExpoModulesCore_CodedError=CodedError;
|
|
262
262
|
|
|
263
263
|
var compareVersions = {exports: {}};
|
|
264
264
|
|
package/dist/index.js
CHANGED
|
@@ -9,106 +9,45 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
12
|
+
const rn_supporter_1 = require("@tarojs/rn-supporter");
|
|
13
|
+
const child_process_1 = require("child_process");
|
|
14
|
+
const fs_1 = require("fs");
|
|
15
15
|
const fse = require("fs-extra");
|
|
16
|
-
const
|
|
17
|
-
const transformHelpers_1 = require("metro/src/lib/transformHelpers");
|
|
18
|
-
const Server = require("metro/src/Server");
|
|
19
|
-
const outputBundle = require("metro/src/shared/output/bundle");
|
|
20
|
-
const path = require("path");
|
|
21
|
-
const qr = require("qrcode-terminal");
|
|
22
|
-
const readline = require("readline");
|
|
23
|
-
const url = require("url");
|
|
24
|
-
const config_1 = require("./config");
|
|
16
|
+
const path_1 = require("path");
|
|
25
17
|
const build_component_1 = require("./config/build-component");
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
else if (outputType === 'object') {
|
|
39
|
-
output = config.output[config.deviceType];
|
|
40
|
-
if (!output) {
|
|
41
|
-
console.error(`lack value for 'rn.output' configuration with platform '${config.deviceType}': ${JSON.stringify(config.output)}`);
|
|
18
|
+
// 确认根目录下 metro.config.js index.js 是否存在
|
|
19
|
+
const files = ['metro.config.js', 'index.js'];
|
|
20
|
+
function confirmFiles() {
|
|
21
|
+
files.forEach(file => {
|
|
22
|
+
const filePath = (0, path_1.join)(process.cwd(), file);
|
|
23
|
+
(0, fs_1.copyFile)((0, path_1.join)(__dirname, '..', 'templates', file), filePath, fs_1.constants.COPYFILE_EXCL, err => {
|
|
24
|
+
if (err) {
|
|
25
|
+
if (err.code !== 'EEXIST') {
|
|
26
|
+
// 不重复生成配置文件
|
|
27
|
+
console.log(err);
|
|
28
|
+
}
|
|
42
29
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
if (config.bundleOutput) {
|
|
49
|
-
output = config.bundleOutput;
|
|
50
|
-
}
|
|
51
|
-
const res = path.isAbsolute(output) ? output : path.join('.', output);
|
|
52
|
-
fse.ensureDirSync(path.dirname(res));
|
|
53
|
-
return res;
|
|
54
|
-
}
|
|
55
|
-
function concatOutputAssetsDest(config) {
|
|
56
|
-
// 优先级:--assets-dest > config.output > config.outputRoot
|
|
57
|
-
let assetDest;
|
|
58
|
-
if (!(config === null || config === void 0 ? void 0 : config.deviceType) || !(config === null || config === void 0 ? void 0 : config.output)) {
|
|
59
|
-
assetDest = config.outputRoot;
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
assetDest = config.deviceType === 'ios' ? config.output.iosAssetsDest : config.output.androidAssetsDest;
|
|
63
|
-
}
|
|
64
|
-
if (config.assetsDest) {
|
|
65
|
-
assetDest = config.assetsDest;
|
|
66
|
-
}
|
|
67
|
-
if (!assetDest)
|
|
68
|
-
return undefined;
|
|
69
|
-
const res = path.isAbsolute(assetDest) ? assetDest : path.join('.', assetDest);
|
|
70
|
-
fse.ensureDirSync(path.dirname(res));
|
|
71
|
-
return res;
|
|
72
|
-
}
|
|
73
|
-
function getOutputSourceMapOption(config) {
|
|
74
|
-
var _a, _b, _c, _d, _e, _f;
|
|
75
|
-
if (!(config === null || config === void 0 ? void 0 : config.deviceType)) {
|
|
76
|
-
return {};
|
|
77
|
-
}
|
|
78
|
-
const isIos = config.deviceType === 'ios';
|
|
79
|
-
const sourceMapUrl = config.sourceMapUrl || (isIos ? (_a = config === null || config === void 0 ? void 0 : config.output) === null || _a === void 0 ? void 0 : _a.iosSourceMapUrl : (_b = config === null || config === void 0 ? void 0 : config.output) === null || _b === void 0 ? void 0 : _b.androidSourceMapUrl);
|
|
80
|
-
const sourcemapOutput = config.sourcemapOutput || (isIos ? (_c = config === null || config === void 0 ? void 0 : config.output) === null || _c === void 0 ? void 0 : _c.iosSourcemapOutput : (_d = config === null || config === void 0 ? void 0 : config.output) === null || _d === void 0 ? void 0 : _d.androidSourcemapOutput);
|
|
81
|
-
const sourcemapSourcesRoot = config.sourcemapSourcesRoot || (isIos ? (_e = config === null || config === void 0 ? void 0 : config.output) === null || _e === void 0 ? void 0 : _e.iosSourcemapSourcesRoot : (_f = config === null || config === void 0 ? void 0 : config.output) === null || _f === void 0 ? void 0 : _f.androidSourcemapSourcesRoot);
|
|
82
|
-
sourcemapOutput && fse.ensureDirSync(path.dirname(sourcemapOutput));
|
|
83
|
-
return {
|
|
84
|
-
sourceMapUrl,
|
|
85
|
-
sourcemapOutput,
|
|
86
|
-
sourcemapSourcesRoot
|
|
87
|
-
};
|
|
30
|
+
else {
|
|
31
|
+
console.log(`${file} created`);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
88
35
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
// IBuildConfig
|
|
36
|
+
const isWin = /^win/.test(process.platform);
|
|
37
|
+
const npxCmd = isWin ? 'npx.cmd' : 'npx';
|
|
92
38
|
function build(_appPath, config) {
|
|
93
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
-
process.env.TARO_ENV =
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
config.
|
|
98
|
-
|
|
99
|
-
const sourceRoot = config.sourceRoot || 'src';
|
|
100
|
-
const commonOptions = {
|
|
101
|
-
platform: config.deviceType,
|
|
102
|
-
minify: process.env.NODE_ENV === 'production' || !config.isWatch,
|
|
103
|
-
dev: config.isWatch
|
|
104
|
-
};
|
|
40
|
+
process.env.TARO_ENV = 'rn';
|
|
41
|
+
const isIos = config.deviceType === 'ios';
|
|
42
|
+
const cliParams = [];
|
|
43
|
+
config.output = config.output || {};
|
|
44
|
+
// cli & config 参数透传
|
|
105
45
|
if (config.resetCache) {
|
|
106
|
-
|
|
46
|
+
cliParams.push('--reset-cache');
|
|
107
47
|
}
|
|
108
48
|
if (config.publicPath) {
|
|
109
|
-
|
|
49
|
+
process.env.PUBLIC_PATH = config.publicPath;
|
|
110
50
|
}
|
|
111
|
-
metroConfig.reporter = new terminal_reporter_1.TerminalReporter(entry, sourceRoot, metroConfig.cacheStores[0]);
|
|
112
51
|
const onFinish = function (error) {
|
|
113
52
|
if (typeof config.onBuildFinish === 'function') {
|
|
114
53
|
config.onBuildFinish({
|
|
@@ -122,115 +61,74 @@ function build(_appPath, config) {
|
|
|
122
61
|
if (config.isBuildNativeComp) {
|
|
123
62
|
return (0, build_component_1.default)(_appPath, config);
|
|
124
63
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if (!metroConfig.server) {
|
|
128
|
-
metroConfig.server = {};
|
|
129
|
-
}
|
|
130
|
-
metroConfig.server.useGlobalHotkey = true;
|
|
131
|
-
}
|
|
64
|
+
confirmFiles();
|
|
65
|
+
if (config.isWatch) {
|
|
132
66
|
if (config.port) {
|
|
133
|
-
|
|
67
|
+
cliParams.push('--port', config.port);
|
|
134
68
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
});
|
|
139
|
-
metroConfig.server.enhanceMiddleware = (metroMiddleware, metroServer) => {
|
|
140
|
-
metroConfig.reporter.metroServerInstance = metroServer;
|
|
141
|
-
// bundle路由只识别/index.bundle
|
|
142
|
-
return middleware.use((req, res, next) => {
|
|
143
|
-
// eslint-disable-next-line node/no-deprecated-api
|
|
144
|
-
const urlObj = url.parse(req.url);
|
|
145
|
-
if (/\/[^]+.bundle/.test(urlObj.pathname || '') && (urlObj.pathname || '').toLowerCase() !== '/index.bundle') {
|
|
146
|
-
res.writeHead(400);
|
|
147
|
-
res.end('Please access /index.bundle for entry bundling.');
|
|
148
|
-
}
|
|
149
|
-
else if (/^\/debugger-ui\//.test(urlObj.pathname || '')) {
|
|
150
|
-
next();
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
metroMiddleware(req, res, next);
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
};
|
|
157
|
-
// 支持host
|
|
158
|
-
return Metro.runServer(metroConfig, Object.assign(Object.assign({}, commonOptions), { hmrEnabled: true, websocketEndpoints })).then(server => {
|
|
159
|
-
console.log(`React-Native Dev server is running on port: ${metroConfig.server.port}`);
|
|
160
|
-
console.log('\n\nTo reload the app press "r"\nTo open developer menu press "d"\n');
|
|
161
|
-
readline.emitKeypressEvents(process.stdin);
|
|
162
|
-
process.stdin.setRawMode && process.stdin.setRawMode(true);
|
|
163
|
-
process.stdin.on('keypress', (_key, data) => {
|
|
164
|
-
const { ctrl, name } = data;
|
|
165
|
-
if (name === 'r') {
|
|
166
|
-
messageSocketEndpoint.broadcast('reload');
|
|
167
|
-
console.log('Reloading app...');
|
|
168
|
-
}
|
|
169
|
-
else if (name === 'd') {
|
|
170
|
-
messageSocketEndpoint.broadcast('devMenu');
|
|
171
|
-
console.log('Opening developer menu...');
|
|
172
|
-
}
|
|
173
|
-
else if (ctrl && (name === 'c')) {
|
|
174
|
-
process.exit();
|
|
175
|
-
}
|
|
69
|
+
try {
|
|
70
|
+
(0, child_process_1.spawn)(npxCmd, ['react-native', 'start'].concat(cliParams), {
|
|
71
|
+
stdio: 'inherit'
|
|
176
72
|
});
|
|
177
73
|
if (config.qr) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
console.log(utils_1.PLAYGROUNDINFO);
|
|
182
|
-
console.log(`print qrcode of '${url}':`);
|
|
183
|
-
qr.generate(url, { small: !utils_1.isWin });
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
console.log('print qrcode error: host not found.');
|
|
187
|
-
}
|
|
74
|
+
(0, rn_supporter_1.previewDev)({
|
|
75
|
+
port: parseInt(config.port) || 8081,
|
|
76
|
+
});
|
|
188
77
|
}
|
|
189
78
|
onFinish(null);
|
|
190
|
-
|
|
191
|
-
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
192
81
|
onFinish(e);
|
|
193
|
-
}
|
|
82
|
+
}
|
|
194
83
|
}
|
|
195
84
|
else {
|
|
196
|
-
const
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
85
|
+
const defaultOutputDir = (0, path_1.join)(process.cwd(), config.outputRoot || 'dist');
|
|
86
|
+
const defaultBundleOutput = (0, path_1.join)(defaultOutputDir, 'index.bundle');
|
|
87
|
+
const bundleOutput = (config.bundleOutput ? config.bundleOutput : (isIos ? config.output.ios : config.output.android)) || defaultBundleOutput;
|
|
88
|
+
fse.ensureDirSync((0, path_1.dirname)(bundleOutput));
|
|
89
|
+
cliParams.push('--bundle-output', bundleOutput);
|
|
90
|
+
const sourcemapOutput = config.sourcemapOutput ? config.sourcemapOutput : (isIos ? config.output.iosSourcemapOutput : config.output.androidSourcemapOutput);
|
|
91
|
+
if (sourcemapOutput) {
|
|
92
|
+
cliParams.push('--sourcemap-output', sourcemapOutput);
|
|
93
|
+
}
|
|
94
|
+
const sourceMapUrl = config.sourceMapUrl ? config.sourceMapUrl : (isIos ? config.output.iosSourceMapUrl : config.output.androidSourceMapUrl);
|
|
95
|
+
if (sourceMapUrl) {
|
|
96
|
+
cliParams.push('--sourcemap-use-absolute-path', sourceMapUrl);
|
|
97
|
+
}
|
|
98
|
+
const sourcemapSourcesRoot = config.sourcemapSourcesRoot ? config.sourcemapSourcesRoot : (isIos ? config.output.iosSourcemapSourcesRoot : config.output.androidSourcemapSourcesRoot);
|
|
99
|
+
if (sourcemapSourcesRoot) {
|
|
100
|
+
cliParams.push('--sourcemap-sources-root', sourcemapSourcesRoot);
|
|
101
|
+
}
|
|
102
|
+
const assetsDest = (config.assetsDest ? config.assetsDest : (isIos ? config.output.iosAssetsDest : config.output.androidAssetsDest)) || defaultOutputDir;
|
|
103
|
+
cliParams.push('--assets-dest', assetsDest);
|
|
104
|
+
fse.ensureDirSync(assetsDest);
|
|
209
105
|
try {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
assetsDest,
|
|
222
|
-
platform: options.platform
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
onFinish(null);
|
|
106
|
+
(0, child_process_1.spawn)(npxCmd, [
|
|
107
|
+
'react-native',
|
|
108
|
+
'bundle',
|
|
109
|
+
'--platform',
|
|
110
|
+
config.deviceType,
|
|
111
|
+
'--dev',
|
|
112
|
+
'false',
|
|
113
|
+
'--entry-file',
|
|
114
|
+
'index.js'
|
|
115
|
+
].concat(cliParams), {
|
|
116
|
+
stdio: 'inherit'
|
|
226
117
|
});
|
|
118
|
+
if (config.qr) {
|
|
119
|
+
process.on('beforeExit', () => {
|
|
120
|
+
(0, rn_supporter_1.previewProd)({
|
|
121
|
+
out: bundleOutput,
|
|
122
|
+
platform: config.deviceType,
|
|
123
|
+
assetsDest: assetsDest,
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
onFinish(null);
|
|
227
128
|
}
|
|
228
129
|
catch (e) {
|
|
229
130
|
onFinish(e);
|
|
230
131
|
}
|
|
231
|
-
finally {
|
|
232
|
-
server.end();
|
|
233
|
-
}
|
|
234
132
|
}
|
|
235
133
|
});
|
|
236
134
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uDAA8D;AAC9D,iDAAqC;AACrC,2BAAwC;AACxC,gCAA+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
|
2
2
|
"name": "@tarojs/rn-runner",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0-beta.1",
|
|
4
4
|
"description": "ReactNative build tool for taro",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -21,11 +21,6 @@
|
|
|
21
21
|
"npm": ">=6.0.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@react-native-community/cli": "^8.0.0",
|
|
25
|
-
"@react-native-community/cli-config": "^8.0.0",
|
|
26
|
-
"@react-native-community/cli-plugin-metro": "^8.0.0",
|
|
27
|
-
"@react-native-community/cli-tools": "^8.0.0",
|
|
28
|
-
"@react-native-community/cli-server-api": "^8.0.0",
|
|
29
24
|
"@rollup/plugin-babel": "^5.3.1",
|
|
30
25
|
"@rollup/plugin-commonjs": "^20.0.0",
|
|
31
26
|
"@rollup/plugin-json": "^4.1.0",
|
|
@@ -34,31 +29,23 @@
|
|
|
34
29
|
"acorn-jsx": "^5.3.2",
|
|
35
30
|
"fs-extra": "^8.0.1",
|
|
36
31
|
"lodash": "^4.17.21",
|
|
37
|
-
"metro": "^0.70.3",
|
|
38
|
-
"metro-cache": "^0.70.3",
|
|
39
|
-
"metro-config": "^0.70.3",
|
|
40
|
-
"metro-core": "^0.70.3",
|
|
41
|
-
"metro-react-native-babel-transformer": "^0.70.3",
|
|
42
|
-
"metro-resolver": "^0.70.3",
|
|
43
|
-
"mime-types": "^2.1.27",
|
|
44
|
-
"qrcode-terminal": "^0.12.0",
|
|
45
32
|
"rollup-plugin-image-file": "^1.0.2",
|
|
46
|
-
"@tarojs/
|
|
47
|
-
"@tarojs/rn-
|
|
48
|
-
"@tarojs/rn-
|
|
49
|
-
"@tarojs/
|
|
33
|
+
"@tarojs/rn-style-transformer": "3.6.0-beta.1",
|
|
34
|
+
"@tarojs/rn-supporter": "3.6.0-beta.1",
|
|
35
|
+
"@tarojs/rn-transformer": "3.6.0-beta.1",
|
|
36
|
+
"@tarojs/helper": "3.6.0-beta.1"
|
|
50
37
|
},
|
|
51
38
|
"devDependencies": {
|
|
52
39
|
"@babel/core": "^7.14.5",
|
|
53
40
|
"@babel/preset-env": "^7.14.5",
|
|
54
41
|
"acorn": "^8.0.4",
|
|
55
|
-
"expo": "~
|
|
56
|
-
"expo-file-system": "~
|
|
57
|
-
"react": "18.
|
|
42
|
+
"expo": "~47.0.3",
|
|
43
|
+
"expo-file-system": "~15.1.1",
|
|
44
|
+
"react": "18.1.0",
|
|
58
45
|
"react-is": "^16.13.0",
|
|
59
|
-
"react-native": "^0.
|
|
46
|
+
"react-native": "^0.70.5",
|
|
60
47
|
"react-native-root-siblings": "^4.1.1",
|
|
61
|
-
"react-test-renderer": "18.
|
|
48
|
+
"react-test-renderer": "18.1.0",
|
|
62
49
|
"rollup": "^2.79.0"
|
|
63
50
|
},
|
|
64
51
|
"scripts": {
|