@tarojs/rn-runner 3.4.0 → 3.4.3

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/dist/index.js CHANGED
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -19,79 +8,52 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
19
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
20
9
  });
21
10
  };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
11
  Object.defineProperty(exports, "__esModule", { value: true });
50
- var Metro = require("metro");
51
- var config_1 = require("./config");
52
- var config_holder_1 = require("./config/config-holder");
53
- var utils_1 = require("./utils");
54
- var preview_1 = require("./config/preview");
55
- var helper_1 = require("@tarojs/helper");
56
- var path = require("path");
57
- var fse = require("fs-extra");
58
- var url = require("url");
59
- var qrcode_terminal_1 = require("qrcode-terminal");
60
- var readline = require("readline");
61
- var cli_server_api_1 = require("@react-native-community/cli-server-api");
62
- var terminal_reporter_1 = require("./config/terminal-reporter");
63
- var transformHelpers_1 = require("metro/src/lib/transformHelpers");
64
- var Server = require("metro/src/Server");
65
- var saveAssets_1 = require("@react-native-community/cli/build/commands/bundle/saveAssets");
66
- var outputBundle = require("metro/src/shared/output/bundle");
12
+ const Metro = require("metro");
13
+ const config_1 = require("./config");
14
+ const config_holder_1 = require("./config/config-holder");
15
+ const utils_1 = require("./utils");
16
+ const preview_1 = require("./config/preview");
17
+ const helper_1 = require("@tarojs/helper");
18
+ const path = require("path");
19
+ const fse = require("fs-extra");
20
+ const url = require("url");
21
+ const qrcode_terminal_1 = require("qrcode-terminal");
22
+ const readline = require("readline");
23
+ const cli_server_api_1 = require("@react-native-community/cli-server-api");
24
+ const terminal_reporter_1 = require("./config/terminal-reporter");
25
+ const transformHelpers_1 = require("metro/src/lib/transformHelpers");
26
+ const Server = require("metro/src/Server");
27
+ const saveAssets_1 = require("@react-native-community/cli/build/commands/bundle/saveAssets");
28
+ const outputBundle = require("metro/src/shared/output/bundle");
67
29
  function concatOutputFileName(config) {
68
30
  // 优先级:--bundle-output > config.output > config.outputRoot
69
- var output = path.join(config.outputRoot, 'index.bundle');
31
+ let output = path.join(config.outputRoot, 'index.bundle');
70
32
  if (config.output) {
71
- var outputType = typeof config.output;
33
+ const outputType = typeof config.output;
72
34
  if (outputType === 'string') {
73
35
  output = config.output;
74
36
  }
75
37
  else if (outputType === 'object') {
76
38
  output = config.output[config.deviceType];
77
39
  if (!output) {
78
- console.error("lack value for 'rn.output' configuration with platform '" + config.deviceType + "': " + JSON.stringify(config.output));
40
+ console.error(`lack value for 'rn.output' configuration with platform '${config.deviceType}': ${JSON.stringify(config.output)}`);
79
41
  }
80
42
  }
81
43
  else {
82
- console.error("invalid value for 'rn.output' configuration: " + JSON.stringify(config.output));
44
+ console.error(`invalid value for 'rn.output' configuration: ${JSON.stringify(config.output)}`);
83
45
  }
84
46
  }
85
47
  if (config.bundleOutput) {
86
48
  output = config.bundleOutput;
87
49
  }
88
- var res = path.isAbsolute(output) ? output : path.join('.', output);
50
+ const res = path.isAbsolute(output) ? output : path.join('.', output);
89
51
  fse.ensureDirSync(path.dirname(res));
90
52
  return res;
91
53
  }
92
54
  function concatOutputAssetsDest(config) {
93
55
  // 优先级:--assets-dest > config.output > config.outputRoot
94
- var assetDest;
56
+ let assetDest;
95
57
  if (!(config === null || config === void 0 ? void 0 : config.deviceType) || !(config === null || config === void 0 ? void 0 : config.output)) {
96
58
  assetDest = config.outputRoot;
97
59
  }
@@ -103,7 +65,7 @@ function concatOutputAssetsDest(config) {
103
65
  }
104
66
  if (!assetDest)
105
67
  return undefined;
106
- var res = path.isAbsolute(assetDest) ? assetDest : path.join('.', assetDest);
68
+ const res = path.isAbsolute(assetDest) ? assetDest : path.join('.', assetDest);
107
69
  fse.ensureDirSync(path.dirname(res));
108
70
  return res;
109
71
  }
@@ -112,181 +74,157 @@ function getOutputSourceMapOption(config) {
112
74
  if (!(config === null || config === void 0 ? void 0 : config.deviceType)) {
113
75
  return {};
114
76
  }
115
- var isIos = config.deviceType === 'ios';
116
- var 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);
117
- var 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);
118
- var 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);
77
+ const isIos = config.deviceType === 'ios';
78
+ 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);
79
+ 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);
80
+ 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);
119
81
  sourcemapOutput && fse.ensureDirSync(path.dirname(sourcemapOutput));
120
82
  return {
121
- sourceMapUrl: sourceMapUrl,
122
- sourcemapOutput: sourcemapOutput,
123
- sourcemapSourcesRoot: sourcemapSourcesRoot
83
+ sourceMapUrl,
84
+ sourcemapOutput,
85
+ sourcemapSourcesRoot
124
86
  };
125
87
  }
126
88
  // TODO: 返回值
127
89
  // HttpServer | {code: string, map: string}
128
90
  // IBuildConfig
129
- function build(appPath, config) {
130
- return __awaiter(this, void 0, void 0, function () {
131
- var entry, metroConfig, sourceRoot, commonOptions, onFinish, _a, middleware_1, attachToServer_1, options_1, savedBuildFunc_1, server, sourceMapOption, requestOptions, bundle, outputOptions, outputAssets, assetsDest_1, e_1;
132
- var _this = this;
133
- return __generator(this, function (_b) {
134
- switch (_b.label) {
135
- case 0:
136
- process.env.TARO_ENV = helper_1.PLATFORMS.RN;
137
- entry = config_holder_1.getRNConfigEntry();
138
- config.entry = entry;
139
- return [4 /*yield*/, config_1.default(config)];
140
- case 1:
141
- metroConfig = _b.sent();
142
- sourceRoot = config.sourceRoot || 'src';
143
- commonOptions = {
144
- platform: config.deviceType,
145
- minify: process.env.NODE_ENV === 'production' || !config.isWatch,
146
- dev: config.isWatch
147
- };
148
- if (config.resetCache) {
149
- metroConfig.resetCache = config.resetCache;
91
+ function build(_appPath, config) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ process.env.TARO_ENV = helper_1.PLATFORMS.RN;
94
+ // TODO:新增环境变量是否可以在metro构建过程中可以访问到?
95
+ const entry = config_holder_1.getRNConfigEntry();
96
+ config.entry = entry;
97
+ const metroConfig = yield config_1.default(config);
98
+ const sourceRoot = config.sourceRoot || 'src';
99
+ const commonOptions = {
100
+ platform: config.deviceType,
101
+ minify: process.env.NODE_ENV === 'production' || !config.isWatch,
102
+ dev: config.isWatch
103
+ };
104
+ if (config.resetCache) {
105
+ metroConfig.resetCache = config.resetCache;
106
+ }
107
+ if (config.publicPath) {
108
+ metroConfig.transformer.publicPath = config.publicPath;
109
+ }
110
+ metroConfig.reporter = new terminal_reporter_1.TerminalReporter(entry, sourceRoot, metroConfig.cacheStores[0]);
111
+ const onFinish = function (error) {
112
+ if (typeof config.onBuildFinish === 'function') {
113
+ config.onBuildFinish({
114
+ error,
115
+ isWatch: config.isWatch
116
+ });
117
+ }
118
+ if (error instanceof Error)
119
+ throw error;
120
+ };
121
+ if (config.isWatch) {
122
+ if (!metroConfig.server || (metroConfig.server.useGlobalHotkey === undefined)) {
123
+ if (!metroConfig.server) {
124
+ metroConfig.server = {};
125
+ }
126
+ metroConfig.server.useGlobalHotkey = true;
127
+ }
128
+ if (config.port) {
129
+ metroConfig.server.port = config.port;
130
+ }
131
+ const { middleware, attachToServer } = cli_server_api_1.createDevServerMiddleware({
132
+ port: metroConfig.server.port,
133
+ watchFolders: metroConfig.watchFolders
134
+ });
135
+ metroConfig.server.enhanceMiddleware = (metroMiddleware, metroServer) => {
136
+ metroConfig.reporter.metroServerInstance = metroServer;
137
+ // bundle路由只识别/index.bundle
138
+ return middleware.use((req, res, next) => {
139
+ // eslint-disable-next-line node/no-deprecated-api
140
+ const urlObj = url.parse(req.url);
141
+ if (/\/[^]+.bundle/.test(urlObj.pathname || '') && (urlObj.pathname || '').toLowerCase() !== '/index.bundle') {
142
+ res.writeHead(400);
143
+ res.end('Please access /index.bundle for entry bundling.');
150
144
  }
151
- if (config.publicPath) {
152
- metroConfig.transformer.publicPath = config.publicPath;
145
+ else if (/^\/debugger-ui\//.test(urlObj.pathname || '')) {
146
+ next();
153
147
  }
154
- metroConfig.reporter = new terminal_reporter_1.TerminalReporter(entry, sourceRoot, metroConfig.cacheStores[0]);
155
- onFinish = function (error) {
156
- if (typeof config.onBuildFinish === 'function') {
157
- config.onBuildFinish({
158
- error: error,
159
- isWatch: config.isWatch
160
- });
161
- }
162
- if (error instanceof Error)
163
- throw error;
164
- };
165
- if (!config.isWatch) return [3 /*break*/, 2];
166
- if (!metroConfig.server || (metroConfig.server.useGlobalHotkey === undefined)) {
167
- if (!metroConfig.server) {
168
- metroConfig.server = {};
169
- }
170
- metroConfig.server.useGlobalHotkey = true;
148
+ else {
149
+ metroMiddleware(req, res, next);
171
150
  }
172
- if (config.port) {
173
- metroConfig.server.port = config.port;
151
+ });
152
+ };
153
+ // 支持host
154
+ return Metro.runServer(metroConfig, Object.assign(Object.assign({}, commonOptions), { hmrEnabled: true })).then(server => {
155
+ console.log(`React-Native Dev server is running on port: ${metroConfig.server.port}`);
156
+ console.log('\n\nTo reload the app press "r"\nTo open developer menu press "d"\n');
157
+ const { messageSocket } = attachToServer(server);
158
+ readline.emitKeypressEvents(process.stdin);
159
+ process.stdin.setRawMode && process.stdin.setRawMode(true);
160
+ process.stdin.on('keypress', (_key, data) => {
161
+ const { ctrl, name } = data;
162
+ if (name === 'r') {
163
+ messageSocket.broadcast('reload');
164
+ console.log('Reloading app...');
174
165
  }
175
- _a = cli_server_api_1.createDevServerMiddleware({
176
- port: metroConfig.server.port,
177
- watchFolders: metroConfig.watchFolders
178
- }), middleware_1 = _a.middleware, attachToServer_1 = _a.attachToServer;
179
- metroConfig.server.enhanceMiddleware = function (metroMiddleware, metroServer) {
180
- metroConfig.reporter.metroServerInstance = metroServer;
181
- // bundle路由只识别/index.bundle
182
- return middleware_1.use(function (req, res, next) {
183
- // eslint-disable-next-line node/no-deprecated-api
184
- var urlObj = url.parse(req.url);
185
- if (/\/[^]+.bundle/.test(urlObj.pathname || '') && (urlObj.pathname || '').toLowerCase() !== '/index.bundle') {
186
- res.writeHead(400);
187
- res.end('Please access /index.bundle for entry bundling.');
188
- }
189
- else if (/^\/debugger-ui\//.test(urlObj.pathname || '')) {
190
- next();
191
- }
192
- else {
193
- metroMiddleware(req, res, next);
194
- }
195
- });
196
- };
197
- // 支持host
198
- return [2 /*return*/, Metro.runServer(metroConfig, __assign(__assign({}, commonOptions), { hmrEnabled: true })).then(function (server) {
199
- console.log("React-Native Dev server is running on port: " + metroConfig.server.port);
200
- console.log('\n\nTo reload the app press "r"\nTo open developer menu press "d"\n');
201
- var messageSocket = attachToServer_1(server).messageSocket;
202
- readline.emitKeypressEvents(process.stdin);
203
- process.stdin.setRawMode && process.stdin.setRawMode(true);
204
- process.stdin.on('keypress', function (key, data) {
205
- var ctrl = data.ctrl, name = data.name;
206
- if (name === 'r') {
207
- messageSocket.broadcast('reload');
208
- console.log('Reloading app...');
209
- }
210
- else if (name === 'd') {
211
- messageSocket.broadcast('devMenu');
212
- console.log('Opening developer menu...');
213
- }
214
- else if (ctrl && (name === 'c')) {
215
- process.exit();
216
- }
217
- });
218
- if (config.qr) {
219
- var host = utils_1.getOpenHost();
220
- if (host) {
221
- var url_1 = "taro://" + host + ":" + metroConfig.server.port;
222
- console.log(utils_1.PLAYGROUNDINFO);
223
- console.log("print qrcode of '" + url_1 + "':");
224
- qrcode_terminal_1.generate(url_1, { small: true });
225
- }
226
- else {
227
- console.log('print qrcode error: host not found.');
228
- }
229
- }
230
- onFinish(null);
231
- return server;
232
- }).catch(function (e) {
233
- onFinish(e);
234
- })];
235
- case 2:
236
- options_1 = __assign(__assign({}, commonOptions), { entry: './index', out: concatOutputFileName(config) });
237
- savedBuildFunc_1 = outputBundle.build;
238
- outputBundle.build = function (packagerClient, requestOptions) { return __awaiter(_this, void 0, void 0, function () {
239
- var resolutionFn;
240
- return __generator(this, function (_a) {
241
- switch (_a.label) {
242
- case 0: return [4 /*yield*/, transformHelpers_1.getResolveDependencyFn(packagerClient.getBundler().getBundler(), requestOptions.platform)];
243
- case 1:
244
- resolutionFn = _a.sent();
245
- requestOptions.entryFile = resolutionFn(metroConfig.projectRoot, requestOptions.entryFile);
246
- return [2 /*return*/, savedBuildFunc_1(packagerClient, requestOptions)];
247
- }
166
+ else if (name === 'd') {
167
+ messageSocket.broadcast('devMenu');
168
+ console.log('Opening developer menu...');
169
+ }
170
+ else if (ctrl && (name === 'c')) {
171
+ process.exit();
172
+ }
173
+ });
174
+ if (config.qr) {
175
+ const host = utils_1.getOpenHost();
176
+ if (host) {
177
+ const url = `taro://${host}:${metroConfig.server.port}`;
178
+ console.log(utils_1.PLAYGROUNDINFO);
179
+ console.log(`print qrcode of '${url}':`);
180
+ qrcode_terminal_1.generate(url, { small: true });
181
+ }
182
+ else {
183
+ console.log('print qrcode error: host not found.');
184
+ }
185
+ }
186
+ onFinish(null);
187
+ return server;
188
+ }).catch(e => {
189
+ onFinish(e);
190
+ });
191
+ }
192
+ else {
193
+ const options = Object.assign(Object.assign({}, commonOptions), { entry: './index', out: concatOutputFileName(config) });
194
+ const savedBuildFunc = outputBundle.build;
195
+ outputBundle.build = (packagerClient, requestOptions) => __awaiter(this, void 0, void 0, function* () {
196
+ const resolutionFn = yield transformHelpers_1.getResolveDependencyFn(packagerClient.getBundler().getBundler(), requestOptions.platform);
197
+ requestOptions.entryFile = resolutionFn(metroConfig.projectRoot, requestOptions.entryFile);
198
+ return savedBuildFunc(packagerClient, requestOptions);
199
+ });
200
+ const server = new Server(metroConfig);
201
+ const sourceMapOption = getOutputSourceMapOption(config);
202
+ try {
203
+ const requestOptions = Object.assign(Object.assign(Object.assign({}, commonOptions), sourceMapOption), { entryFile: options.entry, inlineSourceMap: false, createModuleIdFactory: metroConfig.serializer.createModuleIdFactory });
204
+ const bundle = yield outputBundle.build(server, requestOptions);
205
+ const outputOptions = Object.assign(Object.assign(Object.assign({}, commonOptions), sourceMapOption), { bundleOutput: options.out });
206
+ yield outputBundle.save(bundle, outputOptions, console.log);
207
+ // Save the assets of the bundle
208
+ const outputAssets = yield server.getAssets(Object.assign(Object.assign({}, Server.DEFAULT_BUNDLE_OPTIONS), requestOptions));
209
+ const assetsDest = concatOutputAssetsDest(config);
210
+ return yield saveAssets_1.default(outputAssets, options.platform, assetsDest).then(() => {
211
+ if (config.qr) {
212
+ preview_1.default({
213
+ out: options.out,
214
+ assetsDest,
215
+ platform: options.platform
248
216
  });
249
- }); };
250
- server = new Server(metroConfig);
251
- sourceMapOption = getOutputSourceMapOption(config);
252
- _b.label = 3;
253
- case 3:
254
- _b.trys.push([3, 8, 9, 10]);
255
- requestOptions = __assign(__assign(__assign({}, commonOptions), sourceMapOption), { entryFile: options_1.entry, inlineSourceMap: false, createModuleIdFactory: metroConfig.serializer.createModuleIdFactory });
256
- return [4 /*yield*/, outputBundle.build(server, requestOptions)];
257
- case 4:
258
- bundle = _b.sent();
259
- outputOptions = __assign(__assign(__assign({}, commonOptions), sourceMapOption), { bundleOutput: options_1.out });
260
- return [4 /*yield*/, outputBundle.save(bundle, outputOptions, console.log)
261
- // Save the assets of the bundle
262
- ];
263
- case 5:
264
- _b.sent();
265
- return [4 /*yield*/, server.getAssets(__assign(__assign({}, Server.DEFAULT_BUNDLE_OPTIONS), requestOptions))];
266
- case 6:
267
- outputAssets = _b.sent();
268
- assetsDest_1 = concatOutputAssetsDest(config);
269
- return [4 /*yield*/, saveAssets_1.default(outputAssets, options_1.platform, assetsDest_1).then(function () {
270
- if (config.qr) {
271
- preview_1.default({
272
- out: options_1.out,
273
- assetsDest: assetsDest_1,
274
- platform: options_1.platform
275
- });
276
- }
277
- onFinish(null);
278
- })];
279
- case 7: return [2 /*return*/, _b.sent()];
280
- case 8:
281
- e_1 = _b.sent();
282
- onFinish(e_1);
283
- return [3 /*break*/, 10];
284
- case 9:
285
- server.end();
286
- return [7 /*endfinally*/];
287
- case 10: return [2 /*return*/];
217
+ }
218
+ onFinish(null);
219
+ });
220
+ }
221
+ catch (e) {
222
+ onFinish(e);
288
223
  }
289
- });
224
+ finally {
225
+ server.end();
226
+ }
227
+ }
290
228
  });
291
229
  }
292
230
  exports.default = build;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA8B;AAC9B,mCAAqC;AACrC,wDAAyD;AACzD,iCAAqD;AACrD,4CAAsC;AAEtC,yCAA0C;AAC1C,2BAA4B;AA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AAC,GAAG,EAAE,CAAA;aACb;SACF;IACH,CAAC;CAAA;AAhKD,wBAgKC"}
package/dist/utils.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PLAYGROUNDINFO = exports.PLAYGROUNDREPO = exports.getOpenHost = void 0;
4
- var os_1 = require("os");
4
+ const os_1 = require("os");
5
5
  function getOpenHost() {
6
6
  var _a;
7
- var result;
8
- var interfaces = os_1.networkInterfaces();
9
- for (var devName in interfaces) {
10
- var isEnd = (_a = interfaces[devName]) === null || _a === void 0 ? void 0 : _a.some(function (item) {
7
+ let result;
8
+ const interfaces = os_1.networkInterfaces();
9
+ for (const devName in interfaces) {
10
+ const isEnd = (_a = interfaces[devName]) === null || _a === void 0 ? void 0 : _a.some(item => {
11
11
  // 取IPv4, 不为127.0.0.1的内网ip
12
12
  if (item.family === 'IPv4' && item.address !== '127.0.0.1' && !item.internal) {
13
13
  result = item.address;
@@ -24,5 +24,5 @@ function getOpenHost() {
24
24
  }
25
25
  exports.getOpenHost = getOpenHost;
26
26
  exports.PLAYGROUNDREPO = 'https://github.com/wuba/taro-playground';
27
- exports.PLAYGROUNDINFO = "use [Taro Playground App](" + exports.PLAYGROUNDREPO + ") to scan";
27
+ exports.PLAYGROUNDINFO = `use [Taro Playground App](${exports.PLAYGROUNDREPO}) to scan`;
28
28
  //# sourceMappingURL=utils.js.map
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA,yBAAsC;AAEtC,SAAgB,WAAW;;IACzB,IAAI,MAAM,CAAA;IACV,IAAM,UAAU,GAAG,sBAAiB,EAAE,CAAA;IACtC,KAAK,IAAM,OAAO,IAAI,UAAU,EAAE;QAChC,IAAM,KAAK,GAAG,MAAA,UAAU,CAAC,OAAO,CAAC,0CAAE,IAAI,CAAC,UAAA,IAAI;YAC1C,0BAA0B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2
2
  "name": "@tarojs/rn-runner",
3
- "version": "3.4.0",
3
+ "version": "3.4.3",
4
4
  "description": "ReactNative build tool for taro",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -32,10 +32,10 @@
32
32
  "dependencies": {
33
33
  "@react-native-community/cli": "^5.0.1",
34
34
  "@react-native-community/cli-server-api": "^5.0.1",
35
- "@tarojs/helper": "3.4.0",
36
- "@tarojs/rn-style-transformer": "3.4.0",
37
- "@tarojs/rn-supporter": "3.4.0",
38
- "@tarojs/rn-transformer": "3.4.0",
35
+ "@tarojs/helper": "3.4.3",
36
+ "@tarojs/rn-style-transformer": "3.4.3",
37
+ "@tarojs/rn-supporter": "3.4.3",
38
+ "@tarojs/rn-transformer": "3.4.3",
39
39
  "fs-extra": "^8.0.1",
40
40
  "lodash": "^4.17.21",
41
41
  "metro": "^0.66.2",
@@ -47,5 +47,5 @@
47
47
  "mime-types": "^2.1.27",
48
48
  "qrcode-terminal": "^0.12.0"
49
49
  },
50
- "gitHead": "a0e97bc937f878cc059f54748c9a3829fa3f4664"
50
+ "gitHead": "de55da7a845e9c09ba65528e74c7310e5082c2d5"
51
51
  }
package/src/index.ts CHANGED
@@ -78,7 +78,7 @@ function getOutputSourceMapOption (config: any): Record<string, any> {
78
78
  // TODO: 返回值
79
79
  // HttpServer | {code: string, map: string}
80
80
  // IBuildConfig
81
- export default async function build (appPath: string, config: any): Promise<any> {
81
+ export default async function build (_appPath: string, config: any): Promise<any> {
82
82
  process.env.TARO_ENV = PLATFORMS.RN
83
83
  // TODO:新增环境变量是否可以在metro构建过程中可以访问到?
84
84
  const entry = getRNConfigEntry()
@@ -154,7 +154,7 @@ export default async function build (appPath: string, config: any): Promise<any>
154
154
 
155
155
  readline.emitKeypressEvents(process.stdin)
156
156
  process.stdin.setRawMode && process.stdin.setRawMode(true)
157
- process.stdin.on('keypress', (key, data) => {
157
+ process.stdin.on('keypress', (_key, data) => {
158
158
  const { ctrl, name } = data
159
159
  if (name === 'r') {
160
160
  messageSocket.broadcast('reload')
package/tsconfig.json CHANGED
@@ -1,28 +1,13 @@
1
1
  {
2
- "include": [
3
- "src/**/*"
4
- ],
5
- "compilerOptions": {
6
- "rootDir": "./src",
7
- "outDir": "./dist",
8
- "strictNullChecks": true,
9
- "sourceMap": true,
10
- "allowJs": true,
11
- "noImplicitAny": false,
12
- "allowSyntheticDefaultImports": true,
13
- "downlevelIteration": true,
14
- "moduleResolution": "node",
15
- "target": "es5",
16
- "skipLibCheck": true,
17
- "lib": [
18
- "ES2015",
19
- ],
20
- "types": [
21
- "node"
22
- ],
23
- "typeRoots": [
24
- "./node_modules",
25
- "./src/types"
26
- ]
27
- }
2
+ "extends": "../../tsconfig.root.json",
3
+ "include": ["src/**/*"],
4
+ "compilerOptions": {
5
+ "rootDir": "./src",
6
+ "outDir": "./dist",
7
+ "sourceMap": true,
8
+ "skipLibCheck": true,
9
+ "types": ["node"],
10
+ "module": "commonjs",
11
+ "typeRoots": ["./node_modules/@types", "./src/types"]
28
12
  }
13
+ }