GeezerVison is showing github.com — Allow ng16 peer (#3361) · angular/angularfire@7a2402a
File treeExpand file treeCollapse file tree Open diff view settings compat/firestore/collection-group
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/workflows/codeql-analysis.yml +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 39 | 39 |
| 40 | 40 | # Initializes the CodeQL tools for scanning. | 41 | 41 | - name: Initialize CodeQL | 42 | | - uses: github/codeql-action/init@v1 | | 42 | + uses: github/codeql-action/init@v2 | 43 | 43 | with: | 44 | 44 | languages: ${{ matrix.language }} | 45 | 45 | # If you wish to specify custom queries, you can do so here or in a config file. | | 50 | 50 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | 51 | 51 | # If this step fails, then you should remove it and run the build manually (see below) | 52 | 52 | - name: Autobuild | 53 | | - uses: github/codeql-action/autobuild@v1 | | 53 | + uses: github/codeql-action/autobuild@v2 | 54 | 54 |
| 55 | 55 | # ℹ️ Command-line programs to run using the OS shell. | 56 | 56 | # 📚 https://git.io/JvXDl | | 64 | 64 | # make release | 65 | 65 |
| 66 | 66 | - name: Perform CodeQL Analysis | 67 | | - uses: github/codeql-action/analyze@v1 | | 67 | + uses: github/codeql-action/analyze@v2 |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/test.yml +76-208Lines changed: 76 additions & 208 deletions Large diffs are not rendered by default. Collapse file Copy file name to clipboardExpand all lines: README.md +1Lines changed: 1 addition & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -69,6 +69,7 @@ AngularFire doesn't follow Angular's versioning as Firebase also has breaking ch | 69 | 69 |
| 70 | 70 | | Angular | Firebase | AngularFire | | 71 | 71 | | --------|----------|--------------| | | 72 | +| 16 | 9 | ^7.6 | | 72 | 73 | | 15 | 9 | ^7.5 | | 73 | 74 | | 14 | 9 | ^7.4 | | 74 | 75 | | 13 | 9 | ^7.2 | | |
Collapse file Copy file name to clipboardExpand all lines: package.json +8-8Lines changed: 8 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | { | 2 | 2 | "name": "@angular/fire", | 3 | | - "version": "7.5.0", | | 3 | + "version": "7.6.0", | 4 | 4 | "description": "The official Angular library for Firebase.", | 5 | 5 | "private": true, | 6 | 6 | "scripts": { | 7 | 7 | "test": "npm run build:jasmine && npm run test:node && npm run test:chrome-headless", | 8 | | - "test:watch": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=true --browsers=Chrome\"", | 9 | | - "test:chrome": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=Chrome\"", | 10 | | - "test:firefox": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=Firefox\"", | 11 | | - "test:safari": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=SafariNative\"", | 12 | | - "test:chrome-headless": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=ChromeHeadless\"", | 13 | | - "test:firefox-headless": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=FirefoxHeadless\"", | | 8 | + "test:watch": "npx --yes firebase-tools emulators:exec --project=demo123 \"ng test --watch=true --browsers=Chrome\"", | | 9 | + "test:chrome": "npx --yes firebase-tools emulators:exec --project=demo123 \"ng test --watch=false --browsers=Chrome\"", | | 10 | + "test:firefox": "npx --yes firebase-tools emulators:exec --project=demo123 \"ng test --watch=false --browsers=Firefox\"", | | 11 | + "test:safari": "npx --yes firebase-tools emulators:exec --project=demo123 \"ng test --watch=false --browsers=SafariNative\"", | | 12 | + "test:chrome-headless": "npx --yes firebase-tools emulators:exec --project=demo123 \"ng test --watch=false --browsers=ChromeHeadless\"", | | 13 | + "test:firefox-headless": "npx --yes firebase-tools emulators:exec --project=demo123 \"ng test --watch=false --browsers=FirefoxHeadless\"", | 14 | 14 | "lint": "ng lint", | 15 | 15 | "test:node": "node -r tsconfig-paths/register ./dist/out-tsc/jasmine/tools/jasmine.js --input-type=commonjs", | 16 | 16 | "test:node-esm": "node -r tsconfig-paths/register ./dist/out-tsc/jasmine/tools/jasmine.mjs --input-type=commonjs", | | 57 | 57 | "firebase": "^9.8.2", | 58 | 58 | "firebase-admin": "^9.11.1", | 59 | 59 | "firebase-functions": "^3.6.0", | 60 | | - "firebase-tools": "^9.0.0", | | 60 | + "firebase-tools": "^12.2.1", | 61 | 61 | "fs-extra": "^8.0.1", | 62 | 62 | "fuzzy": "^0.1.3", | 63 | 63 | "husky": "^4.2.5", | |
Collapse file Copy file name to clipboardExpand all lines: src/compat/firestore/collection-group/collection-group.spec.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -353,6 +353,7 @@ describe('AngularFirestoreCollectionGroup', () => { | 353 | 353 |
| 354 | 354 | it('should be able to filter snapshotChanges() types - removed', done => { | 355 | 355 | (async () => { | | 356 | + | 356 | 357 | const ITEMS = 10; | 357 | 358 | const { ref, stocks, names } = await collectionHarness(afs, ITEMS); | 358 | 359 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/messaging/messaging.spec.ts +10-3Lines changed: 10 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -35,9 +35,16 @@ describe('Messaging', () => { | 35 | 35 | messaging = TestBed.inject(Messaging); | 36 | 36 | }); | 37 | 37 |
| 38 | | - it('should be injectable', () => { | 39 | | - expect(providedMessaging).toBeTruthy(); | 40 | | - expect(messaging).toEqual(providedMessaging); | | 38 | + it('should be injectable', async (done) => { | | 39 | + const supported = await isSupported(); | | 40 | + if (supported) { | | 41 | + expect(providedMessaging).toBeTruthy(); | | 42 | + expect(messaging).toEqual(providedMessaging); | | 43 | + } else { | | 44 | + expect(providedMessaging).toBeUndefined(); | | 45 | + expect(messaging).toBeNull(); | | 46 | + } | | 47 | + done(); | 41 | 48 | }); | 42 | 49 |
| 43 | 50 | }); | |
Collapse file Copy file name to clipboardExpand all lines: src/package.json +7-7Lines changed: 7 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 23 | 23 | "author": "angular,firebase", | 24 | 24 | "license": "MIT", | 25 | 25 | "peerDependencies": { | 26 | | - "@angular/common": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0", | 27 | | - "@angular/core": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0", | 28 | | - "@angular/platform-browser": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0", | 29 | | - "@angular/platform-browser-dynamic": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0", | | 26 | + "@angular/common": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0", | | 27 | + "@angular/core": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0", | | 28 | + "@angular/platform-browser": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0", | | 29 | + "@angular/platform-browser-dynamic": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0", | 30 | 30 | "rxjs": "~6.6.0 || ^7.0.0", | 31 | | - "firebase-tools": "^9.9.0 || ^10.0.0 || ^11.0.0" | | 31 | + "firebase-tools": "^9.9.0 || ^10.0.0 || ^11.0.0 || ^12.0.0" | 32 | 32 | }, | 33 | 33 | "peerDependenciesMeta": { | 34 | 34 | "firebase-tools": { "optional": true } | 35 | 35 | }, | 36 | 36 | "dependencies": { | 37 | 37 | "firebase": "^9.8.0", | 38 | 38 | "rxfire": "^6.0.0", | 39 | | - "@angular-devkit/schematics": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0", | 40 | | - "@schematics/angular": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0", | | 39 | + "@angular-devkit/schematics": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0", | | 40 | + "@schematics/angular": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0", | 41 | 41 | "tslib": "^2.0.0", | 42 | 42 | "fuzzy": "^0.1.3", | 43 | 43 | "inquirer-autocomplete-prompt": "^1.0.1", | |
Collapse file Copy file name to clipboardExpand all lines: src/schematics/deploy/actions.ts +36-27Lines changed: 36 additions & 27 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -5,7 +5,7 @@ import { copySync, removeSync } from 'fs-extra'; | 5 | 5 | import { dirname, join } from 'path'; | 6 | 6 | import { execSync, spawn, SpawnOptionsWithoutStdio } from 'child_process'; | 7 | 7 | import { defaultFunction, functionGen2, defaultPackage, DEFAULT_FUNCTION_NAME, dockerfile } from './functions-templates'; | 8 | | -import { satisfies } from 'semver'; | | 8 | +import { satisfies, lt } from 'semver'; | 9 | 9 | import open from 'open'; | 10 | 10 | import { SchematicsException } from '@angular-devkit/schematics'; | 11 | 11 | import { firebaseFunctionsDependencies } from '../versions.json'; | @@ -79,7 +79,7 @@ const deployToHosting = async ( | 79 | 79 | await firebaseTools.serve({ | 80 | 80 | port: DEFAULT_EMULATOR_PORT, | 81 | 81 | host: DEFAULT_EMULATOR_HOST, | 82 | | - targets: [`hosting:${siteTarget}`], | | 82 | + only: `hosting:${siteTarget}`, | 83 | 83 | nonInteractive: true, | 84 | 84 | projectRoot: workspaceRoot, | 85 | 85 | }); | @@ -92,6 +92,8 @@ const deployToHosting = async ( | 92 | 92 |
| 93 | 93 | if (!deployProject) { return; } | 94 | 94 |
| | 95 | + process.env.FIREBASE_FRAMEWORKS_SKIP_BUILD = 'true'; | | 96 | + | 95 | 97 | } | 96 | 98 |
| 97 | 99 | return await firebaseTools.deploy({ | @@ -394,37 +396,44 @@ export default async function deploy( | 394 | 396 | console.log(`Logged into Firebase as ${user.email}.`); | 395 | 397 | } | 396 | 398 |
| 397 | | - if (prerenderBuildTarget) { | | 399 | + if (options.version && options.version >= 2) { | | 400 | + if (lt(firebaseTools.cli.version(), '12.2')) { | | 401 | + throw new SchematicsException('firebase-tools version 12.2+ is required.'); | | 402 | + } | | 403 | + process.env.FIREBASE_FRAMEWORK_BUILD_TARGET = (prerenderBuildTarget || serverBuildTarget || staticBuildTarget).name; | | 404 | + } else { | | 405 | + if (prerenderBuildTarget) { | 398 | 406 |
| 399 | | - const run = await context.scheduleTarget( | 400 | | - targetFromTargetString(prerenderBuildTarget.name), | 401 | | - prerenderBuildTarget.options | 402 | | - ); | 403 | | - await run.result; | | 407 | + const run = await context.scheduleTarget( | | 408 | + targetFromTargetString(prerenderBuildTarget.name), | | 409 | + prerenderBuildTarget.options | | 410 | + ); | | 411 | + await run.result; | 404 | 412 |
| 405 | | - } else { | | 413 | + } else { | 406 | 414 |
| 407 | | - if (!context.target) { | 408 | | - throw new Error('Cannot execute the build target'); | 409 | | - } | | 415 | + if (!context.target) { | | 416 | + throw new Error('Cannot execute the build target'); | | 417 | + } | 410 | 418 |
| 411 | | - context.logger.info(`📦 Building "${context.target.project}"`); | | 419 | + context.logger.info(`📦 Building "${context.target.project}"`); | 412 | 420 |
| 413 | | - const builders = [ | 414 | | - context.scheduleTarget( | 415 | | - targetFromTargetString(staticBuildTarget.name), | 416 | | - staticBuildTarget.options | 417 | | - ).then(run => run.result) | 418 | | - ]; | | 421 | + const builders = [ | | 422 | + context.scheduleTarget( | | 423 | + targetFromTargetString(staticBuildTarget.name), | | 424 | + staticBuildTarget.options | | 425 | + ).then(run => run.result) | | 426 | + ]; | 419 | 427 |
| 420 | | - if (serverBuildTarget) { | 421 | | - builders.push(context.scheduleTarget( | 422 | | - targetFromTargetString(serverBuildTarget.name), | 423 | | - serverBuildTarget.options | 424 | | - ).then(run => run.result)); | 425 | | - } | | 428 | + if (serverBuildTarget) { | | 429 | + builders.push(context.scheduleTarget( | | 430 | + targetFromTargetString(serverBuildTarget.name), | | 431 | + serverBuildTarget.options | | 432 | + ).then(run => run.result)); | | 433 | + } | 426 | 434 |
| 427 | | - await Promise.all(builders); | | 435 | + await Promise.all(builders); | | 436 | + } | 428 | 437 | } | 429 | 438 |
| 430 | 439 | try { | @@ -457,7 +466,7 @@ export default async function deploy( | 457 | 466 |
| 458 | 467 | firebaseTools.logger.logger.add(logger); | 459 | 468 |
| 460 | | - if (serverBuildTarget) { | | 469 | + if ((!options.version || options.version < 2) && serverBuildTarget) { | 461 | 470 | if (options.ssr === 'cloud-run') { | 462 | 471 | await deployToCloudRun( | 463 | 472 | firebaseTools, | |
Collapse file Copy file name to clipboardExpand all lines: src/schematics/firebaseTools.ts +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -10,19 +10,20 @@ declare global { | 10 | 10 | export const getFirebaseTools = () => globalThis.firebaseTools ? | 11 | 11 | Promise.resolve(globalThis.firebaseTools) : | 12 | 12 | new Promise<FirebaseTools>((resolve, reject) => { | | 13 | + process.env.FIREBASE_CLI_EXPERIMENTS ||= 'webframeworks'; | 13 | 14 | try { | 14 | 15 | resolve(require('firebase-tools')); | 15 | 16 | } catch (e) { | 16 | 17 | try { | 17 | | - const root = execSync('npm root -g').toString().trim(); | | 18 | + const root = execSync('npm root --location=global').toString().trim(); | 18 | 19 | resolve(require(`${root}/firebase-tools`)); | 19 | 20 | } catch (e) { | 20 | 21 | const spinner = ora({ | 21 | 22 | text: `Installing firebase-tools...`, | 22 | 23 | // Workaround for https://github.com/sindresorhus/ora/issues/136. | 23 | 24 | discardStdin: process.platform !== 'win32', | 24 | 25 | }).start(); | 25 | | - spawn('npm', ['i', '-g', 'firebase-tools'], { | | 26 | + spawn('npm', ['i', '--location=global', 'firebase-tools'], { | 26 | 27 | stdio: 'pipe', | 27 | 28 | shell: true, | 28 | 29 | }).on('close', (code) => { | |
Collapse file Copy file name to clipboardExpand all lines: src/schematics/interfaces.ts +7-5Lines changed: 7 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -26,7 +26,7 @@ export const featureOptions = [ | 26 | 26 | { name: 'Remote Config', value: FEATURES.RemoteConfig }, | 27 | 27 | ]; | 28 | 28 |
| 29 | | -export const enum PROJECT_TYPE { Static, CloudFunctions, CloudRun } | | 29 | +export const enum PROJECT_TYPE { Static, CloudFunctions, CloudRun, WebFrameworks } | 30 | 30 |
| 31 | 31 | export interface NgAddOptions { | 32 | 32 | firebaseProject: string; | @@ -39,10 +39,11 @@ export interface NgAddNormalizedOptions { | 39 | 39 | firebaseApp: FirebaseApp|undefined; | 40 | 40 | firebaseHostingSite: FirebaseHostingSite|undefined; | 41 | 41 | sdkConfig: Record<string, string>|undefined; | 42 | | - prerender: boolean; | | 42 | + prerender: boolean|undefined; | 43 | 43 | browserTarget: string|undefined; | 44 | 44 | serverTarget: string|undefined; | 45 | 45 | prerenderTarget: string|undefined; | | 46 | + ssrRegion: string|undefined; | 46 | 47 | } | 47 | 48 |
| 48 | 49 | export interface DeployOptions { | @@ -139,9 +140,9 @@ export interface FirebaseHostingRewrite { | 139 | 140 |
| 140 | 141 | export interface FirebaseHostingConfig { | 141 | 142 | public?: string; | 142 | | - ignore: string[]; | 143 | | - target: string; | 144 | | - rewrites: FirebaseHostingRewrite[]; | | 143 | + ignore?: string[]; | | 144 | + target?: string; | | 145 | + rewrites?: FirebaseHostingRewrite[]; | 145 | 146 | } | 146 | 147 |
| 147 | 148 | export interface FirebaseFunctionsConfig { [key: string]: any; } | @@ -179,6 +180,7 @@ export interface DeployBuilderSchema { | 179 | 180 | cloudRunOptions?: Partial<CloudRunOptions>; | 180 | 181 | outputPath?: string; | 181 | 182 | CF3v2?: boolean; | | 183 | + version?: number; | 182 | 184 | } | 183 | 185 |
| 184 | 186 | export interface CloudRunOptions { | |
|