Socket
Socket
Sign inDemoInstall

metro

Package Overview
Dependencies
Maintainers
5
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metro - npm Package Compare versions

Comparing version 0.24.1 to 0.24.2

src/lib/formatBanner.js

12

package.json
{
"version": "0.24.1",
"version": "0.24.2",
"name": "metro",

@@ -36,5 +36,5 @@ "description": "🚇 The JavaScript bundler for React Native.",

"image-size": "^0.6.0",
"jest-docblock": "21.3.0-beta.13",
"jest-haste-map": "21.3.0-beta.13",
"jest-worker": "21.3.0-beta.13",
"jest-docblock": "22.0.0",
"jest-haste-map": "22.0.0",
"jest-worker": "22.0.0",
"json-stable-stringify": "^1.0.1",

@@ -45,4 +45,4 @@ "json5": "^0.4.0",

"merge-stream": "^1.0.1",
"metro-core": "0.24.1",
"metro-source-map": "0.24.1",
"metro-core": "0.24.2",
"metro-source-map": "0.24.2",
"mime-types": "2.1.11",

@@ -49,0 +49,0 @@ "mkdirp": "^0.5.1",

@@ -153,3 +153,3 @@ /**

return record;
});return function getAbsoluteAssetRecord(_x, _x2) {return _ref.apply(this, arguments);};})();let findRoot = (() => {var _ref2 = _asyncToGenerator(
});return function getAbsoluteAssetRecord(_x) {return _ref.apply(this, arguments);};})();let findRoot = (() => {var _ref2 = _asyncToGenerator(

@@ -179,3 +179,3 @@ function* (

}
});return function (_x7) {return _ref3.apply(this, arguments);};})()));
});return function (_x6) {return _ref3.apply(this, arguments);};})()));

@@ -194,3 +194,3 @@

});return function findRoot(_x4, _x5, _x6) {return _ref2.apply(this, arguments);};})();let getAssetRecord = (() => {var _ref4 = _asyncToGenerator(
});return function findRoot(_x3, _x4, _x5) {return _ref2.apply(this, arguments);};})();let getAssetRecord = (() => {var _ref4 = _asyncToGenerator(

@@ -215,3 +215,3 @@ function* (

});return function getAssetRecord(_x8, _x9, _x10) {return _ref4.apply(this, arguments);};})();let getAbsoluteAssetInfo = (() => {var _ref5 = _asyncToGenerator(
});return function getAssetRecord(_x7, _x8) {return _ref4.apply(this, arguments);};})();let getAbsoluteAssetInfo = (() => {var _ref5 = _asyncToGenerator(

@@ -236,3 +236,3 @@ function* (

return { files, hash: hasher.digest('hex'), name, scales, type };
});return function getAbsoluteAssetInfo(_x12, _x13) {return _ref5.apply(this, arguments);};})();let getAssetData = (() => {var _ref7 = _asyncToGenerator(
});return function getAbsoluteAssetInfo(_x10) {return _ref5.apply(this, arguments);};})();let getAssetData = (() => {var _ref7 = _asyncToGenerator(

@@ -268,7 +268,7 @@ function* (

});return function getAssetData(_x15, _x16, _x17) {return _ref7.apply(this, arguments);};})();
});return function getAssetData(_x12, _x13) {return _ref7.apply(this, arguments);};})();
/**
* Returns all the associated files (for different resolutions) of an asset.
**/let getAssetFiles = (() => {var _ref8 = _asyncToGenerator(
* Returns all the associated files (for different resolutions) of an asset.
**/let getAssetFiles = (() => {var _ref8 = _asyncToGenerator(
function* (

@@ -281,16 +281,16 @@ assetPath)

return assetData.files;
});return function getAssetFiles(_x19, _x20) {return _ref8.apply(this, arguments);};})();
});return function getAssetFiles(_x15) {return _ref8.apply(this, arguments);};})();
/**
* Return a buffer with the actual image given a request for an image by path.
* The relativePath can contain a resolution postfix, in this case we need to
* find that image (or the closest one to it's resolution) in one of the
* project roots:
*
* 1. We first parse the directory of the asset
* 2. We check to find a matching directory in one of the project roots
* 3. We then build a map of all assets and their scales in this directory
* 4. Then try to pick platform-specific asset records
* 5. Then pick the closest resolution (rounding up) to the requested one
*/let getAsset = (() => {var _ref9 = _asyncToGenerator(
* Return a buffer with the actual image given a request for an image by path.
* The relativePath can contain a resolution postfix, in this case we need to
* find that image (or the closest one to it's resolution) in one of the
* project roots:
*
* 1. We first parse the directory of the asset
* 2. We check to find a matching directory in one of the project roots
* 3. We then build a map of all assets and their scales in this directory
* 4. Then try to pick platform-specific asset records
* 5. Then pick the closest resolution (rounding up) to the requested one
*/let getAsset = (() => {var _ref9 = _asyncToGenerator(
function* (

@@ -315,3 +315,3 @@ relativePath,

return readFile(record.files[record.files.length - 1]);
});return function getAsset(_x22, _x23, _x24) {return _ref9.apply(this, arguments);};})();function _asyncToGenerator(fn) {return function () {var gen = fn.apply(this, arguments);return new Promise(function (resolve, reject) {function step(key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {return Promise.resolve(value).then(function (value) {step("next", value);}, function (err) {step("throw", err);});}}return step("next");});};}const AssetPaths = require('../node-haste/lib/AssetPaths');const crypto = require('crypto');const denodeify = require('denodeify');const fs = require('fs');const imageSize = require('image-size');const path = require('path');var _require = require('../Bundler/util');const isAssetTypeAnImage = _require.isAssetTypeAnImage;const stat = denodeify(fs.stat);const readDir = denodeify(fs.readdir);const readFile = denodeify(fs.readFile);const hashFiles = denodeify(function hashFilesCb(files, hash, callback) {if (!files.length) {callback(null);return;}fs.createReadStream(files.shift()).on('data', data => hash.update(data)).once('end', () => hashFilesCb(files, hash, callback)).once('error', error => callback(error));});function buildAssetMap(dir, files, platform) {const platforms = new Set(platform != null ? [platform] : []);const assets = files.map(file => AssetPaths.tryParse(file, platforms));const map = new Map();assets.forEach(function (asset, i) {if (asset == null) {return;}const file = files[i];const assetKey = getAssetKey(asset.assetName, asset.platform);let record = map.get(assetKey);if (!record) {record = { scales: [], files: [] };map.set(assetKey, record);}let insertIndex;const length = record.scales.length;for (insertIndex = 0; insertIndex < length; insertIndex++) {if (asset.resolution < record.scales[insertIndex]) {break;}}record.scales.splice(insertIndex, 0, asset.resolution);record.files.splice(insertIndex, 0, path.join(dir, file));});return map;}function getAssetKey(assetName, platform) {if (platform != null) {return `${assetName} : ${platform}`;} else {return assetName;}}
});return function getAsset(_x17, _x18) {return _ref9.apply(this, arguments);};})();function _asyncToGenerator(fn) {return function () {var gen = fn.apply(this, arguments);return new Promise(function (resolve, reject) {function step(key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {return Promise.resolve(value).then(function (value) {step("next", value);}, function (err) {step("throw", err);});}}return step("next");});};}const AssetPaths = require('../node-haste/lib/AssetPaths');const crypto = require('crypto');const denodeify = require('denodeify');const fs = require('fs');const imageSize = require('image-size');const path = require('path');var _require = require('../Bundler/util');const isAssetTypeAnImage = _require.isAssetTypeAnImage;const stat = denodeify(fs.stat);const readDir = denodeify(fs.readdir);const readFile = denodeify(fs.readFile);const hashFiles = denodeify(function hashFilesCb(files, hash, callback) {if (!files.length) {callback(null);return;}fs.createReadStream(files.shift()).on('data', data => hash.update(data)).once('end', () => hashFilesCb(files, hash, callback)).once('error', error => callback(error));});function buildAssetMap(dir, files, platform) {const platforms = new Set(platform != null ? [platform] : []);const assets = files.map(file => AssetPaths.tryParse(file, platforms));const map = new Map();assets.forEach(function (asset, i) {if (asset == null) {return;}const file = files[i];const assetKey = getAssetKey(asset.assetName, asset.platform);let record = map.get(assetKey);if (!record) {record = { scales: [], files: [] };map.set(assetKey, record);}let insertIndex;const length = record.scales.length;for (insertIndex = 0; insertIndex < length; insertIndex++) {if (asset.resolution < record.scales[insertIndex]) {break;}}record.scales.splice(insertIndex, 0, asset.resolution);record.files.splice(insertIndex, 0, path.join(dir, file));});return map;}function getAssetKey(assetName, platform) {if (platform != null) {return `${assetName} : ${platform}`;} else {return assetName;}}

@@ -318,0 +318,0 @@ module.exports = {

@@ -50,3 +50,3 @@ /**

{let onProgress = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : () => {};
{let onProgress = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function () {};
const changes = yield Promise.all(

@@ -80,3 +80,3 @@ paths.map(function (path) {return (

});return function traverseDependencies(_x, _x2, _x3, _x4, _x5) {return _ref.apply(this, arguments);};})();let initialTraverseDependencies = (() => {var _ref2 = _asyncToGenerator(
});return function traverseDependencies(_x, _x2, _x3, _x4) {return _ref.apply(this, arguments);};})();let initialTraverseDependencies = (() => {var _ref2 = _asyncToGenerator(

@@ -89,3 +89,3 @@ function* (

{let onProgress = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : () => {};
{let onProgress = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function () {};
createEdge(path, edges);

@@ -100,3 +100,3 @@

});return function initialTraverseDependencies(_x7, _x8, _x9, _x10, _x11) {return _ref2.apply(this, arguments);};})();let traverseDependenciesForSingleFile = (() => {var _ref3 = _asyncToGenerator(
});return function initialTraverseDependencies(_x6, _x7, _x8, _x9) {return _ref2.apply(this, arguments);};})();let traverseDependenciesForSingleFile = (() => {var _ref3 = _asyncToGenerator(

@@ -109,3 +109,3 @@ function* (

{let onProgress = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : () => {};
{let onProgress = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function () {};
const edge = edges.get(path);

@@ -175,3 +175,3 @@

});return function (_x19) {return _ref6.apply(this, arguments);};})()));
});return function (_x16) {return _ref6.apply(this, arguments);};})()));

@@ -187,3 +187,3 @@

});return function traverseDependenciesForSingleFile(_x13, _x14, _x15, _x16, _x17) {return _ref3.apply(this, arguments);};})();let addDependency = (() => {var _ref9 = _asyncToGenerator(
});return function traverseDependenciesForSingleFile(_x11, _x12, _x13, _x14) {return _ref3.apply(this, arguments);};})();let addDependency = (() => {var _ref9 = _asyncToGenerator(

@@ -255,3 +255,3 @@ function* (

return addedDependencies;
});return function addDependency(_x20, _x21, _x22, _x23, _x24, _x25, _x26) {return _ref9.apply(this, arguments);};})();function _asyncToGenerator(fn) {return function () {var gen = fn.apply(this, arguments);return new Promise(function (resolve, reject) {function step(key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {return Promise.resolve(value).then(function (value) {step("next", value);}, function (err) {step("throw", err);});}}return step("next");});};}const removeInlineRequiresBlacklistFromOptions = require('../lib/removeInlineRequiresBlacklistFromOptions');
});return function addDependency(_x17, _x18, _x19, _x20, _x21, _x22, _x23) {return _ref9.apply(this, arguments);};})();function _asyncToGenerator(fn) {return function () {var gen = fn.apply(this, arguments);return new Promise(function (resolve, reject) {function step(key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {return Promise.resolve(value).then(function (value) {step("next", value);}, function (err) {step("throw", err);});}}return step("next");});};}const removeInlineRequiresBlacklistFromOptions = require('../lib/removeInlineRequiresBlacklistFromOptions');

@@ -258,0 +258,0 @@ function removeDependency(

@@ -23,5 +23,5 @@ /**

require('metro-core'),_require$Logger = _require.Logger;const createActionStartEntry = _require$Logger.createActionStartEntry,createActionEndEntry = _require$Logger.createActionEndEntry,log = _require$Logger.log;
require('../Logger');const createActionStartEntry = _require.createActionStartEntry,createActionEndEntry = _require.createActionEndEntry,log = _require.log;

@@ -35,11 +35,13 @@

/**
* The HmrServer (Hot Module Reloading) implements a lightweight interface
* to communicate easily to the logic in the React Native repository (which
* is the one that handles the Web Socket connections).
*
* This interface allows the HmrServer to hook its own logic to WS clients
* getting connected, disconnected or having errors (through the
* `onClientConnect`, `onClientDisconnect` and `onClientError` methods).
*/
* The HmrServer (Hot Module Reloading) implements a lightweight interface
* to communicate easily to the logic in the React Native repository (which
* is the one that handles the Web Socket connections).
*
* This interface allows the HmrServer to hook its own logic to WS clients
* getting connected, disconnected or having errors (through the
* `onClientConnect`, `onClientDisconnect` and `onClientError` methods).
*/
class HmrServer {

@@ -46,0 +48,0 @@

@@ -130,3 +130,3 @@ /**

return new MetroServer(serverOptions);
});return function runMetro(_x2) {return _ref2.apply(this, arguments);};})();function _asyncToGenerator(fn) {return function () {var gen = fn.apply(this, arguments);return new Promise(function (resolve, reject) {function step(key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {return Promise.resolve(value).then(function (value) {step("next", value);}, function (err) {step("throw", err);});}}return step("next");});};}const Config = require('./Config');const Http = require('http');const Https = require('https');const MetroBundler = require('./shared/output/bundle');const MetroServer = require('./Server');const TerminalReporter = require('./lib/TerminalReporter');const TransformCaching = require('./lib/TransformCaching');const defaults = require('./defaults');var _require = require('fs');const realpath = _require.realpath;var _require2 = require('fs-extra');const readFile = _require2.readFile;var _require3 = require('metro-core');const Terminal = _require3.Terminal;
});return function runMetro(_x2) {return _ref2.apply(this, arguments);};})();function _asyncToGenerator(fn) {return function () {var gen = fn.apply(this, arguments);return new Promise(function (resolve, reject) {function step(key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {return Promise.resolve(value).then(function (value) {step("next", value);}, function (err) {step("throw", err);});}}return step("next");});};}const Config = require('./Config');const Http = require('http');const Https = require('https');const MetroBundler = require('./shared/output/bundle');const MetroServer = require('./Server');const Terminal = require('./lib/Terminal');const TerminalReporter = require('./lib/TerminalReporter');const TransformCaching = require('./lib/TransformCaching');const defaults = require('./defaults');var _require = require('fs');const realpath = _require.realpath;var _require2 = require('fs-extra');const readFile = _require2.readFile;

@@ -133,0 +133,0 @@

@@ -13,5 +13,5 @@ /**

'use strict';function _asyncToGenerator(fn) {return function () {var gen = fn.apply(this, arguments);return new Promise(function (resolve, reject) {function step(key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {return Promise.resolve(value).then(function (value) {step("next", value);}, function (err) {step("throw", err);});}}return step("next");});};}var _require =
'use strict';function _asyncToGenerator(fn) {return function () {var gen = fn.apply(this, arguments);return new Promise(function (resolve, reject) {function step(key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {return Promise.resolve(value).then(function (value) {step("next", value);}, function (err) {step("throw", err);});}}return step("next");});};}
require('metro-core');const Logger = _require.Logger;
const Logger = require('../Logger');

@@ -18,0 +18,0 @@ const debug = require('debug')('Metro:JStransformer');

@@ -16,3 +16,2 @@ /**

const babel = require('babel-core');
const inlinePlatform = require('./inline-platform');
const invariant = require('fbjs/lib/invariant');

@@ -23,2 +22,9 @@

const React = { name: 'React' };
const ReactNative = { name: 'ReactNative' };
const platform = { name: 'Platform' };
const os = { name: 'OS' };
const select = { name: 'select' };
const requirePattern = { name: 'require' };
const env = { name: 'env' };

@@ -30,2 +36,4 @@ const nodeEnv = { name: 'NODE_ENV' };

const importMap = new Map([['ReactNative', 'react-native']]);
const isGlobal = binding => !binding;

@@ -38,5 +46,45 @@

const isToplevelBinding = (binding, isWrappedModule) =>
isGlobal(binding) ||
!binding.scope.parent ||
isWrappedModule && !binding.scope.parent.parent;
const isRequireCall = (node, dependencyId, scope) =>
t.isCallExpression(node) &&
t.isIdentifier(node.callee, requirePattern) &&
checkRequireArgs(node.arguments, dependencyId);
const isImport = (node, scope, patterns) =>
patterns.some(pattern => {
const importName = importMap.get(pattern.name) || pattern.name;
return isRequireCall(node, importName, scope);
});
function isImportOrGlobal(node, scope, patterns, isWrappedModule) {
const identifier = patterns.find(pattern => t.isIdentifier(node, pattern));
return (
identifier &&
isToplevelBinding(scope.getBinding(identifier.name), isWrappedModule) ||
isImport(node, scope, patterns));
}
const isLeftHandSideOfAssignmentExpression = (node, parent) =>
t.isAssignmentExpression(parent) && parent.left === node;
const isPlatformOS = (node, scope, isWrappedModule) =>
t.isIdentifier(node.property, os) &&
isImportOrGlobal(node.object, scope, [platform], isWrappedModule);
const isReactPlatformOS = (node, scope, isWrappedModule) =>
t.isIdentifier(node.property, os) &&
t.isMemberExpression(node.object) &&
t.isIdentifier(node.object.property, platform) &&
isImportOrGlobal(
node.object.object,
scope,
[React, ReactNative],
isWrappedModule);
const isProcessEnvNodeEnv = (node, scope) =>

@@ -49,2 +97,20 @@ t.isIdentifier(node.property, nodeEnv) &&

const isPlatformSelect = (node, scope, isWrappedModule) =>
t.isMemberExpression(node.callee) &&
t.isIdentifier(node.callee.object, platform) &&
t.isIdentifier(node.callee.property, select) &&
isImportOrGlobal(node.callee.object, scope, [platform], isWrappedModule);
const isReactPlatformSelect = (node, scope, isWrappedModule) =>
t.isMemberExpression(node.callee) &&
t.isIdentifier(node.callee.property, select) &&
t.isMemberExpression(node.callee.object) &&
t.isIdentifier(node.callee.object.property, platform) &&
isImportOrGlobal(
node.callee.object.object,
scope,
[React, ReactNative],
isWrappedModule);
const isDev = (node, parent, scope) =>

@@ -73,3 +139,6 @@ t.isIdentifier(node, dev) &&

if (!isLeftHandSideOfAssignmentExpression(node, path.parent)) {
if (inlinePlatform.isPlatformNode(node, scope, opts.isWrapped)) {
if (
isPlatformOS(node, scope, opts.isWrapped) ||
isReactPlatformOS(node, scope, opts.isWrapped))
{
path.replaceWith(t.stringLiteral(opts.platform));

@@ -89,3 +158,6 @@ } else if (isProcessEnvNodeEnv(node, scope)) {

if (inlinePlatform.isPlatformSelectNode(node, scope, opts.isWrapped)) {
if (
isPlatformSelect(node, scope, opts.isWrapped) ||
isReactPlatformSelect(node, scope, opts.isWrapped))
{
const fallback = () =>

@@ -98,8 +170,2 @@ findProperty(arg, 'default', () => t.identifier('undefined'));

path.replaceWith(replacement);
} else if (
inlinePlatform.isPlatformOSSelect(node, scope, opts.isWrapped))
{
path.replaceWith(
inlinePlatform.getReplacementForPlatformOSSelect(node, opts.platform));
}

@@ -112,3 +178,11 @@ } } };

function checkRequireArgs(args, dependencyId) {
const pattern = t.stringLiteral(dependencyId);
return (
t.isStringLiteral(args[0], pattern) ||
t.isMemberExpression(args[0]) &&
t.isNumericLiteral(args[0].property) &&
t.isStringLiteral(args[1], pattern));
}

@@ -119,2 +193,4 @@

function inline(

@@ -121,0 +197,0 @@ filename,

@@ -15,2 +15,3 @@ /**

const Logger = require('./Logger');
const TransformCaching = require('./lib/TransformCaching');

@@ -22,4 +23,3 @@

require('metro-core');const Logger = _require.Logger;var _require2 =
require('metro-source-map');const fromRawMappings = _require2.fromRawMappings,compactMapping = _require2.compactMapping;
require('metro-source-map');const fromRawMappings = _require.fromRawMappings,compactMapping = _require.compactMapping;

@@ -26,0 +26,0 @@

@@ -16,5 +16,4 @@ /**

const chalk = require('chalk');
const util = require('util');var _require =
const util = require('util');
require('metro-core');const Terminal = _require.Terminal;

@@ -25,12 +24,6 @@

/**
* A tagged union of all the actions that may happen and we may want to
* report to the tool user.
*/
* A tagged union of all the actions that may happen and we may want to
* report to the tool user.
*/

@@ -104,19 +97,19 @@

/**
* Code across the application takes a reporter as an option and calls the
* update whenever one of the ReportableEvent happens. Code does not directly
* write to the standard output, because a build would be:
*
* 1. ad-hoc, embedded into another tool, in which case we do not want to
* pollute that tool's own output. The tool is free to present the
* warnings/progress we generate any way they want, by specifing a custom
* reporter.
* 2. run as a background process from another tool, in which case we want
* to expose updates in a way that is easily machine-readable, for example
* a JSON-stream. We don't want to pollute it with textual messages.
*
* We centralize terminal reporting into a single place because we want the
* output to be robust and consistent. The most common reporter is
* TerminalReporter, that should be the only place in the application should
* access the `terminal` module (nor the `console`).
*/
* Code across the application takes a reporter as an option and calls the
* update whenever one of the ReportableEvent happens. Code does not directly
* write to the standard output, because a build would be:
*
* 1. ad-hoc, embedded into another tool, in which case we do not want to
* pollute that tool's own output. The tool is free to present the
* warnings/progress we generate any way they want, by specifing a custom
* reporter.
* 2. run as a background process from another tool, in which case we want
* to expose updates in a way that is easily machine-readable, for example
* a JSON-stream. We don't want to pollute it with textual messages.
*
* We centralize terminal reporting into a single place because we want the
* output to be robust and consistent. The most common reporter is
* TerminalReporter, that should be the only place in the application should
* access the `terminal` module (nor the `console`).
*/

@@ -127,7 +120,7 @@

/**
* A standard way to log a warning to the terminal. This should not be called
* from some arbitrary Metro Bundler logic, only from the reporters. Instead of
* calling this, add a new type of ReportableEvent instead, and implement a
* proper handler in the reporter(s).
*/
* A standard way to log a warning to the terminal. This should not be called
* from some arbitrary Metro Bundler logic, only from the reporters. Instead of
* calling this, add a new type of ReportableEvent instead, and implement a
* proper handler in the reporter(s).
*/
function logWarning(

@@ -134,0 +127,0 @@ terminal,

@@ -16,2 +16,3 @@ /**

const chalk = require('chalk');
const formatBanner = require('./formatBanner');
const path = require('path');

@@ -23,4 +24,3 @@ const reporting = require('./reporting');

require('../node-haste/DependencyGraph/ResolutionRequest');const AmbiguousModuleResolutionError = _require.AmbiguousModuleResolutionError;var _require2 =
require('metro-core');const formatBanner = _require2.formatBanner;
require('../node-haste/DependencyGraph/ResolutionRequest');const AmbiguousModuleResolutionError = _require.AmbiguousModuleResolutionError;

@@ -31,5 +31,2 @@

const DEP_GRAPH_MESSAGE = 'Loading dependency graph';

@@ -105,10 +102,12 @@ const GLOBAL_CACHE_DISABLED_MESSAGE_FORMAT =

phase)
{var _ref$bundleDetails = _ref.bundleDetails;let entryFile = _ref$bundleDetails.entryFile,platform = _ref$bundleDetails.platform,dev = _ref$bundleDetails.dev,minify = _ref$bundleDetails.minify,bundleType = _ref$bundleDetails.bundleType,transformedFileCount = _ref.transformedFileCount,totalFileCount = _ref.totalFileCount,ratio = _ref.ratio;
const localPath = path.relative('.', entryFile);
{let bundleOptions = _ref.bundleOptions,transformedFileCount = _ref.transformedFileCount,totalFileCount = _ref.totalFileCount,ratio = _ref.ratio;
const localPath = path.relative('.', bundleOptions.entryFile);
const fileName = path.basename(localPath);
const dirName = path.dirname(localPath);
platform = platform ? platform + ', ' : '';
const devOrProd = dev ? 'dev' : 'prod';
const min = minify ? ', minified' : '';
const platform = bundleOptions.platform ?
bundleOptions.platform + ', ' :
'';
const devOrProd = bundleOptions.dev ? 'dev' : 'prod';
const min = bundleOptions.minify ? ', minified' : '';
const progress = (100 * ratio).toFixed(1);

@@ -121,3 +120,3 @@ const currentPhase =

return (
chalk.inverse.green.bold(` ${bundleType.toUpperCase()} `) +
chalk.inverse.green.bold(` ${bundleOptions.bundleType.toUpperCase()} `) +
chalk.dim(` [${platform}${devOrProd}${min}] ${dirName}/`) +

@@ -365,9 +364,8 @@ chalk.bold(fileName) +

case 'bundle_build_started':
const bundleProgress = {
bundleDetails: event.bundleDetails,
this._activeBundles.set(event.buildID, {
bundleOptions: event.bundleOptions,
transformedFileCount: 0,
totalFileCount: 1,
ratio: 0 };
ratio: 0 });
this._activeBundles.set(event.buildID, bundleProgress);
break;

@@ -374,0 +372,0 @@ case 'bundle_transform_progressed':

@@ -29,9 +29,9 @@ /**

require('./DependencyGraph/ModuleResolution');const ModuleResolver = _require.ModuleResolver;var _require2 =
require('events');const EventEmitter = _require2.EventEmitter;var _require3 =
require('metro-core'),_require3$Logger = _require3.Logger;const createActionStartEntry = _require3$Logger.createActionStartEntry,createActionEndEntry = _require3$Logger.createActionEndEntry,log = _require3$Logger.log;
require('../Logger');const createActionEndEntry = _require.createActionEndEntry,createActionStartEntry = _require.createActionStartEntry,log = _require.log;var _require2 =
require('./DependencyGraph/ModuleResolution');const ModuleResolver = _require2.ModuleResolver;var _require3 =
require('events');const EventEmitter = _require3.EventEmitter;

@@ -72,2 +72,4 @@

const JEST_HASTE_MAP_CACHE_BREAKER = 1;

@@ -287,15 +289,2 @@

// If we failed to find a file, maybe this is just a Haste name so try that
// TODO: We should prefer Haste name resolution first ideally since it is faster
// TODO: Ideally, we should not do any `path.parse().name` here and just use the
// name, but in `metro/src/Server/index.js` we append `'.js'` to all names
// so until that changes, we have to do this.
const potentialPath = this._moduleMap.getModule(
path.parse(filePath).name,
null);
if (potentialPath) {
return potentialPath;
}
throw new NotFoundError(

@@ -302,0 +291,0 @@ 'Cannot find entry file %s in any of the roots: %j',

@@ -163,7 +163,2 @@ /**

function packModuleId(value) {
return value.segmentId << ID_MASK_SHIFT + value.localId;
}
require.packModuleId = packModuleId;
function loadModuleImplementation(moduleId, module) {

@@ -170,0 +165,0 @@ const nativeRequire = global.nativeRequire;

@@ -50,4 +50,6 @@ /**

require('metro-core'),_require2$Logger = _require2.Logger;const createActionStartEntry = _require2$Logger.createActionStartEntry,createActionEndEntry = _require2$Logger.createActionEndEntry,log = _require2$Logger.log;
require('../Logger');const createActionStartEntry = _require2.createActionStartEntry,createActionEndEntry = _require2.createActionEndEntry,log = _require2.log;
function debounceAndBatch(fn, delay) {

@@ -459,9 +461,3 @@ let args = [];

buildID,
bundleDetails: {
entryFile: options.entryFile,
platform: options.platform,
dev: options.dev,
minify: options.minify,
bundleType: options.bundleType },
bundleOptions: options,
type: 'bundle_build_started' });

@@ -468,0 +464,0 @@

@@ -34,2 +34,3 @@ /**

hash.update(buffer);
// $FlowFixMe: Flow doesn't know that 'buffer' is a valid value
const digest = hash.digest('buffer');

@@ -36,0 +37,0 @@ const signature = Buffer.alloc ?

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc