Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
},
ts.sys,
'.',
undefined,
packageFilePath
)
}
}
if (!config) {
throw new Error('Nothing to compile')
}
if (config.errors.length > 0) {
log.error({ errors: config.errors }, `Cannot build project, tsconfig.json has errors`)
throw new Error(``)
}
log.trace({ fileNames: config.fileNames }, 'Initial project files')
const pkg = Package.fromPath(path.join(target, 'package.js'))
const result = compile(
config.fileNames,
Object.assign({}, config.options, {
target: ts.ScriptTarget.Latest,
allowJs: true,
noEmit: true
})
)
return {
.forEach(pkg => {
const packageInfo = {
name: pkg.manifest.name,
version: pkg.manifest.version,
manifest: pkg.manifestFilePath,
folder: pkg.folderPath
}
if (!pkg.manifest.name) {
log.error(packageInfo, 'Package has no name, skipping')
return
}
if (!pkg.manifest.version) {
log.error(packageInfo, 'Package has no version, skipping')
return
}
log.info(packageInfo, 'Generate package')
pkg.generate(context)
})
.forEach(pkg => {
const packageInfo = {
name: pkg.manifest.name,
version: pkg.manifest.version,
manifest: pkg.manifestFilePath,
folder: pkg.folderPath
}
if (!pkg.manifest.name) {
log.error(packageInfo, 'Package has no name, skipping')
return
}
if (!pkg.manifest.version) {
log.error(packageInfo, 'Package has no version, skipping')
return
}
log.info(packageInfo, 'Generate package')
pkg.generate(context)
})