File tree 6 files changed +27
-3
lines changed
6 files changed +27
-3
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "deno.codeLens.references" : true ,
3
+ "deno.enablePaths" : [
4
+ " ./scripts"
5
+ ],
6
+ "deno.enable" : true
7
+ }
Original file line number Diff line number Diff line change 15
15
"scripts" : {
16
16
"test" : " vitest run" ,
17
17
"test-with-emulator" : " firebase emulators:exec --project project12345 'vitest run'" ,
18
- "build" : " run-p build:*" ,
18
+ "build" : " deno run --allow-read --allow-write scripts/version.ts && run-p build:*" ,
19
19
"build:main" : " tsc -p tsconfig.main.json" ,
20
20
"build:module" : " tsc -p tsconfig.module.json" ,
21
21
"start-firebase-emulator" : " firebase emulators:start --project project12345" ,
Original file line number Diff line number Diff line change
1
+ const decoder = new TextDecoder ( 'utf-8' ) ;
2
+ const encoder = new TextEncoder ( ) ;
3
+
4
+ async function updateVersion ( ) {
5
+ const packageJsonText = decoder . decode ( await Deno . readFile ( './package.json' ) ) ;
6
+ const packageJson = JSON . parse ( packageJsonText ) ;
7
+ const version = packageJson . version ;
8
+
9
+ const versionTsContent = `export const version = '${ version } ';\n` ;
10
+ await Deno . writeFile ( 'src/version.ts' , encoder . encode ( versionTsContent ) ) ;
11
+ }
12
+
13
+ updateVersion ( ) . catch ( error => {
14
+ console . error ( 'failed to update version.ts:' , error ) ;
15
+ Deno . exit ( 1 ) ;
16
+ } ) ;
Original file line number Diff line number Diff line change 1
- import { version } from '../package.json' ;
2
1
import type { ApiSettings } from './api-requests' ;
3
2
import type { Credential } from './credential' ;
4
3
import { useEmulator , type EmulatorEnv } from './emulator' ;
5
4
import { AppErrorCodes , FirebaseAppError } from './errors' ;
5
+ import { version } from './version' ;
6
6
7
7
/**
8
8
* Specifies how failing HTTP requests should be retried.
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ export class UrlKeyFetcher implements KeyFetcher {
63
63
64
64
// store the public keys cache in the KV store.
65
65
const maxAge = parseMaxAge ( cacheControlHeader ) ;
66
- if ( ! isNaN ( maxAge ) ) {
66
+ if ( ! isNaN ( maxAge ) && maxAge > 0 ) {
67
67
await this . keyStorer . put ( JSON . stringify ( publicKeys . keys ) , maxAge ) ;
68
68
}
69
69
Original file line number Diff line number Diff line change
1
+ export const version = '1.2.0' ;
You can’t perform that action at this time.
0 commit comments