Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function showVersion() {
// get electrode-native local-cli version
if (config.get('platformVersion')) {
log.info(`ern-local-cli : ${config.get('platformVersion')}`)
}
// get electrode-native global-cli version
const packageInfo = JSON.parse(
execSync('npm ls -g electrode-native --json').toString()
)
if (packageInfo && packageInfo.dependencies) {
log.info(
`electrode-native : ${
packageInfo.dependencies['electrode-native'].version
}`
)
}
}
}
} else {
updatedMiniApps.push(miniapp)
}
}
const cauldronCommitMessage = [
`${
miniapps.length === 1
? `Update ${miniapps[0]} MiniApp version in ${descriptor}`
: `Update multiple MiniApps versions in ${descriptor}`
}`,
]
if (updatedMiniApps.length === 0) {
log.info(
'No changes to MiniApps resolved SHAs (pointing to same commit(s))'
)
if (fullRegen) {
log.info('Performing regen anyway [--fullRegen]')
} else {
log.info(
`Skipping Container regen.
Only updating Cauldron with new MiniApps versions.
To regenerate anyway use the --fullRegen option.`
)
await cauldron.beginTransaction()
await cauldron.syncContainerMiniApps(descriptor!, miniapps)
await cauldron.commitTransaction(cauldronCommitMessage)
return
}
}
hasConfig,
nativeOnly,
outputDirectory,
packageName,
paths: {
apiImplHull: path.join(
Platform.currentPlatformVersionPath,
'ern-api-impl-gen',
'hull'
),
outDirectory: '',
},
reactNativeVersion,
scope,
})
log.info('Success')
}
export const commandHandler = async ({
cauldronFilePath,
}: {
cauldronFilePath: string
}) => {
const cauldron = await getActiveCauldron()
await cauldron.removeFile({ cauldronFilePath })
log.info(`${cauldronFilePath} file successfully removed from the Cauldron`)
}
export async function deleteBranchOrTag({
name,
packages,
type,
}: {
name: string
packages: PackagePath[]
type: 'branch' | 'tag'
}) {
for (const pkg of packages) {
if (!pkg.isGitPath) {
log.info(`Skipping ${pkg.basePath} [not git based]`)
continue
}
const opts: any = { name }
const { owner, repo } = extractGitData(pkg)
const api = await getGitHubApi({ owner, repo })
const refExist =
type === 'branch' ? await api.isBranch(name) : await api.isTag(name)
if (!refExist) {
log.warn(
`Skipping ${pkg.basePath} [${name} ${type} as it does not exist]`
)
continue
}
if (type === 'branch') {
await api.deleteBranch(opts)
} else {
export const commandHandler = async ({ alias }: { alias: string }) => {
cauldronRepositories.remove({ alias })
log.info(`Removed Cauldron repository exists with alias ${alias}`)
}
v.forEach(x => {
log.info(` ${x}`)
})
}
export const commandHandler = async ({ accessKey }: { accessKey: string }) => {
await logErrorAndExitIfNotSatisfied({
bundleStoreUrlSetInCauldron: {
extraErrorMessage: `You should add bundleStore config in your Cauldron`,
},
})
const cauldron = await getActiveCauldron()
const bundleStoreUrl = (await cauldron.getBundleStoreConfig()).url
const sdk = new BundleStoreSdk(bundleStoreUrl)
const store = await sdk.getStoreByAccessKey({ accessKey })
config.set('bundlestore-id', store)
config.set('bundlestore-accesskey', accessKey)
log.info(`Now using store ${store}`)
}
extraErrorMessage:
'This command cannot work on a non existing native application version',
},
})
} else {
descriptor = await askUserToChooseANapDescriptorFromCauldron()
}
const cauldron = await getActiveCauldron()
const lock = await cauldron.getYarnLock(descriptor, 'container')
if (lock) {
const tree = YarnLockParser.fromContent(
lock.toString()
).buildDependencyTree(dependency)
if (_.isEmpty(tree)) {
log.info(`${dependency} is not part of the Composite of ${descriptor}`)
} else {
log.info(treeify.asTree(tree, true, true))
}
} else {
throw new Error(
`No yarn lock was found in Cauldron for ${descriptor} Container`
)
}
}
mavenPassword: config.extra && config.extra.mavenPassword,
mavenUser: config.extra && config.extra.mavenUser,
})}
}
}
}
`
)
try {
log.info('[=== Starting build and publication ===]')
shell.pushd(config.containerPath)
await this.buildAndUploadArchive()
log.info('[=== Completed build and publication of the Container ===]')
log.info(`[Publication url : ${config.url}]`)
log.info(
`[Artifact: ${config.extra.groupId}:${config.extra.artifactId}:${
config.containerVersion
} ]`
)
} finally {
shell.popd()
}
}