Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
files.forEach(file => {
log.info({ fileName: file.sourceFile.fileName }, 'Generate module')
file.generate(ctx)
})
}
export function compileFolder(target: string = process.cwd()): FolderCompilationResult {
log.info(`Using TypeScript ${ts.version}`)
let packageFilePath: string | undefined
let configFilePath: string | undefined
if (target.includes('package.json')) {
packageFilePath = target
} else if (target.includes('.json')) {
configFilePath = target
} else {
const maybeTsconfig = path.join(target, 'tsconfig.json')
if (fs.existsSync(maybeTsconfig)) {
configFilePath = maybeTsconfig
}
const maybePackageJson = path.join(target, 'package.json')
if (fs.existsSync(maybePackageJson)) {
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)
})