Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-native-community/cli-plugin-metro

Package Overview
Dependencies
Maintainers
30
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native-community/cli-plugin-metro - npm Package Compare versions

Comparing version 12.0.0-alpha.7 to 12.0.0-alpha.8

4

build/commands/bundle/buildBundle.d.ts

@@ -8,6 +8,6 @@ /**

*/
import type { Config } from '@react-native-community/cli-types';
import type { ConfigT } from 'metro-config';
import outputBundle from 'metro/src/shared/output/bundle';
import type { ConfigT } from 'metro-config';
import { CommandLineArgs } from './bundleCommandLineArgs';
import type { Config } from '@react-native-community/cli-types';
declare function buildBundle(args: CommandLineArgs, ctx: Config, output?: typeof outputBundle): Promise<void | undefined>;

@@ -14,0 +14,0 @@ /**

@@ -8,2 +8,23 @@ "use strict";

exports.default = void 0;
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function _fs() {
const data = _interopRequireDefault(require("fs"));
_fs = function () {
return data;
};
return data;
}
function _Server() {

@@ -30,18 +51,4 @@ const data = _interopRequireDefault(require("metro/src/Server"));

}
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
var _loadMetroConfig = _interopRequireDefault(require("../../tools/loadMetroConfig"));
var _saveAssets = _interopRequireDefault(require("./saveAssets"));
var _loadMetroConfig = _interopRequireDefault(require("../../tools/loadMetroConfig"));
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -95,2 +102,9 @@ /**

const bundle = await output.build(server, requestOpts);
// Ensure destination directory exists before saving the bundle
const mkdirOptions = {
recursive: true,
mode: 0o755
};
_fs().default.mkdirSync(_path().default.dirname(args.bundleOutput), mkdirOptions);
await output.save(bundle, args, _cliTools().logger.info);

@@ -97,0 +111,0 @@

@@ -5,2 +5,5 @@ import { ConfigT } from 'metro-config';

export type ConfigLoadingContext = Pick<Config, 'root' | 'reactNativePath' | 'platforms'>;
declare global {
var __REACT_NATIVE_METRO_CONFIG_LOADED: boolean;
}
export interface ConfigOptionsT {

@@ -7,0 +10,0 @@ maxWorkers?: number;

@@ -7,9 +7,2 @@ "use strict";

exports.default = loadMetroConfig;
function _fs() {
const data = _interopRequireDefault(require("fs"));
_fs = function () {
return data;
};
return data;
}
function _path() {

@@ -36,3 +29,2 @@ const data = _interopRequireDefault(require("path"));

}
var _getDefaultMetroConfig = _interopRequireDefault(require("./getDefaultMetroConfig"));
var _metroPlatformResolver = require("./metroPlatformResolver");

@@ -76,20 +68,26 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

}
const projectConfig = await (0, _metroConfig().resolveConfig)(undefined, ctx.root);
const cwd = ctx.root;
const projectConfig = await (0, _metroConfig().resolveConfig)(options.config, cwd);
if (projectConfig.isEmpty) {
throw new (_cliTools().CLIError)(`No metro config found in ${ctx.root}`);
throw new (_cliTools().CLIError)(`No Metro config found in ${cwd}`);
}
_cliTools().logger.debug(`Reading Metro config from ${projectConfig.filepath}`);
if (!/['"']@react-native\/metro-config['"']/.test(_fs().default.readFileSync(projectConfig.filepath, 'utf8'))) {
_cliTools().logger.warn('From React Native 0.72, your metro.config.js file should extend' + "'@react-native/metro-config'. Please see the React Native 0.72 " + 'changelog, or copy the template at:\n' + 'https://github.com/facebook/react-native/blob/main/packages/react-native/template/metro.config.js');
_cliTools().logger.warn('Falling back to internal defaults.');
const loadedConfig = await (0, _metroConfig().loadConfig)({
cwd: ctx.root,
...options
},
// Provide React Native defaults on top of Metro defaults
(0, _getDefaultMetroConfig.default)(ctx));
return (0, _metroConfig().mergeConfig)(loadedConfig, overrideConfig);
if (!global.__REACT_NATIVE_METRO_CONFIG_LOADED) {
const warning = `
=================================================================================================
From React Native 0.73, your project's Metro config should extend '@react-native/metro-config'
or it will fail to build. Please copy the template at:
https://github.com/facebook/react-native/blob/main/packages/react-native/template/metro.config.js
This warning will be removed in future (https://github.com/facebook/metro/issues/1018).
=================================================================================================
`;
for (const line of warning.trim().split('\n')) {
_cliTools().logger.warn(line);
}
}
return (0, _metroConfig().mergeConfig)(await (0, _metroConfig().loadConfig)({
cwd: ctx.root,
cwd,
...options

@@ -96,0 +94,0 @@ }), overrideConfig);

{
"name": "@react-native-community/cli-plugin-metro",
"version": "12.0.0-alpha.7",
"version": "12.0.0-alpha.8",
"license": "MIT",

@@ -10,16 +10,14 @@ "main": "build/index.js",

"dependencies": {
"@react-native-community/cli-server-api": "12.0.0-alpha.7",
"@react-native-community/cli-tools": "12.0.0-alpha.7",
"@react-native-community/cli-server-api": "12.0.0-alpha.8",
"@react-native-community/cli-tools": "12.0.0-alpha.8",
"chalk": "^4.1.2",
"execa": "^5.0.0",
"metro": "0.77.0",
"metro-config": "0.77.0",
"metro-core": "0.77.0",
"metro-react-native-babel-transformer": "0.77.0",
"metro-resolver": "0.77.0",
"metro-runtime": "0.77.0",
"metro": "0.78.0",
"metro-config": "0.78.0",
"metro-core": "0.78.0",
"readline": "^1.3.0"
},
"devDependencies": {
"@react-native-community/cli-types": "12.0.0-alpha.7"
"@react-native-community/cli-types": "12.0.0-alpha.8",
"metro-resolver": "0.78.0"
},

@@ -36,3 +34,3 @@ "files": [

},
"gitHead": "dcda33c412399f1c7dd39e94e7b660c70f32ce75"
"gitHead": "3d3616ed5149318984e33a2a5fb2d80744b6bd3a"
}

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