From c42a0dd9dd96686df66f97a9e6b8b3ded87f96a0 Mon Sep 17 00:00:00 2001 From: David East Date: Wed, 16 Aug 2017 06:26:10 -0600 Subject: [PATCH] chore(release): bump versions. verify package versions. --- package.json | 2 +- tools/build.js | 45 ++++++++++++++++++++++++++++++++++++--------- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index e088e49fc..77b6224cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angularfire2", - "version": "4.0.0-rc.2-next", + "version": "4.0.0-rc.2", "description": "The official library of Firebase and Angular.", "private": true, "scripts": { diff --git a/tools/build.js b/tools/build.js index 35cfc431f..cf8abe038 100644 --- a/tools/build.js +++ b/tools/build.js @@ -198,6 +198,32 @@ function measure(module, gzip = true) { return prettySize(bytes, gzip); } +/** + * Returns each version of each AngularFire module. + * This is used to help ensure each package has the same verison. + */ +function getVersions() { + const paths = [ + getDestPackageFile('core'), + getDestPackageFile('auth'), + getDestPackageFile('database') + ]; + return paths + .map(path => require(path)) + .map(pkgs => pkgs.version); +} + +function verifyVersions() { + const versions = getVersions(); + console.log(versions); + versions.map(version => { + if(version !== pkg.version) { + throw new Error('Versions mistmatch'); + process.exit(1); + } + }); +} + function buildModule(name, globals) { const es2015$ = spawnObservable(NGC, TSC_ARGS(name)); const esm$ = spawnObservable(NGC, TSC_ARGS(name, 'esm')); @@ -219,14 +245,7 @@ function buildModules(globals) { return Observable .forkJoin(core$, Observable.from(copyRootTest())) .switchMapTo(auth$) - .switchMapTo(db$) - .do(() => { - console.log(` - core.umd.js - ${measure('core')} - auth.umd.js - ${measure('auth')} - database.umd.js - ${measure('database')} - `); - }); + .switchMapTo(db$); } function buildLibrary(globals) { @@ -235,7 +254,15 @@ function buildLibrary(globals) { .forkJoin(modules$) .switchMap(() => Observable.from(createTestUmd(globals))) .switchMap(() => Observable.from(copyNpmIgnore())) - .switchMap(() => Observable.from(copyReadme())); + .switchMap(() => Observable.from(copyReadme())) + .do(() => { + console.log(` + core.umd.js - ${measure('core')} + auth.umd.js - ${measure('auth')} + database.umd.js - ${measure('database')} + `); + verifyVersions(); + }); } buildLibrary(GLOBALS).subscribe(