@react-native-community/cli-hermes
Advanced tools
Comparing version 6.3.0 to 7.0.1
@@ -10,4 +10,6 @@ import { Config } from '@react-native-community/cli-types'; | ||
* @param generateSourceMap | ||
* @param appId | ||
* @param appIdSuffix | ||
*/ | ||
export declare function downloadProfile(ctx: Config, dstPath: string, filename?: string, sourcemapPath?: string, raw?: boolean, shouldGenerateSourcemap?: boolean, port?: string): Promise<void>; | ||
export declare function downloadProfile(ctx: Config, dstPath: string, filename?: string, sourcemapPath?: string, raw?: boolean, shouldGenerateSourcemap?: boolean, port?: string, appId?: string, appIdSuffix?: string): Promise<void>; | ||
//# sourceMappingURL=downloadProfile.d.ts.map |
@@ -84,7 +84,7 @@ "use strict"; | ||
* Get the last modified hermes profile | ||
* @param packageName | ||
* @param packageNameWithSuffix | ||
*/ | ||
function getLatestFile(packageName) { | ||
function getLatestFile(packageNameWithSuffix) { | ||
try { | ||
const file = (0, _child_process().execSync)(`adb shell run-as ${packageName} ls cache/ -tp | grep -v /$ | grep -E '.cpuprofile' | head -1 | ||
const file = (0, _child_process().execSync)(`adb shell run-as ${packageNameWithSuffix} ls cache/ -tp | grep -v /$ | grep -E '.cpuprofile' | head -1 | ||
`); | ||
@@ -110,11 +110,13 @@ return file.toString().trim(); | ||
* @param generateSourceMap | ||
* @param appId | ||
* @param appIdSuffix | ||
*/ | ||
async function downloadProfile(ctx, dstPath, filename, sourcemapPath, raw, shouldGenerateSourcemap, port) { | ||
async function downloadProfile(ctx, dstPath, filename, sourcemapPath, raw, shouldGenerateSourcemap, port, appId, appIdSuffix) { | ||
try { | ||
const androidProject = (0, _cliPlatformAndroid().getAndroidProject)(ctx); | ||
const packageName = (0, _cliPlatformAndroid().getPackageName)(androidProject); // If file name is not specified, pull the latest file from device | ||
const packageNameWithSuffix = [appId || (0, _cliPlatformAndroid().getPackageName)(androidProject), appIdSuffix].filter(Boolean).join('.'); // If file name is not specified, pull the latest file from device | ||
const file = filename || getLatestFile(packageName); | ||
const file = filename || getLatestFile(packageNameWithSuffix); | ||
@@ -134,3 +136,3 @@ if (!file) { | ||
if (raw) { | ||
execSyncWithLog(`adb shell run-as ${packageName} cat cache/${file} > ${dstPath}/${file}`); | ||
execSyncWithLog(`adb shell run-as ${packageNameWithSuffix} cat cache/${file} > ${dstPath}/${file}`); | ||
@@ -144,3 +146,3 @@ _cliTools().logger.success(`Successfully pulled the file to ${dstPath}/${file}`); | ||
execSyncWithLog(`adb shell run-as ${packageName} cat cache/${file} > ${tempFilePath}`); // If path to source map is not given | ||
execSyncWithLog(`adb shell run-as ${packageNameWithSuffix} cat cache/${file} > ${tempFilePath}`); // If path to source map is not given | ||
@@ -147,0 +149,0 @@ if (!sourcemapPath) { |
@@ -8,2 +8,4 @@ import { Config } from '@react-native-community/cli-types'; | ||
port: string; | ||
appId?: string; | ||
appIdSuffix?: string; | ||
}; | ||
@@ -10,0 +12,0 @@ declare function profileHermes([dstPath]: Array<string>, ctx: Config, options: Options): Promise<void>; |
@@ -28,3 +28,3 @@ "use strict"; | ||
await (0, _downloadProfile.downloadProfile)(ctx, dstPath, options.filename, options.sourcemapPath, options.raw, options.generateSourcemap, options.port); | ||
await (0, _downloadProfile.downloadProfile)(ctx, dstPath, options.filename, options.sourcemapPath, options.raw, options.generateSourcemap, options.port, options.appId, options.appIdSuffix); | ||
} catch (err) { | ||
@@ -54,2 +54,8 @@ throw err; | ||
default: `${process.env.RCT_METRO_PORT || 8081}` | ||
}, { | ||
name: '--appId <string>', | ||
description: 'Specify an applicationId to launch after build. If not specified, `package` from AndroidManifest.xml will be used.' | ||
}, { | ||
name: '--appIdSuffix <string>', | ||
description: 'Specify an applicationIdSuffix to launch after build.' | ||
}], | ||
@@ -56,0 +62,0 @@ examples: [{ |
{ | ||
"name": "@react-native-community/cli-hermes", | ||
"version": "6.3.0", | ||
"version": "7.0.1", | ||
"license": "MIT", | ||
@@ -11,4 +11,4 @@ "main": "build/index.js", | ||
"dependencies": { | ||
"@react-native-community/cli-platform-android": "^6.3.0", | ||
"@react-native-community/cli-tools": "^6.2.0", | ||
"@react-native-community/cli-platform-android": "^7.0.1", | ||
"@react-native-community/cli-tools": "^7.0.1", | ||
"chalk": "^4.1.2", | ||
@@ -24,3 +24,3 @@ "hermes-profile-transformer": "^0.0.6", | ||
"devDependencies": { | ||
"@react-native-community/cli-types": "^6.0.0", | ||
"@react-native-community/cli-types": "^7.0.1", | ||
"@types/ip": "^1.1.0" | ||
@@ -33,4 +33,3 @@ }, | ||
"directory": "packages/cli-hermes" | ||
}, | ||
"gitHead": "89a19ed8d05da643f198adf4d82877f795cb4d4a" | ||
} | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
153941
23
680
+ Added@react-native-community/cli-platform-android@7.0.1(transitive)
+ Added@react-native-community/cli-tools@7.0.1(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbl@4.1.0(transitive)
+ Addedbuffer@5.7.1(transitive)
+ Addedcli-cursor@3.1.0(transitive)
+ Addedcli-spinners@2.9.2(transitive)
+ Addedclone@1.0.4(transitive)
+ Addeddefaults@1.0.4(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedis-interactive@1.0.0(transitive)
+ Addedis-unicode-supported@0.1.0(transitive)
+ Addedlog-symbols@4.1.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedora@5.4.1(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedrestore-cursor@3.1.0(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwcwidth@1.0.1(transitive)
- Removed@react-native-community/cli-platform-android@6.3.1(transitive)
- Removed@react-native-community/cli-tools@6.2.1(transitive)