From c54b83ba58ba963f9e240055c46440cb4244b398 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Fri, 29 Sep 2017 00:31:55 +0200 Subject: [PATCH] chore: fix validate release task (#7359) Updates the `gulp validate-release` task to work with the current package structure. --- tools/gulp/tasks/validate-release.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/gulp/tasks/validate-release.ts b/tools/gulp/tasks/validate-release.ts index c538b0ed75c..1c8a266865a 100644 --- a/tools/gulp/tasks/validate-release.ts +++ b/tools/gulp/tasks/validate-release.ts @@ -37,7 +37,17 @@ task('validate-release:check-bundles', () => { /** Task that validates the given release package before releasing. */ function checkReleasePackage(packageName: string): string[] { - const bundlePath = join(releasesDir, packageName, '@angular', `${packageName}.js`); + return glob(join(releasesDir, packageName, 'esm2015/*.js')) + .reduce((failures: string[], bundlePath: string) => { + return failures.concat(checkEs2015ReleaseBundle(packageName, bundlePath)); + }, []); +} + +/** + * Checks an ES2015 bundle inside of a release package. Secondary entry-point bundles will be + * checked as well. + */ +function checkEs2015ReleaseBundle(packageName: string, bundlePath: string): string[] { const bundleContent = readFileSync(bundlePath, 'utf8'); let failures: string[] = [];