Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
})
if (!skipNpmCheck && !await utils.performPkgNameConflictCheck(packageName)) {
throw new Error('Aborting command')
}
const bridgeDep = await manifest.getNativeDependency(PackagePath.fromString('react-native-electrode-bridge'))
if (!bridgeDep) {
throw new Error('react-native-electrode-bridge not found in manifest. cannot infer version to use')
}
if (!bridgeDep.version) {
throw new Error('react-native-electrode-bridge version needs to be defined')
}
const reactNative = await manifest.getNativeDependency(PackagePath.fromString('react-native'))
if (!reactNative) {
throw new Error('react-native-electrode-bridge not found in manifest. cannot infer version to use')
}
log.info(`Generating ${apiName} API`)
await ApiGen.generateApi({
bridgeVersion: `${bridgeDep.version || ''}`,
reactNativeVersion: reactNative.version,
name: apiName,
npmScope: scope,
apiSchemaPath: schemaPath,
apiVersion: apiVersion,
apiAuthor: apiAuthor,
packageName: packageName
})
platformVersion = Platform.currentVersion,
}: {
manifestId?: string
name: string
platformVersion?: string
}) => {
if (manifestId) {
await logErrorAndExitIfNotSatisfied({
manifestIdExists: {
id: manifestId,
},
})
}
const plugin = await manifest.getNativeDependency(
PackagePath.fromString(name),
{ manifestId, platformVersion }
)
if (!plugin) {
return log.warn(
`No plugin named ${name} was found for platform version ${platformVersion}`
)
}
log.info(
`${chalk.yellow(plugin.basePath)}@${chalk.magenta(plugin.version || '?')}`
)
}
return _.map(codePushEntry.jsApiImpls, e => PackagePath.fromString(e))
}
const existingPkg = _.find(container[key], p =>
pkg.same(PackagePath.fromString(p), { ignoreVersion: true })
)
public getMiniAppsPackages(): Array<{
path: string
packagePath: PackagePath
}> {
const result: Array<{ path: string; packagePath: PackagePath }> = []
for (const key of Object.keys(this.packageJson.dependencies)) {
const ppValue = PackagePath.fromString(this.packageJson.dependencies[key])
const ppKey = PackagePath.fromString(key)
if (
ppValue.isFilePath ||
this.config.miniApps.some(p => p.basePath === ppValue.basePath)
) {
result.push({
packagePath: ppValue,
path: path.join(this.path, 'node_modules', key),
})
} else if (
this.config.miniApps.some(p => p.basePath === ppKey.basePath)
) {
result.push({
packagePath: PackagePath.fromString(
`${key}@${this.packageJson.dependencies[key]}`
}
const extraFile = await cauldron.getFile({ cauldronFilePath: extra })
extra = parseJsonFromStringOrFile(extraFile.toString())
}
await kax
.task(
`[${curIdx}/${pipeline.length}] Running Container ${pipelineEltType} ${pipelineEltPackage.basePath}`
)
.run(
isPublisher(pipelineEltPackage)
? publishContainer({
containerPath,
containerVersion,
extra,
platform,
publisher: PackagePath.fromString(pipelineElt.name),
url: pipelineElt.url,
})
: transformContainer({
containerPath,
extra,
platform,
transformer: PackagePath.fromString(pipelineElt.name),
})
)
}
}
const ppValue = PackagePath.fromString(this.packageJson.dependencies[key])
const ppKey = PackagePath.fromString(key)
if (
ppValue.isFilePath ||
this.config.miniApps.some(p => p.basePath === ppValue.basePath)
) {
result.push({
packagePath: ppValue,
path: path.join(this.path, 'node_modules', key),
})
} else if (
this.config.miniApps.some(p => p.basePath === ppKey.basePath)
) {
result.push({
packagePath: PackagePath.fromString(
`${key}@${this.packageJson.dependencies[key]}`
),
path: path.join(this.path, 'node_modules', key),
})
}
}
return result
}
return _.map(codePushEntry.miniapps, e => PackagePath.fromString(e))
}
.coerce('baseComposite', d => PackagePath.fromString(d))
.option('descriptor', {
const miniAppsDependencyPaths = _.map(miniapps, m => PackagePath.fromString(m))
for (const miniAppDependencyPath of miniAppsDependencyPaths) {