Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// If force or skipFinalConfirmation was not provided as option, we ask user for confirmation before proceeding
// with code-push publication
const userConfirmedCodePushPublication = force || skipConfirmation || await askUserToConfirmCodePushPublication(miniAppsToBeCodePushed, jsApiImplsToBeCodePushed)
if (!userConfirmedCodePushPublication) {
return log.info('CodePush publication aborted')
} else {
log.info('Getting things ready for CodePush publication')
}
const pathsToMiniAppsToBeCodePushed = _.map(miniAppsToBeCodePushed, m => PackagePath.fromString(m.toString()))
const pathToJsApiImplsToBeCodePushed = _.map(jsApiImplsToBeCodePushed, j => PackagePath.fromString(j.toString()))
await spin('Generating composite module',
generateMiniAppsComposite(pathsToMiniAppsToBeCodePushed, tmpWorkingDir, {pathToYarnLock}, pathToJsApiImplsToBeCodePushed))
const bundleOutputDirectory = path.join(tmpWorkingDir, 'bundleOut')
shell.mkdir('-p', bundleOutputDirectory)
const platform = napDescriptor.platform || ''
const bundleOutputPath = platform === 'android'
? path.join(bundleOutputDirectory, 'index.android.bundle')
: path.join(bundleOutputDirectory, 'MiniApp.jsbundle')
await spin('Generating composite bundle for miniapps', reactnative.bundle({
entryFile: `index.${platform}.js`,
dev: false,
bundleOutput: bundleOutputPath,
platform,
assetsDest: bundleOutputDirectory
}))