Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
resolutions = compositeGenConfig?.resolutions
}
// Because this command can only be stoped through `CTRL+C` (or killing the process)
// we listen for the SIGINT signal and then just exit the process
// This is needed for tmp module to do its cleanup, otherwise the temporary directory
// is not removed after `CTRL+C` is done
process.on('SIGINT', () => process.exit())
compositeDir = compositeDir || createTmpDir()
log.trace(`Temporary composite directory is ${compositeDir}`)
const composite = await kax
.task(`Generating composite in ${compositeDir}`)
.run(
Composite.generate({
baseComposite,
extraJsDependencies: extraJsDependencies || undefined,
jsApiImplDependencies: jsApiImpls,
miniApps: miniapps!,
outDir: compositeDir,
resolutions,
})
)
// Third party native modules
const nativeDependencies = await composite.getNativeDependencies()
const nativeModules: PackagePath[] = [
...nativeDependencies.thirdPartyInManifest,
...nativeDependencies.thirdPartyNotInManifest,
].map(d => d.packagePath)
miniappPackagesPaths: PackagePath[],
{
baseComposite,
jsApiImpls,
outDir,
resolutions,
}: {
baseComposite?: PackagePath
jsApiImpls?: PackagePath[]
outDir?: string
resolutions?: { [pkg: string]: string }
}
): Promise {
try {
const composite = await kax.task('Generating Composite').run(
Composite.generate({
baseComposite,
jsApiImplDependencies: jsApiImpls,
miniApps: miniappPackagesPaths,
outDir: outDir || createTmpDir(),
resolutions,
})
)
await validateCompositeNativeDependencies(composite)
return composite
} catch (e) {
log.error(`runLocalCompositeGen failed: ${e}`)
throw e
}
}
)
let pathToYarnLock
if (!containerGenConfig || !containerGenConfig.bypassYarnLock) {
pathToYarnLock = await cauldron.getPathToYarnLock(
napDescriptor,
constants.CONTAINER_YARN_KEY
)
} else {
log.debug(
'Bypassing yarn.lock usage as bypassYarnLock flag is set in Cauldron config'
)
}
const composite = await kax.task('Generating Composite').run(
Composite.generate({
baseComposite,
jsApiImplDependencies: jsApiImpls,
miniApps: miniapps,
outDir: outDir || createTmpDir(),
pathToYarnLock,
resolutions: compositeGenConfig && compositeGenConfig.resolutions,
})
)
await validateCompositeNativeDependencies(composite)
return composite
} catch (e) {
log.error(`runCauldronCompositeGen failed: ${e}`)
throw e
}