Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'You cannot CodePush to a non existing native application version.',
},
sameNativeApplicationAndPlatform: {
descriptors,
extraErrorMessage:
'You can only pass descriptors that match the same native application and version',
},
})
} else if (descriptors.length === 0 && !semVerDescriptor) {
// User provided no descriptors, nor a semver descriptor
descriptors = await askUserToChooseOneOrMoreNapDescriptorFromCauldron({
onlyReleasedVersions: true,
})
} else if (semVerDescriptor) {
// User provided a semver Descriptor
const semVerNapDescriptor = AppVersionDescriptor.fromString(
semVerDescriptor
)
const cauldron = await getActiveCauldron()
descriptors = await cauldron.getDescriptorsMatchingSemVerDescriptor(
semVerNapDescriptor
)
if (descriptors.length === 0) {
throw new Error(`No versions matching ${semVerDescriptor} were found`)
} else {
log.info(
'CodePush release will target the following native application descriptors :'
)
for (const descriptor of descriptors) {
log.info(`- ${descriptor}`)
}
if (!skipConfirmation) {
.coerce('descriptor', d => AppVersionDescriptor.fromString(d))
.coerce('dependencies', d => d.map(PackagePath.fromString))
.coerce('descriptor', d => AppVersionDescriptor.fromString(d))
.option('fullRegen', {
.coerce('descriptor', d => AppVersionDescriptor.fromString(d))
.option('flavor', {
.coerce('descriptor', d => AppVersionDescriptor.fromString(d))
.option('extraJsDependencies', {
export const commandHandler = async ({
completeNapDescriptor,
dependency,
}: {
completeNapDescriptor: string
dependency: string
}) => {
log.warn(
'This command has been deprecated in 0.31.0. Use `ern cauldry why` instead.'
)
const napDescriptor = AppVersionDescriptor.fromString(completeNapDescriptor)
const cauldron = await getActiveCauldron()
const miniApps = await cauldron.getContainerMiniApps(napDescriptor)
log.info(`This might take a while. The more MiniApps, the longer.`)
const result = await dependencyLookup.getMiniAppsUsingNativeDependency(
miniApps,
PackagePath.fromString(dependency)
)
if (!result || result.length === 0) {
log.info(`${dependency} dependency is not directly used by any MiniApps`)
} else {
log.info(`The following MiniApp(s) are using ${dependency} dependency :`)
for (const miniApp of result) {
log.info(`=> ${miniApp.name}`)
}
}
}
.coerce('descriptor', d => AppVersionDescriptor.fromString(d))
.option('disabled', {
.coerce('descriptor', d => AppVersionDescriptor.fromString(d))
.coerce('miniapps', d => d.map(PackagePath.fromString))
.coerce('descriptor', d => AppVersionDescriptor.fromString(d))
.epilog(epilog(exports))
.coerce('descriptor', d => AppVersionDescriptor.fromString(d))
.option('flavor', {