@@ -198,6 +198,32 @@ function measure(module, gzip = true) {
198198 return prettySize ( bytes , gzip ) ;
199199}
200200
201+ /**
202+ * Returns each version of each AngularFire module.
203+ * This is used to help ensure each package has the same verison.
204+ */
205+ function getVersions ( ) {
206+ const paths = [
207+ getDestPackageFile ( 'core' ) ,
208+ getDestPackageFile ( 'auth' ) ,
209+ getDestPackageFile ( 'database' )
210+ ] ;
211+ return paths
212+ . map ( path => require ( path ) )
213+ . map ( pkgs => pkgs . version ) ;
214+ }
215+
216+ function verifyVersions ( ) {
217+ const versions = getVersions ( ) ;
218+ console . log ( versions ) ;
219+ versions . map ( version => {
220+ if ( version !== pkg . version ) {
221+ throw new Error ( 'Versions mistmatch' ) ;
222+ process . exit ( 1 ) ;
223+ }
224+ } ) ;
225+ }
226+
201227function buildModule ( name , globals ) {
202228 const es2015$ = spawnObservable ( NGC , TSC_ARGS ( name ) ) ;
203229 const esm$ = spawnObservable ( NGC , TSC_ARGS ( name , 'esm' ) ) ;
@@ -219,14 +245,7 @@ function buildModules(globals) {
219245 return Observable
220246 . forkJoin ( core$ , Observable . from ( copyRootTest ( ) ) )
221247 . switchMapTo ( auth$ )
222- . switchMapTo ( db$ )
223- . do ( ( ) => {
224- console . log ( `
225- core.umd.js - ${ measure ( 'core' ) }
226- auth.umd.js - ${ measure ( 'auth' ) }
227- database.umd.js - ${ measure ( 'database' ) }
228- ` ) ;
229- } ) ;
248+ . switchMapTo ( db$ ) ;
230249}
231250
232251function buildLibrary ( globals ) {
@@ -235,7 +254,15 @@ function buildLibrary(globals) {
235254 . forkJoin ( modules$ )
236255 . switchMap ( ( ) => Observable . from ( createTestUmd ( globals ) ) )
237256 . switchMap ( ( ) => Observable . from ( copyNpmIgnore ( ) ) )
238- . switchMap ( ( ) => Observable . from ( copyReadme ( ) ) ) ;
257+ . switchMap ( ( ) => Observable . from ( copyReadme ( ) ) )
258+ . do ( ( ) => {
259+ console . log ( `
260+ core.umd.js - ${ measure ( 'core' ) }
261+ auth.umd.js - ${ measure ( 'auth' ) }
262+ database.umd.js - ${ measure ( 'database' ) }
263+ ` ) ;
264+ verifyVersions ( ) ;
265+ } ) ;
239266}
240267
241268buildLibrary ( GLOBALS ) . subscribe (
0 commit comments