Socket
Socket
Sign inDemoInstall

@react-native-community/cli-platform-android

Package Overview
Dependencies
Maintainers
30
Versions
213
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native-community/cli-platform-android - npm Package Compare versions

Comparing version 2.8.2 to 2.8.3

build/commands/index.d.ts

2

build/commands/logAndroid/index.js

@@ -39,3 +39,3 @@ "use strict";

platform: 'android',
minPriority: _logkitty().AndroidPriority.VERBOSE,
priority: _logkitty().AndroidPriority.VERBOSE,
filter: (0, _logkitty().makeTagsFilter)('ReactNative', 'ReactNativeJS')

@@ -42,0 +42,0 @@ });

@@ -24,4 +24,2 @@ "use strict";

*
* @format
*
*/

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

@@ -14,3 +14,2 @@ "use strict";

*
*
*/

@@ -17,0 +16,0 @@ function getAdbPath() {

@@ -84,3 +84,3 @@ "use strict";

*/
async function runAndroid(argv, config, args) {
async function runAndroid(_argv, config, args) {
if (!checkAndroid(args.root)) {

@@ -149,6 +149,5 @@ _cliTools().logger.error('Android project not found. Are you sure this is a React Native project?');

appFolder
} = args;
} = args; // @ts-ignore
const packageName = _fs().default.readFileSync(`${appFolder}/src/main/AndroidManifest.xml`, 'utf8') // $FlowFixMe
.match(/package="(.+?)"/)[1];
const packageName = _fs().default.readFileSync(`${appFolder}/src/main/AndroidManifest.xml`, 'utf8').match(/package="(.+?)"/)[1];

@@ -251,4 +250,5 @@ const packageNameWithSuffix = getPackageNameWithSuffix(args.appId, args.appIdSuffix, packageName);

(0, _tryLaunchAppOnDevice.default)(selectedDevice, packageNameWithSuffix, packageName, adbPath, args.mainActivity);
}
} // @ts-ignore
function startServerInNewWindow(port, terminal, reactNativePath) {

@@ -331,5 +331,6 @@ /**

flag: 'w'
});
}); // Awaiting this causes the CLI to hang indefinitely, so this must execute without await.
return _execa().default.sync('cmd.exe', ['/C', launchPackagerScript], _objectSpread({}, procConfig, {
return (0, _execa().default)('cmd.exe', ['/C', launchPackagerScript], _objectSpread({}, procConfig, {
detached: true,

@@ -336,0 +337,0 @@ stdio: 'ignore'

@@ -52,3 +52,2 @@ "use strict";

*
*
*/

@@ -55,0 +54,0 @@ function getTaskNames(appFolder, commands) {

@@ -34,3 +34,2 @@ "use strict";

*
*
*/

@@ -37,0 +36,0 @@ function tryLaunchAppOnDevice(device, packageNameWithSuffix, packageName, adbPath, mainActivity) {

@@ -38,3 +38,2 @@ "use strict";

*
*
*/

@@ -41,0 +40,0 @@ // Runs ADB reverse tcp:8081 tcp:8081 to allow loading the jsbundle from the packager

@@ -36,9 +36,3 @@ "use strict";

*
* @format
*/
/**
* @param {String} folder Folder to seek in
* @return {String}
*/
function findAndroidAppFolder(folder) {

@@ -45,0 +39,0 @@ const flat = 'android';

@@ -36,11 +36,3 @@ "use strict";

*
* @format
*/
/**
* Find an android application path in the folder
*
* @param {String} folder Name of the folder where to seek
* @return {String}
*/
function findManifest(folder) {

@@ -47,0 +39,0 @@ const manifestPath = _glob().default.sync(_path().default.join('**', 'AndroidManifest.xml'), {

@@ -47,11 +47,3 @@ "use strict";

*
* @format
*/
/**
* Gets package's class name (class that implements ReactPackage)
* by searching for its declaration in all Java/Kotlin files present in the folder
*
* @param {String} folder Folder to find java/kt files
*/
function getPackageClassName(folder) {

@@ -62,14 +54,9 @@ const files = _glob().default.sync('**/+(*.java|*.kt)', {

const packages = files.map(filePath => _fs().default.readFileSync(_path().default.join(folder, filePath), 'utf8')).map(matchClassName).filter(match => match);
const packages = files.map(filePath => _fs().default.readFileSync(_path().default.join(folder, filePath), 'utf8')).map(matchClassName).filter(match => match); // @ts-ignore
return packages.length ? packages[0][1] : null;
}
/**
* Match function that is looking for package's class name in file
*
* @param {String} file Content of file to match
*/
function matchClassName(file) {
return file.match(/class\s+(\w+[^(\s]*)[\s\w():]*(\s+implements\s+|:)[\s\w():,]*[^{]*ReactPackage/);
}

@@ -35,3 +35,2 @@ "use strict";

*
* @format
*/

@@ -38,0 +37,0 @@ const getPackageName = manifest => manifest.attr.package;

@@ -36,11 +36,5 @@ "use strict";

*
* @format
*/
/**
* @param {String} manifestPath
* @return {XMLDocument} Parsed manifest's content
*/
function readManifest(manifestPath) {
return new (_xmldoc().default.XmlDocument)(_fs().default.readFileSync(manifestPath, 'utf8'));
}

@@ -46,3 +46,2 @@ "use strict";

*
*
*/

@@ -49,0 +48,0 @@

@@ -27,3 +27,3 @@ "use strict";

*
*
* @flow
*/

@@ -30,0 +30,0 @@ function getAndroidLinkConfig() {

@@ -28,8 +28,7 @@ "use strict";

*
* @format
*/
function isInstalled(config, name) {
const buildGradle = _fs().default.readFileSync(config.buildGradlePath);
const buildGradle = _fs().default.readFileSync(config.buildGradlePath, 'utf8');
return (0, _makeBuildPatch.default)(name).installPattern.test(buildGradle);
}

@@ -24,9 +24,9 @@ "use strict";

*
* @format
*/
function applyParams(str, params, prefix) {
return str.replace(/\$\{(\w+)\}/g, (pattern, param) => {
const name = `${(0, _lodash().camelCase)(prefix)}_${param}`;
return params[param] ? `getResources().getString(R.string.${name})` : null;
return str.replace(/\$\{(\w+)\}/g, (_pattern, param) => {
const name = `${(0, _lodash().camelCase)(prefix)}_${param}`; // @ts-ignore
return params[param] ? `getResources().getString(R.string.${name})` : 'null';
});
}

@@ -36,3 +36,2 @@ "use strict";

*
* @format
*/

@@ -39,0 +38,0 @@ function applyPatch(file, patch) {

@@ -28,3 +28,2 @@ "use strict";

*
* @format
*/

@@ -50,3 +49,3 @@ const depConfigs = ['compile', 'api', 'implementation'];

const buildGradle = _fs().default.readFileSync(buildGradlePath);
const buildGradle = _fs().default.readFileSync(buildGradlePath, 'utf8');

@@ -53,0 +52,0 @@ for (const config of depConfigs) {

@@ -14,3 +14,2 @@ "use strict";

*
* @format
*/

@@ -17,0 +16,0 @@ function makeImportPatch(packageImportPath) {

@@ -18,3 +18,2 @@ "use strict";

*
* @format
*/

@@ -21,0 +20,0 @@ function makePackagePatch(packageInstance, params, prefix) {

@@ -38,3 +38,2 @@ "use strict";

*
* @format
*/

@@ -41,0 +40,0 @@ function makeSettingsPatch(name, androidConfig, projectConfig) {

@@ -24,3 +24,2 @@ "use strict";

*
* @format
*/

@@ -30,3 +29,4 @@ function makeStringsPatch(params, prefix) {

const name = `${(0, _lodash().camelCase)(prefix)}_${param}`;
return ' ' + `<string moduleConfig="true" name="${name}">${params[param]}</string>`;
return ' ' + // @ts-ignore
`<string moduleConfig="true" name="${name}">${params[param]}</string>`;
});

@@ -33,0 +33,0 @@ const patch = values.length > 0 ? `${values.join('\n')}\n` : '';

@@ -14,3 +14,2 @@ "use strict";

*
* @format
*/

@@ -17,0 +16,0 @@ function normalizeProjectName(name) {

@@ -36,3 +36,2 @@ "use strict";

*
* @format
*/

@@ -39,0 +38,0 @@ function revokePatch(file, patch) {

@@ -28,3 +28,2 @@ "use strict";

*
* @format
*/

@@ -31,0 +30,0 @@ function registerNativeAndroidModule(name, androidConfig, params, projectConfig) {

@@ -46,4 +46,2 @@ "use strict";

*
* @format
*
*/

@@ -50,0 +48,0 @@

@@ -48,3 +48,2 @@ "use strict";

*
* @format
*/

@@ -57,3 +56,5 @@ function unregisterNativeAndroidModule(name, androidConfig, projectConfig) {

const params = {};
strings.replace(/moduleConfig="true" name="(\w+)">(.*)</g, (_, param, value) => {
strings.replace(/moduleConfig="true" name="(\w+)">(.*)</g, // @ts-ignore
(_, param, value) => {
// @ts-ignore
params[param.slice((0, _lodash().camelCase)(name).length + 1)] = value;

@@ -60,0 +61,0 @@ });

{
"name": "@react-native-community/cli-platform-android",
"version": "2.8.2",
"version": "2.8.3",
"license": "MIT",
"main": "build/index.js",
"dependencies": {
"@react-native-community/cli-tools": "^2.7.0",
"@react-native-community/cli-tools": "^2.8.3",
"chalk": "^2.4.2",

@@ -12,4 +12,4 @@ "execa": "^1.0.0",

"logkitty": "^0.5.0",
"slash": "^2.0.0",
"xmldoc": "^0.4.0"
"slash": "^3.0.0",
"xmldoc": "^1.1.2"
},

@@ -20,3 +20,9 @@ "files": [

],
"gitHead": "f58dc3c7f152a962c22e66504df9214c7f9af4b5"
"devDependencies": {
"@types/execa": "^0.9.0",
"@types/fs-extra": "^8.0.0",
"@types/glob": "^7.1.1",
"@types/xmldoc": "^1.1.4"
},
"gitHead": "a12f1fa5498993db3130f52fec749ec503ec269b"
}

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