@tarojs/rn-runner 3.5.5 → 3.5.6-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { getRNConfigBabelPlugin, getRNConfigEntry, getRNConfigOutput, getRNConfigTransformer } from '../src/config/config-holder'
1
+ import { getRNConfigEntry } from '../src/config/config-holder'
2
2
 
3
3
  const path = require('path')
4
4
 
@@ -9,27 +9,8 @@ describe('init', () => {
9
9
  NODE_ENV: 'development'
10
10
  }
11
11
 
12
- it('getRNConfigOutput', () => {
13
- expect(getRNConfigOutput('ios')).toEqual('iosbundle/main.bundle')
14
- })
15
-
16
12
  it('getRNConfigEntry', () => {
17
13
  expect(getRNConfigEntry()).toEqual('app')
18
14
  })
19
15
 
20
- it('getRNConfigTransformer', () => {
21
- expect(getRNConfigTransformer()).toEqual([
22
- 'metro/transformer'
23
- ])
24
- })
25
-
26
- it('getRNConfigBabelPlugin', () => {
27
- const babelPlugin = [
28
- '/absulute/path/plugin/filename',
29
- '@tarojs/plugin-mock',
30
- ['@tarojs/plugin-mock'],
31
- ['@tarojs/plugin-mock', {}]
32
- ]
33
- expect(getRNConfigBabelPlugin()).toEqual(babelPlugin)
34
- })
35
16
  })
package/dist/index.js CHANGED
@@ -9,106 +9,43 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const saveAssets_1 = require("@react-native-community/cli-plugin-metro/build/commands/bundle/saveAssets");
13
- const cli_server_api_1 = require("@react-native-community/cli-server-api");
14
12
  const helper_1 = require("@tarojs/helper");
15
- const fse = require("fs-extra");
16
- const Metro = require("metro");
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");
13
+ const child_process_1 = require("child_process");
14
+ const fs_1 = require("fs");
15
+ const path_1 = require("path");
25
16
  const build_component_1 = require("./config/build-component");
26
- const config_holder_1 = require("./config/config-holder");
27
- const preview_1 = require("./config/preview");
28
- const terminal_reporter_1 = require("./config/terminal-reporter");
29
- const utils_1 = require("./utils");
30
- function concatOutputFileName(config) {
31
- // 优先级:--bundle-output > config.output > config.outputRoot
32
- let output = path.join(config.outputRoot, 'index.bundle');
33
- if (config.output) {
34
- const outputType = typeof config.output;
35
- if (outputType === 'string') {
36
- output = config.output;
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)}`);
17
+ // 确认根目录下 metro.config.js index.js 是否存在
18
+ const files = ['metro.config.js', 'index.js'];
19
+ function confirmFiles() {
20
+ files.forEach(file => {
21
+ const filePath = (0, path_1.join)(process.cwd(), file);
22
+ (0, fs_1.copyFile)((0, path_1.join)(__dirname, '..', 'templates', file), filePath, fs_1.constants.COPYFILE_EXCL, err => {
23
+ if (err) {
24
+ if (err.code !== 'EEXIST') {
25
+ // 不重复生成配置文件
26
+ console.log(err);
27
+ }
42
28
  }
43
- }
44
- else {
45
- console.error(`invalid value for 'rn.output' configuration: ${JSON.stringify(config.output)}`);
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
- };
29
+ else {
30
+ console.log(`${file} created`);
31
+ }
32
+ });
33
+ });
88
34
  }
89
- // TODO: 返回值
90
- // HttpServer | {code: string, map: string}
91
- // IBuildConfig
92
35
  function build(_appPath, config) {
93
36
  return __awaiter(this, void 0, void 0, function* () {
37
+ confirmFiles();
94
38
  process.env.TARO_ENV = helper_1.PLATFORMS.RN;
95
- // TODO:新增环境变量是否可以在metro构建过程中可以访问到?
96
- const entry = (0, config_holder_1.getRNConfigEntry)();
97
- config.entry = entry;
98
- const metroConfig = yield (0, config_1.default)(config);
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
- };
39
+ const isIos = config.deviceType === 'ios';
40
+ const cliParams = [];
41
+ config.output = config.output || {};
42
+ // cli & config 参数透传
105
43
  if (config.resetCache) {
106
- metroConfig.resetCache = config.resetCache;
44
+ cliParams.push('--reset-cache');
107
45
  }
108
46
  if (config.publicPath) {
109
- metroConfig.transformer.publicPath = config.publicPath;
47
+ cliParams.push('--public-path', config.publicPath);
110
48
  }
111
- metroConfig.reporter = new terminal_reporter_1.TerminalReporter(entry, sourceRoot, metroConfig.cacheStores[0]);
112
49
  const onFinish = function (error) {
113
50
  if (typeof config.onBuildFinish === 'function') {
114
51
  config.onBuildFinish({
@@ -123,114 +60,51 @@ function build(_appPath, config) {
123
60
  return (0, build_component_1.default)(_appPath, config);
124
61
  }
125
62
  else if (config.isWatch) {
126
- if (!metroConfig.server || (metroConfig.server.useGlobalHotkey === undefined)) {
127
- if (!metroConfig.server) {
128
- metroConfig.server = {};
129
- }
130
- metroConfig.server.useGlobalHotkey = true;
131
- }
132
63
  if (config.port) {
133
- metroConfig.server.port = config.port;
64
+ cliParams.push('--port', config.port);
134
65
  }
135
- const { middleware, messageSocketEndpoint, websocketEndpoints } = (0, cli_server_api_1.createDevServerMiddleware)({
136
- port: metroConfig.server.port,
137
- watchFolders: metroConfig.watchFolders
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
- }
66
+ try {
67
+ (0, child_process_1.spawn)('react-native', ['start'].concat(cliParams), {
68
+ stdio: 'inherit'
176
69
  });
177
- if (config.qr) {
178
- const host = (0, utils_1.getOpenHost)();
179
- if (host) {
180
- const url = `taro://${host}:${metroConfig.server.port}`;
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
- }
188
- }
189
70
  onFinish(null);
190
- return server;
191
- }).catch(e => {
71
+ }
72
+ catch (e) {
192
73
  onFinish(e);
193
- });
74
+ }
194
75
  }
195
76
  else {
196
- const options = Object.assign(Object.assign({}, commonOptions), { entry: './index', out: concatOutputFileName(config) });
197
- const savedBuildFunc = outputBundle.build;
198
- outputBundle.build = (packagerClient, requestOptions) => __awaiter(this, void 0, void 0, function* () {
199
- const resolutionFn = yield (0, transformHelpers_1.getResolveDependencyFn)(packagerClient.getBundler().getBundler(), requestOptions.platform);
200
- // try for test case build_noWatch
201
- try {
202
- requestOptions.entryFile = resolutionFn(metroConfig.projectRoot, requestOptions.entryFile);
203
- }
204
- catch (e) { }
205
- return savedBuildFunc(packagerClient, requestOptions);
206
- });
207
- const server = new Server(metroConfig);
208
- const sourceMapOption = getOutputSourceMapOption(config);
77
+ const bundleOutput = config.bundleOutput ? config.bundleOutput : (isIos ? config.output.ios : config.output.android);
78
+ cliParams.push('--bundle-output', bundleOutput);
79
+ const sourcemapOutput = config.sourcemapOutput ? config.sourcemapOutput : (isIos ? config.output.iosSourcemapOutput : config.output.androidSourcemapOutput);
80
+ if (sourcemapOutput) {
81
+ cliParams.push('--sourcemap-output', sourcemapOutput);
82
+ }
83
+ const sourceMapUrl = config.sourceMapUrl ? config.sourceMapUrl : (isIos ? config.output.iosSourceMapUrl : config.output.androidSourceMapUrl);
84
+ if (sourceMapUrl) {
85
+ cliParams.push('--sourcemap-use-absolute-path', sourceMapUrl);
86
+ }
87
+ const sourcemapSourcesRoot = config.sourcemapSourcesRoot ? config.sourcemapSourcesRoot : (isIos ? config.output.iosSourcemapSourcesRoot : config.output.androidSourcemapSourcesRoot);
88
+ if (sourcemapSourcesRoot) {
89
+ cliParams.push('--sourcemap-sources-root', sourcemapSourcesRoot);
90
+ }
91
+ const assetsDest = config.assetsDest ? config.assetsDest : (isIos ? config.output.iosAssetsDest : config.output.androidAssetsDest);
92
+ cliParams.push('--assets-dest', assetsDest);
209
93
  try {
210
- const requestOptions = Object.assign(Object.assign(Object.assign({}, commonOptions), sourceMapOption), { entryFile: options.entry, inlineSourceMap: false, createModuleIdFactory: metroConfig.serializer.createModuleIdFactory });
211
- const bundle = yield outputBundle.build(server, requestOptions);
212
- const outputOptions = Object.assign(Object.assign(Object.assign({}, commonOptions), sourceMapOption), { bundleOutput: options.out });
213
- yield outputBundle.save(bundle, outputOptions, console.log);
214
- // Save the assets of the bundle
215
- const outputAssets = yield server.getAssets(Object.assign(Object.assign({}, Server.DEFAULT_BUNDLE_OPTIONS), requestOptions));
216
- const assetsDest = concatOutputAssetsDest(config);
217
- return yield (0, saveAssets_1.default)(outputAssets, options.platform, assetsDest).then(() => {
218
- if (config.qr) {
219
- (0, preview_1.default)({
220
- out: options.out,
221
- assetsDest,
222
- platform: options.platform
223
- });
224
- }
225
- onFinish(null);
94
+ (0, child_process_1.spawn)('react-native', [
95
+ 'bundle',
96
+ '--platform',
97
+ config.deviceType,
98
+ '--entry-file',
99
+ 'index.js'
100
+ ].concat(cliParams), {
101
+ stdio: 'inherit'
226
102
  });
103
+ onFinish(null);
227
104
  }
228
105
  catch (e) {
229
106
  onFinish(e);
230
107
  }
231
- finally {
232
- server.end();
233
- }
234
108
  }
235
109
  });
236
110
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,0GAAkG;AAClG,2EAAkF;AAClF,2CAA0C;AAC1C,gCAA+B;AAC/B,+BAA8B;AAC9B,qEAAuE;AACvE,2CAA0C;AAC1C,+DAA8D;AAC9D,6BAA4B;AAC5B,sCAAqC;AACrC,qCAAoC;AACpC,2BAA0B;AAE1B,qCAAqC;AACrC,8DAAqD;AACrD,0DAAyD;AACzD,8CAAsC;AACtC,kEAA6D;AAC7D,mCAA4D;AAE5D,SAAS,oBAAoB,CAAE,MAAW;IACxC,0DAA0D;IAC1D,IAAI,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,cAAc,CAAC,CAAA;IACzD,IAAI,MAAM,CAAC,MAAM,EAAE;QACjB,MAAM,UAAU,GAAG,OAAO,MAAM,CAAC,MAAM,CAAA;QACvC,IAAI,UAAU,KAAK,QAAQ,EAAE;YAC3B,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;SACvB;aAAM,IAAI,UAAU,KAAK,QAAQ,EAAE;YAClC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;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,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAA;YAClI,SAAS,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAA;YAE3C,IAAI;gBACF,IAAA,qBAAK,EAAC,cAAc,EAAE;oBACpB,QAAQ;oBACR,YAAY;oBACZ,MAAM,CAAC,UAAU;oBACjB,cAAc;oBACd,UAAU;iBACX,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;oBACnB,KAAK,EAAE,SAAS;iBACjB,CAAC,CAAA;gBACF,QAAQ,CAAC,IAAI,CAAC,CAAA;aACf;YAAC,OAAM,CAAC,EAAE;gBACT,QAAQ,CAAC,CAAC,CAAC,CAAA;aACZ;SACF;IACH,CAAC;CAAA;AA5ED,wBA4EC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/rn-runner",
3
- "version": "3.5.5",
3
+ "version": "3.5.6-alpha.0",
4
4
  "description": "ReactNative build tool for taro",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -21,33 +21,20 @@
21
21
  "npm": ">=6.0.0"
22
22
  },
23
23
  "dependencies": {
24
- "@react-native-community/cli": "^7.0.3",
25
- "@react-native-community/cli-plugin-metro": "^7.0.0",
26
- "@react-native-community/cli-server-api": "^7.0.0",
27
24
  "@rollup/plugin-babel": "^5.3.1",
28
25
  "@rollup/plugin-commonjs": "^20.0.0",
29
26
  "@rollup/plugin-json": "^4.1.0",
30
27
  "@rollup/plugin-node-resolve": "^13.3.0",
31
28
  "@rollup/plugin-replace": "^4.0.0",
32
- "@tarojs/helper": "3.5.5",
33
- "@tarojs/rn-style-transformer": "3.5.5",
34
- "@tarojs/rn-supporter": "3.5.5",
35
- "@tarojs/rn-transformer": "3.5.5",
29
+ "@tarojs/helper": "3.5.6-alpha.0",
30
+ "@tarojs/rn-style-transformer": "3.5.6-alpha.0",
31
+ "@tarojs/rn-supporter": "3.5.6-alpha.0",
32
+ "@tarojs/rn-transformer": "3.5.6-alpha.0",
36
33
  "acorn-jsx": "^5.3.2",
37
- "fs-extra": "^8.0.1",
38
34
  "lodash": "^4.17.21",
39
- "metro": "^0.67.0",
40
- "metro-cache": "^0.67.0",
41
- "metro-config": "^0.67.0",
42
- "metro-core": "^0.67.0",
43
- "metro-react-native-babel-transformer": "^0.67.0",
44
- "metro-resolver": "^0.67.0",
45
- "mime-types": "^2.1.27",
46
- "qrcode-terminal": "^0.12.0",
47
35
  "rollup-plugin-image-file": "^1.0.2"
48
36
  },
49
37
  "devDependencies": {
50
- "expo-file-system": "~14.1.0",
51
38
  "react-is": "^16.13.0",
52
39
  "react-native-root-siblings": "^4.1.1"
53
40
  },