From c0f61dcb839895d0ac7d35a6814dd0b122d43cdf Mon Sep 17 00:00:00 2001 From: Hans Date: Mon, 20 Aug 2018 10:39:20 -0700 Subject: [PATCH] build: throw an exception when a package is not found in monorepo --- lib/packages.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/packages.ts b/lib/packages.ts index 268ced9e45..d418943173 100644 --- a/lib/packages.ts +++ b/lib/packages.ts @@ -190,6 +190,12 @@ export const packages: PackageMap = // Only build the entry if there's a package name. return packages; } + if (!(name in monorepoPackages)) { + throw new Error( + `Package ${name} found in ${JSON.stringify(pkg.root)}, not found in .monorepo.json.`, + ); + } + const bin: {[name: string]: string} = {}; Object.keys(packageJson['bin'] || {}).forEach(binName => { let p = path.resolve(pkg.root, packageJson['bin'][binName]);