metro 0.72.2 → 0.72.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metro",
3
- "version": "0.72.2",
3
+ "version": "0.72.3",
4
4
  "description": "🚇 The JavaScript bundler for React Native.",
5
5
  "main": "src/index.js",
6
6
  "bin": "src/cli.js",
@@ -36,22 +36,22 @@
36
36
  "invariant": "^2.2.4",
37
37
  "jest-worker": "^27.2.0",
38
38
  "lodash.throttle": "^4.1.1",
39
- "metro-babel-transformer": "0.72.2",
40
- "metro-cache": "0.72.2",
41
- "metro-cache-key": "0.72.2",
42
- "metro-config": "0.72.2",
43
- "metro-core": "0.72.2",
44
- "metro-file-map": "0.72.2",
45
- "metro-hermes-compiler": "0.72.2",
46
- "metro-inspector-proxy": "0.72.2",
47
- "metro-minify-uglify": "0.72.2",
48
- "metro-react-native-babel-preset": "0.72.2",
49
- "metro-resolver": "0.72.2",
50
- "metro-runtime": "0.72.2",
51
- "metro-source-map": "0.72.2",
52
- "metro-symbolicate": "0.72.2",
53
- "metro-transform-plugins": "0.72.2",
54
- "metro-transform-worker": "0.72.2",
39
+ "metro-babel-transformer": "0.72.3",
40
+ "metro-cache": "0.72.3",
41
+ "metro-cache-key": "0.72.3",
42
+ "metro-config": "0.72.3",
43
+ "metro-core": "0.72.3",
44
+ "metro-file-map": "0.72.3",
45
+ "metro-hermes-compiler": "0.72.3",
46
+ "metro-inspector-proxy": "0.72.3",
47
+ "metro-minify-uglify": "0.72.3",
48
+ "metro-react-native-babel-preset": "0.72.3",
49
+ "metro-resolver": "0.72.3",
50
+ "metro-runtime": "0.72.3",
51
+ "metro-source-map": "0.72.3",
52
+ "metro-symbolicate": "0.72.3",
53
+ "metro-transform-plugins": "0.72.3",
54
+ "metro-transform-worker": "0.72.3",
55
55
  "mime-types": "^2.1.27",
56
56
  "node-fetch": "^2.2.0",
57
57
  "nullthrows": "^1.1.1",
@@ -70,10 +70,10 @@
70
70
  "babel-jest": "^26.6.3",
71
71
  "dedent": "^0.7.0",
72
72
  "jest-snapshot": "^26.5.2",
73
- "metro-babel-register": "0.72.2",
74
- "metro-memory-fs": "0.72.2",
75
- "metro-react-native-babel-preset": "0.72.2",
76
- "metro-react-native-babel-transformer": "0.72.2",
73
+ "metro-babel-register": "0.72.3",
74
+ "metro-memory-fs": "0.72.3",
75
+ "metro-react-native-babel-preset": "0.72.3",
76
+ "metro-react-native-babel-transformer": "0.72.3",
77
77
  "mock-req": "^0.2.0",
78
78
  "mock-res": "^0.6.0",
79
79
  "stack-trace": "^0.0.10"
@@ -13,7 +13,6 @@ export type * from './Worker.flow';
13
13
  */
14
14
 
15
15
  try {
16
- // $FlowFixMe[untyped-import]
17
16
  require("metro-babel-register").unstable_registerForMetroMonorepo();
18
17
  } catch {}
19
18
 
@@ -15,7 +15,6 @@ export type * from './Worker.flow';
15
15
  */
16
16
 
17
17
  try {
18
- // $FlowFixMe[untyped-import]
19
18
  require('metro-babel-register').unstable_registerForMetroMonorepo();
20
19
  } catch {}
21
20
 
@@ -286,8 +286,7 @@ async function processModule(path, graph, delta, options) {
286
286
  invariant(
287
287
  module.dependencies.size === currentDependencies.size,
288
288
  "Failed to add the correct dependencies"
289
- ); // $FlowFixMe[cannot-write]
290
-
289
+ );
291
290
  module.dependencies = currentDependencies;
292
291
  return module;
293
292
  }
@@ -728,10 +727,11 @@ function collectWhite(module, graph, delta) {
728
727
  graph.privateState.gc.color.set(module.path, "black");
729
728
 
730
729
  for (const dependency of module.dependencies.values()) {
731
- const childModule = nullthrows(
732
- graph.dependencies.get(dependency.absolutePath)
733
- );
734
- collectWhite(childModule, graph, delta);
730
+ const childModule = graph.dependencies.get(dependency.absolutePath); // The child may already have been collected.
731
+
732
+ if (childModule) {
733
+ collectWhite(childModule, graph, delta);
734
+ }
735
735
  }
736
736
 
737
737
  freeModule(module, graph, delta);
@@ -345,7 +345,6 @@ async function processModule<T>(
345
345
  'Failed to add the correct dependencies',
346
346
  );
347
347
 
348
- // $FlowFixMe[cannot-write]
349
348
  module.dependencies = currentDependencies;
350
349
 
351
350
  return module;
@@ -812,10 +811,11 @@ function collectWhite<T>(module: Module<T>, graph: Graph<T>, delta: Delta) {
812
811
  ) {
813
812
  graph.privateState.gc.color.set(module.path, 'black');
814
813
  for (const dependency of module.dependencies.values()) {
815
- const childModule = nullthrows(
816
- graph.dependencies.get(dependency.absolutePath),
817
- );
818
- collectWhite(childModule, graph, delta);
814
+ const childModule = graph.dependencies.get(dependency.absolutePath);
815
+ // The child may already have been collected.
816
+ if (childModule) {
817
+ collectWhite(childModule, graph, delta);
818
+ }
819
819
  }
820
820
  freeModule(module, graph, delta);
821
821
  }
@@ -54,7 +54,6 @@ module.exports = class HasteFS {
54
54
 
55
55
  matches(directory, pattern) {
56
56
  const entries = this.directoryEntries.get(directory); // $FlowFixMe[method-unbinding] added when improving typing for this parameters
57
- // $FlowFixMe[incompatible-call]
58
57
 
59
58
  return entries ? entries.filter(pattern.test, pattern) : [];
60
59
  }
@@ -66,7 +66,6 @@ module.exports = class HasteFS {
66
66
  const entries = this.directoryEntries.get(directory);
67
67
 
68
68
  // $FlowFixMe[method-unbinding] added when improving typing for this parameters
69
- // $FlowFixMe[incompatible-call]
70
69
  return entries ? entries.filter(pattern.test, pattern) : [];
71
70
  }
72
71
  };
@@ -25,8 +25,7 @@ function reverseDependencyMapReferences({ types: t }) {
25
25
 
26
26
  if (node.callee.name === `${state.opts.globalPrefix}__d`) {
27
27
  // $FlowFixMe Flow error uncovered by typing Babel more strictly
28
- const lastArg = node.arguments[0].params.slice(-1)[0]; // $FlowFixMe Flow error uncovered by typing Babel more strictly
29
-
28
+ const lastArg = node.arguments[0].params.slice(-1)[0];
30
29
  const depMapName = lastArg && lastArg.name;
31
30
 
32
31
  if (depMapName == null) {
@@ -37,7 +37,6 @@ function reverseDependencyMapReferences({types: t}: {types: Types, ...}): {
37
37
  if (node.callee.name === `${state.opts.globalPrefix}__d`) {
38
38
  // $FlowFixMe Flow error uncovered by typing Babel more strictly
39
39
  const lastArg = node.arguments[0].params.slice(-1)[0];
40
- // $FlowFixMe Flow error uncovered by typing Babel more strictly
41
40
  const depMapName: ?string = lastArg && lastArg.name;
42
41
 
43
42
  if (depMapName == null) {
@@ -314,7 +314,6 @@ export type ResolvedLibrary = {
314
314
  +files: $ReadOnlyArray<$DeepReadOnly<ResolvedCodeFile>>,
315
315
  /* cannot be a Map because it's JSONified later on */
316
316
  +assets: AssetContentsByPath,
317
- +isPartiallyResolved?: boolean,
318
317
  };
319
318
 
320
319
  type DeepReadOnlyFn = (<T>(Array<T>) => $ReadOnlyArray<$DeepReadOnly<T>>) &
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
+ *
7
8
  * @format
8
9
  */
9
10
  "use strict";
@@ -14,17 +15,20 @@ const CRLF = "\r\n";
14
15
  const BOUNDARY = "3beqjf3apnqeu3h5jqorms4i";
15
16
 
16
17
  class MultipartResponse {
17
- static wrap(req, res) {
18
+ static wrapIfSupported(req, res) {
18
19
  if (accepts(req).types().includes("multipart/mixed")) {
19
20
  return new MultipartResponse(res);
20
- } // Ugly hack, ideally wrap function should always return a proxy
21
- // object with the same interface
22
-
23
- res.writeChunk = () => {}; // noop
21
+ }
24
22
 
25
23
  return res;
26
24
  }
27
25
 
26
+ static serializeHeaders(headers) {
27
+ return Object.keys(headers)
28
+ .map((key) => `${key}: ${headers[key]}`)
29
+ .join(CRLF);
30
+ }
31
+
28
32
  constructor(res) {
29
33
  this.res = res;
30
34
  this.headers = {};
@@ -47,7 +51,7 @@ class MultipartResponse {
47
51
  this.res.write(MultipartResponse.serializeHeaders(headers) + CRLF + CRLF);
48
52
  }
49
53
 
50
- if (data) {
54
+ if (data != null) {
51
55
  this.res.write(data);
52
56
  }
53
57
 
@@ -78,12 +82,6 @@ class MultipartResponse {
78
82
  this.writeChunk(this.headers, data, true);
79
83
  this.res.end();
80
84
  }
81
-
82
- static serializeHeaders(headers) {
83
- return Object.keys(headers)
84
- .map((key) => `${key}: ${headers[key]}`)
85
- .join(CRLF);
86
- }
87
85
  }
88
86
 
89
87
  module.exports = MultipartResponse;
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict
8
+ * @format
9
+ */
10
+
11
+ 'use strict';
12
+ import type {IncomingMessage, ServerResponse} from 'http';
13
+ const accepts = require('accepts');
14
+
15
+ const CRLF = '\r\n';
16
+ const BOUNDARY = '3beqjf3apnqeu3h5jqorms4i';
17
+ type Data = string | Buffer | Uint8Array;
18
+ type Headers = {[string]: string | number};
19
+
20
+ class MultipartResponse {
21
+ static wrapIfSupported(
22
+ req: IncomingMessage,
23
+ res: ServerResponse,
24
+ ): MultipartResponse | ServerResponse {
25
+ if (accepts(req).types().includes('multipart/mixed')) {
26
+ return new MultipartResponse(res);
27
+ }
28
+
29
+ return res;
30
+ }
31
+
32
+ static serializeHeaders(headers: Headers): string {
33
+ return Object.keys(headers)
34
+ .map(key => `${key}: ${headers[key]}`)
35
+ .join(CRLF);
36
+ }
37
+
38
+ res: ServerResponse;
39
+ headers: Headers;
40
+
41
+ constructor(res: ServerResponse) {
42
+ this.res = res;
43
+ this.headers = {};
44
+ res.writeHead(200, {
45
+ 'Content-Type': `multipart/mixed; boundary="${BOUNDARY}"`,
46
+ });
47
+ res.write(
48
+ 'If you are seeing this, your client does not support multipart response',
49
+ );
50
+ }
51
+
52
+ writeChunk(
53
+ headers: Headers | null,
54
+ data?: Data,
55
+ isLast?: boolean = false,
56
+ ): void {
57
+ if (this.res.finished) {
58
+ return;
59
+ }
60
+
61
+ this.res.write(`${CRLF}--${BOUNDARY}${CRLF}`);
62
+ if (headers) {
63
+ this.res.write(MultipartResponse.serializeHeaders(headers) + CRLF + CRLF);
64
+ }
65
+
66
+ if (data != null) {
67
+ this.res.write(data);
68
+ }
69
+
70
+ if (isLast) {
71
+ this.res.write(`${CRLF}--${BOUNDARY}--${CRLF}`);
72
+ }
73
+ }
74
+
75
+ writeHead(status: number, headers?: Headers): void {
76
+ // We can't actually change the response HTTP status code
77
+ // because the headers have already been sent
78
+ this.setHeader('X-Http-Status', status);
79
+ if (!headers) {
80
+ return;
81
+ }
82
+ for (const key in headers) {
83
+ this.setHeader(key, headers[key]);
84
+ }
85
+ }
86
+
87
+ setHeader(name: string, value: string | number): void {
88
+ this.headers[name] = value;
89
+ }
90
+
91
+ end(data?: Data): void {
92
+ this.writeChunk(this.headers, data, true);
93
+ this.res.end();
94
+ }
95
+ }
96
+
97
+ module.exports = MultipartResponse;
package/src/Server.js CHANGED
@@ -47,12 +47,12 @@ const transformHelpers = require("./lib/transformHelpers");
47
47
 
48
48
  const parsePlatformFilePath = require("./node-haste/lib/parsePlatformFilePath");
49
49
 
50
- const MultipartResponse = require("./Server/MultipartResponse");
51
-
52
50
  const symbolicate = require("./Server/symbolicate");
53
51
 
54
52
  const { codeFrameColumns } = require("@babel/code-frame");
55
53
 
54
+ const MultipartResponse = require("./Server/MultipartResponse");
55
+
56
56
  const debug = require("debug")("Metro:Server");
57
57
 
58
58
  const fs = require("graceful-fs");
@@ -516,7 +516,7 @@ class Server {
516
516
  return;
517
517
  }
518
518
 
519
- const mres = MultipartResponse.wrap(req, res);
519
+ const mres = MultipartResponse.wrapIfSupported(req, res);
520
520
  const buildID = this.getNewBuildID();
521
521
  let onProgress = null;
522
522
  let lastProgress = -1;
@@ -532,15 +532,17 @@ class Server {
532
532
  // actually different and that have increased from the last one we sent.
533
533
 
534
534
  if (currentProgress > lastProgress || totalFileCount < 10) {
535
- mres.writeChunk(
536
- {
537
- "Content-Type": "application/json",
538
- },
539
- JSON.stringify({
540
- done: transformedFileCount,
541
- total: totalFileCount,
542
- })
543
- ); // The `uncork` called internally in Node via `promise.nextTick()` may not fire
535
+ if (mres instanceof MultipartResponse) {
536
+ mres.writeChunk(
537
+ {
538
+ "Content-Type": "application/json",
539
+ },
540
+ JSON.stringify({
541
+ done: transformedFileCount,
542
+ total: totalFileCount,
543
+ })
544
+ );
545
+ } // The `uncork` called internally in Node via `promise.nextTick()` may not fire
544
546
  // until all of the Promises are resolved because the microtask queue we're
545
547
  // in could be starving the event loop. This can cause a bug where the progress
546
548
  // is not actually sent in the response until after bundling is complete. This
@@ -691,8 +693,6 @@ class Server {
691
693
 
692
694
  const serializer =
693
695
  this._config.serializer.customSerializer ||
694
- /* $FlowFixMe[missing-local-annot] The type annotation(s) required by
695
- * Flow's LTI update could not be added via codemod */
696
696
  ((...args) => bundleToString(baseJSBundle(...args)).code);
697
697
 
698
698
  const bundle = await serializer(
@@ -60,9 +60,9 @@ const parseOptionsFromUrl = require('./lib/parseOptionsFromUrl');
60
60
  const splitBundleOptions = require('./lib/splitBundleOptions');
61
61
  const transformHelpers = require('./lib/transformHelpers');
62
62
  const parsePlatformFilePath = require('./node-haste/lib/parsePlatformFilePath');
63
- const MultipartResponse = require('./Server/MultipartResponse');
64
63
  const symbolicate = require('./Server/symbolicate');
65
64
  const {codeFrameColumns} = require('@babel/code-frame');
65
+ const MultipartResponse = require('./Server/MultipartResponse');
66
66
  const debug = require('debug')('Metro:Server');
67
67
  const fs = require('graceful-fs');
68
68
  const {
@@ -91,8 +91,7 @@ type ProcessStartContext = {
91
91
  +bundleOptions: BundleOptions,
92
92
  +graphId: GraphId,
93
93
  +graphOptions: GraphOptions,
94
- // $FlowFixMe[value-as-type]
95
- +mres: MultipartResponse,
94
+ +mres: MultipartResponse | ServerResponse,
96
95
  +req: IncomingMessage,
97
96
  +revisionId?: ?RevisionId,
98
97
  ...SplitBundleOptions,
@@ -601,7 +600,7 @@ class Server {
601
600
  return;
602
601
  }
603
602
 
604
- const mres = MultipartResponse.wrap(req, res);
603
+ const mres = MultipartResponse.wrapIfSupported(req, res);
605
604
  const buildID = this.getNewBuildID();
606
605
 
607
606
  let onProgress = null;
@@ -618,13 +617,15 @@ class Server {
618
617
  // that, we check the percentage, and only send percentages that are
619
618
  // actually different and that have increased from the last one we sent.
620
619
  if (currentProgress > lastProgress || totalFileCount < 10) {
621
- mres.writeChunk(
622
- {'Content-Type': 'application/json'},
623
- JSON.stringify({
624
- done: transformedFileCount,
625
- total: totalFileCount,
626
- }),
627
- );
620
+ if (mres instanceof MultipartResponse) {
621
+ mres.writeChunk(
622
+ {'Content-Type': 'application/json'},
623
+ JSON.stringify({
624
+ done: transformedFileCount,
625
+ total: totalFileCount,
626
+ }),
627
+ );
628
+ }
628
629
 
629
630
  // The `uncork` called internally in Node via `promise.nextTick()` may not fire
630
631
  // until all of the Promises are resolved because the microtask queue we're
@@ -789,8 +790,6 @@ class Server {
789
790
 
790
791
  const serializer =
791
792
  this._config.serializer.customSerializer ||
792
- /* $FlowFixMe[missing-local-annot] The type annotation(s) required by
793
- * Flow's LTI update could not be added via codemod */
794
793
  ((...args) => bundleToString(baseJSBundle(...args)).code);
795
794
 
796
795
  const bundle = await serializer(
package/src/index.js CHANGED
@@ -13,7 +13,6 @@ export type * from './index.flow';
13
13
  */
14
14
 
15
15
  try {
16
- // $FlowFixMe[untyped-import]
17
16
  require("metro-babel-register").unstable_registerForMetroMonorepo();
18
17
  } catch {}
19
18
 
package/src/index.js.flow CHANGED
@@ -15,7 +15,6 @@ export type * from './index.flow';
15
15
  */
16
16
 
17
17
  try {
18
- // $FlowFixMe[untyped-import]
19
18
  require('metro-babel-register').unstable_registerForMetroMonorepo();
20
19
  } catch {}
21
20
 
@@ -68,7 +68,6 @@ class CountingSet {
68
68
  }
69
69
  } // Iterate over unique entries
70
70
  // $FlowIssue[unsupported-syntax]
71
- // $FlowFixMe[missing-local-annot]
72
71
 
73
72
  [Symbol.iterator]() {
74
73
  return this.values();
@@ -81,7 +81,6 @@ export default class CountingSet<T> implements ReadOnlyCountingSet<T> {
81
81
 
82
82
  // Iterate over unique entries
83
83
  // $FlowIssue[unsupported-syntax]
84
- // $FlowFixMe[missing-local-annot]
85
84
  [Symbol.iterator](): Iterator<T> {
86
85
  return this.values();
87
86
  }
@@ -144,28 +144,21 @@ class TerminalReporter {
144
144
 
145
145
  _logInitializing(port, hasReducedPerformance) {
146
146
  const logo = [
147
- " ",
148
- " ####### ",
149
- " ################ ",
150
- " ######### ######### ",
151
- " ######### ########## ",
152
- " ######### ###### ######### ",
153
- " ########################################## ",
154
- " ##### ##################### ##### ",
155
- " ##### ############## ##### ",
156
- " ##### ### ###### ### ##### ",
157
- " ##### ####### ####### ##### ",
158
- " ##### ########### ########### ##### ",
159
- " ##### ########################## ##### ",
160
- " ##### ########################## ##### ",
161
- " ##### ###################### ###### ",
162
- " ###### ############# ####### ",
163
- " ######### #### ######### ",
164
- " ######### ######### ",
165
- " ######### ######### ",
166
- " ######### ",
167
- " ",
168
- " ",
147
+ "",
148
+ " ▒▒▓▓▓▓▒▒",
149
+ " ▒▓▓▓▒▒░░▒▒▓▓▓▒",
150
+ " ▒▓▓▓▓░░░▒▒▒▒░░░▓▓▓▓▒",
151
+ " ▓▓▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▓▓",
152
+ " ▓▓░░░░░▒▓▓▓▓▓▓▒░░░░░▓▓",
153
+ " ▓▓░░▓▓▒░░░▒▒░░░▒▓▒░░▓▓",
154
+ " ▓▓░░▓▓▓▓▓▒▒▒▒▓▓▓▓▒░░▓▓",
155
+ " ▓▓░░▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░▓▓",
156
+ " ▓▓▒░░▒▒▓▓▓▓▓▓▓▓▒░░░▒▓▓",
157
+ " ▒▓▓▓▒░░░▒▓▓▒░░░▒▓▓▓▒",
158
+ " ▒▓▓▓▒░░░░▒▓▓▓▒",
159
+ " ▒▒▓▓▓▓▒▒",
160
+ "",
161
+ "",
169
162
  ];
170
163
  const color = hasReducedPerformance ? chalk.red : chalk.blue;
171
164
  this.terminal.log(color(logo.join("\n")));
@@ -258,9 +251,14 @@ class TerminalReporter {
258
251
 
259
252
  case "dep_graph_loading":
260
253
  const color = event.hasReducedPerformance ? chalk.red : chalk.blue;
254
+
255
+ const version = "v" + require("../../package.json").version;
256
+
261
257
  this.terminal.log(
262
- color.bold(" Welcome to Metro!\n") +
263
- chalk.dim(" Fast - Scalable - Integrated\n\n")
258
+ color.bold(
259
+ " ".repeat(19 - version.length / 2),
260
+ "Welcome to Metro " + chalk.white(version) + "\n"
261
+ ) + chalk.dim(" Fast - Scalable - Integrated\n\n")
264
262
  );
265
263
 
266
264
  if (event.hasReducedPerformance) {
@@ -182,28 +182,21 @@ class TerminalReporter {
182
182
 
183
183
  _logInitializing(port: number, hasReducedPerformance: boolean): void {
184
184
  const logo = [
185
- ' ',
186
- ' ####### ',
187
- ' ################ ',
188
- ' ######### ######### ',
189
- ' ######### ########## ',
190
- ' ######### ###### ######### ',
191
- ' ########################################## ',
192
- ' ##### ##################### ##### ',
193
- ' ##### ############## ##### ',
194
- ' ##### ### ###### ### ##### ',
195
- ' ##### ####### ####### ##### ',
196
- ' ##### ########### ########### ##### ',
197
- ' ##### ########################## ##### ',
198
- ' ##### ########################## ##### ',
199
- ' ##### ###################### ###### ',
200
- ' ###### ############# ####### ',
201
- ' ######### #### ######### ',
202
- ' ######### ######### ',
203
- ' ######### ######### ',
204
- ' ######### ',
205
- ' ',
206
- ' ',
185
+ '',
186
+ ' ▒▒▓▓▓▓▒▒',
187
+ ' ▒▓▓▓▒▒░░▒▒▓▓▓▒',
188
+ ' ▒▓▓▓▓░░░▒▒▒▒░░░▓▓▓▓▒',
189
+ ' ▓▓▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▓▓',
190
+ ' ▓▓░░░░░▒▓▓▓▓▓▓▒░░░░░▓▓',
191
+ ' ▓▓░░▓▓▒░░░▒▒░░░▒▓▒░░▓▓',
192
+ ' ▓▓░░▓▓▓▓▓▒▒▒▒▓▓▓▓▒░░▓▓',
193
+ ' ▓▓░░▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░▓▓',
194
+ ' ▓▓▒░░▒▒▓▓▓▓▓▓▓▓▒░░░▒▓▓',
195
+ ' ▒▓▓▓▒░░░▒▓▓▒░░░▒▓▓▓▒',
196
+ ' ▒▓▓▓▒░░░░▒▓▓▓▒',
197
+ ' ▒▒▓▓▓▓▒▒',
198
+ '',
199
+ '',
207
200
  ];
208
201
 
209
202
  const color = hasReducedPerformance ? chalk.red : chalk.blue;
@@ -275,9 +268,12 @@ class TerminalReporter {
275
268
  break;
276
269
  case 'dep_graph_loading':
277
270
  const color = event.hasReducedPerformance ? chalk.red : chalk.blue;
271
+ const version = 'v' + require('../../package.json').version;
278
272
  this.terminal.log(
279
- color.bold(' Welcome to Metro!\n') +
280
- chalk.dim(' Fast - Scalable - Integrated\n\n'),
273
+ color.bold(
274
+ ' '.repeat(19 - version.length / 2),
275
+ 'Welcome to Metro ' + chalk.white(version) + '\n',
276
+ ) + chalk.dim(' Fast - Scalable - Integrated\n\n'),
281
277
  );
282
278
 
283
279
  if (event.hasReducedPerformance) {
@@ -63,7 +63,6 @@ class Package {
63
63
  }
64
64
  }
65
65
  }
66
- /* $FlowFixMe: `getReplacements` doesn't validate the return value. */
67
66
 
68
67
  return path.join(this._root, main);
69
68
  }
@@ -77,7 +77,6 @@ class Package {
77
77
  }
78
78
  }
79
79
 
80
- /* $FlowFixMe: `getReplacements` doesn't validate the return value. */
81
80
  return path.join(this._root, main);
82
81
  }
83
82
 
@@ -13,7 +13,6 @@ export type * from './bundle.flow';
13
13
  */
14
14
 
15
15
  try {
16
- // $FlowFixMe[untyped-import]
17
16
  require("metro-babel-register").unstable_registerForMetroMonorepo();
18
17
  } catch {}
19
18
 
@@ -15,7 +15,6 @@ export type * from './bundle.flow';
15
15
  */
16
16
 
17
17
  try {
18
- // $FlowFixMe[untyped-import]
19
18
  require('metro-babel-register').unstable_registerForMetroMonorepo();
20
19
  } catch {}
21
20