@@ -198,6 +198,32 @@ function measure(module, gzip = true) {
198
198
return prettySize ( bytes , gzip ) ;
199
199
}
200
200
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
+
201
227
function buildModule ( name , globals ) {
202
228
const es2015$ = spawnObservable ( NGC , TSC_ARGS ( name ) ) ;
203
229
const esm$ = spawnObservable ( NGC , TSC_ARGS ( name , 'esm' ) ) ;
@@ -219,14 +245,7 @@ function buildModules(globals) {
219
245
return Observable
220
246
. forkJoin ( core$ , Observable . from ( copyRootTest ( ) ) )
221
247
. 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$ ) ;
230
249
}
231
250
232
251
function buildLibrary ( globals ) {
@@ -235,7 +254,15 @@ function buildLibrary(globals) {
235
254
. forkJoin ( modules$ )
236
255
. switchMap ( ( ) => Observable . from ( createTestUmd ( globals ) ) )
237
256
. 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
+ } ) ;
239
266
}
240
267
241
268
buildLibrary ( GLOBALS ) . subscribe (
0 commit comments