From ca4665bcbe6479612745bea10f01bee810df9d0e Mon Sep 17 00:00:00 2001 From: robertIsaac Date: Tue, 29 Aug 2023 11:58:37 +0300 Subject: [PATCH 1/2] add eslint --- angular.json | 20 +- eslint.config.js | 109 ++ package.json | 9 +- src/analytics/analytics.module.ts | 10 +- src/analytics/analytics.spec.ts | 4 +- src/analytics/analytics.ts | 6 +- src/analytics/firebase.ts | 4 +- src/analytics/screen-tracking.service.ts | 18 +- src/analytics/user-tracking.service.ts | 7 +- src/app-check/app-check.module.ts | 13 +- src/app-check/app-check.spec.ts | 4 +- src/app-check/app-check.ts | 4 +- src/app/app.module.ts | 10 +- src/app/app.spec.ts | 2 +- src/app/app.ts | 3 +- src/auth-guard/auth-guard.module.ts | 4 +- src/auth-guard/auth-guard.spec.ts | 14 +- src/auth-guard/auth-guard.ts | 7 +- src/auth/auth.module.ts | 12 +- src/auth/auth.spec.ts | 4 +- src/auth/auth.ts | 6 +- src/auth/rxfire.ts | 4 +- src/compat/analytics/analytics.module.ts | 11 +- src/compat/analytics/analytics.spec.ts | 4 +- src/compat/analytics/analytics.ts | 22 +- .../analytics/screen-tracking.service.ts | 10 +- src/compat/analytics/user-tracking.service.ts | 10 +- src/compat/angularfire2.spec.ts | 28 +- src/compat/auth-guard/auth-guard.module.ts | 4 +- src/compat/auth-guard/auth-guard.spec.ts | 8 +- src/compat/auth-guard/auth-guard.ts | 7 +- src/compat/auth/auth.module.ts | 4 +- src/compat/auth/auth.spec.ts | 7 +- src/compat/auth/auth.ts | 21 +- src/compat/cache.ts | 1 + src/compat/database/database.module.ts | 4 +- src/compat/database/database.spec.ts | 12 +- src/compat/database/database.ts | 28 +- src/compat/database/interfaces.ts | 4 +- src/compat/database/list/audit-trail.spec.ts | 10 +- src/compat/database/list/audit-trail.ts | 6 +- src/compat/database/list/changes.spec.ts | 10 +- src/compat/database/list/changes.ts | 11 +- src/compat/database/list/create-reference.ts | 20 +- src/compat/database/list/data-operation.ts | 2 +- .../database/list/snapshot-changes.spec.ts | 16 +- src/compat/database/list/snapshot-changes.ts | 2 +- .../database/list/state-changes.spec.ts | 10 +- src/compat/database/list/state-changes.ts | 2 +- .../database/object/create-reference.ts | 4 +- .../database/object/snapshot-changes.ts | 2 +- .../database/observable/fromRef.spec.ts | 21 +- src/compat/database/observable/fromRef.ts | 7 +- src/compat/database/utils.spec.ts | 2 +- src/compat/database/utils.ts | 2 +- src/compat/firebase.app.module.ts | 12 +- src/compat/firebase.app.ts | 2 +- .../collection-group/collection-group.spec.ts | 37 +- .../collection-group/collection-group.ts | 15 +- src/compat/firestore/collection/changes.ts | 6 +- .../firestore/collection/collection.spec.ts | 38 +- src/compat/firestore/collection/collection.ts | 19 +- .../firestore/document/document.spec.ts | 20 +- src/compat/firestore/document/document.ts | 12 +- src/compat/firestore/firestore.module.ts | 6 +- src/compat/firestore/firestore.spec.ts | 15 +- src/compat/firestore/firestore.ts | 51 +- src/compat/firestore/interfaces.ts | 4 +- src/compat/firestore/observable/fromRef.ts | 8 +- src/compat/firestore/utils.spec.ts | 5 +- src/compat/functions/functions.module.ts | 4 +- src/compat/functions/functions.spec.ts | 8 +- src/compat/functions/functions.ts | 13 +- src/compat/messaging/messaging.module.ts | 4 +- src/compat/messaging/messaging.spec.ts | 6 +- src/compat/messaging/messaging.ts | 20 +- src/compat/performance/performance.module.ts | 7 +- src/compat/performance/performance.service.ts | 1 + src/compat/performance/performance.spec.ts | 6 +- src/compat/performance/performance.ts | 36 +- src/compat/proxy.ts | 11 +- .../remote-config/remote-config.module.ts | 4 +- .../remote-config/remote-config.spec.ts | 6 +- src/compat/remote-config/remote-config.ts | 70 +- src/compat/storage/observable/fromTask.ts | 1 - src/compat/storage/pipes/storageUrl.pipe.ts | 2 +- src/compat/storage/ref.ts | 6 +- src/compat/storage/storage.module.ts | 4 +- src/compat/storage/storage.spec.ts | 48 +- src/compat/storage/storage.ts | 14 +- src/compat/storage/task.ts | 4 +- src/core.ts | 10 +- src/database/database.module.ts | 12 +- src/database/database.spec.ts | 4 +- src/database/database.ts | 6 +- src/database/rxfire.ts | 6 +- src/firestore/firestore.module.ts | 12 +- src/firestore/firestore.spec.ts | 8 +- src/firestore/firestore.ts | 6 +- src/firestore/lite/lite.module.ts | 10 +- src/firestore/lite/lite.spec.ts | 4 +- src/firestore/lite/lite.ts | 6 +- src/firestore/lite/rxfire.ts | 4 +- src/firestore/rxfire.ts | 12 +- src/functions/functions.module.ts | 12 +- src/functions/functions.spec.ts | 4 +- src/functions/functions.ts | 6 +- src/messaging/messaging.module.ts | 10 +- src/messaging/messaging.spec.ts | 6 +- src/messaging/messaging.ts | 6 +- src/performance/performance.module.ts | 16 +- src/performance/performance.spec.ts | 5 +- src/performance/performance.ts | 6 +- src/performance/rxfire.ts | 4 +- .../is-remote-config-supported-factory.ts | 2 +- src/remote-config/remote-config.module.ts | 10 +- src/remote-config/remote-config.spec.ts | 4 +- src/remote-config/remote-config.ts | 6 +- src/remote-config/rxfire.ts | 8 +- src/schematics/add/index.ts | 4 +- src/schematics/common.ts | 10 +- src/schematics/deploy/actions.jasmine.ts | 9 +- src/schematics/deploy/actions.ts | 39 +- src/schematics/deploy/builder.ts | 4 +- src/schematics/deploy/functions-templates.ts | 4 +- src/schematics/firebaseTools.ts | 5 +- src/schematics/interfaces.ts | 12 +- src/schematics/ng-add.jasmine.ts | 221 ++-- src/schematics/setup/index.ts | 28 +- src/schematics/setup/prompts.ts | 32 +- src/schematics/update/index.ts | 2 +- src/schematics/update/v7/index.ts | 6 +- src/schematics/utils.ts | 17 +- src/storage/storage.module.ts | 12 +- src/storage/storage.spec.ts | 4 +- src/storage/storage.ts | 6 +- src/zones.ts | 18 +- tslint.json | 158 --- yarn.lock | 941 +++++++++++++++++- 139 files changed, 1797 insertions(+), 1051 deletions(-) create mode 100644 eslint.config.js delete mode 100644 tslint.json diff --git a/angular.json b/angular.json index a2b35016b..2f387906e 100644 --- a/angular.json +++ b/angular.json @@ -27,18 +27,12 @@ "karmaConfig": "karma.conf.js" } }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "tsconfig.json", - "tsconfig.spec.json" - ], - "exclude": [ - "**/node_modules/**" - ] - } - } + "lint": { + "builder": "@angular-eslint/builder:lint", + "options": { + "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"] + } + } } } }, @@ -46,4 +40,4 @@ "packageManager": "yarn", "analytics": "86795b8f-9036-4a53-929c-a7303453d677" } -} \ No newline at end of file +} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 000000000..cada7df03 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,109 @@ +const tsParser = require('@typescript-eslint/parser'); +const js = require('@eslint/js'); +const globals = require('globals'); +const ts = require('@typescript-eslint/eslint-plugin'); +const ng = require('@angular-eslint/eslint-plugin'); +const esImport = require('eslint-plugin-import'); + +module.exports = [ + { + files: ['**/*.ts'], + plugins: { + '@typescript-eslint': ts, + '@angular-eslint': ng, + import: esImport, + }, + languageOptions: { + parser: tsParser, + globals: { + ...globals.browser, + }, + parserOptions: { + project: ['tsconfig.build.json', 'tsconfig.json', 'tsconfig.spec.json'], + }, + }, + rules: { + ...js.configs.recommended.rules, + ...ts.configs['recommended-requiring-type-checking'].rules, + ...ts.configs['stylistic-type-checked'].rules, + ...ng.configs.recommended.rules, + ...esImport.configs.errors.rules, + // eslint/js rules + 'no-undef': 'off', + 'no-redeclare': 'off', + 'prefer-arrow-callback': 'error', + 'curly': 'error', + 'no-dupe-class-members': 'off', + "no-restricted-imports": ["error", "rxjs/Rx"], + "no-console": ["error", {allow: ['log', 'error', 'warn']}], + 'sort-imports': [ + 'error', + { + ignoreDeclarationSort: true, + }, + ], + // @typescript-eslint rules + '@typescript-eslint/prefer-nullish-coalescing': 'off', // require `strictNullChecks` + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unsafe-declaration-merging': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/no-floating-promises': 'off', + '@typescript-eslint/no-unnecessary-type-assertion': 'off', + '@typescript-eslint/no-redundant-type-constituents': 'off', // causing pipeline error in src/compat/firestore/utils.spec.ts + '@typescript-eslint/no-non-null-assertion': 'error', + "@typescript-eslint/member-ordering": ["error", { + "default": [ + "static-field", + "instance-field", + "static-method", + "instance-method" + ] + }], + '@typescript-eslint/no-unused-vars': [ + 'error', {args: "after-used", "argsIgnorePattern": "^_"} + ], + // @angular-eslint rules + '@angular-eslint/directive-selector': [ + 'error', + { + type: 'attribute', + prefix: 'app', + style: 'camelCase', + }, + ], + '@angular-eslint/component-selector': [ + 'error', + { + type: 'element', + prefix: 'app', + style: 'kebab-case', + }, + ], + // import rules + 'import/no-unresolved': 'off', + 'import/namespace': 'off', + 'import/default': 'off', + 'import/export': 'off', + 'import/newline-after-import': 'error', + 'import/order': [ + 'error', + { + alphabetize: {order: 'asc'}, + "newlines-between": "never" + }, + ], + }, + }, + { + files: ['**/*.spec.ts'], + languageOptions: { + globals: { + ...globals.jasmine, + }, + }, + }, +]; diff --git a/package.json b/package.json index a0c6d9ff4..dedab203b 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "test:safari": "npx --yes firebase-tools emulators:exec --project=demo123 \"ng test --watch=false --browsers=SafariNative\"", "test:chrome-headless": "npx --yes firebase-tools emulators:exec --project=demo123 \"ng test --watch=false --browsers=ChromeHeadless\"", "test:firefox-headless": "npx --yes firebase-tools emulators:exec --project=demo123 \"ng test --watch=false --browsers=FirefoxHeadless\"", - "lint": "echo 'todo: fix tslint -> eslint'", + "lint": "ng lint", "test:node": "node -r tsconfig-paths/register ./dist/out-tsc/jasmine/tools/jasmine.mjs --input-type=commonjs", "test:node-esm": "node -r tsconfig-paths/register ./dist/out-tsc/jasmine/tools/jasmine.mjs", "test:typings": "node ./tools/run-typings-test.js", @@ -77,6 +77,8 @@ }, "devDependencies": { "@angular-devkit/build-angular": "^16.0.0", + "@angular-eslint/builder": "^16.1.1", + "@angular-eslint/eslint-plugin": "^16.1.1", "@angular-eslint/schematics": "16.0.3", "@angular/animations": "~16.0.0", "@angular/cli": "^16.0.0", @@ -92,12 +94,17 @@ "@types/semver": "^7.1.0", "@types/triple-beam": "^1.3.0", "@types/winston": "^2.4.4", + "@typescript-eslint/eslint-plugin": "^6.5.0", + "@typescript-eslint/parser": "^6.5.0", "codelyzer": "^6.0.0", "concurrently": "^2.2.0", "conventional-changelog-cli": "^1.2.0", "cross-spawn": "^7.0.3", + "eslint": "^8.48.0", + "eslint-plugin-import": "^2.28.1", "file-loader": "^6.2.0", "firebase-functions-test": "^0.2.2", + "globals": "^13.21.0", "globalthis": "^1.0.1", "gzip-size": "^5.1.1", "jasmine": "^5.0.0", diff --git a/src/analytics/analytics.module.ts b/src/analytics/analytics.module.ts index 5020fa70a..d688a44b5 100644 --- a/src/analytics/analytics.module.ts +++ b/src/analytics/analytics.module.ts @@ -1,12 +1,12 @@ -import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, APP_INITIALIZER, Injector } from '@angular/core'; +import { APP_INITIALIZER, InjectionToken, Injector, ModuleWithProviders, NgModule, NgZone, Optional } from '@angular/core'; +import { VERSION, ɵAngularFireSchedulers, ɵgetDefaultInstanceOf } from '@angular/fire'; +import { FirebaseApp, FirebaseApps } from '@angular/fire/app'; import { Analytics as FirebaseAnalytics } from 'firebase/analytics'; -import { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION } from '@angular/fire'; -import { Analytics, ANALYTICS_PROVIDER_NAME, AnalyticsInstances } from './analytics'; -import { FirebaseApps, FirebaseApp } from '@angular/fire/app'; import { registerVersion } from 'firebase/app'; +import { ANALYTICS_PROVIDER_NAME, Analytics, AnalyticsInstances } from './analytics'; +import { isAnalyticsSupportedFactory } from './is-analytics-supported-factory'; import { ScreenTrackingService } from './screen-tracking.service'; import { UserTrackingService } from './user-tracking.service'; -import { isAnalyticsSupportedFactory } from './is-analytics-supported-factory'; export const PROVIDED_ANALYTICS_INSTANCES = new InjectionToken('angularfire2.analytics-instances'); diff --git a/src/analytics/analytics.spec.ts b/src/analytics/analytics.spec.ts index a33706283..d27f9886e 100644 --- a/src/analytics/analytics.spec.ts +++ b/src/analytics/analytics.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { FirebaseApp, provideFirebaseApp, getApp, initializeApp, deleteApp } from '@angular/fire/app'; -import { Analytics, provideAnalytics, getAnalytics, isSupported } from '@angular/fire/analytics'; +import { Analytics, getAnalytics, isSupported, provideAnalytics } from '@angular/fire/analytics'; +import { FirebaseApp, getApp, initializeApp, provideFirebaseApp } from '@angular/fire/app'; import { COMMON_CONFIG_TOO } from '../test-config'; import { rando } from '../utils'; diff --git a/src/analytics/analytics.ts b/src/analytics/analytics.ts index ee5a584f5..3aabbe1a4 100644 --- a/src/analytics/analytics.ts +++ b/src/analytics/analytics.ts @@ -1,10 +1,10 @@ -import { Analytics as FirebaseAnalytics } from 'firebase/analytics'; import { ɵgetAllInstancesOf } from '@angular/fire'; +import { Analytics as FirebaseAnalytics } from 'firebase/analytics'; import { from, timer } from 'rxjs'; import { concatMap, distinct } from 'rxjs/operators'; // see notes in core/firebase.app.module.ts for why we're building the class like this -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Analytics extends FirebaseAnalytics {} export class Analytics { @@ -15,7 +15,7 @@ export class Analytics { export const ANALYTICS_PROVIDER_NAME = 'analytics'; -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface AnalyticsInstances extends Array {} export class AnalyticsInstances { diff --git a/src/analytics/firebase.ts b/src/analytics/firebase.ts index 0eea5bf5b..c1bfdfd56 100644 --- a/src/analytics/firebase.ts +++ b/src/analytics/firebase.ts @@ -7,9 +7,9 @@ import { logEvent as _logEvent, setAnalyticsCollectionEnabled as _setAnalyticsCollectionEnabled, setCurrentScreen as _setCurrentScreen, - settings as _settings, setUserId as _setUserId, - setUserProperties as _setUserProperties + setUserProperties as _setUserProperties, + settings as _settings } from 'firebase/analytics'; export { diff --git a/src/analytics/screen-tracking.service.ts b/src/analytics/screen-tracking.service.ts index 06078a587..924832cc1 100644 --- a/src/analytics/screen-tracking.service.ts +++ b/src/analytics/screen-tracking.service.ts @@ -1,13 +1,12 @@ -import { ComponentFactoryResolver, Injectable, NgZone, OnDestroy, Optional, Injector } from '@angular/core'; -import { of, Subscription, Observable } from 'rxjs'; -import { distinctUntilChanged, filter, groupBy, map, mergeMap, pairwise, startWith, switchMap } from 'rxjs/operators'; -import { ActivationEnd, Router, ɵEmptyOutletComponent } from '@angular/router'; -import { Title } from '@angular/platform-browser'; +import { ComponentFactoryResolver, Injectable, Injector, NgZone, OnDestroy, Optional } from '@angular/core'; import { VERSION } from '@angular/fire'; +import { Title } from '@angular/platform-browser'; +import { ActivationEnd, Router, ɵEmptyOutletComponent } from '@angular/router'; import { registerVersion } from 'firebase/app'; - +import { Observable, Subscription, of } from 'rxjs'; +import { distinctUntilChanged, filter, groupBy, map, mergeMap, pairwise, startWith, switchMap } from 'rxjs/operators'; import { Analytics } from './analytics'; -import { logEvent, isSupported } from './firebase'; +import { isSupported, logEvent } from './firebase'; import { UserTrackingService } from './user-tracking.service'; const FIREBASE_EVENT_ORIGIN_KEY = 'firebase_event_origin'; @@ -29,14 +28,15 @@ const SCREEN_INSTANCE_DELIMITER = '#'; // this is an INT64 in iOS/Android but use INT32 cause javascript let nextScreenInstanceID = Math.floor(Math.random() * (2 ** 32 - 1)) - 2 ** 31; -const knownScreenInstanceIDs: { [key: string]: number } = {}; +const knownScreenInstanceIDs: Record = {}; -const getScreenInstanceID = (params: { [key: string]: any }) => { +const getScreenInstanceID = (params: Record) => { // unique the screen class against the outlet name const screenInstanceKey = [ params[SCREEN_CLASS_KEY], params[OUTLET_KEY] ].join(SCREEN_INSTANCE_DELIMITER); + // eslint-disable-next-line no-prototype-builtins if (knownScreenInstanceIDs.hasOwnProperty(screenInstanceKey)) { return knownScreenInstanceIDs[screenInstanceKey]; } else { diff --git a/src/analytics/user-tracking.service.ts b/src/analytics/user-tracking.service.ts index e4b7025f8..ce40b7c14 100644 --- a/src/analytics/user-tracking.service.ts +++ b/src/analytics/user-tracking.service.ts @@ -1,17 +1,16 @@ import { Injectable, Injector, NgZone, OnDestroy } from '@angular/core'; -import { Subscription } from 'rxjs'; import { VERSION } from '@angular/fire'; import { Auth, authState } from '@angular/fire/auth'; import { registerVersion } from 'firebase/app'; - +import { Subscription } from 'rxjs'; import { Analytics } from './analytics'; -import { setUserId, isSupported } from './firebase'; +import { isSupported, setUserId } from './firebase'; @Injectable() export class UserTrackingService implements OnDestroy { public readonly initialized: Promise; - private disposables: Array = []; + private disposables: Subscription[] = []; constructor( auth: Auth, diff --git a/src/app-check/app-check.module.ts b/src/app-check/app-check.module.ts index 32cec3c51..a09b99607 100644 --- a/src/app-check/app-check.module.ts +++ b/src/app-check/app-check.module.ts @@ -1,10 +1,10 @@ -import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, PLATFORM_ID, isDevMode, Injector } from '@angular/core'; +import { isPlatformServer } from '@angular/common'; +import { InjectionToken, Injector, ModuleWithProviders, NgModule, NgZone, Optional, PLATFORM_ID, isDevMode } from '@angular/core'; +import { VERSION, ɵAPP_CHECK_PROVIDER_NAME, ɵAngularFireSchedulers, ɵAppCheckInstances, ɵgetDefaultInstanceOf } from '@angular/fire'; +import { FirebaseApp, FirebaseApps } from '@angular/fire/app'; +import { registerVersion } from 'firebase/app'; import { AppCheck as FirebaseAppCheck } from 'firebase/app-check'; -import { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, ɵAppCheckInstances, ɵAPP_CHECK_PROVIDER_NAME, VERSION } from '@angular/fire'; import { AppCheck } from './app-check'; -import { FirebaseApps, FirebaseApp } from '@angular/fire/app'; -import { registerVersion } from 'firebase/app'; -import { isPlatformServer } from '@angular/common'; export const PROVIDED_APP_CHECK_INSTANCES = new InjectionToken('angularfire2.app-check-instances'); @@ -17,8 +17,7 @@ const LOCALHOSTS = ['localhost', '0.0.0.0', '127.0.0.1']; const isLocalhost = typeof window !== 'undefined' && LOCALHOSTS.includes(window.location.hostname); export function appCheckInstanceFactory(fn: (injector: Injector) => FirebaseAppCheck) { - // tslint:disable-next-line:ban-types - return (zone: NgZone, injector: Injector, platformId: Object) => { + return (zone: NgZone, injector: Injector, platformId: unknown) => { // Node should use admin token provider, browser devmode and localhost should use debug token if (!isPlatformServer(platformId) && (isDevMode() || isLocalhost)) { globalThis.FIREBASE_APPCHECK_DEBUG_TOKEN ??= true; diff --git a/src/app-check/app-check.spec.ts b/src/app-check/app-check.spec.ts index 8e1c76388..80aab5e63 100644 --- a/src/app-check/app-check.spec.ts +++ b/src/app-check/app-check.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { FirebaseApp, provideFirebaseApp, getApp, initializeApp, deleteApp } from '@angular/fire/app'; -import { Auth, provideAuth, getAuth, connectAuthEmulator } from '@angular/fire/auth'; +import { FirebaseApp, getApp, initializeApp, provideFirebaseApp } from '@angular/fire/app'; +import { Auth, connectAuthEmulator, getAuth, provideAuth } from '@angular/fire/auth'; import { COMMON_CONFIG } from '../test-config'; import { rando } from '../utils'; diff --git a/src/app-check/app-check.ts b/src/app-check/app-check.ts index 2f7ee5f51..77ea8dcfd 100644 --- a/src/app-check/app-check.ts +++ b/src/app-check/app-check.ts @@ -1,10 +1,10 @@ +import { ɵAPP_CHECK_PROVIDER_NAME, ɵgetAllInstancesOf } from '@angular/fire'; import { AppCheck as FirebaseAppCheck } from 'firebase/app-check'; -import { ɵgetAllInstancesOf, ɵAPP_CHECK_PROVIDER_NAME } from '@angular/fire'; import { from, timer } from 'rxjs'; import { concatMap, distinct } from 'rxjs/operators'; // see notes in core/firebase.app.module.ts for why we're building the class like this -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface AppCheck extends FirebaseAppCheck {} export class AppCheck { diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 2434dd608..aca94cea4 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,16 +3,15 @@ import { InjectionToken, Injector, ModuleWithProviders, + VERSION as NG_VERSION, NgModule, NgZone, Optional, PLATFORM_ID, - VERSION as NG_VERSION, } from '@angular/core'; +import { VERSION, ɵAngularFireSchedulers } from '@angular/fire'; import { FirebaseApp as IFirebaseApp, getApp, registerVersion } from 'firebase/app'; - import { FirebaseApp, FirebaseApps } from './app'; -import { VERSION, ɵAngularFireSchedulers } from '@angular/fire'; export function defaultFirebaseAppFactory(provided: FirebaseApp[]|undefined) { // Use the provided app, if there is only one, otherwise fetch the default app @@ -23,7 +22,7 @@ export function defaultFirebaseAppFactory(provided: FirebaseApp[]|undefined) { // With FIREBASE_APPS I wanted to capture the default app instance, if it is initialized by // the reserved URL; ɵPROVIDED_FIREBASE_APPS is not for public consumption and serves to ensure that all // provideFirebaseApp(...) calls are satisfied before FirebaseApp$ or FirebaseApp is resolved -export const PROVIDED_FIREBASE_APPS = new InjectionToken>('angularfire2._apps'); +export const PROVIDED_FIREBASE_APPS = new InjectionToken('angularfire2._apps'); // Injecting FirebaseApp will now only inject the default Firebase App // this allows allows beginners to import /__/firebase/init.js to auto initialize Firebase App @@ -57,10 +56,11 @@ export function firebaseAppFactory(fn: (injector: Injector) => IFirebaseApp) { ] }) export class FirebaseAppModule { - // tslint:disable-next-line:ban-types + // eslint-disable-next-line @typescript-eslint/ban-types constructor(@Inject(PLATFORM_ID) platformId: Object) { registerVersion('angularfire', VERSION.full, 'core'); registerVersion('angularfire', VERSION.full, 'app'); + // eslint-disable-next-line @typescript-eslint/no-base-to-string registerVersion('angular', NG_VERSION.full, platformId.toString()); } } diff --git a/src/app/app.spec.ts b/src/app/app.spec.ts index 795f2db7b..d600032ed 100644 --- a/src/app/app.spec.ts +++ b/src/app/app.spec.ts @@ -1,5 +1,5 @@ import { TestBed } from '@angular/core/testing'; -import { FirebaseApp, provideFirebaseApp, initializeApp, deleteApp } from '@angular/fire/app'; +import { FirebaseApp, initializeApp, provideFirebaseApp } from '@angular/fire/app'; import { COMMON_CONFIG } from '../test-config'; import { rando } from '../utils'; diff --git a/src/app/app.ts b/src/app/app.ts index c26f4331d..0b71e3d54 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -15,7 +15,7 @@ import { concatMap, distinct } from 'rxjs/operators'; // constructor(private app: FirebaseApp) { } // ngOnDestroy() { deleteApp(this.app); } // -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface FirebaseApp extends IFirebaseApp {} export class FirebaseApp { @@ -24,6 +24,7 @@ export class FirebaseApp { } } +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface FirebaseApps extends Array {} export class FirebaseApps { diff --git a/src/auth-guard/auth-guard.module.ts b/src/auth-guard/auth-guard.module.ts index 76dd87889..3d9480545 100644 --- a/src/auth-guard/auth-guard.module.ts +++ b/src/auth-guard/auth-guard.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; -import { AuthGuard } from './auth-guard'; -import { registerVersion } from 'firebase/app'; import { VERSION } from '@angular/fire'; +import { registerVersion } from 'firebase/app'; +import { AuthGuard } from './auth-guard'; @NgModule({ providers: [ AuthGuard ] diff --git a/src/auth-guard/auth-guard.spec.ts b/src/auth-guard/auth-guard.spec.ts index 4463b3802..b26203e29 100644 --- a/src/auth-guard/auth-guard.spec.ts +++ b/src/auth-guard/auth-guard.spec.ts @@ -1,18 +1,15 @@ +import { APP_BASE_HREF } from '@angular/common'; import { TestBed } from '@angular/core/testing'; -import { FirebaseApp, provideFirebaseApp, getApp, initializeApp, deleteApp } from '@angular/fire/app'; -import { Auth, provideAuth, getAuth, connectAuthEmulator } from '@angular/fire/auth'; -import { COMMON_CONFIG } from '../test-config'; +import { getApp, initializeApp, provideFirebaseApp } from '@angular/fire/app'; +import { connectAuthEmulator, getAuth, provideAuth } from '@angular/fire/auth'; import { AuthGuard, AuthGuardModule } from '@angular/fire/auth-guard'; import { Router, RouterModule } from '@angular/router'; -import { APP_BASE_HREF } from '@angular/common'; +import { COMMON_CONFIG } from '../test-config'; import { rando } from '../utils'; class TestComponent { } describe('AuthGuard', () => { - let app: FirebaseApp; - let auth: Auth; - let authGuard: AuthGuard; let router: Router; let appName: string; @@ -36,9 +33,6 @@ describe('AuthGuard', () => { ] }); - app = TestBed.inject(FirebaseApp); - auth = TestBed.inject(Auth); - authGuard = TestBed.inject(AuthGuard); router = TestBed.inject(Router); }); diff --git a/src/auth-guard/auth-guard.ts b/src/auth-guard/auth-guard.ts index 27d61ee48..51cff3550 100644 --- a/src/auth-guard/auth-guard.ts +++ b/src/auth-guard/auth-guard.ts @@ -1,9 +1,9 @@ import { Injectable } from '@angular/core'; -import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router'; -import { Observable, of, pipe, UnaryFunction } from 'rxjs'; -import { map, switchMap, take } from 'rxjs/operators'; import { Auth, user } from '@angular/fire/auth'; +import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router'; import { User } from 'firebase/auth'; +import { Observable, UnaryFunction, of, pipe } from 'rxjs'; +import { map, switchMap, take } from 'rxjs/operators'; export type AuthPipeGenerator = (next: ActivatedRouteSnapshot, state: RouterStateSnapshot) => AuthPipe; export type AuthPipe = UnaryFunction, Observable>; @@ -46,6 +46,7 @@ export const idTokenResult = switchMap((user: User|null) => user ? user.getIdTok export const emailVerified: AuthPipe = map(user => !!user && user.emailVerified); export const customClaims = pipe(idTokenResult, map(idTokenResult => idTokenResult ? idTokenResult.claims : [])); export const hasCustomClaim: (claim: string) => AuthPipe = + // eslint-disable-next-line no-prototype-builtins (claim) => pipe(customClaims, map(claims => claims.hasOwnProperty(claim))); export const redirectUnauthorizedTo: (redirect: string|any[]) => AuthPipe = (redirect) => pipe(loggedIn, map(loggedIn => loggedIn || redirect)); diff --git a/src/auth/auth.module.ts b/src/auth/auth.module.ts index a0ce58893..6c07b32e6 100644 --- a/src/auth/auth.module.ts +++ b/src/auth/auth.module.ts @@ -1,10 +1,10 @@ -import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector } from '@angular/core'; -import { Auth as FirebaseAuth } from 'firebase/auth'; -import { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION } from '@angular/fire'; -import { Auth, AuthInstances, AUTH_PROVIDER_NAME } from './auth'; -import { FirebaseApps, FirebaseApp } from '@angular/fire/app'; -import { registerVersion } from 'firebase/app'; +import { InjectionToken, Injector, ModuleWithProviders, NgModule, NgZone, Optional } from '@angular/core'; +import { VERSION, ɵAngularFireSchedulers, ɵgetDefaultInstanceOf } from '@angular/fire'; import { ɵAppCheckInstances } from '@angular/fire'; +import { FirebaseApp, FirebaseApps } from '@angular/fire/app'; +import { registerVersion } from 'firebase/app'; +import { Auth as FirebaseAuth } from 'firebase/auth'; +import { AUTH_PROVIDER_NAME, Auth, AuthInstances } from './auth'; export const PROVIDED_AUTH_INSTANCES = new InjectionToken('angularfire2.auth-instances'); diff --git a/src/auth/auth.spec.ts b/src/auth/auth.spec.ts index b675a4fc9..29d8c5749 100644 --- a/src/auth/auth.spec.ts +++ b/src/auth/auth.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { FirebaseApp, provideFirebaseApp, getApp, initializeApp, deleteApp } from '@angular/fire/app'; -import { Auth, provideAuth, getAuth, connectAuthEmulator } from '@angular/fire/auth'; +import { FirebaseApp, getApp, initializeApp, provideFirebaseApp } from '@angular/fire/app'; +import { Auth, connectAuthEmulator, getAuth, provideAuth } from '@angular/fire/auth'; import { COMMON_CONFIG } from '../test-config'; import { rando } from '../utils'; diff --git a/src/auth/auth.ts b/src/auth/auth.ts index bf13ea337..27c79cf78 100644 --- a/src/auth/auth.ts +++ b/src/auth/auth.ts @@ -1,12 +1,12 @@ -import { Auth as FirebaseAuth } from 'firebase/auth'; import { ɵgetAllInstancesOf } from '@angular/fire'; +import { Auth as FirebaseAuth } from 'firebase/auth'; import { from, timer } from 'rxjs'; import { concatMap, distinct } from 'rxjs/operators'; export const AUTH_PROVIDER_NAME = 'auth'; // see notes in core/firebase.app.module.ts for why we're building the class like this -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Auth extends FirebaseAuth {} export class Auth { @@ -15,7 +15,7 @@ export class Auth { } } -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface AuthInstances extends Array {} export class AuthInstances { diff --git a/src/auth/rxfire.ts b/src/auth/rxfire.ts index f4fad8eb9..d964dd86c 100644 --- a/src/auth/rxfire.ts +++ b/src/auth/rxfire.ts @@ -2,8 +2,8 @@ import { ɵzoneWrap } from '@angular/fire'; import { authState as _authState, - user as _user, - idToken as _idToken + idToken as _idToken, + user as _user } from 'rxfire/auth'; export const authState = ɵzoneWrap(_authState, true); diff --git a/src/compat/analytics/analytics.module.ts b/src/compat/analytics/analytics.module.ts index 561b21a60..dd9c0d6a1 100644 --- a/src/compat/analytics/analytics.module.ts +++ b/src/compat/analytics/analytics.module.ts @@ -1,9 +1,9 @@ import { NgModule, Optional } from '@angular/core'; -import { ScreenTrackingService } from './screen-tracking.service'; +import { VERSION } from '@angular/fire'; +import firebase from 'firebase/compat/app'; import { AngularFireAnalytics } from './analytics'; +import { ScreenTrackingService } from './screen-tracking.service'; import { UserTrackingService } from './user-tracking.service'; -import firebase from 'firebase/compat/app'; -import { VERSION } from '@angular/fire'; @NgModule({ providers: [ AngularFireAnalytics ] @@ -11,12 +11,13 @@ import { VERSION } from '@angular/fire'; export class AngularFireAnalyticsModule { constructor( analytics: AngularFireAnalytics, + // eslint-disable-next-line @typescript-eslint/no-unused-vars @Optional() screenTracking: ScreenTrackingService, + // eslint-disable-next-line @typescript-eslint/no-unused-vars @Optional() userTracking: UserTrackingService, ) { firebase.registerVersion('angularfire', VERSION.full, 'analytics-compat'); // calling anything on analytics will eagerly load the SDK - // tslint:disable-next-line:no-unused-expression - analytics.app.then(() => {}); + analytics.app.then(() => undefined); } } diff --git a/src/compat/analytics/analytics.spec.ts b/src/compat/analytics/analytics.spec.ts index cb5b6e059..a05a23c5f 100644 --- a/src/compat/analytics/analytics.spec.ts +++ b/src/compat/analytics/analytics.spec.ts @@ -1,12 +1,11 @@ import { TestBed } from '@angular/core/testing'; -import { AngularFireModule, FirebaseApp } from '@angular/fire/compat'; +import { AngularFireModule } from '@angular/fire/compat'; import { AngularFireAnalytics, AngularFireAnalyticsModule } from '@angular/fire/compat/analytics'; import { COMMON_CONFIG } from '../../test-config'; import { rando } from '../../utils'; describe('AngularFireAnalytics', () => { - let app: FirebaseApp; let analytics: AngularFireAnalytics; beforeEach(() => { @@ -17,7 +16,6 @@ describe('AngularFireAnalytics', () => { ] }); - app = TestBed.inject(FirebaseApp); analytics = TestBed.inject(AngularFireAnalytics); }); diff --git a/src/compat/analytics/analytics.ts b/src/compat/analytics/analytics.ts index 183d84f55..c7c9b22f0 100644 --- a/src/compat/analytics/analytics.ts +++ b/src/compat/analytics/analytics.ts @@ -1,17 +1,15 @@ -import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core'; -import { EMPTY, of } from 'rxjs'; import { isPlatformBrowser } from '@angular/common'; -import { map, shareReplay, switchMap, observeOn } from 'rxjs/operators'; +import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core'; import { ɵAngularFireSchedulers } from '@angular/fire'; -import { ɵlazySDKProxy, ɵPromiseProxy, ɵapplyMixins, ɵcacheInstance } from '@angular/fire/compat'; +import { ɵPromiseProxy, ɵapplyMixins, ɵcacheInstance, ɵlazySDKProxy } from '@angular/fire/compat'; import { FirebaseApp } from '@angular/fire/compat'; +import { isSupported } from 'firebase/analytics'; import firebase from 'firebase/compat/app'; +import { EMPTY, of } from 'rxjs'; +import { map, observeOn, shareReplay, switchMap } from 'rxjs/operators'; import { proxyPolyfillCompat } from './base'; -import { isSupported } from 'firebase/analytics'; -export interface Config { - [key: string]: any; -} +export type Config = Record; export const COLLECTION_ENABLED = new InjectionToken('angularfire2.analytics.analyticsCollectionEnabled'); export const APP_VERSION = new InjectionToken('angularfire2.analytics.appVersion'); @@ -27,6 +25,7 @@ const GTAG_FUNCTION_NAME = 'gtag'; // TODO rename these const DATA_LAYER_NAME = 'dataLayer'; const SEND_TO_KEY = 'send_to'; +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface AngularFireAnalytics extends ɵPromiseProxy { } @@ -36,7 +35,7 @@ export interface AngularFireAnalytics extends ɵPromiseProxy = new Promise(() => {}); + private analyticsInitialized = new Promise(() => undefined); async updateConfig(config: Config) { await this.analyticsInitialized; @@ -50,7 +49,7 @@ export class AngularFireAnalytics { @Optional() @Inject(APP_NAME) providedAppName: string | null, @Optional() @Inject(DEBUG_MODE) debugModeEnabled: boolean | null, @Optional() @Inject(CONFIG) providedConfig: Config | null, - // tslint:disable-next-line:ban-types + // eslint-disable-next-line @typescript-eslint/ban-types @Inject(PLATFORM_ID) platformId: Object, zone: NgZone, schedulers: ɵAngularFireSchedulers, @@ -92,7 +91,7 @@ export class AngularFireAnalytics { } } if (debugModeEnabled && typeof console !== 'undefined') { - // tslint:disable-next-line:no-console + // eslint-disable-next-line no-console console.info(...args); } /** @@ -101,7 +100,6 @@ export class AngularFireAnalytics { * like an array and contains more information then just indexes. Transforming this into arrow function * caused issue #2505 where analytics no longer sent any data. */ - // tslint:disable-next-line: only-arrow-functions (function(..._args: any[]) { window[DATA_LAYER_NAME].push(arguments); })(...args); diff --git a/src/compat/analytics/screen-tracking.service.ts b/src/compat/analytics/screen-tracking.service.ts index 869e975b9..5ceec926b 100644 --- a/src/compat/analytics/screen-tracking.service.ts +++ b/src/compat/analytics/screen-tracking.service.ts @@ -1,13 +1,13 @@ import { ComponentFactoryResolver, Injectable, NgZone, OnDestroy, Optional } from '@angular/core'; +import { VERSION } from '@angular/fire'; +import { ɵscreenViewEvent } from '@angular/fire/analytics'; +import { Title } from '@angular/platform-browser'; +import { Router } from '@angular/router'; +import firebase from 'firebase/compat/app'; import { Subscription } from 'rxjs'; import { switchMap } from 'rxjs/operators'; -import { Router } from '@angular/router'; import { AngularFireAnalytics } from './analytics'; -import { Title } from '@angular/platform-browser'; import { UserTrackingService } from './user-tracking.service'; -import firebase from 'firebase/compat/app'; -import { VERSION } from '@angular/fire'; -import { ɵscreenViewEvent } from '@angular/fire/analytics'; const SCREEN_VIEW_EVENT = 'screen_view'; diff --git a/src/compat/analytics/user-tracking.service.ts b/src/compat/analytics/user-tracking.service.ts index b7b6a2b46..ce962d5f4 100644 --- a/src/compat/analytics/user-tracking.service.ts +++ b/src/compat/analytics/user-tracking.service.ts @@ -1,21 +1,21 @@ import { isPlatformServer } from '@angular/common'; import { Inject, Injectable, NgZone, OnDestroy, PLATFORM_ID } from '@angular/core'; -import { AngularFireAnalytics } from './analytics'; +import { VERSION } from '@angular/fire'; import { AngularFireAuth } from '@angular/fire/compat/auth'; -import { Subscription } from 'rxjs'; import firebase from 'firebase/compat/app'; -import { VERSION } from '@angular/fire'; +import { Subscription } from 'rxjs'; +import { AngularFireAnalytics } from './analytics'; @Injectable() export class UserTrackingService implements OnDestroy { initialized: Promise; - private disposables: Array = []; + private disposables: Subscription[] = []; // TODO a user properties injector constructor( analytics: AngularFireAnalytics, - // tslint:disable-next-line:ban-types + // eslint-disable-next-line @typescript-eslint/ban-types @Inject(PLATFORM_ID) platformId: Object, auth: AngularFireAuth, zone: NgZone, diff --git a/src/compat/angularfire2.spec.ts b/src/compat/angularfire2.spec.ts index c7ed98f12..eef6b97bf 100644 --- a/src/compat/angularfire2.spec.ts +++ b/src/compat/angularfire2.spec.ts @@ -1,20 +1,16 @@ +import { CompilerFactory, DoBootstrap, NgModule, NgZone, PlatformRef } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { CompilerFactory, NgModule, NgZone, PlatformRef } from '@angular/core'; +import { ɵAngularFireSchedulers, ɵZoneScheduler, ɵkeepUnstableUntilFirstFactory } from '@angular/fire'; import { AngularFireModule, FirebaseApp } from '@angular/fire/compat'; -import { Observable, of, Subject } from 'rxjs'; -import { COMMON_CONFIG } from '../../src/test-config'; -import { rando } from '../../src/utils'; import { BrowserModule } from '@angular/platform-browser'; -import firebase from 'firebase/compat/app'; +import { Observable, Subject, of } from 'rxjs'; import { tap } from 'rxjs/operators'; import { TestScheduler } from 'rxjs/testing'; -import { ɵAngularFireSchedulers, ɵkeepUnstableUntilFirstFactory, ɵZoneScheduler } from '@angular/fire'; +import { COMMON_CONFIG } from '../../src/test-config'; +import { rando } from '../../src/utils'; describe('angularfire', () => { let app: FirebaseApp; - let rootRef: firebase.database.Reference; - let questionsRef: firebase.database.Reference; - let listOfQuestionsRef: firebase.database.Reference; let defaultPlatform: PlatformRef; let appName: string; @@ -28,9 +24,6 @@ describe('angularfire', () => { app = TestBed.inject(FirebaseApp); defaultPlatform = TestBed.inject(PlatformRef); - rootRef = app.database().ref(); - questionsRef = rootRef.child('questions'); - listOfQuestionsRef = rootRef.child('list-of-questions'); }); describe('ZoneScheduler', () => { @@ -153,7 +146,7 @@ describe('angularfire', () => { const testScheduler = new TestScheduler(null); testScheduler.run(helpers => { const outsideZone = Zone.current; - // tslint:disable-next-line:no-string-literal + // eslint-disable-next-line @typescript-eslint/dot-notation const taskTrack = new Zone['TaskTrackingZoneSpec'](); const insideZone = Zone.current.fork(taskTrack); const trackingSchedulers: ɵAngularFireSchedulers = { @@ -171,11 +164,9 @@ describe('angularfire', () => { const s = new Subject(); s.pipe( keepUnstableOp - ).subscribe(() => { - }, err => { + ).subscribe(() => undefined, err => { fail(err); - }, () => { - }); + }, () => undefined); // Flush to ensure all async scheduled functions are run helpers.flush(); @@ -218,7 +209,8 @@ describe('angularfire', () => { BrowserModule ] }) - class MyModule { + class MyModule implements DoBootstrap { + // eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method,@typescript-eslint/no-empty-function ngDoBootstrap() { } } diff --git a/src/compat/auth-guard/auth-guard.module.ts b/src/compat/auth-guard/auth-guard.module.ts index e045c874c..42012c6f9 100644 --- a/src/compat/auth-guard/auth-guard.module.ts +++ b/src/compat/auth-guard/auth-guard.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; -import { AngularFireAuthGuard } from './auth-guard'; -import firebase from 'firebase/compat/app'; import { VERSION } from '@angular/fire'; +import firebase from 'firebase/compat/app'; +import { AngularFireAuthGuard } from './auth-guard'; @NgModule({ providers: [ AngularFireAuthGuard ] diff --git a/src/compat/auth-guard/auth-guard.spec.ts b/src/compat/auth-guard/auth-guard.spec.ts index b14250a99..808417461 100644 --- a/src/compat/auth-guard/auth-guard.spec.ts +++ b/src/compat/auth-guard/auth-guard.spec.ts @@ -1,15 +1,14 @@ +import { APP_BASE_HREF } from '@angular/common'; import { TestBed } from '@angular/core/testing'; -import { AngularFireModule, FirebaseApp } from '@angular/fire/compat'; -import { COMMON_CONFIG } from '../../../src/test-config'; +import { AngularFireModule } from '@angular/fire/compat'; import { AngularFireAuthGuard, AngularFireAuthGuardModule } from '@angular/fire/compat/auth-guard'; import { Router, RouterModule } from '@angular/router'; -import { APP_BASE_HREF } from '@angular/common'; +import { COMMON_CONFIG } from '../../../src/test-config'; import { rando } from '../../../src/utils'; class TestComponent { } describe('AngularFireAuthGuard', () => { - let app: FirebaseApp; let router: Router; beforeEach(() => { @@ -26,7 +25,6 @@ describe('AngularFireAuthGuard', () => { ] }); - app = TestBed.inject(FirebaseApp); router = TestBed.inject(Router); }); diff --git a/src/compat/auth-guard/auth-guard.ts b/src/compat/auth-guard/auth-guard.ts index 21d9b4df2..9be909838 100644 --- a/src/compat/auth-guard/auth-guard.ts +++ b/src/compat/auth-guard/auth-guard.ts @@ -1,9 +1,9 @@ import { Injectable } from '@angular/core'; +import { AngularFireAuth } from '@angular/fire/compat/auth'; import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router'; -import { Observable, of, pipe, UnaryFunction } from 'rxjs'; -import { map, switchMap, take } from 'rxjs/operators'; import firebase from 'firebase/compat/app'; -import { AngularFireAuth } from '@angular/fire/compat/auth'; +import { Observable, UnaryFunction, of, pipe } from 'rxjs'; +import { map, switchMap, take } from 'rxjs/operators'; export type AuthPipeGenerator = (next: ActivatedRouteSnapshot, state: RouterStateSnapshot) => AuthPipe; export type AuthPipe = UnaryFunction, Observable>; @@ -47,6 +47,7 @@ export const idTokenResult = switchMap((user: firebase.User|null) => user ? user export const emailVerified: AuthPipe = map(user => !!user && user.emailVerified); export const customClaims = pipe(idTokenResult, map(idTokenResult => idTokenResult ? idTokenResult.claims : [])); export const hasCustomClaim: (claim: string) => AuthPipe = + // eslint-disable-next-line no-prototype-builtins (claim) => pipe(customClaims, map(claims => claims.hasOwnProperty(claim))); export const redirectUnauthorizedTo: (redirect: string|any[]) => AuthPipe = (redirect) => pipe(loggedIn, map(loggedIn => loggedIn || redirect)); diff --git a/src/compat/auth/auth.module.ts b/src/compat/auth/auth.module.ts index c2b017b2f..3cc268eef 100644 --- a/src/compat/auth/auth.module.ts +++ b/src/compat/auth/auth.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; -import { AngularFireAuth } from './auth'; -import firebase from 'firebase/compat/app'; import { VERSION } from '@angular/fire'; +import firebase from 'firebase/compat/app'; +import { AngularFireAuth } from './auth'; @NgModule({ providers: [ AngularFireAuth ] diff --git a/src/compat/auth/auth.spec.ts b/src/compat/auth/auth.spec.ts index a7a759b67..baaedd8b2 100644 --- a/src/compat/auth/auth.spec.ts +++ b/src/compat/auth/auth.spec.ts @@ -1,8 +1,9 @@ -import firebase from 'firebase/compat/app'; -import { Observable, Subject, forkJoin, merge, tap } from 'rxjs'; +/* eslint-disable @typescript-eslint/ban-ts-comment */ import { TestBed } from '@angular/core/testing'; import { AngularFireModule, FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseApp } from '@angular/fire/compat'; import { AngularFireAuth, AngularFireAuthModule, SETTINGS } from '@angular/fire/compat/auth'; +import firebase from 'firebase/compat/app'; +import { Observable, Subject } from 'rxjs'; import { COMMON_CONFIG } from '../../../src/test-config'; import 'firebase/compat/auth'; import { rando } from '../../../src/utils'; @@ -13,7 +14,6 @@ const firebaseUser = { } as firebase.User; describe('AngularFireAuth', () => { - let app: FirebaseApp; let afAuth: AngularFireAuth; let mockAuthState: Subject; @@ -28,7 +28,6 @@ describe('AngularFireAuth', () => { ] }); - app = TestBed.inject(FirebaseApp); afAuth = TestBed.inject(AngularFireAuth); mockAuthState = new Subject(); diff --git a/src/compat/auth/auth.ts b/src/compat/auth/auth.ts index d10c69bd1..c3d80944e 100644 --- a/src/compat/auth/auth.ts +++ b/src/compat/auth/auth.ts @@ -1,15 +1,16 @@ -import { Injectable, Inject, Optional, NgZone, PLATFORM_ID, InjectionToken } from '@angular/core'; -import { Observable, of, from, merge, Subject } from 'rxjs'; -import { switchMap, map, observeOn, shareReplay, first, filter, switchMapTo, subscribeOn } from 'rxjs/operators'; -import { ɵAngularFireSchedulers, keepUnstableUntilFirst } from '@angular/fire'; -import { ɵlazySDKProxy, ɵPromiseProxy, ɵapplyMixins } from '@angular/fire/compat'; -import { ɵfirebaseAppFactory, FIREBASE_OPTIONS, FIREBASE_APP_NAME, FirebaseApp, ɵcacheInstance } from '@angular/fire/compat'; +import { isPlatformServer } from '@angular/common'; +import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core'; +import { keepUnstableUntilFirst, ɵAngularFireSchedulers } from '@angular/fire'; +import { AppCheckInstances } from '@angular/fire/app-check'; +import { ɵPromiseProxy, ɵapplyMixins, ɵlazySDKProxy } from '@angular/fire/compat'; +import { FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseApp, ɵcacheInstance, ɵfirebaseAppFactory } from '@angular/fire/compat'; import { FirebaseOptions } from 'firebase/app'; import firebase from 'firebase/compat/app'; -import { isPlatformServer } from '@angular/common'; +import { Observable, Subject, from, merge, of } from 'rxjs'; +import { filter, first, map, observeOn, shareReplay, subscribeOn, switchMap, switchMapTo } from 'rxjs/operators'; import { proxyPolyfillCompat } from './base'; -import { AppCheckInstances } from '@angular/fire/app-check'; +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface AngularFireAuth extends ɵPromiseProxy {} type UseEmulatorArguments = Parameters; @@ -83,7 +84,7 @@ export class AngularFireAuth { constructor( @Inject(FIREBASE_OPTIONS) options: FirebaseOptions, @Optional() @Inject(FIREBASE_APP_NAME) name: string|null|undefined, - // tslint:disable-next-line:ban-types + // eslint-disable-next-line @typescript-eslint/ban-types @Inject(PLATFORM_ID) platformId: Object, zone: NgZone, schedulers: ɵAngularFireSchedulers, @@ -116,7 +117,7 @@ export class AngularFireAuth { // as we're completely lazy. Let's eagerly load the Auth SDK here. // There could potentially be race conditions still... but this greatly decreases the odds while // we reevaluate the API. - const _ = auth.pipe(first()).subscribe(); + auth.pipe(first()).subscribe(); const redirectResult = auth.pipe( switchMap(auth => auth.getRedirectResult().then(it => it, () => null)), diff --git a/src/compat/cache.ts b/src/compat/cache.ts index db19b2e75..108b6beaf 100644 --- a/src/compat/cache.ts +++ b/src/compat/cache.ts @@ -27,6 +27,7 @@ const IS_HMR = typeof module !== 'undefined' && !!(module as any).hot; const log = (level: 'log'|'error'|'info'|'warn', ...args: any) => { if (isDevMode() && typeof console !== 'undefined') { + // eslint-disable-next-line no-console console[level](...args); } }; diff --git a/src/compat/database/database.module.ts b/src/compat/database/database.module.ts index 97eaec3b3..3c1d51d32 100644 --- a/src/compat/database/database.module.ts +++ b/src/compat/database/database.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; -import { AngularFireDatabase } from './database'; -import firebase from 'firebase/compat/app'; import { VERSION } from '@angular/fire'; +import firebase from 'firebase/compat/app'; +import { AngularFireDatabase } from './database'; @NgModule({ providers: [ AngularFireDatabase ] diff --git a/src/compat/database/database.spec.ts b/src/compat/database/database.spec.ts index fba0854d3..5a104e4b4 100644 --- a/src/compat/database/database.spec.ts +++ b/src/compat/database/database.spec.ts @@ -1,11 +1,11 @@ +import { NgZone } from '@angular/core'; +import { TestBed } from '@angular/core/testing'; +import { ɵAngularFireSchedulers } from '@angular/fire'; import { AngularFireModule, FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseApp } from '@angular/fire/compat'; import { AngularFireDatabase, AngularFireDatabaseModule, URL } from '@angular/fire/compat/database'; -import { TestBed } from '@angular/core/testing'; import { COMMON_CONFIG } from '../../../src/test-config'; -import { NgZone } from '@angular/core'; -import 'firebase/compat/database'; import { rando } from '../../../src/utils'; -import { ɵAngularFireSchedulers } from '@angular/fire'; +import 'firebase/compat/database'; describe('AngularFireDatabase', () => { let app: FirebaseApp; @@ -60,14 +60,11 @@ describe('AngularFireDatabase', () => { }); describe('AngularFireDatabase w/options', () => { - let app: FirebaseApp; let db: AngularFireDatabase; let firebaseAppName: string; let url: string; - let query: string; beforeEach(() => { - query = rando(); firebaseAppName = rando(); url = `http://localhost:${Math.floor(Math.random() * 9999)}`; TestBed.configureTestingModule({ @@ -82,7 +79,6 @@ describe('AngularFireDatabase w/options', () => { ] }); - app = TestBed.inject(FirebaseApp); db = TestBed.inject(AngularFireDatabase); }); diff --git a/src/compat/database/database.ts b/src/compat/database/database.ts index 23c8fd1e3..b66f1025e 100644 --- a/src/compat/database/database.ts +++ b/src/compat/database/database.ts @@ -1,25 +1,25 @@ import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core'; -import { AngularFireList, AngularFireObject, DatabaseQuery, PathReference, QueryFn } from './interfaces'; -import { getRef } from './utils'; -import { createListReference } from './list/create-reference'; -import { createObjectReference } from './object/create-reference'; import { ɵAngularFireSchedulers } from '@angular/fire'; -import { FirebaseOptions } from 'firebase/app'; -import { ɵfirebaseAppFactory, FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance } from '@angular/fire/compat'; -import 'firebase/compat/auth'; -import 'firebase/compat/database'; +import { AppCheckInstances } from '@angular/fire/app-check'; +import { FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance, ɵfirebaseAppFactory } from '@angular/fire/compat'; import { - AngularFireAuth, - USE_EMULATOR as USE_AUTH_EMULATOR, SETTINGS as AUTH_SETTINGS, - TENANT_ID, + AngularFireAuth, LANGUAGE_CODE, - USE_DEVICE_LANGUAGE, PERSISTENCE, + TENANT_ID, + USE_EMULATOR as USE_AUTH_EMULATOR, + USE_DEVICE_LANGUAGE, ɵauthFactory, } from '@angular/fire/compat/auth'; +import { FirebaseOptions } from 'firebase/app'; import firebase from 'firebase/compat/app'; -import { AppCheckInstances } from '@angular/fire/app-check'; +import { AngularFireList, AngularFireObject, DatabaseQuery, PathReference, QueryFn } from './interfaces'; +import { createListReference } from './list/create-reference'; +import { createObjectReference } from './object/create-reference'; +import { getRef } from './utils'; +import 'firebase/compat/auth'; +import 'firebase/compat/database'; export const URL = new InjectionToken('angularfire2.realtimeDatabaseURL'); @@ -36,7 +36,7 @@ export class AngularFireDatabase { @Inject(FIREBASE_OPTIONS) options: FirebaseOptions, @Optional() @Inject(FIREBASE_APP_NAME) name: string | null | undefined, @Optional() @Inject(URL) databaseURL: string | null, - // tslint:disable-next-line:ban-types + // eslint-disable-next-line @typescript-eslint/ban-types @Inject(PLATFORM_ID) platformId: Object, zone: NgZone, public schedulers: ɵAngularFireSchedulers, diff --git a/src/compat/database/interfaces.ts b/src/compat/database/interfaces.ts index 5f2559ca8..461f7bc25 100644 --- a/src/compat/database/interfaces.ts +++ b/src/compat/database/interfaces.ts @@ -1,11 +1,11 @@ -import { Observable } from 'rxjs'; import firebase from 'firebase/compat/app'; +import { Observable } from 'rxjs'; export type FirebaseOperation = string | firebase.database.Reference | firebase.database.DataSnapshot; export interface AngularFireList { query: DatabaseQuery; - valueChanges(events?: ChildEvent[], options?: {}): Observable; + valueChanges(events?: ChildEvent[], options?: unknown): Observable; valueChanges(events?: ChildEvent[], options?: {idField: K}): Observable<(T & {[T in K]?: string})[]>; snapshotChanges(events?: ChildEvent[]): Observable[]>; stateChanges(events?: ChildEvent[]): Observable>; diff --git a/src/compat/database/list/audit-trail.spec.ts b/src/compat/database/list/audit-trail.spec.ts index a2c9f7109..aade4cfb9 100644 --- a/src/compat/database/list/audit-trail.spec.ts +++ b/src/compat/database/list/audit-trail.spec.ts @@ -1,14 +1,13 @@ -import { AngularFireModule, FirebaseApp } from '@angular/fire/compat'; -import { AngularFireDatabase, AngularFireDatabaseModule, auditTrail, ChildEvent, URL } from '@angular/fire/compat/database'; import { TestBed } from '@angular/core/testing'; -import { COMMON_CONFIG } from '../../../../src/test-config'; +import { AngularFireModule } from '@angular/fire/compat'; +import { AngularFireDatabase, AngularFireDatabaseModule, ChildEvent, URL, auditTrail } from '@angular/fire/compat/database'; +import firebase from 'firebase/compat/app'; import { skip } from 'rxjs/operators'; +import { COMMON_CONFIG } from '../../../../src/test-config'; import 'firebase/compat/database'; -import firebase from 'firebase/compat/app'; import { rando } from '../../../../src/utils'; describe('auditTrail', () => { - let app: FirebaseApp; let db: AngularFireDatabase; let createRef: (path: string) => firebase.database.Reference; let batch = {}; @@ -30,7 +29,6 @@ describe('auditTrail', () => { ] }); - app = TestBed.inject(FirebaseApp); db = TestBed.inject(AngularFireDatabase); createRef = (path: string) => db.database.ref(path); }); diff --git a/src/compat/database/list/audit-trail.ts b/src/compat/database/list/audit-trail.ts index 1ead7342b..666a458d7 100644 --- a/src/compat/database/list/audit-trail.ts +++ b/src/compat/database/list/audit-trail.ts @@ -1,9 +1,9 @@ -import { AngularFireAction, ChildEvent, DatabaseQuery, DataSnapshot, SnapshotAction } from '../interfaces'; -import { stateChanges } from './state-changes'; import { Observable, SchedulerLike } from 'rxjs'; +import { map, scan, skipWhile, withLatestFrom } from 'rxjs/operators'; +import { AngularFireAction, ChildEvent, DataSnapshot, DatabaseQuery, SnapshotAction } from '../interfaces'; import { fromRef } from '../observable/fromRef'; +import { stateChanges } from './state-changes'; -import { map, scan, skipWhile, withLatestFrom } from 'rxjs/operators'; export function auditTrail(query: DatabaseQuery, events?: ChildEvent[], scheduler?: SchedulerLike): Observable[]> { const auditTrail$ = stateChanges(query, events) diff --git a/src/compat/database/list/changes.spec.ts b/src/compat/database/list/changes.spec.ts index d21104fae..032842acc 100644 --- a/src/compat/database/list/changes.spec.ts +++ b/src/compat/database/list/changes.spec.ts @@ -1,14 +1,13 @@ -import firebase from 'firebase/compat/app'; -import { AngularFireModule, FirebaseApp } from '@angular/fire/compat'; -import { AngularFireDatabase, AngularFireDatabaseModule, listChanges, URL } from '@angular/fire/compat/database'; import { TestBed } from '@angular/core/testing'; -import { COMMON_CONFIG } from '../../../../src/test-config'; +import { AngularFireModule } from '@angular/fire/compat'; +import { AngularFireDatabase, AngularFireDatabaseModule, URL, listChanges } from '@angular/fire/compat/database'; +import firebase from 'firebase/compat/app'; import { skip, take } from 'rxjs/operators'; +import { COMMON_CONFIG } from '../../../../src/test-config'; import 'firebase/compat/database'; import { rando } from '../../../../src/utils'; describe('listChanges', () => { - let app: FirebaseApp; let db: AngularFireDatabase; let ref: (path: string) => firebase.database.Reference; let batch = {}; @@ -30,7 +29,6 @@ describe('listChanges', () => { ] }); - app = TestBed.inject(FirebaseApp); db = TestBed.inject(AngularFireDatabase); ref = (path: string) => db.database.ref(path); }); diff --git a/src/compat/database/list/changes.ts b/src/compat/database/list/changes.ts index cb37d0694..c7c5fd904 100644 --- a/src/compat/database/list/changes.ts +++ b/src/compat/database/list/changes.ts @@ -1,10 +1,9 @@ -import { fromRef } from '../observable/fromRef'; -import { merge, Observable, of, SchedulerLike } from 'rxjs'; - +import { Observable, SchedulerLike, merge, of } from 'rxjs'; +import { distinctUntilChanged, scan, switchMap } from 'rxjs/operators'; import { ChildEvent, DatabaseQuery, SnapshotAction } from '../interfaces'; +import { fromRef } from '../observable/fromRef'; import { isNil } from '../utils'; -import { distinctUntilChanged, scan, switchMap } from 'rxjs/operators'; export function listChanges(ref: DatabaseQuery, events: ChildEvent[], scheduler?: SchedulerLike): Observable[]> { return fromRef(ref, 'value', 'once', scheduler).pipe( @@ -46,7 +45,7 @@ function buildView(current, action) { const afterPreviousKeyPosition = positionAfter(current, prevKey); switch (action.type) { case 'value': - if (action.payload && action.payload.exists()) { + if (action.payload?.exists()) { let prevKey = null; action.payload.forEach(payload => { const action = { payload, type: 'value', prevKey, key: payload.key }; @@ -60,7 +59,7 @@ function buildView(current, action) { if (currentKeyPosition > -1) { // check that the previouskey is what we expect, else reorder const previous = current[currentKeyPosition - 1]; - if ((previous && previous.key || null) !== prevKey) { + if ((previous?.key || null) !== prevKey) { current = current.filter(x => x.payload.key !== payload.key); current.splice(afterPreviousKeyPosition, 0, action); } diff --git a/src/compat/database/list/create-reference.ts b/src/compat/database/list/create-reference.ts index 8585fa254..e23e09ce3 100644 --- a/src/compat/database/list/create-reference.ts +++ b/src/compat/database/list/create-reference.ts @@ -1,21 +1,21 @@ +import { keepUnstableUntilFirst } from '@angular/fire'; +import type { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { AngularFireDatabase } from '../database'; import { AngularFireList, ChildEvent, DatabaseQuery } from '../interfaces'; -import { snapshotChanges } from './snapshot-changes'; -import { stateChanges } from './state-changes'; import { auditTrail } from './audit-trail'; import { createDataOperationMethod } from './data-operation'; import { createRemoveMethod } from './remove'; -import { AngularFireDatabase } from '../database'; -import type { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; -import { keepUnstableUntilFirst } from '@angular/fire'; +import { snapshotChanges } from './snapshot-changes'; +import { stateChanges } from './state-changes'; export function createListReference(query: DatabaseQuery, afDatabase: AngularFireDatabase): AngularFireList { const outsideAngularScheduler = afDatabase.schedulers.outsideAngular; const refInZone = afDatabase.schedulers.ngZone.run(() => query.ref); return { query, - update: createDataOperationMethod>(refInZone, 'update'), - set: createDataOperationMethod(refInZone, 'set'), + update: createDataOperationMethod(refInZone, 'update'), + set: createDataOperationMethod(refInZone, 'set'), push: (data: T) => refInZone.push(data), remove: createRemoveMethod(refInZone), snapshotChanges(events?: ChildEvent[]) { @@ -27,7 +27,7 @@ export function createListReference(query: DatabaseQuery, afDatabase: An auditTrail(events?: ChildEvent[]) { return auditTrail(query, events, outsideAngularScheduler).pipe(keepUnstableUntilFirst); }, - valueChanges(events?: ChildEvent[], options?: {idField?: K}): Observable<(T & { [x: string]: string; })[]> { + valueChanges(events?: ChildEvent[], options?: {idField?: K}): Observable<(T & Record)[]> { const snapshotChanges$ = snapshotChanges(query, events, outsideAngularScheduler); return snapshotChanges$.pipe( map(actions => actions.map(a => { @@ -39,7 +39,7 @@ export function createListReference(query: DatabaseQuery, afDatabase: An } }; } else { - return a.payload.val() as T & { [x: string]: string; } + return a.payload.val() as T & Record } })), keepUnstableUntilFirst diff --git a/src/compat/database/list/data-operation.ts b/src/compat/database/list/data-operation.ts index 78bb0bf4e..16650a8b3 100644 --- a/src/compat/database/list/data-operation.ts +++ b/src/compat/database/list/data-operation.ts @@ -1,7 +1,7 @@ import { DatabaseReference, DatabaseSnapshot, FirebaseOperation } from '../interfaces'; import { checkOperationCases } from '../utils'; -export function createDataOperationMethod(ref: DatabaseReference, operation: string) { +export function createDataOperationMethod(ref: DatabaseReference, operation: string) { return function dataOperation(item: FirebaseOperation, value: T) { return checkOperationCases(item, { stringCase: () => ref.child(item as string)[operation](value), diff --git a/src/compat/database/list/snapshot-changes.spec.ts b/src/compat/database/list/snapshot-changes.spec.ts index 394cf87b9..a3399075e 100644 --- a/src/compat/database/list/snapshot-changes.spec.ts +++ b/src/compat/database/list/snapshot-changes.spec.ts @@ -1,15 +1,14 @@ -import firebase from 'firebase/compat/app'; -import { AngularFireModule, FirebaseApp } from '@angular/fire/compat'; -import { AngularFireDatabase, AngularFireDatabaseModule, ChildEvent, snapshotChanges, URL } from '@angular/fire/compat/database'; import { TestBed } from '@angular/core/testing'; -import { COMMON_CONFIG } from '../../../../src/test-config'; +import { AngularFireModule } from '@angular/fire/compat'; +import { AngularFireDatabase, AngularFireDatabaseModule, ChildEvent, URL, snapshotChanges } from '@angular/fire/compat/database'; +import firebase from 'firebase/compat/app'; import { BehaviorSubject } from 'rxjs'; import { skip, switchMap, take } from 'rxjs/operators'; +import { COMMON_CONFIG } from '../../../../src/test-config'; import 'firebase/compat/database'; import { rando } from '../../../../src/utils'; describe('snapshotChanges', () => { - let app: FirebaseApp; let db: AngularFireDatabase; let createRef: (path: string) => firebase.database.Reference; let batch = {}; @@ -31,7 +30,6 @@ describe('snapshotChanges', () => { ] }); - app = TestBed.inject(FirebaseApp); db = TestBed.inject(AngularFireDatabase); createRef = (path: string) => db.database.ref(path); }); @@ -61,8 +59,7 @@ describe('snapshotChanges', () => { it('should handle multiple subscriptions (hot)', (done) => { const { snapChanges, ref } = prepareSnapshotChanges(); - const sub = snapChanges.subscribe(() => { - }); + const sub = snapChanges.subscribe(() => undefined); sub.add(done); snapChanges.pipe(take(1)).subscribe(actions => { const data = actions.map(a => a.payload.val()); @@ -73,8 +70,7 @@ describe('snapshotChanges', () => { it('should handle multiple subscriptions (warm)', done => { const { snapChanges, ref } = prepareSnapshotChanges(); - snapChanges.pipe(take(1)).subscribe(() => { - }).add(() => { + snapChanges.pipe(take(1)).subscribe(() => undefined).add(() => { snapChanges.pipe(take(1)).subscribe(actions => { const data = actions.map(a => a.payload.val()); expect(data).toEqual(items); diff --git a/src/compat/database/list/snapshot-changes.ts b/src/compat/database/list/snapshot-changes.ts index 7422c65bd..a98adf045 100644 --- a/src/compat/database/list/snapshot-changes.ts +++ b/src/compat/database/list/snapshot-changes.ts @@ -1,6 +1,6 @@ import { Observable, SchedulerLike } from 'rxjs'; -import { listChanges } from './changes'; import { ChildEvent, DatabaseQuery, SnapshotAction } from '../interfaces'; +import { listChanges } from './changes'; import { validateEventsArray } from './utils'; export function snapshotChanges( diff --git a/src/compat/database/list/state-changes.spec.ts b/src/compat/database/list/state-changes.spec.ts index d1d1f5721..8829dc355 100644 --- a/src/compat/database/list/state-changes.spec.ts +++ b/src/compat/database/list/state-changes.spec.ts @@ -1,14 +1,13 @@ -import firebase from 'firebase/compat/app'; -import { AngularFireModule, FirebaseApp } from '@angular/fire/compat'; -import { AngularFireDatabase, AngularFireDatabaseModule, ChildEvent, stateChanges, URL } from '@angular/fire/compat/database'; import { TestBed } from '@angular/core/testing'; -import { COMMON_CONFIG } from '../../../../src/test-config'; +import { AngularFireModule } from '@angular/fire/compat'; +import { AngularFireDatabase, AngularFireDatabaseModule, ChildEvent, URL, stateChanges } from '@angular/fire/compat/database'; +import firebase from 'firebase/compat/app'; import { skip } from 'rxjs/operators'; +import { COMMON_CONFIG } from '../../../../src/test-config'; import 'firebase/compat/database'; import { rando } from '../../../../src/utils'; describe('stateChanges', () => { - let app: FirebaseApp; let db: AngularFireDatabase; let createRef: (path: string) => firebase.database.Reference; let batch = {}; @@ -30,7 +29,6 @@ describe('stateChanges', () => { ] }); - app = TestBed.inject(FirebaseApp); db = TestBed.inject(AngularFireDatabase); createRef = (path: string) => db.database.ref(path); }); diff --git a/src/compat/database/list/state-changes.ts b/src/compat/database/list/state-changes.ts index 192043e3b..10a4cdffa 100644 --- a/src/compat/database/list/state-changes.ts +++ b/src/compat/database/list/state-changes.ts @@ -1,7 +1,7 @@ +import { SchedulerLike, merge } from 'rxjs'; import { ChildEvent, DatabaseQuery } from '../interfaces'; import { fromRef } from '../observable/fromRef'; import { validateEventsArray } from './utils'; -import { merge, SchedulerLike } from 'rxjs'; export function stateChanges(query: DatabaseQuery, events?: ChildEvent[], scheduler?: SchedulerLike) { events = validateEventsArray(events); diff --git a/src/compat/database/object/create-reference.ts b/src/compat/database/object/create-reference.ts index d041c4de1..32088f845 100644 --- a/src/compat/database/object/create-reference.ts +++ b/src/compat/database/object/create-reference.ts @@ -1,8 +1,8 @@ +import { keepUnstableUntilFirst } from '@angular/fire'; import { map } from 'rxjs/operators'; +import { AngularFireDatabase } from '../database'; import { AngularFireObject, DatabaseQuery } from '../interfaces'; import { createObjectSnapshotChanges } from './snapshot-changes'; -import { AngularFireDatabase } from '../database'; -import { keepUnstableUntilFirst } from '@angular/fire'; export function createObjectReference(query: DatabaseQuery, afDatabase: AngularFireDatabase): AngularFireObject { return { diff --git a/src/compat/database/object/snapshot-changes.ts b/src/compat/database/object/snapshot-changes.ts index 66ae6ef3c..bff2f90c9 100644 --- a/src/compat/database/object/snapshot-changes.ts +++ b/src/compat/database/object/snapshot-changes.ts @@ -1,6 +1,6 @@ import { Observable, SchedulerLike } from 'rxjs'; -import { fromRef } from '../observable/fromRef'; import { DatabaseQuery, SnapshotAction } from '../interfaces'; +import { fromRef } from '../observable/fromRef'; export function createObjectSnapshotChanges(query: DatabaseQuery, scheduler?: SchedulerLike) { return function snapshotChanges(): Observable> { diff --git a/src/compat/database/observable/fromRef.spec.ts b/src/compat/database/observable/fromRef.spec.ts index a1148795b..eb876c32a 100644 --- a/src/compat/database/observable/fromRef.spec.ts +++ b/src/compat/database/observable/fromRef.spec.ts @@ -1,15 +1,15 @@ +/* eslint-disable @typescript-eslint/unbound-method */ +import { TestBed } from '@angular/core/testing'; import { ɵZoneScheduler } from '@angular/fire'; -import { AngularFireModule, FirebaseApp } from '@angular/fire/compat'; +import { AngularFireModule } from '@angular/fire/compat'; import { AngularFireDatabase, AngularFireDatabaseModule, fromRef } from '@angular/fire/compat/database'; -import { TestBed } from '@angular/core/testing'; -import { COMMON_CONFIG } from '../../../../src/test-config'; +import firebase from 'firebase/compat/app'; import { take } from 'rxjs/operators'; import { TestScheduler } from 'rxjs/testing'; +import { COMMON_CONFIG } from '../../../../src/test-config'; import { rando } from '../../../../src/utils'; -import firebase from 'firebase/compat/app'; describe('fromRef', () => { - let app: FirebaseApp; let db: AngularFireDatabase; let ref: (path: string) => firebase.database.Reference; let batch = {}; @@ -32,7 +32,6 @@ describe('fromRef', () => { ] }); - app = TestBed.inject(FirebaseApp); db = TestBed.inject(AngularFireDatabase); ref = (path: string) => db.database.ref(path); }); @@ -120,8 +119,7 @@ describe('fromRef', () => { scheduler ); completeObservable.subscribe( - () => { - }, + () => undefined, () => fail('Should not error'), () => expect(Zone.current.name).toEqual('ExpectedZone') ); @@ -144,9 +142,7 @@ describe('fromRef', () => { const itemRef = ref(rando()); itemRef.set(batch); const obs = fromRef(itemRef, 'value', 'once'); - obs.subscribe(() => { - }, () => { - }, done); + obs.subscribe(() => undefined, () => undefined, done); }); it('it should listen and then unsubscribe', (done) => { @@ -233,8 +229,7 @@ describe('fromRef', () => { sub.unsubscribe(); done(); }); - itemRef.child(key).setPriority(-100, () => { - }); + itemRef.child(key).setPriority(-100, () => undefined); }); it('should stream back a value event', (done: any) => { diff --git a/src/compat/database/observable/fromRef.ts b/src/compat/database/observable/fromRef.ts index d08283235..81845e86a 100644 --- a/src/compat/database/observable/fromRef.ts +++ b/src/compat/database/observable/fromRef.ts @@ -1,6 +1,6 @@ -import { AngularFireAction, DatabaseQuery, DatabaseSnapshot, ListenEvent } from '../interfaces'; -import { asyncScheduler, Observable, SchedulerLike } from 'rxjs'; +import { Observable, SchedulerLike, asyncScheduler } from 'rxjs'; import { map, share } from 'rxjs/operators'; +import { AngularFireAction, DatabaseQuery, DatabaseSnapshot, ListenEvent } from '../interfaces'; interface SnapshotPrevKey { snapshot: DatabaseSnapshot; @@ -20,7 +20,7 @@ export function fromRef(ref: DatabaseQuery, scheduler: SchedulerLike = asyncScheduler ): Observable>> { return new Observable>(subscriber => { - let fn: any | null = null; + let fn: any = null; fn = ref[listenType](event, (snapshot, prevKey) => { scheduler.schedule(() => { subscriber.next({ snapshot, prevKey }); @@ -42,6 +42,7 @@ export function fromRef(ref: DatabaseQuery, }; } else { return { + // eslint-disable-next-line @typescript-eslint/no-empty-function unsubscribe() { } }; diff --git a/src/compat/database/utils.spec.ts b/src/compat/database/utils.spec.ts index b437b0700..7363ddc53 100644 --- a/src/compat/database/utils.spec.ts +++ b/src/compat/database/utils.spec.ts @@ -10,7 +10,7 @@ describe('utils', () => { const bool = true; const nul = null; const obj = {}; - const fn = () => { }; + const fn = () => undefined; const undef = undefined; expect(utils.isString(str)).toBe(true); expect(utils.isString(notStr)).toBe(false); diff --git a/src/compat/database/utils.ts b/src/compat/database/utils.ts index d5d635df7..8a648bb00 100644 --- a/src/compat/database/utils.ts +++ b/src/compat/database/utils.ts @@ -1,5 +1,5 @@ -import { DatabaseReference, FirebaseOperation, FirebaseOperationCases, PathReference } from './interfaces'; import firebase from 'firebase/compat/app'; +import { DatabaseReference, FirebaseOperation, FirebaseOperationCases, PathReference } from './interfaces'; export function isString(value: any): boolean { return typeof value === 'string'; diff --git a/src/compat/firebase.app.module.ts b/src/compat/firebase.app.module.ts index f3f2c5052..df20cde0c 100644 --- a/src/compat/firebase.app.module.ts +++ b/src/compat/firebase.app.module.ts @@ -1,9 +1,9 @@ import { - InjectionToken, Inject, isDevMode, ModuleWithProviders, NgModule, NgZone, Optional, PLATFORM_ID, VERSION as NG_VERSION, Version + Inject, InjectionToken, ModuleWithProviders, VERSION as NG_VERSION, NgModule, NgZone, Optional, PLATFORM_ID, isDevMode } from '@angular/core'; -import firebase from 'firebase/compat/app'; -import { FirebaseOptions, FirebaseAppSettings } from 'firebase/app'; import { VERSION } from '@angular/fire'; +import { FirebaseAppSettings, FirebaseOptions } from 'firebase/app'; +import firebase from 'firebase/compat/app'; import { FirebaseApp } from './firebase.app'; export const FIREBASE_OPTIONS = new InjectionToken('angularfire2.app.options'); @@ -24,12 +24,13 @@ export function ɵfirebaseAppFactory(options: FirebaseOptions, zone: NgZone, nam const hmr = !!(module as any).hot; log('error', `${app.name} Firebase App already initialized with different options${hmr ? ', you may need to reload as Firebase is not HMR aware.' : '.'}`); } - } catch (e) { } + } catch (e) { /* empty */ } return new FirebaseApp(app); } const log = (level: 'log'|'error'|'info'|'warn', ...args: any) => { if (isDevMode() && typeof console !== 'undefined') { + // eslint-disable-next-line no-console console[level](...args); } }; @@ -58,10 +59,11 @@ export class AngularFireModule { }; } - // tslint:disable-next-line:ban-types + // eslint-disable-next-line @typescript-eslint/ban-types constructor(@Inject(PLATFORM_ID) platformId: Object) { firebase.registerVersion('angularfire', VERSION.full, 'core'); firebase.registerVersion('angularfire', VERSION.full, 'app-compat'); + // eslint-disable-next-line @typescript-eslint/no-base-to-string firebase.registerVersion('angular', NG_VERSION.full, platformId.toString()); } } diff --git a/src/compat/firebase.app.ts b/src/compat/firebase.app.ts index 9c19c6f6a..3f8f6d6be 100644 --- a/src/compat/firebase.app.ts +++ b/src/compat/firebase.app.ts @@ -1,6 +1,6 @@ import firebase from 'firebase/compat/app'; -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface FirebaseApp extends firebase.app.App {} export class FirebaseApp { diff --git a/src/compat/firestore/collection-group/collection-group.spec.ts b/src/compat/firestore/collection-group/collection-group.spec.ts index 04aa646c6..05f0d5c45 100644 --- a/src/compat/firestore/collection-group/collection-group.spec.ts +++ b/src/compat/firestore/collection-group/collection-group.spec.ts @@ -1,22 +1,21 @@ -import { AngularFireModule, FirebaseApp } from '@angular/fire/compat'; -import { QueryGroupFn, Query , AngularFirestore, AngularFirestoreCollectionGroup, AngularFirestoreModule, USE_EMULATOR } from '@angular/fire/compat/firestore'; +import { TestBed } from '@angular/core/testing'; +import { AngularFireModule } from '@angular/fire/compat'; +import { AngularFirestore, AngularFirestoreCollectionGroup , AngularFirestoreModule, Query, QueryGroupFn, USE_EMULATOR } from '@angular/fire/compat/firestore'; import { BehaviorSubject } from 'rxjs'; import { skip, switchMap, take } from 'rxjs/operators'; -import { TestBed } from '@angular/core/testing'; import { COMMON_CONFIG } from '../../../../src/test-config'; -import 'firebase/compat/firestore'; - +import { rando } from '../../../../src/utils'; import { + FAKE_STOCK_DATA, + Stock, createRandomStocks, delayAdd, delayDelete, delayUpdate, deleteThemAll, - FAKE_STOCK_DATA, - randomName, - Stock + randomName } from '../utils.spec'; -import { rando } from '../../../../src/utils'; +import 'firebase/compat/firestore'; async function collectionHarness(afs: AngularFirestore, items: number, queryGroupFn?: QueryGroupFn) { const randomCollectionName = randomName(afs.firestore); @@ -30,7 +29,6 @@ async function collectionHarness(afs: AngularFirestore, items: number, queryGrou } describe('AngularFirestoreCollectionGroup', () => { - let app: FirebaseApp; let afs: AngularFirestore; beforeEach(() => { @@ -44,7 +42,6 @@ describe('AngularFirestoreCollectionGroup', () => { ] }); - app = TestBed.inject(FirebaseApp); afs = TestBed.inject(AngularFirestore); }); @@ -86,8 +83,7 @@ describe('AngularFirestoreCollectionGroup', () => { const ITEMS = 4; const { ref, stocks, names } = await collectionHarness(afs, ITEMS); const changes = stocks.valueChanges(); - const sub = changes.subscribe(() => { - }); + const sub = changes.subscribe(() => undefined); sub.add( changes.pipe(take(1)).subscribe(data => { expect(data.length).toEqual(ITEMS); @@ -110,8 +106,7 @@ describe('AngularFirestoreCollectionGroup', () => { const ITEMS = 4; const { ref, stocks, names } = await collectionHarness(afs, ITEMS); const changes = stocks.valueChanges(); - changes.pipe(take(1)).subscribe(() => { - }).add(() => { + changes.pipe(take(1)).subscribe(() => undefined).add(() => { changes.pipe(take(1)).subscribe(data => { expect(data.length).toEqual(ITEMS); }).add(() => { @@ -217,8 +212,7 @@ describe('AngularFirestoreCollectionGroup', () => { const ITEMS = 4; const { ref, stocks, names } = await collectionHarness(afs, ITEMS); const changes = stocks.snapshotChanges(); - const sub = changes.subscribe(() => { - }); + const sub = changes.subscribe(() => undefined); sub.add( changes.pipe(take(1)).subscribe(data => { expect(data.length).toEqual(ITEMS); @@ -241,8 +235,7 @@ describe('AngularFirestoreCollectionGroup', () => { const ITEMS = 4; const { ref, stocks, names } = await collectionHarness(afs, ITEMS); const changes = stocks.snapshotChanges(); - changes.pipe(take(1)).subscribe(() => { - }).add(() => { + changes.pipe(take(1)).subscribe(() => undefined).add(() => { changes.pipe(take(1)).subscribe(data => { expect(data.length).toEqual(ITEMS); }).add(() => { @@ -501,8 +494,7 @@ describe('AngularFirestoreCollectionGroup', () => { const ITEMS = 4; const { ref, stocks, names } = await collectionHarness(afs, ITEMS); const changes = stocks.stateChanges(); - const sub = changes.subscribe(() => { - }); + const sub = changes.subscribe(() => undefined); sub.add( changes.pipe(take(1)).subscribe(data => { expect(data.length).toEqual(ITEMS); @@ -525,8 +517,7 @@ describe('AngularFirestoreCollectionGroup', () => { const ITEMS = 4; const { ref, stocks, names } = await collectionHarness(afs, ITEMS); const changes = stocks.stateChanges(); - changes.pipe(take(1)).subscribe(() => { - }).add(() => { + changes.pipe(take(1)).subscribe(() => undefined).add(() => { changes.pipe(take(1)).subscribe(data => { expect(data.length).toEqual(ITEMS); }).add(() => { diff --git a/src/compat/firestore/collection-group/collection-group.ts b/src/compat/firestore/collection-group/collection-group.ts index 06162ed13..99d93abfd 100644 --- a/src/compat/firestore/collection-group/collection-group.ts +++ b/src/compat/firestore/collection-group/collection-group.ts @@ -1,13 +1,12 @@ -import { from, Observable } from 'rxjs'; -import { fromCollectionRef } from '../observable/fromRef'; -import { filter, map, scan } from 'rxjs/operators'; -import firebase from 'firebase/compat/app'; import { keepUnstableUntilFirst } from '@angular/fire'; - -import { DocumentChangeAction, DocumentChangeType, DocumentData, Query } from '../interfaces'; -import { validateEventsArray } from '../collection/collection'; +import firebase from 'firebase/compat/app'; +import { Observable, from } from 'rxjs'; +import { filter, map, scan } from 'rxjs/operators'; import { docChanges, sortedChanges } from '../collection/changes'; +import { validateEventsArray } from '../collection/collection'; import { AngularFirestore } from '../firestore'; +import { DocumentChangeAction, DocumentChangeType, DocumentData, Query } from '../interfaces'; +import { fromCollectionRef } from '../observable/fromRef'; /** * AngularFirestoreCollectionGroup service @@ -82,7 +81,7 @@ export class AngularFirestoreCollectionGroup { * provided `idField` property name. */ valueChanges(): Observable; - // tslint:disable-next-line:unified-signatures + // eslint-disable-next-line no-empty-pattern valueChanges({}): Observable; valueChanges(options: {idField: K}): Observable<(T & { [T in K]: string })[]>; valueChanges(options: {idField?: K} = {}): Observable { diff --git a/src/compat/firestore/collection/changes.ts b/src/compat/firestore/collection/changes.ts index b7c741dfe..5676d47fb 100644 --- a/src/compat/firestore/collection/changes.ts +++ b/src/compat/firestore/collection/changes.ts @@ -1,8 +1,8 @@ -import { fromCollectionRef } from '../observable/fromRef'; +import firebase from 'firebase/compat/app'; import { Observable, SchedulerLike } from 'rxjs'; import { distinctUntilChanged, map, pairwise, scan, startWith } from 'rxjs/operators'; -import { Action, QuerySnapshot, DocumentChange, DocumentChangeAction, DocumentChangeType, Query } from '../interfaces'; -import firebase from 'firebase/compat/app'; +import { Action, DocumentChange, DocumentChangeAction, DocumentChangeType, Query, QuerySnapshot } from '../interfaces'; +import { fromCollectionRef } from '../observable/fromRef'; type ActionTupe = [Action>, Action>] diff --git a/src/compat/firestore/collection/collection.spec.ts b/src/compat/firestore/collection/collection.spec.ts index c2cfa0ce2..bbd8226de 100644 --- a/src/compat/firestore/collection/collection.spec.ts +++ b/src/compat/firestore/collection/collection.spec.ts @@ -1,23 +1,22 @@ -import { AngularFireModule, FirebaseApp } from '@angular/fire/compat'; -import { AngularFirestore, USE_EMULATOR, AngularFirestoreModule, AngularFirestoreCollection, QueryFn, CollectionReference } from '@angular/fire/compat/firestore'; +import { TestBed } from '@angular/core/testing'; +import { AngularFireModule } from '@angular/fire/compat'; +import { AngularFirestore, AngularFirestoreCollection, AngularFirestoreModule, CollectionReference, QueryFn, USE_EMULATOR } from '@angular/fire/compat/firestore'; import { BehaviorSubject } from 'rxjs'; import { skip, switchMap, take } from 'rxjs/operators'; -import 'firebase/compat/firestore'; - -import { async, TestBed } from '@angular/core/testing'; import { COMMON_CONFIG } from '../../../../src/test-config'; - +import { rando } from '../../../../src/utils'; import { + FAKE_STOCK_DATA, + Stock, createRandomStocks, delayAdd, delayDelete, delayUpdate, deleteThemAll, - FAKE_STOCK_DATA, - randomName, - Stock + randomName } from '../utils.spec'; -import { rando } from '../../../../src/utils'; + +import 'firebase/compat/firestore'; async function collectionHarness(afs: AngularFirestore, items: number, queryFn?: QueryFn) { const randomCollectionName = randomName(afs.firestore); @@ -31,7 +30,6 @@ async function collectionHarness(afs: AngularFirestore, items: number, queryFn?: } describe('AngularFirestoreCollection', () => { - let app: FirebaseApp; let afs: AngularFirestore; beforeEach(() => { @@ -45,7 +43,6 @@ describe('AngularFirestoreCollection', () => { ] }); - app = TestBed.inject(FirebaseApp); afs = TestBed.inject(AngularFirestore); }); @@ -105,8 +102,7 @@ describe('AngularFirestoreCollection', () => { const ITEMS = 4; const { ref, stocks, names } = await collectionHarness(afs, ITEMS); const changes = stocks.valueChanges(); - const sub = changes.subscribe(() => { - }); + const sub = changes.subscribe(() => undefined); sub.add( changes.pipe(take(1)).subscribe(data => { expect(data.length).toEqual(ITEMS); @@ -129,8 +125,7 @@ describe('AngularFirestoreCollection', () => { const ITEMS = 4; const { ref, stocks, names } = await collectionHarness(afs, ITEMS); const changes = stocks.valueChanges(); - changes.pipe(take(1)).subscribe(() => { - }).add(() => { + changes.pipe(take(1)).subscribe(() => undefined).add(() => { changes.pipe(take(1)).subscribe(data => { expect(data.length).toEqual(ITEMS); }).add(() => { @@ -220,7 +215,7 @@ describe('AngularFirestoreCollection', () => { const ITEMS = 4; const { ref, stocks, names } = await collectionHarness(afs, ITEMS); const changes$ = stocks.snapshotChanges(); - const sub = changes$.subscribe(changes => { }); + const sub = changes$.subscribe(() => undefined); sub.add( changes$.pipe(take(1)).subscribe(data => { expect(data.length).toEqual(ITEMS); @@ -243,8 +238,7 @@ describe('AngularFirestoreCollection', () => { const ITEMS = 4; const { ref, stocks, names } = await collectionHarness(afs, ITEMS); const changes = stocks.snapshotChanges(); - changes.pipe(take(1)).subscribe(() => { - }).add(() => { + changes.pipe(take(1)).subscribe(() => undefined).add(() => { changes.pipe(take(1)).subscribe(data => { expect(data.length).toEqual(ITEMS); }).add(() => { @@ -475,8 +469,7 @@ describe('AngularFirestoreCollection', () => { const ITEMS = 4; const { ref, stocks, names } = await collectionHarness(afs, ITEMS); const changes = stocks.stateChanges(); - const sub = changes.subscribe(() => { - }); + const sub = changes.subscribe(() => undefined); sub.add( changes.pipe(take(1)).subscribe(data => { expect(data.length).toEqual(ITEMS); @@ -499,8 +492,7 @@ describe('AngularFirestoreCollection', () => { const ITEMS = 4; const { ref, stocks, names } = await collectionHarness(afs, ITEMS); const changes = stocks.stateChanges(); - changes.pipe(take(1)).subscribe(() => { - }).add(() => { + changes.pipe(take(1)).subscribe(() => undefined).add(() => { changes.pipe(take(1)).subscribe(data => { expect(data.length).toEqual(ITEMS); }).add(() => { diff --git a/src/compat/firestore/collection/collection.ts b/src/compat/firestore/collection/collection.ts index 54efd316a..2cae2f6ec 100644 --- a/src/compat/firestore/collection/collection.ts +++ b/src/compat/firestore/collection/collection.ts @@ -1,13 +1,12 @@ -import { from, Observable } from 'rxjs'; -import { filter, map, pairwise, scan, startWith } from 'rxjs/operators'; -import firebase from 'firebase/compat/app'; import { keepUnstableUntilFirst } from '@angular/fire'; - -import { CollectionReference, DocumentChangeAction, DocumentChangeType, DocumentData, DocumentReference, Query } from '../interfaces'; -import { docChanges, sortedChanges } from './changes'; +import firebase from 'firebase/compat/app'; +import { Observable, from } from 'rxjs'; +import { filter, map, pairwise, scan, startWith } from 'rxjs/operators'; import { AngularFirestoreDocument } from '../document/document'; -import { fromCollectionRef } from '../observable/fromRef'; import { AngularFirestore } from '../firestore'; +import { CollectionReference, DocumentChangeAction, DocumentChangeType, DocumentData, DocumentReference, Query } from '../interfaces'; +import { fromCollectionRef } from '../observable/fromRef'; +import { docChanges, sortedChanges } from './changes'; type DocumentChangeTuple = [DocumentChangeAction[], DocumentChangeAction[]]; @@ -74,7 +73,7 @@ export class AngularFirestoreCollection { startWith[], undefined>(undefined), pairwise(), filter(([prior, current]: DocumentChangeTuple) => current.length > 0 || !prior), - map(([prior, current]) => current), + map(([, current]) => current), keepUnstableUntilFirst ); } @@ -106,7 +105,7 @@ export class AngularFirestoreCollection { * provided `idField` property name. */ valueChanges(): Observable; - // tslint:disable-next-line:unified-signatures + // eslint-disable-next-line no-empty-pattern valueChanges({}): Observable; valueChanges(options: {idField: K}): Observable<(T & { [T in K]: string })[]>; valueChanges(options: {idField?: K} = {}): Observable { @@ -115,7 +114,7 @@ export class AngularFirestoreCollection { map(actions => actions.payload.docs.map(a => { if (options.idField) { return { - ...a.data() as {}, + ...a.data() as any, ...{ [options.idField]: a.id } } as T & { [T in K]: string }; } else { diff --git a/src/compat/firestore/document/document.spec.ts b/src/compat/firestore/document/document.spec.ts index 21c5d39b0..d8d8f73b9 100644 --- a/src/compat/firestore/document/document.spec.ts +++ b/src/compat/firestore/document/document.spec.ts @@ -1,18 +1,15 @@ -import { AngularFireModule, FirebaseApp } from '@angular/fire/compat'; -import { AngularFirestore, USE_EMULATOR, AngularFirestoreModule, AngularFirestoreDocument, DocumentReference } from '@angular/fire/compat/firestore'; -import { take } from 'rxjs/operators'; - import { TestBed } from '@angular/core/testing'; +import { AngularFireModule } from '@angular/fire/compat'; +import { AngularFirestore, AngularFirestoreDocument, AngularFirestoreModule, DocumentReference, USE_EMULATOR } from '@angular/fire/compat/firestore'; +import firebase from 'firebase/compat/app'; +import { take } from 'rxjs/operators'; import { COMMON_CONFIG } from '../../../../src/test-config'; - -import { FAKE_STOCK_DATA, randomName, Stock } from '../utils.spec'; import { rando } from '../../../../src/utils'; -import firebase from 'firebase/compat/app'; +import { FAKE_STOCK_DATA, Stock, randomName } from '../utils.spec'; import 'firebase/compat/firestore'; // TODO(davideast): Investage this flake on Safari. describe('AngularFirestoreDocument', () => { - let app: FirebaseApp; let afs: AngularFirestore; beforeEach(() => { @@ -26,7 +23,6 @@ describe('AngularFirestoreDocument', () => { ] }); - app = TestBed.inject(FirebaseApp); afs = TestBed.inject(AngularFirestore); }); @@ -43,7 +39,7 @@ describe('AngularFirestoreDocument', () => { const stock = new AngularFirestoreDocument(ref, afs); await stock.set(FAKE_STOCK_DATA); const obs$ = stock.valueChanges(); - obs$.pipe(take(1)).subscribe(async data => { + obs$.pipe(take(1)).subscribe(data => { expect(data).toEqual(FAKE_STOCK_DATA); stock.delete().then(done).catch(done.fail); }); @@ -79,7 +75,7 @@ describe('AngularFirestoreDocument', () => { await stock.set(FAKE_STOCK_DATA); const sub = stock .snapshotChanges() - .subscribe(async a => { + .subscribe(a => { sub.unsubscribe(); if (a.payload.exists) { expect(a.payload.data()).toEqual(FAKE_STOCK_DATA); @@ -96,7 +92,7 @@ describe('AngularFirestoreDocument', () => { const stock = new AngularFirestoreDocument(ref, afs); await stock.set(FAKE_STOCK_DATA); const obs$ = stock.valueChanges(); - obs$.pipe(take(1)).subscribe(async data => { + obs$.pipe(take(1)).subscribe(data => { expect(data).toEqual(FAKE_STOCK_DATA); stock.delete().then(done).catch(done.fail); }); diff --git a/src/compat/firestore/document/document.ts b/src/compat/firestore/document/document.ts index bc4b551f4..c70b754eb 100644 --- a/src/compat/firestore/document/document.ts +++ b/src/compat/firestore/document/document.ts @@ -1,11 +1,11 @@ -import { from, Observable } from 'rxjs'; import { keepUnstableUntilFirst } from '@angular/fire'; -import { Action, DocumentData, DocumentReference, DocumentSnapshot, QueryFn, SetOptions } from '../interfaces'; -import { fromDocRef } from '../observable/fromRef'; +import firebase from 'firebase/compat/app'; +import { Observable, from } from 'rxjs'; import { map } from 'rxjs/operators'; -import { AngularFirestore, associateQuery } from '../firestore'; import { AngularFirestoreCollection } from '../collection/collection'; -import firebase from 'firebase/compat/app'; +import { AngularFirestore, associateQuery } from '../firestore'; +import { Action, DocumentData, DocumentReference, DocumentSnapshot, QueryFn, SetOptions } from '../interfaces'; +import { fromDocRef } from '../observable/fromRef'; /** * AngularFirestoreDocument service @@ -84,7 +84,7 @@ export class AngularFirestoreDocument { * If the `idField` option is provided, document IDs are included and mapped to the * provided `idField` property name. */ - valueChanges(options?: { }): Observable; + valueChanges(options?: unknown): Observable; valueChanges(options: { idField: K }): Observable<(T & { [T in K]: string }) | undefined>; valueChanges(options: { idField?: K } = {}): Observable { return this.snapshotChanges().pipe( diff --git a/src/compat/firestore/firestore.module.ts b/src/compat/firestore/firestore.module.ts index 01cb5e421..ec1f916ac 100644 --- a/src/compat/firestore/firestore.module.ts +++ b/src/compat/firestore/firestore.module.ts @@ -1,8 +1,8 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; -import { PersistenceSettings } from './interfaces'; -import { AngularFirestore, ENABLE_PERSISTENCE, PERSISTENCE_SETTINGS } from './firestore'; -import firebase from 'firebase/compat/app'; import { VERSION } from '@angular/fire'; +import firebase from 'firebase/compat/app'; +import { AngularFirestore, ENABLE_PERSISTENCE, PERSISTENCE_SETTINGS } from './firestore'; +import { PersistenceSettings } from './interfaces'; @NgModule({ providers: [ AngularFirestore ] diff --git a/src/compat/firestore/firestore.spec.ts b/src/compat/firestore/firestore.spec.ts index ffd901148..5cb78d03d 100644 --- a/src/compat/firestore/firestore.spec.ts +++ b/src/compat/firestore/firestore.spec.ts @@ -1,13 +1,11 @@ -import { AngularFireModule, FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseApp } from '@angular/fire/compat'; -import { AngularFirestore, USE_EMULATOR, AngularFirestoreModule, AngularFirestoreDocument, AngularFirestoreCollection } from '@angular/fire/compat/firestore'; - import { TestBed } from '@angular/core/testing'; +import { AngularFireModule, FIREBASE_APP_NAME, FIREBASE_OPTIONS } from '@angular/fire/compat'; +import { AngularFirestore, AngularFirestoreCollection, AngularFirestoreDocument, AngularFirestoreModule, USE_EMULATOR } from '@angular/fire/compat/firestore'; import { COMMON_CONFIG } from '../../../src/test-config'; import 'firebase/compat/firestore'; import { rando } from '../../../src/utils'; describe('AngularFirestore', () => { - let app: FirebaseApp; let afs: AngularFirestore; beforeEach(() => { @@ -21,12 +19,11 @@ describe('AngularFirestore', () => { ] }); - app = TestBed.inject(FirebaseApp); afs = TestBed.inject(AngularFirestore); }); - afterEach(() => { - afs.firestore.disableNetwork(); + afterEach(async () => { + await afs.firestore.disableNetwork(); }); it('should be the properly initialized type', () => { @@ -94,7 +91,6 @@ describe('AngularFirestore', () => { }); describe('AngularFirestore with different app', () => { - let app: FirebaseApp; let afs: AngularFirestore; let firebaseAppName: string; @@ -113,7 +109,6 @@ describe('AngularFirestore with different app', () => { }); - app = TestBed.inject(FirebaseApp); afs = TestBed.inject(AngularFirestore); }); @@ -136,7 +131,6 @@ describe('AngularFirestore with different app', () => { describe('AngularFirestore without persistance', () => { - let app: FirebaseApp; let afs: AngularFirestore; beforeEach(() => { @@ -150,7 +144,6 @@ describe('AngularFirestore without persistance', () => { ] }); - app = TestBed.inject(FirebaseApp); afs = TestBed.inject(AngularFirestore); }); diff --git a/src/compat/firestore/firestore.ts b/src/compat/firestore/firestore.ts index 8a31a8063..bd7132081 100644 --- a/src/compat/firestore/firestore.ts +++ b/src/compat/firestore/firestore.ts @@ -1,5 +1,24 @@ +import { isPlatformServer } from '@angular/common'; import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core'; -import { from, Observable, of } from 'rxjs'; +import { ɵAngularFireSchedulers } from '@angular/fire'; +import { AppCheckInstances } from '@angular/fire/app-check'; +import { FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance, ɵfirebaseAppFactory } from '@angular/fire/compat'; +import { + SETTINGS as AUTH_SETTINGS, + AngularFireAuth, + LANGUAGE_CODE, + PERSISTENCE, + TENANT_ID, + USE_EMULATOR as USE_AUTH_EMULATOR, + USE_DEVICE_LANGUAGE, + ɵauthFactory, +} from '@angular/fire/compat/auth'; +import { FirebaseOptions } from 'firebase/app'; +import firebase from 'firebase/compat/app'; +import { Observable, from, of } from 'rxjs'; +import { AngularFirestoreCollection } from './collection/collection'; +import { AngularFirestoreCollectionGroup } from './collection-group/collection-group'; +import { AngularFirestoreDocument } from './document/document'; import { AssociatedReference, CollectionReference, @@ -10,27 +29,8 @@ import { QueryGroupFn, Settings } from './interfaces'; -import { AngularFirestoreDocument } from './document/document'; -import { AngularFirestoreCollection } from './collection/collection'; -import { AngularFirestoreCollectionGroup } from './collection-group/collection-group'; -import { ɵAngularFireSchedulers } from '@angular/fire'; -import { FirebaseApp, ɵfirebaseAppFactory, FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance } from '@angular/fire/compat'; -import { FirebaseOptions } from 'firebase/app'; -import { isPlatformServer } from '@angular/common'; -import firebase from 'firebase/compat/app'; import 'firebase/compat/auth'; import 'firebase/compat/firestore'; -import { - AngularFireAuth, - USE_EMULATOR as USE_AUTH_EMULATOR, - SETTINGS as AUTH_SETTINGS, - TENANT_ID, - LANGUAGE_CODE, - USE_DEVICE_LANGUAGE, - PERSISTENCE, - ɵauthFactory, -} from '@angular/fire/compat/auth'; -import { AppCheckInstances } from '@angular/fire/app-check'; /** * The value of this token determines whether or not the firestore will have persistance enabled @@ -60,13 +60,6 @@ export function associateQuery(collectionRef: CollectionReference, queryFn return { query, ref }; } -type InstanceCache = Map; - /** * AngularFirestore Service * @@ -139,7 +132,7 @@ export class AngularFirestore { @Optional() @Inject(FIREBASE_APP_NAME) name: string | null | undefined, @Optional() @Inject(ENABLE_PERSISTENCE) shouldEnablePersistence: boolean | null, @Optional() @Inject(SETTINGS) settings: Settings | null, - // tslint:disable-next-line:ban-types + // eslint-disable-next-line @typescript-eslint/ban-types @Inject(PLATFORM_ID) platformId: Object, zone: NgZone, public schedulers: ɵAngularFireSchedulers, @@ -195,7 +188,6 @@ export class AngularFirestore { * set. */ collection(path: string, queryFn?: QueryFn): AngularFirestoreCollection; - // tslint:disable-next-line:unified-signatures collection(ref: CollectionReference, queryFn?: QueryFn): AngularFirestoreCollection; collection(pathOrRef: string | CollectionReference, queryFn?: QueryFn): AngularFirestoreCollection { let collectionRef: CollectionReference; @@ -227,7 +219,6 @@ export class AngularFirestore { * Collection reference and can be queried. */ doc(path: string): AngularFirestoreDocument; - // tslint:disable-next-line:unified-signatures doc(ref: DocumentReference): AngularFirestoreDocument; doc(pathOrRef: string | DocumentReference): AngularFirestoreDocument { let ref: DocumentReference; diff --git a/src/compat/firestore/interfaces.ts b/src/compat/firestore/interfaces.ts index ab5712310..a557a4531 100644 --- a/src/compat/firestore/interfaces.ts +++ b/src/compat/firestore/interfaces.ts @@ -1,5 +1,5 @@ -import { Subscriber } from 'rxjs'; import firebase from 'firebase/compat/app'; +import { Subscriber } from 'rxjs'; export type Settings = firebase.firestore.Settings; export type CollectionReference = firebase.firestore.CollectionReference; @@ -48,7 +48,7 @@ export interface Action { payload: T; } -export interface Reference { +export interface Reference { onSnapshot: (options: firebase.firestore.SnapshotListenOptions, sub: Subscriber) => any; } diff --git a/src/compat/firestore/observable/fromRef.ts b/src/compat/firestore/observable/fromRef.ts index 2557c4cd9..8d7ce4393 100644 --- a/src/compat/firestore/observable/fromRef.ts +++ b/src/compat/firestore/observable/fromRef.ts @@ -1,8 +1,8 @@ -import { asyncScheduler, Observable, SchedulerLike } from 'rxjs'; -import { Action, DocumentReference, DocumentSnapshot, Query, QuerySnapshot, Reference } from '../interfaces'; +import { Observable, SchedulerLike, asyncScheduler } from 'rxjs'; import { map, pairwise, startWith } from 'rxjs/operators'; +import { Action, DocumentReference, DocumentSnapshot, Query, QuerySnapshot, Reference } from '../interfaces'; -function _fromRef(ref: Reference, scheduler: SchedulerLike = asyncScheduler): Observable { +function _fromRef(ref: Reference, scheduler: SchedulerLike = asyncScheduler): Observable { return new Observable(subscriber => { let unsubscribe: () => void; if (scheduler != null) { @@ -22,7 +22,7 @@ function _fromRef(ref: Reference, scheduler: SchedulerLike = asyncSched } export function fromRef(ref: DocumentReference | Query, scheduler?: SchedulerLike) { - return _fromRef(ref, scheduler); + return _fromRef(ref, scheduler); } export function fromDocRef(ref: DocumentReference, scheduler?: SchedulerLike): Observable>> { diff --git a/src/compat/firestore/utils.spec.ts b/src/compat/firestore/utils.spec.ts index 79f284dbf..6552c4d72 100644 --- a/src/compat/firestore/utils.spec.ts +++ b/src/compat/firestore/utils.spec.ts @@ -1,5 +1,5 @@ -import firebase from 'firebase/compat/app'; import { AngularFirestoreCollection } from '@angular/fire/compat/firestore'; +import firebase from 'firebase/compat/app'; export interface Stock { name: string; @@ -18,9 +18,8 @@ export const createRandomStocks = async ( // Create a batch to update everything at once const batch = firestore.batch(); // Store the random names to delete them later - const count = 0; let names: string[] = []; - Array.from(Array(numberOfItems)).forEach((a, i) => { + Array.from(Array(numberOfItems)).forEach(() => { const name = randomName(firestore); batch.set(collectionRef.doc(name), FAKE_STOCK_DATA); names = [...names, name]; diff --git a/src/compat/functions/functions.module.ts b/src/compat/functions/functions.module.ts index ae4c4d4aa..f6cc15327 100644 --- a/src/compat/functions/functions.module.ts +++ b/src/compat/functions/functions.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; -import { AngularFireFunctions } from './functions'; -import firebase from 'firebase/compat/app'; import { VERSION } from '@angular/fire'; +import firebase from 'firebase/compat/app'; +import { AngularFireFunctions } from './functions'; @NgModule({ providers: [ AngularFireFunctions ] diff --git a/src/compat/functions/functions.spec.ts b/src/compat/functions/functions.spec.ts index c350ff346..d762c51ad 100644 --- a/src/compat/functions/functions.spec.ts +++ b/src/compat/functions/functions.spec.ts @@ -1,12 +1,11 @@ import { TestBed } from '@angular/core/testing'; -import { AngularFireModule, FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseApp } from '@angular/fire/compat'; -import { AngularFireFunctions, AngularFireFunctionsModule, USE_EMULATOR, REGION } from '@angular/fire/compat/functions'; +import { AngularFireModule, FIREBASE_APP_NAME, FIREBASE_OPTIONS } from '@angular/fire/compat'; +import { AngularFireFunctions, AngularFireFunctionsModule, REGION, USE_EMULATOR } from '@angular/fire/compat/functions'; import { COMMON_CONFIG } from '../../../src/test-config'; import 'firebase/compat/functions'; import { rando } from '../../../src/utils'; describe('AngularFireFunctions', () => { - let app: FirebaseApp; let afFns: AngularFireFunctions; beforeEach(() => { @@ -17,7 +16,6 @@ describe('AngularFireFunctions', () => { ] }); - app = TestBed.inject(FirebaseApp); afFns = TestBed.inject(AngularFireFunctions); }); @@ -32,7 +30,6 @@ describe('AngularFireFunctions', () => { }); describe('AngularFireFunctions with different app', () => { - let app: FirebaseApp; let afFns: AngularFireFunctions; let firebaseAppName: string; @@ -51,7 +48,6 @@ describe('AngularFireFunctions with different app', () => { ] }); - app = TestBed.inject(FirebaseApp); afFns = TestBed.inject(AngularFireFunctions); }); diff --git a/src/compat/functions/functions.ts b/src/compat/functions/functions.ts index 1971ae4e3..2b6500188 100644 --- a/src/compat/functions/functions.ts +++ b/src/compat/functions/functions.ts @@ -1,14 +1,14 @@ import { Inject, Injectable, InjectionToken, NgZone, Optional } from '@angular/core'; -import { from, Observable, of } from 'rxjs'; -import { map, observeOn, shareReplay, switchMap } from 'rxjs/operators'; import { ɵAngularFireSchedulers } from '@angular/fire'; -import { ɵlazySDKProxy, ɵPromiseProxy, ɵapplyMixins } from '@angular/fire/compat'; +import { AppCheckInstances } from '@angular/fire/app-check'; +import { ɵPromiseProxy, ɵapplyMixins, ɵlazySDKProxy } from '@angular/fire/compat'; +import { FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance, ɵfirebaseAppFactory } from '@angular/fire/compat'; +import { HttpsCallableOptions } from '@firebase/functions-types'; import { FirebaseOptions } from 'firebase/app'; -import { ɵfirebaseAppFactory, FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance } from '@angular/fire/compat'; import firebase from 'firebase/compat/app'; +import { Observable, from, of } from 'rxjs'; +import { map, observeOn, shareReplay, switchMap } from 'rxjs/operators'; import { proxyPolyfillCompat } from './base'; -import { HttpsCallableOptions } from '@firebase/functions-types'; -import { AppCheckInstances } from '@angular/fire/app-check'; export const ORIGIN = new InjectionToken('angularfire2.functions.origin'); export const REGION = new InjectionToken('angularfire2.functions.region'); @@ -17,6 +17,7 @@ type UseEmulatorArguments = Parameters('angularfire2.functions.use-emulator'); // override httpsCallable for compatibility with 5.x +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface AngularFireFunctions extends Omit<ɵPromiseProxy, 'httpsCallable'> { } diff --git a/src/compat/messaging/messaging.module.ts b/src/compat/messaging/messaging.module.ts index 12dea8aaf..6912c4992 100644 --- a/src/compat/messaging/messaging.module.ts +++ b/src/compat/messaging/messaging.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; -import { AngularFireMessaging } from './messaging'; -import firebase from 'firebase/compat/app'; import { VERSION } from '@angular/fire'; +import firebase from 'firebase/compat/app'; +import { AngularFireMessaging } from './messaging'; @NgModule({ providers: [ AngularFireMessaging ] diff --git a/src/compat/messaging/messaging.spec.ts b/src/compat/messaging/messaging.spec.ts index 589b84342..ddd616d98 100644 --- a/src/compat/messaging/messaging.spec.ts +++ b/src/compat/messaging/messaging.spec.ts @@ -1,11 +1,10 @@ import { TestBed } from '@angular/core/testing'; -import { AngularFireModule, FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseApp } from '@angular/fire/compat'; +import { AngularFireModule, FIREBASE_APP_NAME, FIREBASE_OPTIONS } from '@angular/fire/compat'; import { AngularFireMessaging, AngularFireMessagingModule } from '@angular/fire/compat/messaging'; import { COMMON_CONFIG } from '../../../src/test-config'; import { rando } from '../../../src/utils'; describe('AngularFireMessaging', () => { - let app: FirebaseApp; let afm: AngularFireMessaging; beforeEach(() => { @@ -16,7 +15,6 @@ describe('AngularFireMessaging', () => { ] }); - app = TestBed.inject(FirebaseApp); afm = TestBed.inject(AngularFireMessaging); }); @@ -33,7 +31,6 @@ describe('AngularFireMessaging', () => { const FIREBASE_APP_NAME_TOO = (Math.random() + 1).toString(36).substring(7); describe('AngularFireMessaging with different app', () => { - let app: FirebaseApp; let afm: AngularFireMessaging; beforeEach(() => { @@ -48,7 +45,6 @@ describe('AngularFireMessaging with different app', () => { ] }); - app = TestBed.inject(FirebaseApp); afm = TestBed.inject(AngularFireMessaging); }); diff --git a/src/compat/messaging/messaging.ts b/src/compat/messaging/messaging.ts index b46d4950d..84d9d605b 100644 --- a/src/compat/messaging/messaging.ts +++ b/src/compat/messaging/messaging.ts @@ -1,17 +1,18 @@ import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core'; -import firebase from 'firebase/compat/app'; -import { concat, EMPTY, Observable, of } from 'rxjs'; -import { catchError, defaultIfEmpty, map, mergeMap, observeOn, switchMap, switchMapTo, shareReplay, subscribeOn } from 'rxjs/operators'; import { ɵAngularFireSchedulers } from '@angular/fire'; -import { ɵlazySDKProxy, ɵPromiseProxy, ɵapplyMixins } from '@angular/fire/compat'; -import { ɵfirebaseAppFactory, FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance } from '@angular/fire/compat'; +import { ɵPromiseProxy, ɵapplyMixins, ɵlazySDKProxy } from '@angular/fire/compat'; +import { FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance, ɵfirebaseAppFactory } from '@angular/fire/compat'; import { FirebaseOptions } from 'firebase/app'; -import { proxyPolyfillCompat } from './base'; +import firebase from 'firebase/compat/app'; import { isSupported } from 'firebase/messaging'; +import { EMPTY, Observable, concat, of } from 'rxjs'; +import { catchError, defaultIfEmpty, map, mergeMap, observeOn, shareReplay, subscribeOn, switchMap, switchMapTo } from 'rxjs/operators'; +import { proxyPolyfillCompat } from './base'; export const VAPID_KEY = new InjectionToken('angularfire2.messaging.vapid-key'); export const SERVICE_WORKER = new InjectionToken>('angularfire2.messaging.service-worker-registeration'); +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface AngularFireMessaging extends Omit<ɵPromiseProxy, 'deleteToken' | 'getToken' | 'requestPermission'> { } @@ -30,7 +31,7 @@ export class AngularFireMessaging { constructor( @Inject(FIREBASE_OPTIONS) options: FirebaseOptions, @Optional() @Inject(FIREBASE_APP_NAME) name: string | null | undefined, - // tslint:disable-next-line:ban-types + // eslint-disable-next-line @typescript-eslint/ban-types @Inject(PLATFORM_ID) platformId: Object, zone: NgZone, schedulers: ɵAngularFireSchedulers, @@ -45,8 +46,8 @@ export class AngularFireMessaging { switchMap(isSupported), switchMap(supported => supported ? import('firebase/compat/messaging') : EMPTY), map(() => ɵfirebaseAppFactory(options, zone, name)), - switchMap(app => ɵcacheInstance(`${app.name}.messaging`, 'AngularFireMessaging', app.name, async () => { - return app.messaging(); + switchMap(app => ɵcacheInstance(`${app.name}.messaging`, 'AngularFireMessaging', app.name, () => { + return of(app.messaging()); }, [])), shareReplay({ bufferSize: 1, refCount: false }) ); @@ -63,6 +64,7 @@ export class AngularFireMessaging { observeOn(schedulers.insideAngular), switchMap(async messaging => { if (Notification.permission === 'granted') { + // eslint-disable-next-line @typescript-eslint/no-misused-promises const serviceWorkerRegistration = serviceWorker ? await serviceWorker : null; return await messaging.getToken({ vapidKey, serviceWorkerRegistration }); } else { diff --git a/src/compat/performance/performance.module.ts b/src/compat/performance/performance.module.ts index a79e189fc..5caf2eb97 100644 --- a/src/compat/performance/performance.module.ts +++ b/src/compat/performance/performance.module.ts @@ -1,8 +1,8 @@ import { NgModule, Optional } from '@angular/core'; +import { VERSION } from '@angular/fire'; +import firebase from 'firebase/compat/app'; import { AngularFirePerformance } from './performance'; import { PerformanceMonitoringService } from './performance.service'; -import firebase from 'firebase/compat/app'; -import { VERSION } from '@angular/fire'; @NgModule({ providers: [ AngularFirePerformance ] @@ -14,7 +14,6 @@ export class AngularFirePerformanceModule { ) { firebase.registerVersion('angularfire', VERSION.full, 'perf-compat'); // call anything here to get perf loading - // tslint:disable-next-line:no-unused-expression - perf.dataCollectionEnabled.then(() => {}); + perf.dataCollectionEnabled.then(() => undefined); } } diff --git a/src/compat/performance/performance.service.ts b/src/compat/performance/performance.service.ts index 5510f8087..a4d011271 100644 --- a/src/compat/performance/performance.service.ts +++ b/src/compat/performance/performance.service.ts @@ -11,6 +11,7 @@ export class PerformanceMonitoringService implements OnDestroy { private disposable: Subscription|undefined; constructor(appRef: ApplicationRef) { + // eslint-disable-next-line @typescript-eslint/prefer-optional-chain if (typeof window !== 'undefined' && window.performance?.mark) { this.disposable = appRef.isStable.pipe( first(it => it), diff --git a/src/compat/performance/performance.spec.ts b/src/compat/performance/performance.spec.ts index 47028f301..dcd36d340 100644 --- a/src/compat/performance/performance.spec.ts +++ b/src/compat/performance/performance.spec.ts @@ -1,22 +1,20 @@ import { TestBed } from '@angular/core/testing'; -import { AngularFireModule, FirebaseApp } from '@angular/fire/compat'; +import { AngularFireModule } from '@angular/fire/compat'; import { AngularFirePerformance, AngularFirePerformanceModule } from '@angular/fire/compat/performance'; import { COMMON_CONFIG } from '../../../src/test-config'; describe('AngularFirePerformance', () => { - let app: FirebaseApp; let afp: AngularFirePerformance; beforeEach(() => { TestBed.configureTestingModule({ imports: [ - // NOTE: You must use the [DEFAULT] app instance + // NOTE: You must use the [DEFAULT] app instance // for these tests to work. AngularFireModule.initializeApp(COMMON_CONFIG), AngularFirePerformanceModule ] }); - app = TestBed.inject(FirebaseApp); afp = TestBed.inject(AngularFirePerformance); }); diff --git a/src/compat/performance/performance.ts b/src/compat/performance/performance.ts index 06d6f6b29..56b5fd12a 100644 --- a/src/compat/performance/performance.ts +++ b/src/compat/performance/performance.ts @@ -1,15 +1,16 @@ +import { isPlatformBrowser } from '@angular/common'; import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core'; -import { EMPTY, Observable, of, Subscription } from 'rxjs'; -import { map, shareReplay, switchMap, tap } from 'rxjs/operators'; -import firebase from 'firebase/compat/app'; -import { ɵapplyMixins, ɵlazySDKProxy, ɵPromiseProxy, ɵcacheInstance } from '@angular/fire/compat'; +import { ɵPromiseProxy, ɵapplyMixins, ɵcacheInstance, ɵlazySDKProxy } from '@angular/fire/compat'; import { FirebaseApp } from '@angular/fire/compat'; -import { isPlatformBrowser } from '@angular/common'; +import firebase from 'firebase/compat/app'; +import { EMPTY, Observable, Subscription, of } from 'rxjs'; +import { map, shareReplay, switchMap, tap } from 'rxjs/operators'; import { proxyPolyfillCompat } from './base'; export const INSTRUMENTATION_ENABLED = new InjectionToken('angularfire2.performance.instrumentationEnabled'); export const DATA_COLLECTION_ENABLED = new InjectionToken('angularfire2.performance.dataCollectionEnabled'); +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface AngularFirePerformance extends ɵPromiseProxy { } @@ -25,7 +26,7 @@ export class AngularFirePerformance { @Optional() @Inject(INSTRUMENTATION_ENABLED) instrumentationEnabled: boolean | null, @Optional() @Inject(DATA_COLLECTION_ENABLED) dataCollectionEnabled: boolean | null, private zone: NgZone, - // tslint:disable-next-line:ban-types + // eslint-disable-next-line @typescript-eslint/ban-types @Inject(PLATFORM_ID) platformId: Object ) { @@ -51,6 +52,7 @@ export class AngularFirePerformance { } const trace$ = (traceId: string) => { + // eslint-disable-next-line @typescript-eslint/prefer-optional-chain if (typeof window !== 'undefined' && window.performance?.mark) { const entries = window.performance.getEntriesByName(traceId, 'measure') || []; const startMarkName = `_${traceId}Start[${entries.length}]`; @@ -79,8 +81,7 @@ export const traceUntil = ( return source$.pipe( tap( a => test(a) && traceSubscription.unsubscribe(), - () => { - }, + () => undefined, () => options && options.orComplete && traceSubscription.unsubscribe() ) ).subscribe(subscriber); @@ -105,8 +106,7 @@ export const traceWhile = ( traceSubscription = undefined; } }, - () => { - }, + () => undefined, () => options && options.orComplete && traceSubscription && traceSubscription.unsubscribe() ) ).subscribe(subscriber); @@ -116,10 +116,8 @@ export const traceUntilComplete = (name: string) => (source$: Observabl const traceSubscription = trace$(name).subscribe(); return source$.pipe( tap( - () => { - }, - () => { - }, + () => undefined, + () => undefined, () => traceSubscription.unsubscribe() ) ).subscribe(subscriber); @@ -130,11 +128,8 @@ export const traceUntilFirst = (name: string) => (source$: Observable traceSubscription.unsubscribe(), - () => { - }, - () => { - } - ) + () => undefined, + () => undefined ) ).subscribe(subscriber); }); @@ -143,8 +138,7 @@ export const trace = (name: string) => (source$: Observable) => new return source$.pipe( tap( () => traceSubscription.unsubscribe(), - () => { - }, + () => undefined, () => traceSubscription.unsubscribe() ) ).subscribe(subscriber); diff --git a/src/compat/proxy.ts b/src/compat/proxy.ts index 2ea9169bf..5c1eb50d0 100644 --- a/src/compat/proxy.ts +++ b/src/compat/proxy.ts @@ -44,26 +44,25 @@ export const ɵlazySDKProxy = (klass: any, observable: Observable, zone: Ng return klass[name]; } if (noopFunctions.indexOf(name) > -1) { - return () => { - }; + return () => undefined; } const promise = observable.toPromise().then(mod => { - const ret = mod && mod[name]; + const ret = mod?.[name]; // TODO move to proper type guards if (typeof ret === 'function') { return ret.bind(mod); - } else if (ret && ret.then) { + } else if (ret?.then) { return ret.then((res: any) => zone.run(() => res)); } else { return zone.run(() => ret); } }); // recurse the proxy - return new Proxy(() => {}, { + return new Proxy(() => undefined, { get: (_, name) => promise[name], // TODO handle callbacks as transparently as I can apply: (self, _, args) => promise.then(it => { - const res = it && it(...args); + const res = it?.(...args); if (options?.spy?.apply) { options.spy.apply(name, args, res); } diff --git a/src/compat/remote-config/remote-config.module.ts b/src/compat/remote-config/remote-config.module.ts index 0585b0ccc..485358dc7 100644 --- a/src/compat/remote-config/remote-config.module.ts +++ b/src/compat/remote-config/remote-config.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; -import { AngularFireRemoteConfig } from './remote-config'; -import firebase from 'firebase/compat/app'; import { VERSION } from '@angular/fire'; +import firebase from 'firebase/compat/app'; +import { AngularFireRemoteConfig } from './remote-config'; @NgModule({ providers: [ AngularFireRemoteConfig ] diff --git a/src/compat/remote-config/remote-config.spec.ts b/src/compat/remote-config/remote-config.spec.ts index ffa1a0b60..f585379d7 100644 --- a/src/compat/remote-config/remote-config.spec.ts +++ b/src/compat/remote-config/remote-config.spec.ts @@ -1,11 +1,10 @@ import { TestBed } from '@angular/core/testing'; -import { AngularFireModule, FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseApp } from '@angular/fire/compat'; +import { AngularFireModule, FIREBASE_APP_NAME, FIREBASE_OPTIONS } from '@angular/fire/compat'; import { AngularFireRemoteConfig, AngularFireRemoteConfigModule, DEFAULTS, SETTINGS } from '@angular/fire/compat/remote-config'; import { COMMON_CONFIG } from '../../../src/test-config'; import { rando } from '../../../src/utils'; describe('AngularFireRemoteConfig', () => { - let app: FirebaseApp; let rc: AngularFireRemoteConfig; beforeEach(() => { @@ -16,7 +15,6 @@ describe('AngularFireRemoteConfig', () => { ] }); - app = TestBed.inject(FirebaseApp); rc = TestBed.inject(AngularFireRemoteConfig); }); @@ -33,7 +31,6 @@ describe('AngularFireRemoteConfig', () => { const FIREBASE_APP_NAME_TOO = (Math.random() + 1).toString(36).substring(7); describe('AngularFireRemoteConfig with different app', () => { - let app: FirebaseApp; let rc: AngularFireRemoteConfig; beforeEach(() => { @@ -50,7 +47,6 @@ describe('AngularFireRemoteConfig with different app', () => { ] }); - app = TestBed.inject(FirebaseApp); rc = TestBed.inject(AngularFireRemoteConfig); }); diff --git a/src/compat/remote-config/remote-config.ts b/src/compat/remote-config/remote-config.ts index 924a7d1b3..28ce9bbb9 100644 --- a/src/compat/remote-config/remote-config.ts +++ b/src/compat/remote-config/remote-config.ts @@ -1,5 +1,11 @@ import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core'; -import { concat, EMPTY, MonoTypeOperatorFunction, Observable, of, OperatorFunction, pipe } from 'rxjs'; +import { keepUnstableUntilFirst, ɵAngularFireSchedulers } from '@angular/fire'; +import { ɵPromiseProxy, ɵapplyMixins, ɵlazySDKProxy } from '@angular/fire/compat'; +import { FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance, ɵfirebaseAppFactory } from '@angular/fire/compat'; +import { FirebaseOptions } from 'firebase/app'; +import firebase from 'firebase/compat/app'; +import { isSupported } from 'firebase/remote-config'; +import { EMPTY, MonoTypeOperatorFunction, Observable, OperatorFunction, concat, of, pipe } from 'rxjs'; import { debounceTime, distinctUntilChanged, @@ -14,22 +20,15 @@ import { switchMap, withLatestFrom } from 'rxjs/operators'; -import { ɵAngularFireSchedulers, keepUnstableUntilFirst } from '@angular/fire'; -import { ɵlazySDKProxy, ɵPromiseProxy, ɵapplyMixins } from '@angular/fire/compat'; -import { FirebaseOptions } from 'firebase/app'; -import { ɵfirebaseAppFactory, FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance } from '@angular/fire/compat'; -import firebase from 'firebase/compat/app'; -import { Settings } from './interfaces'; import { proxyPolyfillCompat } from './base'; -import { isSupported } from 'firebase/remote-config'; +import { Settings } from './interfaces'; -export interface ConfigTemplate { - [key: string]: string | number | boolean; -} +export type ConfigTemplate = Record; export const SETTINGS = new InjectionToken('angularfire2.remoteConfig.settings'); export const DEFAULTS = new InjectionToken('angularfire2.remoteConfig.defaultConfig'); +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface AngularFireRemoteConfig extends ɵPromiseProxy { } @@ -65,7 +64,6 @@ export class Value implements firebase.remoteConfig.Value { return this._source; } - // tslint:disable-next-line:variable-name constructor(public _source: firebase.remoteConfig.ValueSource, public _value: string) { } } @@ -94,7 +92,7 @@ export const filterFresh = (howRecentInMillis: number) => filterTest(p => p.fetc // which we can simplify to === rather than deep comparison const scanToParametersArray = ( remoteConfig: Observable -): OperatorFunction<{ [key: string]: firebase.remoteConfig.Value }, Parameter[]> => pipe( +): OperatorFunction, Parameter[]> => pipe( withLatestFrom(remoteConfig), scan((existing, [all, rc]) => { // SEMVER use "new Set" to unique once we're only targeting es6 @@ -107,7 +105,7 @@ const scanToParametersArray = ( return updatedValue ? new Parameter(key, rc ? rc.fetchTimeMillis : -1, updatedValue.getSource(), updatedValue.asString()) : existing.find(p => p.key === key); }); - }, [] as Array) + }, [] as Parameter[]) ); @@ -118,9 +116,9 @@ export class AngularFireRemoteConfig { readonly changes: Observable; readonly parameters: Observable; - readonly numbers: Observable<{ [key: string]: number | undefined }> & { [key: string]: Observable }; - readonly booleans: Observable<{ [key: string]: boolean | undefined }> & { [key: string]: Observable }; - readonly strings: Observable<{ [key: string]: string | undefined }> & { [key: string]: Observable }; + readonly numbers: Observable> & Record>; + readonly booleans: Observable> & Record>; + readonly strings: Observable> & Record>; constructor( @Inject(FIREBASE_OPTIONS) options: FirebaseOptions, @@ -129,7 +127,7 @@ export class AngularFireRemoteConfig { @Optional() @Inject(DEFAULTS) defaultConfig: ConfigTemplate | null, private zone: NgZone, schedulers: ɵAngularFireSchedulers, - // tslint:disable-next-line:ban-types + // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-types @Inject(PLATFORM_ID) platformId: Object ) { const remoteConfig$ = of(undefined).pipe( @@ -155,13 +153,13 @@ export class AngularFireRemoteConfig { filter(rc => !!rc) ); - const default$: Observable<{ [key: string]: firebase.remoteConfig.Value }> = of(Object.keys(defaultConfig || {}).reduce( + const default$: Observable> = of(Object.keys(defaultConfig || {}).reduce( (c, k) => ({ ...c, [k]: new Value('default', defaultConfig[k].toString()) }), {} )); // we should filter out the defaults we provided to RC, since we have our own implementation // that gives us a -1 for fetchTimeMillis (so filterFresh can filter them out) - const filterOutDefaults = map<{ [key: string]: firebase.remoteConfig.Value }, { [key: string]: firebase.remoteConfig.Value }>(all => + const filterOutDefaults = map, Record>(all => Object.keys(all) .filter(key => all[key].getSource() !== 'default') .reduce((acc, key) => ({ ...acc, [key]: all[key] }), {}) @@ -251,12 +249,12 @@ const typedMethod = (it: any) => { }; -export function scanToObject(): OperatorFunction; -export function scanToObject(to: 'numbers'): OperatorFunction; -export function scanToObject(to: 'booleans'): OperatorFunction; -// tslint:disable-next-line:unified-signatures -export function scanToObject(to: 'strings'): OperatorFunction; -export function scanToObject(template: T): OperatorFunction; +export function scanToObject(): OperatorFunction>; +export function scanToObject(to: 'numbers'): OperatorFunction>; +export function scanToObject(to: 'booleans'): OperatorFunction>; +// eslint-disable-next-line @typescript-eslint/unified-signatures +export function scanToObject(to: 'strings'): OperatorFunction>; +export function scanToObject(template: T): OperatorFunction>; export function scanToObject(to: 'numbers' | 'booleans' | 'strings' | T = 'strings') { return pipe( // TODO cleanup @@ -267,8 +265,8 @@ export function scanToObject(to: 'numbers' | 'booleans p[AS_TO_FN[to]]() }), typeof to === 'object' ? - to as T & { [key: string]: string | undefined } : - {} as { [key: string]: number | boolean | string } + to as T & Record : + {} as Record ), debounceTime(1), budget(10), @@ -276,13 +274,13 @@ export function scanToObject(to: 'numbers' | 'booleans ); } -export function mapToObject(): OperatorFunction; -export function mapToObject(to: 'numbers'): OperatorFunction; -export function mapToObject(to: 'booleans'): OperatorFunction; -// tslint:disable-next-line:unified-signatures -export function mapToObject(to: 'strings'): OperatorFunction; +export function mapToObject(): OperatorFunction>; +export function mapToObject(to: 'numbers'): OperatorFunction>; +export function mapToObject(to: 'booleans'): OperatorFunction>; +// eslint-disable-next-line @typescript-eslint/unified-signatures +export function mapToObject(to: 'strings'): OperatorFunction>; export function mapToObject(template: T): - OperatorFunction; + OperatorFunction>; export function mapToObject(to: 'numbers' | 'booleans' | 'strings' | T = 'strings') { return pipe( // TODO this is getting a little long, cleanup @@ -293,8 +291,8 @@ export function mapToObject(to: 'numbers' | 'booleans' p[AS_TO_FN[to]]() }), typeof to === 'object' ? - to as T & { [key: string]: string | undefined } : - {} as { [key: string]: number | boolean | string } + to as T & Record : + {} as Record )), distinctUntilChanged((a, b) => JSON.stringify(a) === JSON.stringify(b)) ); diff --git a/src/compat/storage/observable/fromTask.ts b/src/compat/storage/observable/fromTask.ts index 806b23491..85f8a34e5 100644 --- a/src/compat/storage/observable/fromTask.ts +++ b/src/compat/storage/observable/fromTask.ts @@ -4,7 +4,6 @@ import { UploadTask, UploadTaskSnapshot } from '../interfaces'; // need to import, else the types become import('firebase/compat/app').default.storage.UploadTask // and it no longer works w/Firebase v7 -import firebase from 'firebase/compat/app'; // Things aren't working great, I'm having to put in a lot of work-arounds for what // appear to be Firebase JS SDK bugs https://github.com/firebase/firebase-js-sdk/issues/4158 diff --git a/src/compat/storage/pipes/storageUrl.pipe.ts b/src/compat/storage/pipes/storageUrl.pipe.ts index 5f20d2fd4..1bbd4a1d8 100644 --- a/src/compat/storage/pipes/storageUrl.pipe.ts +++ b/src/compat/storage/pipes/storageUrl.pipe.ts @@ -1,6 +1,6 @@ import { AsyncPipe } from '@angular/common'; import { ChangeDetectorRef, NgModule, OnDestroy, Optional, Pipe, PipeTransform } from '@angular/core'; -import { makeStateKey, TransferState } from '@angular/platform-browser'; +import { TransferState, makeStateKey } from '@angular/platform-browser'; import { Observable, of } from 'rxjs'; import { tap } from 'rxjs/operators'; import { AngularFireStorage } from '../storage'; diff --git a/src/compat/storage/ref.ts b/src/compat/storage/ref.ts index 46e3bcd20..37df9848c 100644 --- a/src/compat/storage/ref.ts +++ b/src/compat/storage/ref.ts @@ -1,8 +1,8 @@ +import { keepUnstableUntilFirst, observeOutsideAngular } from '@angular/fire'; +import { Observable, from, of } from 'rxjs'; +import { switchMap } from 'rxjs/operators'; import { ListOptions, ListResult, Reference, SettableMetadata, StringFormat, UploadMetadata } from './interfaces'; import { AngularFireUploadTask, createUploadTask } from './task'; -import { from, Observable, of } from 'rxjs'; -import { observeOutsideAngular, keepUnstableUntilFirst } from '@angular/fire'; -import { switchMap } from 'rxjs/operators'; export interface AngularFireStorageReference { getDownloadURL(): Observable; diff --git a/src/compat/storage/storage.module.ts b/src/compat/storage/storage.module.ts index 3c79430a7..a102142f1 100644 --- a/src/compat/storage/storage.module.ts +++ b/src/compat/storage/storage.module.ts @@ -1,8 +1,8 @@ import { NgModule } from '@angular/core'; +import { VERSION } from '@angular/fire'; +import firebase from 'firebase/compat/app'; import { GetDownloadURLPipeModule } from './pipes/storageUrl.pipe'; import { AngularFireStorage } from './storage'; -import firebase from 'firebase/compat/app'; -import { VERSION } from '@angular/fire'; @NgModule({ exports: [ GetDownloadURLPipeModule ], diff --git a/src/compat/storage/storage.spec.ts b/src/compat/storage/storage.spec.ts index 6868eb2d3..dc93244bd 100644 --- a/src/compat/storage/storage.spec.ts +++ b/src/compat/storage/storage.spec.ts @@ -1,19 +1,19 @@ -import { forkJoin } from 'rxjs'; -import { mergeMap, tap } from 'rxjs/operators'; +import { ChangeDetectorRef } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { AngularFireModule, FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseApp } from '@angular/fire/compat'; -import { AngularFireStorage, AngularFireStorageModule, AngularFireUploadTask, BUCKET, fromTask, USE_EMULATOR } from '@angular/fire/compat/storage'; +import { AngularFireStorage, AngularFireStorageModule, AngularFireUploadTask, BUCKET, USE_EMULATOR, fromTask } from '@angular/fire/compat/storage'; +import firebase from 'firebase/compat/app'; +import { forkJoin } from 'rxjs'; +import { mergeMap, tap } from 'rxjs/operators'; import { COMMON_CONFIG } from '../../../src/test-config'; import { rando } from '../../../src/utils'; -import { ChangeDetectorRef } from '@angular/core'; import 'firebase/compat/storage'; -import firebase from 'firebase/compat/app'; if (typeof XMLHttpRequest === 'undefined') { globalThis.XMLHttpRequest = require('xhr2'); } -const blobOrBuffer = (data: string, options: {}) => { +const blobOrBuffer = (data: string, options: unknown) => { if (typeof Blob === 'undefined') { return Buffer.from(data, 'utf8'); } else { @@ -22,9 +22,7 @@ const blobOrBuffer = (data: string, options: {}) => { }; describe('AngularFireStorage', () => { - let app: FirebaseApp; let afStorage: AngularFireStorage; - let cdr: ChangeDetectorRef; beforeEach(() => { TestBed.configureTestingModule({ @@ -38,9 +36,7 @@ describe('AngularFireStorage', () => { ] }); - app = TestBed.inject(FirebaseApp); afStorage = TestBed.inject(AngularFireStorage); - cdr = TestBed.inject(ChangeDetectorRef); }); it('should exist', () => { @@ -80,8 +76,8 @@ describe('AngularFireStorage', () => { }); it('should upload a file and observe the download url', (done) => { - const data = { angular: 'fire' }; - const blob = blobOrBuffer(JSON.stringify(data), { type: 'application/json' }); + const data = {angular: 'fire'}; + const blob = blobOrBuffer(JSON.stringify(data), {type: 'application/json'}); const ref = afStorage.ref(rando()); ref.put(blob).then(() => { const url$ = ref.getDownloadURL(); @@ -150,25 +146,25 @@ describe('AngularFireStorage', () => { }); it('should work with an already finished task', (done) => { - const data = { angular: 'promise' }; - const blob = blobOrBuffer(JSON.stringify(data), { type: 'application/json' }); + const data = {angular: 'promise'}; + const blob = blobOrBuffer(JSON.stringify(data), {type: 'application/json'}); const ref = afStorage.storage.ref(rando()); const task = ref.put(blob); let emissionCount = 0; let lastSnap: firebase.storage.UploadTaskSnapshot; task.then(_snap => { fromTask(task).subscribe( - snap => { - lastSnap = snap; - emissionCount++; - expect(snap).toBeDefined(); - }, - done.fail, - () => { - expect(lastSnap.state).toBe('success'); - expect(emissionCount).toBe(1); - ref.delete().then(done, done.fail); - }); + snap => { + lastSnap = snap; + emissionCount++; + expect(snap).toBeDefined(); + }, + done.fail, + () => { + expect(lastSnap.state).toBe('success'); + expect(emissionCount).toBe(1); + ref.delete().then(done, done.fail); + }); }); }); @@ -245,7 +241,7 @@ describe('AngularFireStorage w/options', () => { }); afterEach(() => { - try { app.delete().catch(() => undefined); } catch (e) { } + try { app.delete().catch(() => undefined); } catch (e) { /* empty */ } }); describe('', () => { diff --git a/src/compat/storage/storage.ts b/src/compat/storage/storage.ts index 6868d5fd9..6dfc7a138 100644 --- a/src/compat/storage/storage.ts +++ b/src/compat/storage/storage.ts @@ -1,12 +1,12 @@ import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core'; -import { createStorageRef } from './ref'; import { ɵAngularFireSchedulers } from '@angular/fire'; +import { AppCheckInstances } from '@angular/fire/app-check'; +import { FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance, ɵfirebaseAppFactory } from '@angular/fire/compat'; import { FirebaseOptions } from 'firebase/app'; -import { ɵfirebaseAppFactory, FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance } from '@angular/fire/compat'; +import firebase from 'firebase/compat/app'; import { UploadMetadata } from './interfaces'; +import { createStorageRef } from './ref'; import 'firebase/compat/storage'; -import firebase from 'firebase/compat/app'; -import { AppCheckInstances } from '@angular/fire/app-check'; export const BUCKET = new InjectionToken('angularfire2.storageBucket'); export const MAX_UPLOAD_RETRY_TIME = new InjectionToken('angularfire2.storage.maxUploadRetryTime'); @@ -32,12 +32,12 @@ export class AngularFireStorage { @Inject(FIREBASE_OPTIONS) options: FirebaseOptions, @Optional() @Inject(FIREBASE_APP_NAME) name: string | null | undefined, @Optional() @Inject(BUCKET) storageBucket: string | null, - // tslint:disable-next-line:ban-types + // eslint-disable-next-line @typescript-eslint/ban-types @Inject(PLATFORM_ID) platformId: Object, zone: NgZone, schedulers: ɵAngularFireSchedulers, - @Optional() @Inject(MAX_UPLOAD_RETRY_TIME) maxUploadRetryTime: number | any, - @Optional() @Inject(MAX_OPERATION_RETRY_TIME) maxOperationRetryTime: number | any, + @Optional() @Inject(MAX_UPLOAD_RETRY_TIME) maxUploadRetryTime: any, + @Optional() @Inject(MAX_OPERATION_RETRY_TIME) maxOperationRetryTime: any, @Optional() @Inject(USE_EMULATOR) _useEmulator: any, @Optional() _appCheckInstances: AppCheckInstances, ) { diff --git a/src/compat/storage/task.ts b/src/compat/storage/task.ts index bccc7154c..53bba1afc 100644 --- a/src/compat/storage/task.ts +++ b/src/compat/storage/task.ts @@ -1,7 +1,7 @@ -import { UploadTask, UploadTaskSnapshot } from './interfaces'; -import { fromTask } from './observable/fromTask'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; +import { UploadTask, UploadTaskSnapshot } from './interfaces'; +import { fromTask } from './observable/fromTask'; export interface AngularFireUploadTask { task: UploadTask; diff --git a/src/core.ts b/src/core.ts index a1cb8e9fa..9d42bf90a 100644 --- a/src/core.ts +++ b/src/core.ts @@ -1,6 +1,6 @@ import { Version } from '@angular/core'; -import { FirebaseApp, getApps } from 'firebase/app'; import { ComponentContainer } from '@firebase/component'; +import { FirebaseApp, getApps } from 'firebase/app'; import type { AppCheck } from 'firebase/app-check'; export const VERSION = new Version('ANGULARFIRE2_VERSION'); @@ -29,9 +29,9 @@ export function ɵgetDefaultInstanceOf(identifier: string, provided: return provider.getImmediate({ optional: true }); } -export const ɵgetAllInstancesOf = (identifier: string, app?: FirebaseApp): Array => { +export const ɵgetAllInstancesOf = (identifier: string, app?: FirebaseApp): T[] => { const apps = app ? [app] : getApps(); - const instances: Array = []; + const instances: any[] = []; apps.forEach((app: FirebaseAppWithContainer) => { const provider: any = app.container.getProvider(identifier as never); provider.instances.forEach((instance: any) => { @@ -43,15 +43,13 @@ export const ɵgetAllInstancesOf = (identifier: string, app?: Fireba return instances; }; -// tslint:disable-next-line:no-empty-interface class-name +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface ɵAppCheckInstances extends Array {} -// tslint:disable-next-line:class-name export class ɵAppCheckInstances { constructor() { return ɵgetAllInstancesOf(ɵAPP_CHECK_PROVIDER_NAME); } } -// tslint:disable-next-line:variable-name export const ɵAPP_CHECK_PROVIDER_NAME = 'app-check'; diff --git a/src/database/database.module.ts b/src/database/database.module.ts index cb42f6f04..4a372a890 100644 --- a/src/database/database.module.ts +++ b/src/database/database.module.ts @@ -1,11 +1,11 @@ -import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector } from '@angular/core'; -import { Database as FirebaseDatabase } from 'firebase/database'; +import { InjectionToken, Injector, ModuleWithProviders, NgModule, NgZone, Optional } from '@angular/core'; +import { VERSION, ɵAngularFireSchedulers, ɵgetDefaultInstanceOf } from '@angular/fire'; +import { ɵAppCheckInstances } from '@angular/fire'; +import { FirebaseApp, FirebaseApps } from '@angular/fire/app'; import { AuthInstances } from '@angular/fire/auth'; -import { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION } from '@angular/fire'; -import { Database, DatabaseInstances, DATABASE_PROVIDER_NAME } from './database'; -import { FirebaseApps, FirebaseApp } from '@angular/fire/app'; import { registerVersion } from 'firebase/app'; -import { ɵAppCheckInstances } from '@angular/fire'; +import { Database as FirebaseDatabase } from 'firebase/database'; +import { DATABASE_PROVIDER_NAME, Database, DatabaseInstances } from './database'; export const PROVIDED_DATABASE_INSTANCES = new InjectionToken('angularfire2.database-instances'); diff --git a/src/database/database.spec.ts b/src/database/database.spec.ts index c470c0c47..85c1d0360 100644 --- a/src/database/database.spec.ts +++ b/src/database/database.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { FirebaseApp, provideFirebaseApp, getApp, initializeApp, deleteApp } from '@angular/fire/app'; -import { Database, provideDatabase, getDatabase, connectDatabaseEmulator, goOffline } from '@angular/fire/database'; +import { FirebaseApp, getApp, initializeApp, provideFirebaseApp } from '@angular/fire/app'; +import { Database, connectDatabaseEmulator, getDatabase, goOffline, provideDatabase } from '@angular/fire/database'; import { COMMON_CONFIG } from '../test-config'; import { rando } from '../utils'; diff --git a/src/database/database.ts b/src/database/database.ts index d291c1d8b..487968581 100644 --- a/src/database/database.ts +++ b/src/database/database.ts @@ -1,10 +1,10 @@ -import { Database as FirebaseDatabase } from 'firebase/database'; import { ɵgetAllInstancesOf } from '@angular/fire'; +import { Database as FirebaseDatabase } from 'firebase/database'; import { from, timer } from 'rxjs'; import { concatMap, distinct } from 'rxjs/operators'; // see notes in core/firebase.app.module.ts for why we're building the class like this -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Database extends FirebaseDatabase {} export class Database { @@ -15,7 +15,7 @@ export class Database { export const DATABASE_PROVIDER_NAME = 'database'; -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface DatabaseInstances extends Array {} export class DatabaseInstances { diff --git a/src/database/rxfire.ts b/src/database/rxfire.ts index 10a411e06..a6ac2245d 100644 --- a/src/database/rxfire.ts +++ b/src/database/rxfire.ts @@ -1,14 +1,14 @@ // DO NOT MODIFY, this file is autogenerated by tools/build.ts import { ɵzoneWrap } from '@angular/fire'; import { + auditTrail as _auditTrail, + changeToData as _changeToData, fromRef as _fromRef, - stateChanges as _stateChanges, list as _list, listVal as _listVal, - auditTrail as _auditTrail, object as _object, objectVal as _objectVal, - changeToData as _changeToData + stateChanges as _stateChanges } from 'rxfire/database'; export { diff --git a/src/firestore/firestore.module.ts b/src/firestore/firestore.module.ts index 85f24d799..4eccebf2a 100644 --- a/src/firestore/firestore.module.ts +++ b/src/firestore/firestore.module.ts @@ -1,11 +1,11 @@ -import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector } from '@angular/core'; -import { Firestore as FirebaseFirestore } from 'firebase/firestore'; +import { InjectionToken, Injector, ModuleWithProviders, NgModule, NgZone, Optional } from '@angular/core'; +import { VERSION, ɵAngularFireSchedulers, ɵgetDefaultInstanceOf } from '@angular/fire'; +import { ɵAppCheckInstances } from '@angular/fire'; +import { FirebaseApp, FirebaseApps } from '@angular/fire/app'; import { AuthInstances } from '@angular/fire/auth'; -import { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION } from '@angular/fire'; -import { Firestore, FirestoreInstances, FIRESTORE_PROVIDER_NAME } from './firestore'; -import { FirebaseApps, FirebaseApp } from '@angular/fire/app'; import { registerVersion } from 'firebase/app'; -import { ɵAppCheckInstances } from '@angular/fire'; +import { Firestore as FirebaseFirestore } from 'firebase/firestore'; +import { FIRESTORE_PROVIDER_NAME, Firestore, FirestoreInstances } from './firestore'; export const PROVIDED_FIRESTORE_INSTANCES = new InjectionToken('angularfire2.firestore-instances'); diff --git a/src/firestore/firestore.spec.ts b/src/firestore/firestore.spec.ts index bb4adcdf7..063f36a49 100644 --- a/src/firestore/firestore.spec.ts +++ b/src/firestore/firestore.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { FirebaseApp, provideFirebaseApp, getApp, initializeApp, deleteApp } from '@angular/fire/app'; -import { Firestore, provideFirestore, getFirestore, connectFirestoreEmulator, disableNetwork } from '@angular/fire/firestore'; +import { FirebaseApp, getApp, initializeApp, provideFirebaseApp } from '@angular/fire/app'; +import { Firestore, connectFirestoreEmulator, disableNetwork, getFirestore, provideFirestore } from '@angular/fire/firestore'; import { COMMON_CONFIG } from '../test-config'; import { rando } from '../utils'; @@ -28,8 +28,8 @@ describe('Firestore', () => { firestore = TestBed.inject(Firestore); }); - afterEach(() => { - disableNetwork(firestore); + afterEach(async () => { + await disableNetwork(firestore); }); it('should be injectable', () => { diff --git a/src/firestore/firestore.ts b/src/firestore/firestore.ts index 2c24ade7e..4e3b2d10e 100644 --- a/src/firestore/firestore.ts +++ b/src/firestore/firestore.ts @@ -1,10 +1,10 @@ -import { Firestore as FirebaseFirestore } from 'firebase/firestore'; import { ɵgetAllInstancesOf } from '@angular/fire'; +import { Firestore as FirebaseFirestore } from 'firebase/firestore'; import { from, timer } from 'rxjs'; import { concatMap, distinct } from 'rxjs/operators'; // see notes in core/firebase.app.module.ts for why we're building the class like this -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Firestore extends FirebaseFirestore {} export class Firestore { @@ -15,7 +15,7 @@ export class Firestore { export const FIRESTORE_PROVIDER_NAME = 'firestore'; -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface FirestoreInstances extends Array {} export class FirestoreInstances { diff --git a/src/firestore/lite/lite.module.ts b/src/firestore/lite/lite.module.ts index 6328e6d98..3923b3e25 100644 --- a/src/firestore/lite/lite.module.ts +++ b/src/firestore/lite/lite.module.ts @@ -1,10 +1,10 @@ -import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector } from '@angular/core'; -import { Firestore as FirebaseFirestore } from 'firebase/firestore/lite'; +import { InjectionToken, Injector, ModuleWithProviders, NgModule, NgZone, Optional } from '@angular/core'; +import { VERSION, ɵAngularFireSchedulers, ɵAppCheckInstances, ɵgetDefaultInstanceOf } from '@angular/fire'; +import { FirebaseApp, FirebaseApps } from '@angular/fire/app'; import { AuthInstances } from '@angular/fire/auth'; -import { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, ɵAppCheckInstances, VERSION } from '@angular/fire'; -import { Firestore, FirestoreInstances, FIRESTORE_PROVIDER_NAME } from './lite'; -import { FirebaseApps, FirebaseApp } from '@angular/fire/app'; import { registerVersion } from 'firebase/app'; +import { Firestore as FirebaseFirestore } from 'firebase/firestore/lite'; +import { FIRESTORE_PROVIDER_NAME, Firestore, FirestoreInstances } from './lite'; export const PROVIDED_FIRESTORE_INSTANCES = new InjectionToken('angularfire2.firestore-lite-instances'); diff --git a/src/firestore/lite/lite.spec.ts b/src/firestore/lite/lite.spec.ts index 2109b857a..c69c819c8 100644 --- a/src/firestore/lite/lite.spec.ts +++ b/src/firestore/lite/lite.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { FirebaseApp, provideFirebaseApp, getApp, initializeApp, deleteApp } from '@angular/fire/app'; -import { Firestore, provideFirestore, getFirestore, connectFirestoreEmulator } from '@angular/fire/firestore/lite'; +import { FirebaseApp, getApp, initializeApp, provideFirebaseApp } from '@angular/fire/app'; +import { Firestore, connectFirestoreEmulator, getFirestore, provideFirestore } from '@angular/fire/firestore/lite'; import { COMMON_CONFIG } from '../../test-config'; import { rando } from '../../utils'; diff --git a/src/firestore/lite/lite.ts b/src/firestore/lite/lite.ts index 1f9a3c055..838be5b5b 100644 --- a/src/firestore/lite/lite.ts +++ b/src/firestore/lite/lite.ts @@ -1,10 +1,10 @@ -import { Firestore as FirebaseFirestore } from 'firebase/firestore/lite'; import { ɵgetAllInstancesOf } from '@angular/fire'; +import { Firestore as FirebaseFirestore } from 'firebase/firestore/lite'; import { from, timer } from 'rxjs'; import { concatMap, distinct } from 'rxjs/operators'; // see notes in core/firebase.app.module.ts for why we're building the class like this -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Firestore extends FirebaseFirestore {} export class Firestore { @@ -15,7 +15,7 @@ export class Firestore { export const FIRESTORE_PROVIDER_NAME = 'firestore/lite'; -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface FirestoreInstances extends Array {} export class FirestoreInstances { diff --git a/src/firestore/lite/rxfire.ts b/src/firestore/lite/rxfire.ts index a7e648667..ecb22818d 100644 --- a/src/firestore/lite/rxfire.ts +++ b/src/firestore/lite/rxfire.ts @@ -5,8 +5,8 @@ import { collectionData as _collectionData, doc as _doc, docData as _docData, - snapToData as _snapToData, - fromRef as _fromRef + fromRef as _fromRef, + snapToData as _snapToData } from 'rxfire/firestore/lite'; export const collectionSnapshots = ɵzoneWrap(_collection, true); diff --git a/src/firestore/rxfire.ts b/src/firestore/rxfire.ts index c50771aa9..1d195bef3 100644 --- a/src/firestore/rxfire.ts +++ b/src/firestore/rxfire.ts @@ -1,17 +1,17 @@ // DO NOT MODIFY, this file is autogenerated by tools/build.ts import { ɵzoneWrap } from '@angular/fire'; import { - collectionChanges as _collectionChanges, - collection as _collection, - sortedChanges as _sortedChanges, auditTrail as _auditTrail, + collection as _collection, + collectionChanges as _collectionChanges, + collectionCount as _collectionCount, + collectionCountSnap as _collectionCountSnap, collectionData as _collectionData, doc as _doc, docData as _docData, - snapToData as _snapToData, fromRef as _fromRef, - collectionCount as _collectionCount, - collectionCountSnap as _collectionCountSnap + snapToData as _snapToData, + sortedChanges as _sortedChanges } from 'rxfire/firestore'; export const collectionChanges = ɵzoneWrap(_collectionChanges, true); diff --git a/src/functions/functions.module.ts b/src/functions/functions.module.ts index b53be604c..cad0fe5cc 100644 --- a/src/functions/functions.module.ts +++ b/src/functions/functions.module.ts @@ -1,11 +1,11 @@ -import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector } from '@angular/core'; -import { Functions as FirebaseFunctions } from 'firebase/functions'; -import { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION } from '@angular/fire'; -import { Functions, FunctionsInstances, FUNCTIONS_PROVIDER_NAME } from './functions'; -import { FirebaseApps, FirebaseApp } from '@angular/fire/app'; +import { InjectionToken, Injector, ModuleWithProviders, NgModule, NgZone, Optional } from '@angular/core'; +import { VERSION, ɵAngularFireSchedulers, ɵgetDefaultInstanceOf } from '@angular/fire'; +import { ɵAppCheckInstances } from '@angular/fire'; +import { FirebaseApp, FirebaseApps } from '@angular/fire/app'; import { AuthInstances } from '@angular/fire/auth'; import { registerVersion } from 'firebase/app'; -import { ɵAppCheckInstances } from '@angular/fire'; +import { Functions as FirebaseFunctions } from 'firebase/functions'; +import { FUNCTIONS_PROVIDER_NAME, Functions, FunctionsInstances } from './functions'; export const PROVIDED_FUNCTIONS_INSTANCES = new InjectionToken('angularfire2.functions-instances'); diff --git a/src/functions/functions.spec.ts b/src/functions/functions.spec.ts index 96549bbbb..17fffbcbc 100644 --- a/src/functions/functions.spec.ts +++ b/src/functions/functions.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { FirebaseApp, provideFirebaseApp, getApp, initializeApp, deleteApp } from '@angular/fire/app'; -import { Functions, provideFunctions, getFunctions, connectFunctionsEmulator } from '@angular/fire/functions'; +import { FirebaseApp, getApp, initializeApp, provideFirebaseApp } from '@angular/fire/app'; +import { Functions, connectFunctionsEmulator, getFunctions, provideFunctions } from '@angular/fire/functions'; import { COMMON_CONFIG } from '../test-config'; import { rando } from '../utils'; diff --git a/src/functions/functions.ts b/src/functions/functions.ts index cf1890884..861114fa0 100644 --- a/src/functions/functions.ts +++ b/src/functions/functions.ts @@ -1,10 +1,10 @@ -import { Functions as FirebaseFunctions } from 'firebase/functions'; import { ɵgetAllInstancesOf } from '@angular/fire'; +import { Functions as FirebaseFunctions } from 'firebase/functions'; import { from, timer } from 'rxjs'; import { concatMap, distinct } from 'rxjs/operators'; // see notes in core/firebase.app.module.ts for why we're building the class like this -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Functions extends FirebaseFunctions {} export class Functions { @@ -15,7 +15,7 @@ export class Functions { export const FUNCTIONS_PROVIDER_NAME = 'functions'; -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface FunctionsInstances extends Array {} export class FunctionsInstances { diff --git a/src/messaging/messaging.module.ts b/src/messaging/messaging.module.ts index efb863c03..dc001bb99 100644 --- a/src/messaging/messaging.module.ts +++ b/src/messaging/messaging.module.ts @@ -1,10 +1,10 @@ -import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector, APP_INITIALIZER } from '@angular/core'; -import { Messaging as FirebaseMessaging } from 'firebase/messaging'; -import { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION } from '@angular/fire'; -import { Messaging, MessagingInstances, MESSAGING_PROVIDER_NAME } from './messaging'; -import { FirebaseApps, FirebaseApp } from '@angular/fire/app'; +import { APP_INITIALIZER, InjectionToken, Injector, ModuleWithProviders, NgModule, NgZone, Optional } from '@angular/core'; +import { VERSION, ɵAngularFireSchedulers, ɵgetDefaultInstanceOf } from '@angular/fire'; +import { FirebaseApp, FirebaseApps } from '@angular/fire/app'; import { registerVersion } from 'firebase/app'; +import { Messaging as FirebaseMessaging } from 'firebase/messaging'; import { isMessagingSupportedFactory } from './is-messaging-supported-factory'; +import { MESSAGING_PROVIDER_NAME, Messaging, MessagingInstances } from './messaging'; const PROVIDED_MESSAGING_INSTANCES = new InjectionToken('angularfire2.messaging-instances'); diff --git a/src/messaging/messaging.spec.ts b/src/messaging/messaging.spec.ts index 218e81360..5561a7006 100644 --- a/src/messaging/messaging.spec.ts +++ b/src/messaging/messaging.spec.ts @@ -1,11 +1,10 @@ import { TestBed } from '@angular/core/testing'; -import { FirebaseApp, provideFirebaseApp, getApp, initializeApp, deleteApp } from '@angular/fire/app'; -import { Messaging, provideMessaging, getMessaging, isSupported } from '@angular/fire/messaging'; +import { getApp, initializeApp, provideFirebaseApp } from '@angular/fire/app'; +import { Messaging, getMessaging, isSupported, provideMessaging } from '@angular/fire/messaging'; import { COMMON_CONFIG } from '../test-config'; import { rando } from '../utils'; describe('Messaging', () => { - let app: FirebaseApp; let messaging: Messaging; let providedMessaging: Messaging; let appName: string; @@ -31,7 +30,6 @@ describe('Messaging', () => { }), ], }); - app = TestBed.inject(FirebaseApp); messaging = TestBed.inject(Messaging); }); diff --git a/src/messaging/messaging.ts b/src/messaging/messaging.ts index e8b1c5e2a..f33566dcf 100644 --- a/src/messaging/messaging.ts +++ b/src/messaging/messaging.ts @@ -1,10 +1,10 @@ -import { Messaging as FirebaseMessaging } from 'firebase/messaging'; import { ɵgetAllInstancesOf } from '@angular/fire'; +import { Messaging as FirebaseMessaging } from 'firebase/messaging'; import { from, timer } from 'rxjs'; import { concatMap, distinct } from 'rxjs/operators'; // see notes in core/firebase.app.module.ts for why we're building the class like this -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Messaging extends FirebaseMessaging {} export class Messaging { @@ -15,7 +15,7 @@ export class Messaging { export const MESSAGING_PROVIDER_NAME = 'messaging'; -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface MessagingInstances extends Array {} export class MessagingInstances { diff --git a/src/performance/performance.module.ts b/src/performance/performance.module.ts index ed3a08865..be6eeeefe 100644 --- a/src/performance/performance.module.ts +++ b/src/performance/performance.module.ts @@ -1,17 +1,17 @@ -import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, PLATFORM_ID, Injector } from '@angular/core'; -import { FirebasePerformance } from 'firebase/performance'; -import { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION } from '@angular/fire'; -import { Performance, PerformanceInstances, PERFORMANCE_PROVIDER_NAME } from './performance'; -import { FirebaseApps, FirebaseApp } from '@angular/fire/app'; -import { registerVersion } from 'firebase/app'; import { isPlatformBrowser } from '@angular/common'; +import { InjectionToken, Injector, ModuleWithProviders, NgModule, NgZone, Optional, PLATFORM_ID } from '@angular/core'; +import { VERSION, ɵAngularFireSchedulers, ɵgetDefaultInstanceOf } from '@angular/fire'; +import { FirebaseApp, FirebaseApps } from '@angular/fire/app'; +import { registerVersion } from 'firebase/app'; +import { FirebasePerformance } from 'firebase/performance'; +import { PERFORMANCE_PROVIDER_NAME, Performance, PerformanceInstances } from './performance'; export const PROVIDED_PERFORMANCE_INSTANCES = new InjectionToken('angularfire2.performance-instances'); export function defaultPerformanceInstanceFactory( provided: FirebasePerformance[]|undefined, defaultApp: FirebaseApp, - // tslint:disable-next-line:ban-types + // eslint-disable-next-line @typescript-eslint/ban-types platform: Object ) { if (!isPlatformBrowser(platform)) { return null; } @@ -20,7 +20,7 @@ export function defaultPerformanceInstanceFactory( } export function performanceInstanceFactory(fn: (injector: Injector) => FirebasePerformance) { - // tslint:disable-next-line:ban-types + // eslint-disable-next-line @typescript-eslint/ban-types return (zone: NgZone, platform: Object, injector: Injector) => { if (!isPlatformBrowser(platform)) { return null; } const performance = zone.runOutsideAngular(() => fn(injector)); diff --git a/src/performance/performance.spec.ts b/src/performance/performance.spec.ts index 4f084d50e..54b4cf45d 100644 --- a/src/performance/performance.spec.ts +++ b/src/performance/performance.spec.ts @@ -1,8 +1,7 @@ import { TestBed } from '@angular/core/testing'; -import { FirebaseApp, provideFirebaseApp, initializeApp, deleteApp } from '@angular/fire/app'; -import { Performance, providePerformance, getPerformance } from '@angular/fire/performance'; +import { FirebaseApp, initializeApp, provideFirebaseApp } from '@angular/fire/app'; +import { Performance, getPerformance, providePerformance } from '@angular/fire/performance'; import { COMMON_CONFIG } from '../test-config'; -import { rando } from '../utils'; describe('Performance', () => { let app: FirebaseApp; diff --git a/src/performance/performance.ts b/src/performance/performance.ts index 7379ad0bc..ac6044386 100644 --- a/src/performance/performance.ts +++ b/src/performance/performance.ts @@ -1,10 +1,10 @@ -import { FirebasePerformance } from 'firebase/performance'; import { ɵgetAllInstancesOf } from '@angular/fire'; +import { FirebasePerformance } from 'firebase/performance'; import { from, timer } from 'rxjs'; import { concatMap, distinct } from 'rxjs/operators'; // see notes in core/firebase.app.module.ts for why we're building the class like this -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Performance extends FirebasePerformance {} export class Performance { @@ -15,7 +15,7 @@ export class Performance { export const PERFORMANCE_PROVIDER_NAME = 'performance'; -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface PerformanceInstances extends Array {} export class PerformanceInstances { diff --git a/src/performance/rxfire.ts b/src/performance/rxfire.ts index 5b0ea78ea..7d71b321d 100644 --- a/src/performance/rxfire.ts +++ b/src/performance/rxfire.ts @@ -2,9 +2,9 @@ import { ɵzoneWrap } from '@angular/fire'; import { traceUntil as _traceUntil, - traceWhile as _traceWhile, traceUntilComplete as _traceUntilComplete, - traceUntilFirst as _traceUntilFirst + traceUntilFirst as _traceUntilFirst, + traceWhile as _traceWhile } from 'rxfire/performance'; export const traceUntil = ɵzoneWrap(_traceUntil, true); diff --git a/src/remote-config/is-remote-config-supported-factory.ts b/src/remote-config/is-remote-config-supported-factory.ts index 8838150ca..faafd909c 100644 --- a/src/remote-config/is-remote-config-supported-factory.ts +++ b/src/remote-config/is-remote-config-supported-factory.ts @@ -1,5 +1,5 @@ -import { isSupported } from 'firebase/remote-config'; import { ɵisSupportedError } from '@angular/fire'; +import { isSupported } from 'firebase/remote-config'; const isRemoteConfigSupportedValueSymbol = '__angularfire_symbol__remoteConfigIsSupportedValue'; const isRemoteConfigSupportedPromiseSymbol = '__angularfire_symbol__remoteConfigIsSupported'; diff --git a/src/remote-config/remote-config.module.ts b/src/remote-config/remote-config.module.ts index 5bd985d0c..702b666cb 100644 --- a/src/remote-config/remote-config.module.ts +++ b/src/remote-config/remote-config.module.ts @@ -1,10 +1,10 @@ -import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector, APP_INITIALIZER } from '@angular/core'; -import { RemoteConfig as FirebaseRemoteConfig } from 'firebase/remote-config'; -import { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION } from '@angular/fire'; -import { RemoteConfig, RemoteConfigInstances, REMOTE_CONFIG_PROVIDER_NAME } from './remote-config'; -import { FirebaseApps, FirebaseApp } from '@angular/fire/app'; +import { APP_INITIALIZER, InjectionToken, Injector, ModuleWithProviders, NgModule, NgZone, Optional } from '@angular/core'; +import { VERSION, ɵAngularFireSchedulers, ɵgetDefaultInstanceOf } from '@angular/fire'; +import { FirebaseApp, FirebaseApps } from '@angular/fire/app'; import { registerVersion } from 'firebase/app'; +import { RemoteConfig as FirebaseRemoteConfig } from 'firebase/remote-config'; import { isRemoteConfigSupportedFactory } from './is-remote-config-supported-factory'; +import { REMOTE_CONFIG_PROVIDER_NAME, RemoteConfig, RemoteConfigInstances } from './remote-config'; export const PROVIDED_REMOTE_CONFIG_INSTANCES = new InjectionToken('angularfire2.remote-config-instances'); diff --git a/src/remote-config/remote-config.spec.ts b/src/remote-config/remote-config.spec.ts index be3bcca2b..6912544f8 100644 --- a/src/remote-config/remote-config.spec.ts +++ b/src/remote-config/remote-config.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { FirebaseApp, provideFirebaseApp, getApp, initializeApp, deleteApp } from '@angular/fire/app'; -import { RemoteConfig, provideRemoteConfig, getRemoteConfig, isSupported } from '@angular/fire/remote-config'; +import { FirebaseApp, getApp, initializeApp, provideFirebaseApp } from '@angular/fire/app'; +import { RemoteConfig, getRemoteConfig, isSupported, provideRemoteConfig } from '@angular/fire/remote-config'; import { COMMON_CONFIG } from '../test-config'; import { rando } from '../utils'; diff --git a/src/remote-config/remote-config.ts b/src/remote-config/remote-config.ts index f6238f2ce..91731da55 100644 --- a/src/remote-config/remote-config.ts +++ b/src/remote-config/remote-config.ts @@ -1,10 +1,10 @@ -import { RemoteConfig as FirebaseRemoteConfig } from 'firebase/remote-config'; import { ɵgetAllInstancesOf } from '@angular/fire'; +import { RemoteConfig as FirebaseRemoteConfig } from 'firebase/remote-config'; import { from, timer } from 'rxjs'; import { concatMap, distinct } from 'rxjs/operators'; // see notes in core/firebase.app.module.ts for why we're building the class like this -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface RemoteConfig extends FirebaseRemoteConfig {} export class RemoteConfig { @@ -15,7 +15,7 @@ export class RemoteConfig { export const REMOTE_CONFIG_PROVIDER_NAME = 'remote-config'; -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface RemoteConfigInstances extends Array {} export class RemoteConfigInstances { diff --git a/src/remote-config/rxfire.ts b/src/remote-config/rxfire.ts index 0c0d0de5a..d2fd59a52 100644 --- a/src/remote-config/rxfire.ts +++ b/src/remote-config/rxfire.ts @@ -1,11 +1,11 @@ // DO NOT MODIFY, this file is autogenerated by tools/build.ts import { ɵzoneWrap } from '@angular/fire'; import { - getValue as _getValue, - getString as _getString, - getNumber as _getNumber, + getAll as _getAll, getBoolean as _getBoolean, - getAll as _getAll + getNumber as _getNumber, + getString as _getString, + getValue as _getValue } from 'rxfire/remote-config'; export const getValueChanges = ɵzoneWrap(_getValue, true); diff --git a/src/schematics/add/index.ts b/src/schematics/add/index.ts index 39c90428a..150be7c40 100644 --- a/src/schematics/add/index.ts +++ b/src/schematics/add/index.ts @@ -1,8 +1,8 @@ import { SchematicContext, Tree } from '@angular-devkit/schematics'; -import { DeployOptions } from '../interfaces'; +import { NodePackageInstallTask, RunSchematicTask } from '@angular-devkit/schematics/tasks'; import { addDependencies } from '../common'; +import { DeployOptions } from '../interfaces'; import { peerDependencies } from '../versions.json'; -import { NodePackageInstallTask, RunSchematicTask } from '@angular-devkit/schematics/tasks'; export const ngAdd = (options: DeployOptions) => (tree: Tree, context: SchematicContext) => { addDependencies( diff --git a/src/schematics/common.ts b/src/schematics/common.ts index ed2879ea0..061603b69 100644 --- a/src/schematics/common.ts +++ b/src/schematics/common.ts @@ -1,8 +1,8 @@ -import { SchematicsException, Tree, SchematicContext } from '@angular-devkit/schematics'; -import { FirebaseHostingSite, FirebaseRc } from './interfaces'; +import { SchematicContext, SchematicsException, Tree } from '@angular-devkit/schematics'; import * as semver from 'semver'; +import { FirebaseHostingSite, FirebaseRc } from './interfaces'; -export const shortSiteName = (site?: FirebaseHostingSite) => site?.name && site.name.split('/').pop(); +export const shortSiteName = (site?: FirebaseHostingSite) => site?.name?.split('/').pop(); export const stringifyFormatted = (obj: any) => JSON.stringify(obj, null, 2); @@ -58,7 +58,7 @@ export function generateFirebaseRc( export function safeReadJSON(path: string, tree: Tree) { try { - // tslint:disable-next-line:no-non-null-assertion + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion return JSON.parse(tree.read(path)!.toString()); } catch (e) { throw new SchematicsException(`Error when parsing ${path}: ${e.message}`); @@ -67,7 +67,7 @@ export function safeReadJSON(path: string, tree: Tree) { export const addDependencies = ( host: Tree, - deps: { [name: string]: { dev?: boolean, version: string } }, + deps: Record, context: SchematicContext ) => { const packageJson = diff --git a/src/schematics/deploy/actions.jasmine.ts b/src/schematics/deploy/actions.jasmine.ts index 1c1deaa39..890e76350 100644 --- a/src/schematics/deploy/actions.jasmine.ts +++ b/src/schematics/deploy/actions.jasmine.ts @@ -1,8 +1,9 @@ -import { JsonObject, logging } from '@angular-devkit/core'; +/* eslint-disable @typescript-eslint/no-empty-function */ +import { join } from 'path'; import { BuilderContext, BuilderRun, ScheduleOptions, Target } from '@angular-devkit/architect'; -import { BuildTarget, FirebaseDeployConfig, FirebaseTools, FSHost } from '../interfaces'; +import { JsonObject, logging } from '@angular-devkit/core'; +import { BuildTarget, FSHost, FirebaseDeployConfig, FirebaseTools } from '../interfaces'; import deploy, { deployToFunction } from './actions' -import { join } from 'path'; import 'jasmine'; let context: BuilderContext; @@ -89,7 +90,7 @@ const initMocks = () => { id: 1, logger: new logging.NullLogger() as any, workspaceRoot: 'cwd', - getTargetOptions: async (target: Target) => { + getTargetOptions: (target: Target) => { if (target.target === 'build') { return { outputPath: 'dist/browser' }; } else if (target.target === 'server') { diff --git a/src/schematics/deploy/actions.ts b/src/schematics/deploy/actions.ts index ad886e5af..6ee2d6038 100644 --- a/src/schematics/deploy/actions.ts +++ b/src/schematics/deploy/actions.ts @@ -1,17 +1,17 @@ -import { BuilderContext, targetFromTargetString } from '@angular-devkit/architect'; -import { BuildTarget, CloudRunOptions, DeployBuilderSchema, FirebaseTools, FSHost } from '../interfaces'; +import { SpawnOptionsWithoutStdio, execSync, spawn } from 'child_process'; import { existsSync, readFileSync, renameSync, writeFileSync } from 'fs'; -import { copySync, removeSync } from 'fs-extra'; import { dirname, join } from 'path'; -import { execSync, spawn, SpawnOptionsWithoutStdio } from 'child_process'; -import { defaultFunction, functionGen2, defaultPackage, DEFAULT_FUNCTION_NAME, dockerfile } from './functions-templates'; -import { satisfies, lt } from 'semver'; -import open from 'open'; +import { BuilderContext, targetFromTargetString } from '@angular-devkit/architect'; import { SchematicsException } from '@angular-devkit/schematics'; -import { firebaseFunctionsDependencies } from '../versions.json'; -import * as winston from 'winston'; -import tripleBeam from 'triple-beam'; +import { copySync, removeSync } from 'fs-extra'; import * as inquirer from 'inquirer'; +import open from 'open'; +import { satisfies } from 'semver'; +import tripleBeam from 'triple-beam'; +import * as winston from 'winston'; +import { BuildTarget, CloudRunOptions, DeployBuilderSchema, FSHost, FirebaseTools } from '../interfaces'; +import { firebaseFunctionsDependencies } from '../versions.json'; +import { DEFAULT_FUNCTION_NAME, defaultFunction, defaultPackage, dockerfile, functionGen2 } from './functions-templates'; const DEFAULT_EMULATOR_PORT = 5000; const DEFAULT_EMULATOR_HOST = 'localhost'; @@ -56,7 +56,7 @@ const spawnAsync = async ( export type DeployBuilderOptions = DeployBuilderSchema & Record; -const escapeRegExp = (str: string) => str.replace(/[\-\[\]\/{}()*+?.\\^$|]/g, '\\$&'); +const escapeRegExp = (str: string) => str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&'); const moveSync = (src: string, dest: string) => { copySync(src, dest); @@ -71,7 +71,7 @@ const deployToHosting = async ( firebaseToken?: string, ) => { - // tslint:disable-next-line:no-non-null-assertion + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const siteTarget = options.target ?? context.target!.project; if (options.preview) { @@ -116,7 +116,7 @@ const defaultFsHost: FSHost = { }; const findPackageVersion = (packageManager: string, name: string) => { - const match = execSync(`${packageManager} list ${name}`).toString().match(`[^|\s]${escapeRegExp(name)}[@| ][^\s]+(\s.+)?$`); + const match = execSync(`${packageManager} list ${name}`).toString().match(`[^|s]${escapeRegExp(name)}[@| ][^s]+(s.+)?$`); return match ? match[0].split(new RegExp(`${escapeRegExp(name)}[@| ]`))[1].split(/\s/)[0] : null; }; @@ -132,7 +132,7 @@ const getPackageJson = (context: BuilderContext, workspaceRoot: string, options: if (existsSync(join(workspaceRoot, 'angular.json'))) { const angularJson = JSON.parse(readFileSync(join(workspaceRoot, 'angular.json')).toString()); const packageManager = angularJson.cli?.packageManager ?? 'npm'; - // tslint:disable-next-line:no-non-null-assertion + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const server = angularJson.projects[context.target!.project].architect.server; const externalDependencies = server?.options?.externalDependencies || []; const bundleDependencies = server?.options?.bundleDependencies ?? true; @@ -231,10 +231,10 @@ export const deployToFunction = async ( join(newStaticOut, 'index.html'), join(newStaticOut, 'index.original.html') ); - } catch (e) { } + } catch (e) { /* empty */ } } - // tslint:disable-next-line:no-non-null-assertion + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const siteTarget = options.target ?? context.target!.project; if (fsHost.existsSync(functionsPackageJsonPath)) { @@ -340,14 +340,14 @@ export const deployToCloudRun = async ( join(newStaticOut, 'index.html'), join(newStaticOut, 'index.original.html') ); - } catch (e) { } + } catch (e) { /* empty */ } } if (options.preview) { throw new SchematicsException('Cloud Run preview not supported.'); } - const deployArguments: Array = []; + const deployArguments: any[] = []; const cloudRunOptions = options.cloudRunOptions || {}; Object.entries(DEFAULT_CLOUD_RUN_OPTIONS).forEach(([k, v]) => { cloudRunOptions[k] ||= v; @@ -367,7 +367,7 @@ export const deployToCloudRun = async ( await spawnAsync(`gcloud builds submit ${cloudRunOut} --tag gcr.io/${options.firebaseProject}/${serviceId} --project ${options.firebaseProject} --quiet`); await spawnAsync(`gcloud run deploy ${serviceId} --image gcr.io/${options.firebaseProject}/${serviceId} --project ${options.firebaseProject} ${deployArguments.join(' ')} --platform managed --allow-unauthenticated --region=${options.region} --quiet`); - // tslint:disable-next-line:no-non-null-assertion + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const siteTarget = options.target ?? context.target!.project; // TODO deploy cloud run @@ -451,6 +451,7 @@ export default async function deploy( const emulator = info[tripleBeam.SPLAT as any]?.[1]?.metadata?.emulator; const text = info[tripleBeam.SPLAT as any]?.[0]; if (text?.replace) { + // eslint-disable-next-line no-control-regex const plainText = text.replace(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]/g, ''); if (emulator?.name === 'hosting' && plainText.startsWith('Local server: ')) { open(plainText.split(': ')[1]); diff --git a/src/schematics/deploy/builder.ts b/src/schematics/deploy/builder.ts index 3c8b51e74..e36d6c43e 100644 --- a/src/schematics/deploy/builder.ts +++ b/src/schematics/deploy/builder.ts @@ -1,8 +1,8 @@ import { BuilderContext, BuilderOutput, createBuilder } from '@angular-devkit/architect'; -import deploy, { DeployBuilderOptions } from './actions'; +import { getFirebaseTools } from '../firebaseTools'; import { BuildTarget } from '../interfaces'; import { getFirebaseProjectNameFromFs } from '../utils'; -import { getFirebaseTools } from '../firebaseTools'; +import deploy, { DeployBuilderOptions } from './actions'; // Call the createBuilder() function to create a builder. This mirrors // createJobHandler() but add typings specific to Architect Builders. diff --git a/src/schematics/deploy/functions-templates.ts b/src/schematics/deploy/functions-templates.ts index 65ba31492..4005675c9 100644 --- a/src/schematics/deploy/functions-templates.ts +++ b/src/schematics/deploy/functions-templates.ts @@ -11,8 +11,8 @@ const DEFAULT_RUNTIME_OPTIONS = { }; export const defaultPackage = ( - dependencies: {[key: string]: string}, - devDependencies: {[key: string]: string}, + dependencies: Record, + devDependencies: Record, options: DeployBuilderOptions, main?: string, ) => ({ diff --git a/src/schematics/firebaseTools.ts b/src/schematics/firebaseTools.ts index 757527f0b..90db6b1b0 100644 --- a/src/schematics/firebaseTools.ts +++ b/src/schematics/firebaseTools.ts @@ -1,7 +1,8 @@ -import { FirebaseTools } from './interfaces'; -import { spawn, execSync } from 'child_process'; +/* eslint-disable @typescript-eslint/no-var-requires */ +import { execSync, spawn } from 'child_process'; import ora from 'ora'; import * as semver from 'semver'; +import { FirebaseTools } from './interfaces'; declare global { var firebaseTools: FirebaseTools|undefined; diff --git a/src/schematics/interfaces.ts b/src/schematics/interfaces.ts index 39cab9971..795aeaa9c 100644 --- a/src/schematics/interfaces.ts +++ b/src/schematics/interfaces.ts @@ -55,7 +55,7 @@ export interface FirebaseProject { projectNumber: string; displayName: string; name: string; - resources: { [key: string]: string }; + resources: Record; state: string; } @@ -84,7 +84,7 @@ export interface FirebaseHostingSite { export interface FirebaseSDKConfig { fileName: string; fileContents: string; - sdkConfig: { [key: string]: string }; + sdkConfig: Record; } export interface FirebaseTools { @@ -122,8 +122,8 @@ export interface FirebaseTools { login: { list(): Promise<{user: Record}[]>; add(): Promise>; - use(email: string, options?: {}): Promise; - } & ((options?: {}) => Promise>); + use(email: string, options?: unknown): Promise; + } & ((options?: unknown) => Promise>); deploy(config: FirebaseDeployConfig): Promise; @@ -145,7 +145,7 @@ export interface FirebaseHostingConfig { rewrites?: FirebaseHostingRewrite[]; } -export interface FirebaseFunctionsConfig { [key: string]: any; } +export type FirebaseFunctionsConfig = Record; export interface FirebaseJSON { hosting?: FirebaseHostingConfig[] | FirebaseHostingConfig; @@ -195,7 +195,7 @@ export interface CloudRunOptions { export interface BuildTarget { name: string; - options?: {[name: string]: any}; + options?: Record; } export interface FSHost { diff --git a/src/schematics/ng-add.jasmine.ts b/src/schematics/ng-add.jasmine.ts index 72d4a39b0..f710efb72 100644 --- a/src/schematics/ng-add.jasmine.ts +++ b/src/schematics/ng-add.jasmine.ts @@ -1,8 +1,7 @@ import { SchematicsException, Tree } from '@angular-devkit/schematics'; -// import { setupProject } from '@angular/fire/schematics/setup'; +import { FEATURES, PROJECT_TYPE } from './interfaces'; import { setupProject } from './setup'; import 'jasmine'; -import { FEATURES, PROJECT_TYPE } from './interfaces'; const PROJECT_NAME = 'pie-ka-chu'; const PROJECT_ROOT = 'pirojok'; @@ -88,57 +87,57 @@ function generateAngularJsonWithServer() { } const initialFirebaseJson = `{ - \"hosting\": [ + "hosting": [ { - \"target\": \"pie-ka-chu\", - \"source\": \".\", - \"frameworksBackend\": {} + "target": "pie-ka-chu", + "source": ".", + "frameworksBackend": {} } ] }`; const initialFirebaserc = `{ - \"targets\": { - \"pirojok-111e3\": { - \"hosting\": { - \"pie-ka-chu\": [ - \"pirojok-111e3\" + "targets": { + "pirojok-111e3": { + "hosting": { + "pie-ka-chu": [ + "pirojok-111e3" ] } } }, - \"projects\": { - \"default\": \"pirojok-111e3\" + "projects": { + "default": "pirojok-111e3" } }`; const initialAngularJson = `{ - \"defaultProject\": \"pie-ka-chu\", - \"projects\": { - \"pie-ka-chu\": { - \"projectType\": \"application\", - \"root\": \"pirojok\", - \"architect\": { - \"build\": { - \"options\": { - \"outputPath\": \"dist/ikachu\" + "defaultProject": "pie-ka-chu", + "projects": { + "pie-ka-chu": { + "projectType": "application", + "root": "pirojok", + "architect": { + "build": { + "options": { + "outputPath": "dist/ikachu" } }, - \"deploy\": { - \"builder\": \"@angular/fire:deploy\", - \"options\": { - \"version\": 2 + "deploy": { + "builder": "@angular/fire:deploy", + "options": { + "version": 2 } } } }, - \"pi-catch-you\": { - \"projectType\": \"application\", - \"root\": \"pirojok\", - \"architect\": { - \"build\": { - \"options\": { - \"outputPath\": \"dist/ikachu\" + "pi-catch-you": { + "projectType": "application", + "root": "pirojok", + "architect": { + "build": { + "options": { + "outputPath": "dist/ikachu" } } } @@ -147,57 +146,57 @@ const initialAngularJson = `{ }`; const overwriteFirebaseJson = `{ - \"hosting\": [ + "hosting": [ { - \"target\": \"pie-ka-chu\", - \"source\": \".\", - \"frameworksBackend\": {} + "target": "pie-ka-chu", + "source": ".", + "frameworksBackend": {} } ] }`; const overwriteFirebaserc = `{ - \"targets\": { - \"pirojok-111e3\": { - \"hosting\": { - \"pie-ka-chu\": [ - \"pirojok-111e3\" + "targets": { + "pirojok-111e3": { + "hosting": { + "pie-ka-chu": [ + "pirojok-111e3" ] } } }, - \"projects\": { - \"default\": \"pirojok-111e3\" + "projects": { + "default": "pirojok-111e3" } }`; const overwriteAngularJson = `{ - \"defaultProject\": \"pie-ka-chu\", - \"projects\": { - \"pie-ka-chu\": { - \"projectType\": \"application\", - \"root\": \"pirojok\", - \"architect\": { - \"build\": { - \"options\": { - \"outputPath\": \"dist/ikachu\" + "defaultProject": "pie-ka-chu", + "projects": { + "pie-ka-chu": { + "projectType": "application", + "root": "pirojok", + "architect": { + "build": { + "options": { + "outputPath": "dist/ikachu" } }, - \"deploy\": { - \"builder\": \"@angular/fire:deploy\", - \"options\": { - \"version\": 2 + "deploy": { + "builder": "@angular/fire:deploy", + "options": { + "version": 2 } } } }, - \"pi-catch-you\": { - \"projectType\": \"application\", - \"root\": \"pirojok\", - \"architect\": { - \"build\": { - \"options\": { - \"outputPath\": \"dist/ikachu\" + "pi-catch-you": { + "projectType": "application", + "root": "pirojok", + "architect": { + "build": { + "options": { + "outputPath": "dist/ikachu" } } } @@ -206,75 +205,75 @@ const overwriteAngularJson = `{ }`; const projectFirebaseJson = `{ - \"hosting\": [ + "hosting": [ { - \"target\": \"pie-ka-chu\", - \"source\": \".\", - \"frameworksBackend\": {} + "target": "pie-ka-chu", + "source": ".", + "frameworksBackend": {} }, { - \"target\": \"pi-catch-you\", - \"source\": \".\", - \"frameworksBackend\": {} + "target": "pi-catch-you", + "source": ".", + "frameworksBackend": {} } ] }`; const projectFirebaserc = `{ - \"targets\": { - \"pirojok-111e3\": { - \"hosting\": { - \"pie-ka-chu\": [ - \"pirojok-111e3\" + "targets": { + "pirojok-111e3": { + "hosting": { + "pie-ka-chu": [ + "pirojok-111e3" ] } }, - \"bi-catch-you-77e7e\": { - \"hosting\": { - \"pi-catch-you\": [ - \"bi-catch-you-77e7e\" + "bi-catch-you-77e7e": { + "hosting": { + "pi-catch-you": [ + "bi-catch-you-77e7e" ] } } }, - \"projects\": { - \"default\": \"bi-catch-you-77e7e\" + "projects": { + "default": "bi-catch-you-77e7e" } }`; const projectAngularJson = `{ - \"defaultProject\": \"pie-ka-chu\", - \"projects\": { - \"pie-ka-chu\": { - \"projectType\": \"application\", - \"root\": \"pirojok\", - \"architect\": { - \"build\": { - \"options\": { - \"outputPath\": \"dist/ikachu\" + "defaultProject": "pie-ka-chu", + "projects": { + "pie-ka-chu": { + "projectType": "application", + "root": "pirojok", + "architect": { + "build": { + "options": { + "outputPath": "dist/ikachu" } }, - \"deploy\": { - \"builder\": \"@angular/fire:deploy\", - \"options\": { - \"version": 2 + "deploy": { + "builder": "@angular/fire:deploy", + "options": { + "version": 2 } } } }, - \"pi-catch-you\": { - \"projectType\": \"application\", - \"root\": \"pirojok\", - \"architect\": { - \"build\": { - \"options\": { - \"outputPath\": \"dist/ikachu\" + "pi-catch-you": { + "projectType": "application", + "root": "pirojok", + "architect": { + "build": { + "options": { + "outputPath": "dist/ikachu" } }, - \"deploy\": { - \"builder\": \"@angular/fire:deploy\", - \"options\": { - \"version\": 2 + "deploy": { + "builder": "@angular/fire:deploy", + "options": { + "version": 2 } } } @@ -339,7 +338,7 @@ describe('ng-add', () => { }); it('overrides existing files', async () => { - const tempTree = await setupProject(tree, {} as any, [FEATURES.Hosting], { + await setupProject(tree, {} as any, [FEATURES.Hosting], { firebaseProject: { projectId: FIREBASE_PROJECT } as any, projectType: PROJECT_TYPE.Static, project: PROJECT_NAME, @@ -539,14 +538,14 @@ describe('ng-add', () => { tree.create('package.json', JSON.stringify(generatePackageJson())); // TODO mock addTask - const result = await setupProject(tree, {addTask: () => {}} as any, [FEATURES.Hosting], { + const result = await setupProject(tree, {addTask: () => undefined} as any, [FEATURES.Hosting], { firebaseProject: { projectId: FIREBASE_PROJECT } as any, projectType: PROJECT_TYPE.CloudFunctions, project: PROJECT_NAME, prerender: false, }) as Tree; - const workspace = JSON.parse((await result.read('angular.json')).toString()); + const workspace = JSON.parse((result.read('angular.json')).toString()); expect(workspace.projects['pie-ka-chu'].architect.deploy).toBeTruthy(); }); @@ -556,14 +555,14 @@ describe('ng-add', () => { tree.create('package.json', JSON.stringify(generatePackageJson())); // TODO mock addTask - const result = await setupProject(tree, {addTask: () => {}} as any, [FEATURES.Hosting], { + const result = await setupProject(tree, {addTask: () => undefined} as any, [FEATURES.Hosting], { firebaseProject: { projectId: FIREBASE_PROJECT } as any, projectType: PROJECT_TYPE.CloudFunctions, project: PROJECT_NAME, prerender: false, }) as Tree; - const firebaseJson = JSON.parse((await result.read('firebase.json')).toString()); + const firebaseJson = JSON.parse((result.read('firebase.json')).toString()); expect(firebaseJson).toEqual(universalFirebaseJson); }); }); diff --git a/src/schematics/setup/index.ts b/src/schematics/setup/index.ts index 9a8c8950b..a2c6fd6a9 100644 --- a/src/schematics/setup/index.ts +++ b/src/schematics/setup/index.ts @@ -1,24 +1,24 @@ -import { asWindowsPath, normalize } from '@angular-devkit/core'; -import { SchematicContext, SchematicsException, Tree } from '@angular-devkit/schematics'; -import { - getWorkspace, getProject, getFirebaseProjectNameFromHost, addEnvironmentEntry, - addToNgModule, addIgnoreFiles, addFixesToServer -} from '../utils'; -import { projectTypePrompt, appPrompt, sitePrompt, projectPrompt, featuresPrompt, userPrompt } from './prompts'; -import { - FirebaseApp, FirebaseHostingSite, FirebaseProject, DeployOptions, NgAddNormalizedOptions, - FEATURES, PROJECT_TYPE -} from '../interfaces'; -import { getFirebaseTools } from '../firebaseTools'; import { writeFileSync } from 'fs'; import { join } from 'path'; +import { asWindowsPath, normalize } from '@angular-devkit/core'; +import { SchematicContext, SchematicsException, Tree } from '@angular-devkit/schematics'; import { generateFirebaseRc, overwriteIfExists, safeReadJSON, stringifyFormatted } from '../common'; +import { getFirebaseTools } from '../firebaseTools'; +import { + DeployOptions, FEATURES, FirebaseApp, FirebaseHostingSite, FirebaseProject, + NgAddNormalizedOptions, PROJECT_TYPE +} from '../interfaces'; import { FirebaseJSON, Workspace, WorkspaceProject } from '../interfaces'; +import { + addEnvironmentEntry, addFixesToServer, addIgnoreFiles, addToNgModule, + getFirebaseProjectNameFromHost, getProject, getWorkspace +} from '../utils'; +import { appPrompt, featuresPrompt, projectPrompt, projectTypePrompt, sitePrompt, userPrompt } from './prompts'; export interface SetupConfig extends DeployOptions { firebaseProject: FirebaseProject, @@ -33,7 +33,7 @@ export interface SetupConfig extends DeployOptions { ssrRegion?: string, projectType?: PROJECT_TYPE, prerender?: boolean, -}; +} export const setupProject = async (tree: Tree, context: SchematicContext, features: FEATURES[], config: SetupConfig) => { @@ -48,7 +48,7 @@ export const setupProject = const featuresToImport = features.filter(it => it !== FEATURES.Hosting); if (featuresToImport.length > 0) { addToNgModule(tree, { features: featuresToImport, sourcePath }); - addFixesToServer(tree, { features: featuresToImport, sourcePath }); + addFixesToServer(tree); } if (config.sdkConfig) { diff --git a/src/schematics/setup/prompts.ts b/src/schematics/setup/prompts.ts index 0cb6ce462..b8329fbd5 100644 --- a/src/schematics/setup/prompts.ts +++ b/src/schematics/setup/prompts.ts @@ -1,10 +1,11 @@ import * as fuzzy from 'fuzzy'; import * as inquirer from 'inquirer'; -import { featureOptions, FEATURES, FirebaseApp, FirebaseHostingSite, FirebaseProject, PROJECT_TYPE, WorkspaceProject } from '../interfaces'; -import { hasPrerenderOption, isUniversalApp, shortAppId } from '../utils'; -import { getFirebaseTools } from '../firebaseTools'; import { shortSiteName } from '../common'; +import { getFirebaseTools } from '../firebaseTools'; +import { FEATURES, FirebaseApp, FirebaseHostingSite, FirebaseProject, PROJECT_TYPE, WorkspaceProject, featureOptions } from '../interfaces'; +import { hasPrerenderOption, isUniversalApp, shortAppId } from '../utils'; +// eslint-disable-next-line @typescript-eslint/no-var-requires inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt')); const NEW_OPTION = '~~angularfire-new~~'; @@ -25,6 +26,7 @@ const isSite = (elem: FirebaseHostingSite | fuzzy.FilterResult + // eslint-disable-next-line @typescript-eslint/require-await async (_: any, input: string) => { projects.unshift({ projectId: NEW_OPTION, @@ -50,6 +52,7 @@ export const searchProjects = (projects: FirebaseProject[]) => }; export const searchApps = (apps: FirebaseApp[]) => + // eslint-disable-next-line @typescript-eslint/require-await async (_: any, input: string) => { apps.unshift({ appId: NEW_OPTION, @@ -75,6 +78,7 @@ export const searchApps = (apps: FirebaseApp[]) => }; export const searchSites = (sites: FirebaseHostingSite[]) => + // eslint-disable-next-line @typescript-eslint/require-await async (_: any, input: string) => { sites.unshift({ name: NEW_OPTION, @@ -118,7 +122,7 @@ export const featuresPrompt = async (): Promise => { return features; }; -export const userPrompt = async (options: {}): Promise> => { +export const userPrompt = async (options: unknown): Promise> => { const firebaseTools = await getFirebaseTools(); const users = await firebaseTools.login.list(); if (!users || users.length === 0) { @@ -144,7 +148,7 @@ export const userPrompt = async (options: {}): Promise> => { } }; -export const projectPrompt = async (defaultProject: string|undefined, options: {}) => { +export const projectPrompt = async (defaultProject: string|undefined, options: unknown) => { const firebaseTools = await getFirebaseTools(); const projects = await firebaseTools.projects.list(options); const { projectId } = await autocomplete({ @@ -168,11 +172,11 @@ export const projectPrompt = async (defaultProject: string|undefined, options: { }) as { displayName: string }; return await firebaseTools.projects.create(projectId, { account: (options as any).account, displayName, nonInteractive: true }); } - // tslint:disable-next-line:no-non-null-assertion - return (await projects).find(it => it.projectId === projectId)!; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return (projects).find(it => it.projectId === projectId)!; }; -export const appPrompt = async ({ projectId: project }: FirebaseProject, defaultAppId: string|undefined, options: {}) => { +export const appPrompt = async ({ projectId: project }: FirebaseProject, defaultAppId: string|undefined, options: any) => { const firebaseTools = await getFirebaseTools(); const apps = await firebaseTools.apps.list('web', { ...options, project }); const { appId } = await autocomplete({ @@ -187,14 +191,14 @@ export const appPrompt = async ({ projectId: project }: FirebaseProject, default type: 'input', name: 'displayName', message: 'What would you like to call your app?', - }) as { displayName: string };; + }) as { displayName: string }; return await firebaseTools.apps.create('web', displayName, { ...options, nonInteractive: true, project }); } - // tslint:disable-next-line:no-non-null-assertion - return (await apps).find(it => shortAppId(it) === appId)!; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return (apps).find(it => shortAppId(it) === appId)!; }; -export const sitePrompt = async ({ projectId: project }: FirebaseProject, options: {}) => { +export const sitePrompt = async ({ projectId: project }: FirebaseProject, options: any) => { const firebaseTools = await getFirebaseTools(); const sites = await firebaseTools.hosting.sites.list({ ...options, project }).then(it => { if (it.sites.length === 0) { @@ -224,8 +228,8 @@ export const sitePrompt = async ({ projectId: project }: FirebaseProject, option }) as { subdomain: string }; return await firebaseTools.hosting.sites.create(subdomain, { ...options, nonInteractive: true, project }); } - // tslint:disable-next-line:no-non-null-assertion - return (await sites).find(it => shortSiteName(it) === siteName)!; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return (sites).find(it => shortSiteName(it) === siteName)!; }; const DEFAULT_REGION = 'us-central1'; diff --git a/src/schematics/update/index.ts b/src/schematics/update/index.ts index 750909a3c..7b57b5ab4 100644 --- a/src/schematics/update/index.ts +++ b/src/schematics/update/index.ts @@ -2,7 +2,7 @@ import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics'; export const ngPostUpdate = (): Rule => ( host: Tree, - context: SchematicContext + _context: SchematicContext ) => { return host; }; diff --git a/src/schematics/update/v7/index.ts b/src/schematics/update/v7/index.ts index 4fc5a45fb..a8fd5c56f 100644 --- a/src/schematics/update/v7/index.ts +++ b/src/schematics/update/v7/index.ts @@ -1,10 +1,10 @@ +import { join } from 'path'; import { Rule, SchematicContext, SchematicsException, Tree } from '@angular-devkit/schematics'; import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; import { overwriteIfExists, safeReadJSON, stringifyFormatted } from '../../common'; -import { peerDependencies, firebaseFunctionsDependencies } from '../../versions.json'; -import { join } from 'path'; +import { firebaseFunctionsDependencies, peerDependencies } from '../../versions.json'; -const IMPORT_REGEX = /(?import|export)\s+(?:(?[\w,{}\s\*]+)\s+from)?\s*(?:(?["'])?(?[@\w\s\\\/.-]+)\3?)\s*(?[;\n])/g; +const IMPORT_REGEX = /(?import|export)\s+(?:(?[\w,{}\s*]+)\s+from)?\s*(?:(?["'])?(?[@\w\s\\/.-]+)\3?)\s*(?[;\n])/g; interface ImportRegexMatch { key: string; alias: string; diff --git a/src/schematics/utils.ts b/src/schematics/utils.ts index d9b9c5143..1388330f4 100644 --- a/src/schematics/utils.ts +++ b/src/schematics/utils.ts @@ -1,12 +1,12 @@ import { readFileSync } from 'fs'; -import { FirebaseRc, Workspace, WorkspaceProject, FirebaseApp, DeployOptions, FEATURES } from './interfaces'; import { join } from 'path'; import { SchematicsException, Tree } from '@angular-devkit/schematics'; import ts from '@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript'; -import { findNode, addImportToModule, addProviderToModule, insertImport } from '@schematics/angular/utility/ast-utils'; -import { InsertChange, ReplaceChange, applyToUpdateRecorder, Change } from '@schematics/angular/utility/change'; +import { addImportToModule, addProviderToModule, findNode, insertImport } from '@schematics/angular/utility/ast-utils'; +import { Change, InsertChange, ReplaceChange, applyToUpdateRecorder } from '@schematics/angular/utility/change'; import { buildRelativePath } from '@schematics/angular/utility/find-module'; import { overwriteIfExists } from './common'; +import { DeployOptions, FEATURES, FirebaseApp, FirebaseRc, Workspace, WorkspaceProject } from './interfaces'; // We consider a project to be a universal project if it has a `server` architect // target. If it does, it knows how to build the application's server. @@ -18,7 +18,7 @@ export const hasPrerenderOption = ( project: WorkspaceProject ) => project.architect?.prerender; -export const shortAppId = (app?: FirebaseApp) => app?.appId && app.appId.split('/').pop(); +export const shortAppId = (app?: FirebaseApp) => app?.appId?.split('/').pop(); export function getWorkspace( host: Tree @@ -30,6 +30,7 @@ export function getWorkspace( throw new SchematicsException(`Could not find angular.json`); } + // eslint-disable-next-line @typescript-eslint/no-var-requires const { parse } = require('jsonc-parser'); const workspace = parse(configBuffer.toString()) as Workspace|undefined; @@ -121,7 +122,7 @@ export function addEnvironmentEntry( const sourceFile = ts.createSourceFile(filePath, buffer.toString('utf-8'), ts.ScriptTarget.Latest, true); const envIdentifier = findNode(sourceFile as any, ts.SyntaxKind.Identifier, 'environment'); - if (!envIdentifier || !envIdentifier.parent) { + if (!envIdentifier?.parent) { throw new SchematicsException(`Cannot find 'environment' identifier in ${filePath}`); } @@ -132,7 +133,7 @@ export function addEnvironmentEntry( const firebaseIdentifier = findNode(envObjectLiteral, ts.SyntaxKind.Identifier, 'firebase'); const recorder = host.beginUpdate(filePath); - if (firebaseIdentifier && firebaseIdentifier.parent) { + if (firebaseIdentifier?.parent) { const change = new ReplaceChange(filePath, firebaseIdentifier.parent.pos, firebaseIdentifier.parent.getFullText(), data); applyToUpdateRecorder(recorder, [change]); } else { @@ -154,7 +155,7 @@ export function addEnvironmentEntry( } // TODO rewrite using typescript -export function addFixesToServer(host: Tree, options: { sourcePath: string, features: FEATURES[]}) { +export function addFixesToServer(host: Tree) { const serverPath = `/server.ts`; if (!host.exists(serverPath)) { @@ -202,7 +203,7 @@ export function addToNgModule(host: Tree, options: { sourcePath: string, feature `/${options.sourcePath}/environments/environment` ); - const changes: Array = []; + const changes: Change[] = []; if (!findNode(source, ts.SyntaxKind.Identifier, 'provideFirebaseApp')) { changes.push( diff --git a/src/storage/storage.module.ts b/src/storage/storage.module.ts index 761cc27bb..cc903a58f 100644 --- a/src/storage/storage.module.ts +++ b/src/storage/storage.module.ts @@ -1,11 +1,11 @@ -import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector } from '@angular/core'; -import { FirebaseStorage } from 'firebase/storage'; -import { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION } from '@angular/fire'; -import { Storage, StorageInstances, STORAGE_PROVIDER_NAME } from './storage'; -import { FirebaseApps, FirebaseApp } from '@angular/fire/app'; +import { InjectionToken, Injector, ModuleWithProviders, NgModule, NgZone, Optional } from '@angular/core'; +import { VERSION, ɵAngularFireSchedulers, ɵgetDefaultInstanceOf } from '@angular/fire'; +import { ɵAppCheckInstances } from '@angular/fire'; +import { FirebaseApp, FirebaseApps } from '@angular/fire/app'; import { AuthInstances } from '@angular/fire/auth'; import { registerVersion } from 'firebase/app'; -import { ɵAppCheckInstances } from '@angular/fire'; +import { FirebaseStorage } from 'firebase/storage'; +import { STORAGE_PROVIDER_NAME, Storage, StorageInstances } from './storage'; export const PROVIDED_STORAGE_INSTANCES = new InjectionToken('angularfire2.storage-instances'); diff --git a/src/storage/storage.spec.ts b/src/storage/storage.spec.ts index 7b2447ed1..9d403b7df 100644 --- a/src/storage/storage.spec.ts +++ b/src/storage/storage.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { FirebaseApp, provideFirebaseApp, getApp, initializeApp, deleteApp } from '@angular/fire/app'; -import { Storage, provideStorage, getStorage, connectStorageEmulator } from '@angular/fire/storage'; +import { FirebaseApp, getApp, initializeApp, provideFirebaseApp } from '@angular/fire/app'; +import { Storage, connectStorageEmulator, getStorage, provideStorage } from '@angular/fire/storage'; import { COMMON_CONFIG } from '../test-config'; import { rando } from '../utils'; diff --git a/src/storage/storage.ts b/src/storage/storage.ts index 22bd4e934..f24cd6bd1 100644 --- a/src/storage/storage.ts +++ b/src/storage/storage.ts @@ -1,10 +1,10 @@ -import { FirebaseStorage } from 'firebase/storage'; import { ɵgetAllInstancesOf } from '@angular/fire'; +import { FirebaseStorage } from 'firebase/storage'; import { from, timer } from 'rxjs'; import { concatMap, distinct } from 'rxjs/operators'; // see notes in core/firebase.app.module.ts for why we're building the class like this -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Storage extends FirebaseStorage {} export class Storage { @@ -15,7 +15,7 @@ export class Storage { export const STORAGE_PROVIDER_NAME = 'storage'; -// tslint:disable-next-line:no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface StorageInstances extends Array {} export class StorageInstances { diff --git a/src/zones.ts b/src/zones.ts index 5a0813a6b..2b6a6ffb1 100644 --- a/src/zones.ts +++ b/src/zones.ts @@ -1,24 +1,25 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ import { Injectable, NgZone } from '@angular/core'; import { - asyncScheduler, Observable, Operator, - queueScheduler, SchedulerAction, SchedulerLike, Subscriber, Subscription, - TeardownLogic + TeardownLogic, + asyncScheduler, + queueScheduler } from 'rxjs'; import { observeOn, subscribeOn, tap } from 'rxjs/operators'; +// eslint-disable-next-line @typescript-eslint/no-empty-function function noop() { } /** * Schedules tasks so that they are invoked inside the Zone that is passed in the constructor. */ -// tslint:disable-next-line:class-name export class ɵZoneScheduler implements SchedulerLike { constructor(private zone: any, private delegate: any = queueScheduler) { } @@ -76,7 +77,6 @@ class BlockUntilFirstOperator implements Operator { @Injectable({ providedIn: 'root', }) -// tslint:disable-next-line:class-name export class ɵAngularFireSchedulers { public readonly outsideAngular: ɵZoneScheduler; public readonly insideAngular: ɵZoneScheduler; @@ -117,7 +117,6 @@ export function observeInsideAngular(obs$: Observable): Observable { } export function keepUnstableUntilFirst(obs$: Observable): Observable { - const scheduler = getSchedulers(); return ɵkeepUnstableUntilFirstFactory(getSchedulers())(obs$); } @@ -146,9 +145,9 @@ export function ɵkeepUnstableUntilFirstFactory(schedulers: ɵAngularFireSchedul // @ts-ignore const zoneWrapFn = (it: (...args: any[]) => any, macrotask: MacroTask|undefined) => { + // eslint-disable-next-line @typescript-eslint/no-this-alias const _this = this; // function() is needed for the arguments object - // tslint:disable-next-line:only-arrow-functions return function() { const _arguments = arguments; if (macrotask) { @@ -164,7 +163,6 @@ const zoneWrapFn = (it: (...args: any[]) => any, macrotask: MacroTask|undefined) export const ɵzoneWrap = (it: T, blockUntilFirst: boolean): T => { // function() is needed for the arguments object - // tslint:disable-next-line:only-arrow-functions return function() { // @ts-ignore let macrotask: MacroTask | undefined; @@ -185,7 +183,7 @@ export const ɵzoneWrap = (it: T, blockUntilFirst: boolean): T => { if (!blockUntilFirst) { if (ret instanceof Observable) { const schedulers = getSchedulers(); - return ret.pipe( + return ret.pipe( subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular), ); @@ -196,11 +194,11 @@ export const ɵzoneWrap = (it: T, blockUntilFirst: boolean): T => { if (ret instanceof Observable) { return ret.pipe(keepUnstableUntilFirst) as any; } else if (ret instanceof Promise) { + // eslint-disable-next-line @typescript-eslint/no-misused-promises return run(() => new Promise((resolve, reject) => ret.then(it => run(() => resolve(it)), reason => run(() => reject(reason))))); } else if (typeof ret === 'function' && macrotask) { // Handle unsubscribe // function() is needed for the arguments object - // tslint:disable-next-line:only-arrow-functions return function() { setTimeout(() => { if (macrotask && macrotask.state === 'scheduled') { diff --git a/tslint.json b/tslint.json deleted file mode 100644 index d9ef8d70d..000000000 --- a/tslint.json +++ /dev/null @@ -1,158 +0,0 @@ -{ - "extends": "tslint:recommended", - "rules": { - "align": { - "options": [ - "parameters", - "statements" - ] - }, - "array-type": false, - "arrow-parens": false, - "arrow-return-shorthand": true, - "deprecation": { - "severity": "warn" - }, - "component-class-suffix": true, - "contextual-lifecycle": true, - "curly": true, - "directive-class-suffix": true, - "no-shadowed-variable": false, - "no-trailing-whitespace": { - "severity": "warn" - }, - "directive-selector": [ - true, - "attribute", - "app", - "camelCase" - ], - "eofline": true, - "component-selector": [ - true, - "element", - "app", - "kebab-case" - ], - "import-spacing": true, - "indent": { - "options": [ - "spaces" - ] - }, - "import-blacklist": [ - true, - "rxjs/Rx" - ], - "interface-name": false, - "max-classes-per-file": false, - "max-line-length": [ - true, - 140 - ], - "member-access": false, - "member-ordering": [ - true, - { - "order": [ - "static-field", - "instance-field", - "static-method", - "instance-method" - ] - } - ], - "no-consecutive-blank-lines": false, - "no-console": [ - true, - "debug", - "info", - "time", - "timeEnd", - "trace" - ], - "no-empty": false, - "no-inferrable-types": [ - true, - "ignore-params" - ], - "no-non-null-assertion": true, - "no-redundant-jsdoc": true, - "no-switch-case-fall-through": true, - "no-var-requires": false, - "object-literal-key-quotes": [ - true, - "as-needed" - ], - "object-literal-sort-keys": false, - "ordered-imports": false, - "quotemark": [ - true, - "single" - ], - "trailing-comma": false, - "no-conflicting-lifecycle": true, - "no-host-metadata-property": true, - "no-input-rename": true, - "no-inputs-metadata-property": true, - "no-output-native": true, - "no-output-on-prefix": true, - "no-output-rename": true, - "semicolon": { - "options": [ - "always" - ] - }, - "space-before-function-paren": { - "options": { - "anonymous": "never", - "asyncArrow": "always", - "constructor": "never", - "method": "never", - "named": "never" - } - }, - "no-outputs-metadata-property": true, - "template-banana-in-box": true, - "template-no-negated-async": true, - "typedef-whitespace": { - "options": [ - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - }, - { - "call-signature": "onespace", - "index-signature": "onespace", - "parameter": "onespace", - "property-declaration": "onespace", - "variable-declaration": "onespace" - } - ] - }, - "use-lifecycle-interface": true, - "use-pipe-transform-interface": true, - "variable-name": [ - true, - "ban-keywords", - "check-format", - "allow-leading-underscore" - ], - "whitespace": { - "options": [ - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type", - "check-typecast" - ] - } - }, - "rulesDirectory": [ - "codelyzer" - ] - } diff --git a/yarn.lock b/yarn.lock index 1f0291404..5e1c0e472 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@aashutoshrathi/word-wrap@^1.2.3": + version "1.2.6" + resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" + integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== + "@ampproject/remapping@2.2.1", "@ampproject/remapping@^2.2.0": version "2.2.1" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" @@ -139,11 +144,24 @@ "@angular-devkit/core" "8.3.29" rxjs "6.4.0" +"@angular-eslint/builder@^16.1.1": + version "16.1.1" + resolved "https://registry.yarnpkg.com/@angular-eslint/builder/-/builder-16.1.1.tgz#5de2f9aeec26012e764a86bedf049574f5b1a9d4" + integrity sha512-NaB/A0mmlzp7laiucRUsRyoCrOE1In3UifsGP0vD6yjUpefk4g0v+0vCg8mhsIky8gYDtBE9YRfUiLA9FlF/FA== + dependencies: + "@nx/devkit" "16.5.1" + nx "16.5.1" + "@angular-eslint/bundled-angular-compiler@16.0.3": version "16.0.3" resolved "https://registry.yarnpkg.com/@angular-eslint/bundled-angular-compiler/-/bundled-angular-compiler-16.0.3.tgz#52db355eb2794e5407bfd045c64e102a0c078fbe" integrity sha512-8zwY6ustiPXBEF3+jELKVwGk6j2HJn7GHbqAhDFR02YiE27iRMSGTHIAWGs6ZI7F1JgfrIsOHrUgzC1x95K6rg== +"@angular-eslint/bundled-angular-compiler@16.1.1": + version "16.1.1" + resolved "https://registry.yarnpkg.com/@angular-eslint/bundled-angular-compiler/-/bundled-angular-compiler-16.1.1.tgz#d2dbf1bd4942cbb4b11fc3fd4055d1c57d0818c6" + integrity sha512-TB01AWZBDfrZBxN1I50HfBXtC7q4NI5fwl1aS4tOfef2/kQjTtR9zmha8CsxjDkAOa9tA/4MUayAMqEBQLuHKQ== + "@angular-eslint/eslint-plugin-template@16.0.3": version "16.0.3" resolved "https://registry.yarnpkg.com/@angular-eslint/eslint-plugin-template/-/eslint-plugin-template-16.0.3.tgz#513c6b675f0feb5c77d3de1f7daa5484ca1b62a3" @@ -164,6 +182,14 @@ "@angular-eslint/utils" "16.0.3" "@typescript-eslint/utils" "5.59.7" +"@angular-eslint/eslint-plugin@^16.1.1": + version "16.1.1" + resolved "https://registry.yarnpkg.com/@angular-eslint/eslint-plugin/-/eslint-plugin-16.1.1.tgz#2aa5bc237da483cafa987992bb1a5f58d030b68c" + integrity sha512-GauEwFGEcgIdsld4cVarFJYYxaRbMLzbpxyvBUDFg4LNjlcQNt7zfqXRLJoZAaFJFPtGtAoo1+6BlEKErsntuQ== + dependencies: + "@angular-eslint/utils" "16.1.1" + "@typescript-eslint/utils" "5.62.0" + "@angular-eslint/schematics@16.0.3": version "16.0.3" resolved "https://registry.yarnpkg.com/@angular-eslint/schematics/-/schematics-16.0.3.tgz#56f55a09f7882703a18112c97b4db1b47db5d66d" @@ -185,6 +211,14 @@ "@angular-eslint/bundled-angular-compiler" "16.0.3" "@typescript-eslint/utils" "5.59.7" +"@angular-eslint/utils@16.1.1": + version "16.1.1" + resolved "https://registry.yarnpkg.com/@angular-eslint/utils/-/utils-16.1.1.tgz#2c527bef89e87f1db124d6fd56cb77a03aeb8e15" + integrity sha512-cmSTyFFY2TMLjhKdju0KQ9GB6nnXt1AbY9tZ0UtWGo3NKbrBUogc+PR9ma17VRAGhvdj/sSVkStphJH3F7rUgQ== + dependencies: + "@angular-eslint/bundled-angular-compiler" "16.1.1" + "@typescript-eslint/utils" "5.62.0" + "@angular/animations@~16.0.0": version "16.0.6" resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-16.0.6.tgz#32e1f33350299b54abbe689f472fd8f391714ebe" @@ -1398,13 +1432,38 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz#8cfaf2ff603e9aabb910e9c0558c26cf32744061" integrity sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA== -"@eslint-community/eslint-utils@^4.2.0": +"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== dependencies: eslint-visitor-keys "^3.3.0" +"@eslint-community/regexpp@^4.5.1", "@eslint-community/regexpp@^4.6.1": + version "4.8.0" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.8.0.tgz#11195513186f68d42fbf449f9a7136b2c0c92005" + integrity sha512-JylOEEzDiOryeUnFbQz+oViCXS0KsvR1mvHkoMiu5+UiBvy+RYX7tzlIIIEstF/gVa2tj9AQXk3dgnxv6KxhFg== + +"@eslint/eslintrc@^2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.2.tgz#c6936b4b328c64496692f76944e755738be62396" + integrity sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.6.0" + globals "^13.19.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + +"@eslint/js@8.48.0": + version "8.48.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.48.0.tgz#642633964e217905436033a2bd08bf322849b7fb" + integrity sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw== + "@firebase/analytics-compat@0.2.6": version "0.2.6" resolved "https://registry.yarnpkg.com/@firebase/analytics-compat/-/analytics-compat-0.2.6.tgz#50063978c42f13eb800e037e96ac4b17236841f4" @@ -2006,6 +2065,25 @@ protobufjs "^7.2.4" yargs "^17.7.2" +"@humanwhocodes/config-array@^0.11.10": + version "0.11.10" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz#5a3ffe32cc9306365fb3fd572596cd602d5e12d2" + integrity sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ== + dependencies: + "@humanwhocodes/object-schema" "^1.2.1" + debug "^4.1.1" + minimatch "^3.0.5" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/object-schema@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== + "@isaacs/cliui@^8.0.2": version "8.0.2" resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" @@ -2114,7 +2192,7 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== -"@nodelib/fs.walk@^1.2.3": +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": version "1.2.8" resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== @@ -2181,6 +2259,13 @@ dependencies: "@nx/devkit" "16.2.2" +"@nrwl/devkit@16.5.1": + version "16.5.1" + resolved "https://registry.yarnpkg.com/@nrwl/devkit/-/devkit-16.5.1.tgz#43985cc1105e85afd8323586477c4a0d1b2eeee3" + integrity sha512-NB+DE/+AFJ7lKH/WBFyatJEhcZGj25F24ncDkwjZ6MzEiSOGOJS0LaV/R+VUsmS5EHTPXYOpn3zHWWAcJhyOmA== + dependencies: + "@nx/devkit" "16.5.1" + "@nrwl/tao@16.2.2": version "16.2.2" resolved "https://registry.yarnpkg.com/@nrwl/tao/-/tao-16.2.2.tgz#ace8d96c0ffa9ff45accf077d3c8d94a6cfe03a4" @@ -2188,6 +2273,13 @@ dependencies: nx "16.2.2" +"@nrwl/tao@16.5.1": + version "16.5.1" + resolved "https://registry.yarnpkg.com/@nrwl/tao/-/tao-16.5.1.tgz#e6e6b1ab73238497d4d9f014b30af18722e73503" + integrity sha512-x+gi/fKdM6uQNIti9exFlm3V5LBP3Y8vOEziO42HdOigyrXa0S0HD2WMpccmp6PclYKhwEDUjKJ39xh5sdh4Ig== + dependencies: + nx "16.5.1" + "@nx/devkit@16.2.2": version "16.2.2" resolved "https://registry.yarnpkg.com/@nx/devkit/-/devkit-16.2.2.tgz#5035d7e3dc5e113ce29f243a912955fa7d93e95c" @@ -2200,51 +2292,113 @@ tmp "~0.2.1" tslib "^2.3.0" +"@nx/devkit@16.5.1": + version "16.5.1" + resolved "https://registry.yarnpkg.com/@nx/devkit/-/devkit-16.5.1.tgz#1d6a27895a7c85edebe0ba31e0a394839ad5fdd2" + integrity sha512-T1acZrVVmJw/sJ4PIGidCBYBiBqlg/jT9e8nIGXLSDS20xcLvfo4zBQf8UZLrmHglnwwpDpOWuVJCp2rYA5aDg== + dependencies: + "@nrwl/devkit" "16.5.1" + ejs "^3.1.7" + ignore "^5.0.4" + semver "7.5.3" + tmp "~0.2.1" + tslib "^2.3.0" + "@nx/nx-darwin-arm64@16.2.2": version "16.2.2" resolved "https://registry.yarnpkg.com/@nx/nx-darwin-arm64/-/nx-darwin-arm64-16.2.2.tgz#7fb43fe8976a12b58f008d336d4898164254b740" integrity sha512-CKfyLl92mhWqpv1hRTj3WgjVBY6yj3Et5T31m1N0assNWdTfuSB4ycdWzdlxXHx3yptnTOD/FCymTpUQI0GZRQ== +"@nx/nx-darwin-arm64@16.5.1": + version "16.5.1" + resolved "https://registry.yarnpkg.com/@nx/nx-darwin-arm64/-/nx-darwin-arm64-16.5.1.tgz#87111664de492e5ae270ef2adc74553e03d77341" + integrity sha512-q98TFI4B/9N9PmKUr1jcbtD4yAFs1HfYd9jUXXTQOlfO9SbDjnrYJgZ4Fp9rMNfrBhgIQ4x1qx0AukZccKmH9Q== + "@nx/nx-darwin-x64@16.2.2": version "16.2.2" resolved "https://registry.yarnpkg.com/@nx/nx-darwin-x64/-/nx-darwin-x64-16.2.2.tgz#74b20875e1bcd450291a58026df9728f0b70f681" integrity sha512-++uDfp/Oo8DDVU53DiJVkRNjNbOLzahDH6dINeA/3yTCU/IS0wXoaoclNZBReMWlDKTVvWgLF/eSbGINMqUHRg== +"@nx/nx-darwin-x64@16.5.1": + version "16.5.1" + resolved "https://registry.yarnpkg.com/@nx/nx-darwin-x64/-/nx-darwin-x64-16.5.1.tgz#05c34ce8f8f23eeae0529d3c1022ee3e95a608a1" + integrity sha512-j9HmL1l8k7EVJ3eOM5y8COF93gqrydpxCDoz23ZEtsY+JHY77VAiRQsmqBgEx9GGA2dXi9VEdS67B0+1vKariw== + +"@nx/nx-freebsd-x64@16.5.1": + version "16.5.1" + resolved "https://registry.yarnpkg.com/@nx/nx-freebsd-x64/-/nx-freebsd-x64-16.5.1.tgz#b4303ac5066f5c8ced7768097d6c85e8055c7d3a" + integrity sha512-CXSPT01aVS869tvCCF2tZ7LnCa8l41wJ3mTVtWBkjmRde68E5Up093hklRMyXb3kfiDYlfIKWGwrV4r0eH6x1A== + "@nx/nx-linux-arm-gnueabihf@16.2.2": version "16.2.2" resolved "https://registry.yarnpkg.com/@nx/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-16.2.2.tgz#5afa251361b609ed966d31cac6a789174bd6b3a5" integrity sha512-A4XFk63Q7fxgZaHnigIeofp/xOT2ZGDoNUyzld+UTlyJyNcClcOcqrro74aKOCG7PH0D56oE06JW3g7GKszgsA== +"@nx/nx-linux-arm-gnueabihf@16.5.1": + version "16.5.1" + resolved "https://registry.yarnpkg.com/@nx/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-16.5.1.tgz#4dde9e8c79da9c5a213b6938dff74f65dd79c157" + integrity sha512-BhrumqJSZCWFfLFUKl4CAUwR0Y0G2H5EfFVGKivVecEQbb+INAek1aa6c89evg2/OvetQYsJ+51QknskwqvLsA== + "@nx/nx-linux-arm64-gnu@16.2.2": version "16.2.2" resolved "https://registry.yarnpkg.com/@nx/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-16.2.2.tgz#5d2c4f75ba582844d139729f4b194d39b8fc81d1" integrity sha512-aQpTLVSawFVr33pBWjj8elqvjA5uWvzDW7hGaFQPgWgmjxrtJikIAkcLjfNOz8XYjRAP4OZkTVh4/E3GUch0kQ== +"@nx/nx-linux-arm64-gnu@16.5.1": + version "16.5.1" + resolved "https://registry.yarnpkg.com/@nx/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-16.5.1.tgz#43dcdbd9b39fa91923ab949d161aa25c650f56d9" + integrity sha512-x7MsSG0W+X43WVv7JhiSq2eKvH2suNKdlUHEG09Yt0vm3z0bhtym1UCMUg3IUAK7jy9hhLeDaFVFkC6zo+H/XQ== + "@nx/nx-linux-arm64-musl@16.2.2": version "16.2.2" resolved "https://registry.yarnpkg.com/@nx/nx-linux-arm64-musl/-/nx-linux-arm64-musl-16.2.2.tgz#5346829cddd27223c1c1b79c93eb195442b86907" integrity sha512-20vyNYQ2SYSaWdxORj9HdOyGxiqE8SauaFiBjjid6/e5mSyaSKu+HHGsvhDUqzlWn3OaABKBqx0iYa9Kmf3BOQ== +"@nx/nx-linux-arm64-musl@16.5.1": + version "16.5.1" + resolved "https://registry.yarnpkg.com/@nx/nx-linux-arm64-musl/-/nx-linux-arm64-musl-16.5.1.tgz#fc33960cecb0064c3dd3330f393e3a38be8a71b7" + integrity sha512-J+/v/mFjOm74I0PNtH5Ka+fDd+/dWbKhpcZ2R1/6b9agzZk+Ff/SrwJcSYFXXWKbPX+uQ4RcJoytT06Zs3s0ow== + "@nx/nx-linux-x64-gnu@16.2.2": version "16.2.2" resolved "https://registry.yarnpkg.com/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-16.2.2.tgz#702922f71076a041325add15b145f0e33726ec4a" integrity sha512-0G8kYpEmGHD+tT7RvUEvVXvPbvQD9GfEjeWEzZAdNAAMJu7JFjIo/oZDJYV7cMvXnC+tbpI9Gba5xfv8Al95eA== +"@nx/nx-linux-x64-gnu@16.5.1": + version "16.5.1" + resolved "https://registry.yarnpkg.com/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-16.5.1.tgz#2b2ffbb80e29455b6900ec20d4249055590dc58f" + integrity sha512-igooWJ5YxQ94Zft7IqgL+Lw0qHaY15Btw4gfK756g/YTYLZEt4tTvR1y6RnK/wdpE3sa68bFTLVBNCGTyiTiDQ== + "@nx/nx-linux-x64-musl@16.2.2": version "16.2.2" resolved "https://registry.yarnpkg.com/@nx/nx-linux-x64-musl/-/nx-linux-x64-musl-16.2.2.tgz#ca2b0b1c98f16dfe66b7cffbec1e7b4c877058b4" integrity sha512-Incv7DbKLfh6kakzMBuy6GYRgI+jEdZBRiFw0GoN9EsknmrPT/URn+w6uuicGGEXOLYpO3HUO3E374+b5Wz2zg== +"@nx/nx-linux-x64-musl@16.5.1": + version "16.5.1" + resolved "https://registry.yarnpkg.com/@nx/nx-linux-x64-musl/-/nx-linux-x64-musl-16.5.1.tgz#955b2eae615ee6cf1954e24d42c205b1de8772bf" + integrity sha512-zF/exnPqFYbrLAduGhTmZ7zNEyADid2bzNQiIjJkh8Y6NpDwrQIwVIyvIxqynsjMrIs51kBH+8TUjKjj2Jgf5A== + "@nx/nx-win32-arm64-msvc@16.2.2": version "16.2.2" resolved "https://registry.yarnpkg.com/@nx/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-16.2.2.tgz#4ad8f7bf300dac63227e51c393345cc2306368d3" integrity sha512-8m+Usj9faCl0pdQLFeBGhbYUObT3/tno5oGMPtJLyRjITNvTZAaIS4FFctp/rwJPehDBRQsUxwMJ2JRaU4jQdA== +"@nx/nx-win32-arm64-msvc@16.5.1": + version "16.5.1" + resolved "https://registry.yarnpkg.com/@nx/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-16.5.1.tgz#1dc4a7e3662eb757214c46d8db432f61e43a3dd9" + integrity sha512-qtqiLS9Y9TYyAbbpq58kRoOroko4ZXg5oWVqIWFHoxc5bGPweQSJCROEqd1AOl2ZDC6BxfuVHfhDDop1kK05WA== + "@nx/nx-win32-x64-msvc@16.2.2": version "16.2.2" resolved "https://registry.yarnpkg.com/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-16.2.2.tgz#0afbeb2133613a5a3b0083e18a250472ccf45932" integrity sha512-liHtyVVOttcqHIV3Xrg/1AJzEgfiOCeqJsleHXHGgPr1fxPx7SIZaa3/QnDY1lNMN+t6Gvj0/r2Ba3iuptYD3Q== +"@nx/nx-win32-x64-msvc@16.5.1": + version "16.5.1" + resolved "https://registry.yarnpkg.com/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-16.5.1.tgz#d2f4a1b2bf675bceb6fb16174b836438293f9dca" + integrity sha512-kUJBLakK7iyA9WfsGGQBVennA4jwf5XIgm0lu35oMOphtZIluvzItMt0EYBmylEROpmpEIhHq0P6J9FA+WH0Rg== + "@opentelemetry/api@^1.0.0": version "1.4.1" resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.4.1.tgz#ff22eb2e5d476fbc2450a196e40dd243cc20c28f" @@ -2601,7 +2755,7 @@ resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-4.3.4.tgz#1f9b401f5e89f13b2e40c5378e2a16505f45b630" integrity sha512-DsJbnxCdjmhRP7dXwjD6JcPc+z7V/4mG3VA1cEFec/+R343TaNPnZ9eJzMkjR4T1BYkjkDIUsPDybkDC0qLrvA== -"@types/json-schema@*", "@types/json-schema@^7.0.6", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": +"@types/json-schema@*", "@types/json-schema@^7.0.12", "@types/json-schema@^7.0.6", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb" integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== @@ -2845,6 +2999,11 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== +"@types/semver@^7.5.0": + version "7.5.1" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.1.tgz#0480eeb7221eb9bc398ad7432c9d7e14b1a5a367" + integrity sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg== + "@types/send@*": version "0.17.1" resolved "https://registry.yarnpkg.com/@types/send/-/send-0.17.1.tgz#ed4932b8a2a805f1fe362a70f4e62d0ac994e301" @@ -2902,6 +3061,34 @@ dependencies: "@types/node" "*" +"@typescript-eslint/eslint-plugin@^6.5.0": + version "6.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.5.0.tgz#5cee33edf0d45d5ec773e3b3111206b098ac8599" + integrity sha512-2pktILyjvMaScU6iK3925uvGU87E+N9rh372uGZgiMYwafaw9SXq86U04XPq3UH6tzRvNgBsub6x2DacHc33lw== + dependencies: + "@eslint-community/regexpp" "^4.5.1" + "@typescript-eslint/scope-manager" "6.5.0" + "@typescript-eslint/type-utils" "6.5.0" + "@typescript-eslint/utils" "6.5.0" + "@typescript-eslint/visitor-keys" "6.5.0" + debug "^4.3.4" + graphemer "^1.4.0" + ignore "^5.2.4" + natural-compare "^1.4.0" + semver "^7.5.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/parser@^6.5.0": + version "6.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.5.0.tgz#3d6ed231c5e307c5f5f4a0d86893ec01e92b8c77" + integrity sha512-LMAVtR5GN8nY0G0BadkG0XIe4AcNMeyEy3DyhKGAh9k4pLSMBO7rF29JvDBpZGCmp5Pgz5RLHP6eCpSYZJQDuQ== + dependencies: + "@typescript-eslint/scope-manager" "6.5.0" + "@typescript-eslint/types" "6.5.0" + "@typescript-eslint/typescript-estree" "6.5.0" + "@typescript-eslint/visitor-keys" "6.5.0" + debug "^4.3.4" + "@typescript-eslint/scope-manager@5.59.7": version "5.59.7" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.59.7.tgz#0243f41f9066f3339d2f06d7f72d6c16a16769e2" @@ -2910,6 +3097,22 @@ "@typescript-eslint/types" "5.59.7" "@typescript-eslint/visitor-keys" "5.59.7" +"@typescript-eslint/scope-manager@5.62.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz#d9457ccc6a0b8d6b37d0eb252a23022478c5460c" + integrity sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w== + dependencies: + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/visitor-keys" "5.62.0" + +"@typescript-eslint/scope-manager@6.5.0": + version "6.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.5.0.tgz#f2cb20895aaad41b3ad27cc3a338ce8598f261c5" + integrity sha512-A8hZ7OlxURricpycp5kdPTH3XnjG85UpJS6Fn4VzeoH4T388gQJ/PGP4ole5NfKt4WDVhmLaQ/dBLNDC4Xl/Kw== + dependencies: + "@typescript-eslint/types" "6.5.0" + "@typescript-eslint/visitor-keys" "6.5.0" + "@typescript-eslint/type-utils@5.59.7": version "5.59.7" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.7.tgz#89c97291371b59eb18a68039857c829776f1426d" @@ -2920,11 +3123,31 @@ debug "^4.3.4" tsutils "^3.21.0" +"@typescript-eslint/type-utils@6.5.0": + version "6.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.5.0.tgz#6d246c93739282bc0d2e623f28d0dec6cfcc38d7" + integrity sha512-f7OcZOkRivtujIBQ4yrJNIuwyCQO1OjocVqntl9dgSIZAdKqicj3xFDqDOzHDlGCZX990LqhLQXWRnQvsapq8A== + dependencies: + "@typescript-eslint/typescript-estree" "6.5.0" + "@typescript-eslint/utils" "6.5.0" + debug "^4.3.4" + ts-api-utils "^1.0.1" + "@typescript-eslint/types@5.59.7": version "5.59.7" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.7.tgz#6f4857203fceee91d0034ccc30512d2939000742" integrity sha512-UnVS2MRRg6p7xOSATscWkKjlf/NDKuqo5TdbWck6rIRZbmKpVNTLALzNvcjIfHBE7736kZOFc/4Z3VcZwuOM/A== +"@typescript-eslint/types@5.62.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" + integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== + +"@typescript-eslint/types@6.5.0": + version "6.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.5.0.tgz#f4e55cfd99ac5346ea772770bf212a3e689a8f04" + integrity sha512-eqLLOEF5/lU8jW3Bw+8auf4lZSbbljHR2saKnYqON12G/WsJrGeeDHWuQePoEf9ro22+JkbPfWQwKEC5WwLQ3w== + "@typescript-eslint/typescript-estree@5.59.7": version "5.59.7" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.7.tgz#b887acbd4b58e654829c94860dbff4ac55c5cff8" @@ -2938,6 +3161,32 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.62.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz#7d17794b77fabcac615d6a48fb143330d962eb9b" + integrity sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA== + dependencies: + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/visitor-keys" "5.62.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/typescript-estree@6.5.0": + version "6.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.5.0.tgz#1cef6bc822585e9ef89d88834bc902d911d747ed" + integrity sha512-q0rGwSe9e5Kk/XzliB9h2LBc9tmXX25G0833r7kffbl5437FPWb2tbpIV9wAATebC/018pGa9fwPDuvGN+LxWQ== + dependencies: + "@typescript-eslint/types" "6.5.0" + "@typescript-eslint/visitor-keys" "6.5.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.5.4" + ts-api-utils "^1.0.1" + "@typescript-eslint/utils@5.59.7": version "5.59.7" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.7.tgz#7adf068b136deae54abd9a66ba5a8780d2d0f898" @@ -2952,6 +3201,33 @@ eslint-scope "^5.1.1" semver "^7.3.7" +"@typescript-eslint/utils@5.62.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.62.0.tgz#141e809c71636e4a75daa39faed2fb5f4b10df86" + integrity sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@types/json-schema" "^7.0.9" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.62.0" + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/typescript-estree" "5.62.0" + eslint-scope "^5.1.1" + semver "^7.3.7" + +"@typescript-eslint/utils@6.5.0": + version "6.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.5.0.tgz#6668bee4f7f24978b11df8a2ea42d56eebc4662c" + integrity sha512-9nqtjkNykFzeVtt9Pj6lyR9WEdd8npPhhIPM992FWVkZuS6tmxHfGVnlUcjpUP2hv8r4w35nT33mlxd+Be1ACQ== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@types/json-schema" "^7.0.12" + "@types/semver" "^7.5.0" + "@typescript-eslint/scope-manager" "6.5.0" + "@typescript-eslint/types" "6.5.0" + "@typescript-eslint/typescript-estree" "6.5.0" + semver "^7.5.4" + "@typescript-eslint/visitor-keys@5.59.7": version "5.59.7" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.7.tgz#09c36eaf268086b4fbb5eb9dc5199391b6485fc5" @@ -2960,6 +3236,22 @@ "@typescript-eslint/types" "5.59.7" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@5.62.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz#2174011917ce582875954ffe2f6912d5931e353e" + integrity sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw== + dependencies: + "@typescript-eslint/types" "5.62.0" + eslint-visitor-keys "^3.3.0" + +"@typescript-eslint/visitor-keys@6.5.0": + version "6.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.5.0.tgz#1a6f474a0170a447b76f0699ce6700110fd11436" + integrity sha512-yCB/2wkbv3hPsh02ZS8dFQnij9VVQXJMN/gbQsaaY+zxALkZnxa/wagvLEFsAWMPv7d7lxQmNsIzGU1w/T/WyA== + dependencies: + "@typescript-eslint/types" "6.5.0" + eslint-visitor-keys "^3.4.1" + "@vitejs/plugin-basic-ssl@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@vitejs/plugin-basic-ssl/-/plugin-basic-ssl-1.0.1.tgz#48c46eab21e0730921986ce742563ae83fe7fe34" @@ -3101,7 +3393,7 @@ resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== -"@yarnpkg/parsers@^3.0.0-rc.18": +"@yarnpkg/parsers@3.0.0-rc.46", "@yarnpkg/parsers@^3.0.0-rc.18": version "3.0.0-rc.46" resolved "https://registry.yarnpkg.com/@yarnpkg/parsers/-/parsers-3.0.0-rc.46.tgz#03f8363111efc0ea670e53b0282cd3ef62de4e01" integrity sha512-aiATs7pSutzda/rq8fnuPwTglyVwjM22bNnK2ZgjrpAjQHSSl3lztd2f9evst1W/qnC58DRz7T7QndUDumAR4Q== @@ -3169,6 +3461,11 @@ acorn@^8.7.0, acorn@^8.7.1, acorn@^8.8.0, acorn@^8.8.2: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.9.0.tgz#78a16e3b2bcc198c10822786fa6679e245db5b59" integrity sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ== +acorn@^8.9.0: + version "8.10.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" + integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== + add-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" @@ -3271,7 +3568,7 @@ ajv@8.12.0, ajv@^8.0.0, ajv@^8.11.0, ajv@^8.3.0, ajv@^8.9.0: require-from-string "^2.0.2" uri-js "^4.2.2" -ajv@^6.12.3, ajv@^6.12.5, ajv@^6.12.6: +ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.12.6: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -3500,6 +3797,17 @@ array-ify@^1.0.0: resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" integrity sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng== +array-includes@^3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.6.tgz#9e9e720e194f198266ba9e18c29e6a9b0e4b225f" + integrity sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + get-intrinsic "^1.1.3" + is-string "^1.0.7" + array-union@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" @@ -3517,6 +3825,49 @@ array-uniq@^1.0.1: resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" integrity sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q== +array.prototype.findlastindex@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.2.tgz#bc229aef98f6bd0533a2bc61ff95209875526c9b" + integrity sha512-tb5thFFlUcp7NdNF6/MpDk/1r/4awWG1FIz3YqDf+/zJSTezBb+/5WViH41obXULHVpDzoiCLpJ/ZO9YbJMsdw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-shim-unscopables "^1.0.0" + get-intrinsic "^1.1.3" + +array.prototype.flat@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz#ffc6576a7ca3efc2f46a143b9d1dda9b4b3cf5e2" + integrity sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-shim-unscopables "^1.0.0" + +array.prototype.flatmap@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz#1aae7903c2100433cb8261cd4ed310aab5c4a183" + integrity sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-shim-unscopables "^1.0.0" + +arraybuffer.prototype.slice@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz#9b5ea3868a6eebc30273da577eb888381c0044bb" + integrity sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.2" + define-properties "^1.2.0" + get-intrinsic "^1.2.1" + is-array-buffer "^3.0.2" + is-shared-array-buffer "^1.0.2" + arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -4976,7 +5327,7 @@ cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.0, cross-spawn@^7.0.3: +cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -5128,7 +5479,7 @@ debug@3.1.0: dependencies: ms "2.0.0" -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -5334,6 +5685,20 @@ dns-packet@^5.2.2: dependencies: "@leichtgewicht/ip-codec" "^2.0.1" +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + dom-serialize@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" @@ -5574,6 +5939,51 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +es-abstract@^1.20.4, es-abstract@^1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.1.tgz#8b4e5fc5cefd7f1660f0f8e1a52900dfbc9d9ccc" + integrity sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw== + dependencies: + array-buffer-byte-length "^1.0.0" + arraybuffer.prototype.slice "^1.0.1" + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + es-set-tostringtag "^2.0.1" + es-to-primitive "^1.2.1" + function.prototype.name "^1.1.5" + get-intrinsic "^1.2.1" + get-symbol-description "^1.0.0" + globalthis "^1.0.3" + gopd "^1.0.1" + has "^1.0.3" + has-property-descriptors "^1.0.0" + has-proto "^1.0.1" + has-symbols "^1.0.3" + internal-slot "^1.0.5" + is-array-buffer "^3.0.2" + is-callable "^1.2.7" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-typed-array "^1.1.10" + is-weakref "^1.0.2" + object-inspect "^1.12.3" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.5.0" + safe-array-concat "^1.0.0" + safe-regex-test "^1.0.0" + string.prototype.trim "^1.2.7" + string.prototype.trimend "^1.0.6" + string.prototype.trimstart "^1.0.6" + typed-array-buffer "^1.0.0" + typed-array-byte-length "^1.0.0" + typed-array-byte-offset "^1.0.0" + typed-array-length "^1.0.4" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.10" + es-get-iterator@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.3.tgz#3ef87523c5d464d41084b2c3c9c214f1199763d6" @@ -5594,6 +6004,31 @@ es-module-lexer@^1.2.1: resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.3.0.tgz#6be9c9e0b4543a60cd166ff6f8b4e9dae0b0c16f" integrity sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA== +es-set-tostringtag@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" + integrity sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg== + dependencies: + get-intrinsic "^1.1.3" + has "^1.0.3" + has-tostringtag "^1.0.0" + +es-shim-unscopables@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz#702e632193201e3edf8713635d083d378e510241" + integrity sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w== + dependencies: + has "^1.0.3" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + es5-ext@^0.10.12, es5-ext@^0.10.35, es5-ext@^0.10.50: version "0.10.62" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.62.tgz#5e6adc19a6da524bf3d1e02bbc8960e5eb49a9a5" @@ -5698,6 +6133,11 @@ escape-string-regexp@^2.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + escodegen@^1.13.0, escodegen@^1.8.1: version "1.14.3" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" @@ -5710,6 +6150,45 @@ escodegen@^1.13.0, escodegen@^1.8.1: optionalDependencies: source-map "~0.6.1" +eslint-import-resolver-node@^0.3.7: + version "0.3.9" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz#d4eaac52b8a2e7c3cd1903eb00f7e053356118ac" + integrity sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g== + dependencies: + debug "^3.2.7" + is-core-module "^2.13.0" + resolve "^1.22.4" + +eslint-module-utils@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz#e439fee65fc33f6bba630ff621efc38ec0375c49" + integrity sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw== + dependencies: + debug "^3.2.7" + +eslint-plugin-import@^2.28.1: + version "2.28.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.28.1.tgz#63b8b5b3c409bfc75ebaf8fb206b07ab435482c4" + integrity sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A== + dependencies: + array-includes "^3.1.6" + array.prototype.findlastindex "^1.2.2" + array.prototype.flat "^1.3.1" + array.prototype.flatmap "^1.3.1" + debug "^3.2.7" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.7" + eslint-module-utils "^2.8.0" + has "^1.0.3" + is-core-module "^2.13.0" + is-glob "^4.0.3" + minimatch "^3.1.2" + object.fromentries "^2.0.6" + object.groupby "^1.0.0" + object.values "^1.1.6" + semver "^6.3.1" + tsconfig-paths "^3.14.2" + eslint-scope@5.1.1, eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" @@ -5718,11 +6197,67 @@ eslint-scope@5.1.1, eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" +eslint-scope@^7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" + integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: version "3.4.1" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994" integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== +eslint-visitor-keys@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" + integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== + +eslint@^8.48.0: + version "8.48.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.48.0.tgz#bf9998ba520063907ba7bfe4c480dc8be03c2155" + integrity sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.6.1" + "@eslint/eslintrc" "^2.1.2" + "@eslint/js" "8.48.0" + "@humanwhocodes/config-array" "^0.11.10" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + ajv "^6.12.4" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.2.2" + eslint-visitor-keys "^3.4.3" + espree "^9.6.1" + esquery "^1.4.2" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + graphemer "^1.4.0" + ignore "^5.2.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" + natural-compare "^1.4.0" + optionator "^0.9.3" + strip-ansi "^6.0.1" + text-table "^0.2.0" + esniff@^1.1: version "1.1.0" resolved "https://registry.yarnpkg.com/esniff/-/esniff-1.1.0.tgz#c66849229f91464dede2e0d40201ed6abf65f2ac" @@ -5740,11 +6275,27 @@ espree@^9.0.0: acorn-jsx "^5.3.2" eslint-visitor-keys "^3.4.1" +espree@^9.6.0, espree@^9.6.1: + version "9.6.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" + integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== + dependencies: + acorn "^8.9.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.4.1" + esprima@^4.0.0, esprima@^4.0.1, esprima@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== +esquery@^1.4.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" + integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== + dependencies: + estraverse "^5.1.0" + esrecurse@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" @@ -5962,7 +6513,7 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== -fast-levenshtein@~2.0.6: +fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== @@ -6015,6 +6566,13 @@ figures@3.2.0, figures@^3.0.0, figures@^3.2.0: dependencies: escape-string-regexp "^1.0.5" +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + file-loader@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d" @@ -6254,6 +6812,15 @@ firebase@^10.0.0: "@firebase/storage-compat" "0.3.2" "@firebase/util" "1.9.3" +flat-cache@^3.0.4: + version "3.1.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.1.0.tgz#0e54ab4a1a60fe87e2946b6b00657f1c99e1af3f" + integrity sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew== + dependencies: + flatted "^3.2.7" + keyv "^4.5.3" + rimraf "^3.0.2" + flat@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" @@ -6434,6 +7001,16 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function.prototype.name@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.6.tgz#cdf315b7d90ee77a4c6ee216c3c3362da07533fd" + integrity sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + functions-have-names "^1.2.3" + functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" @@ -6515,7 +7092,7 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0, get-intrinsic@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== @@ -6558,6 +7135,14 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + get-uri@3: version "3.0.2" resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-3.0.2.tgz#f0ef1356faabc70e1f9404fa3b66b2ba9bfc725c" @@ -6618,7 +7203,7 @@ glob-parent@^5.1.2, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -glob-parent@^6.0.1: +glob-parent@^6.0.1, glob-parent@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== @@ -6723,12 +7308,19 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== +globals@^13.19.0, globals@^13.21.0: + version "13.21.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.21.0.tgz#163aae12f34ef502f5153cfbdd3600f36c63c571" + integrity sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg== + dependencies: + type-fest "^0.20.2" + globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== -globalthis@^1.0.1: +globalthis@^1.0.1, globalthis@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== @@ -6876,6 +7468,11 @@ graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" integrity sha512-8tLu60LgxF6XpdbK8OW3FA+IfTNBn1ZHGHKF4KQbEeSkajYw5PlYJcKluntgegDPTg8UkHjpet1T82vk6TQ68w== +graphemer@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" + integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== + gtoken@^5.0.4: version "5.3.2" resolved "https://registry.yarnpkg.com/gtoken/-/gtoken-5.3.2.tgz#deb7dc876abe002178e0515e383382ea9446d58f" @@ -6953,7 +7550,7 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" -has-bigints@^1.0.1: +has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== @@ -7281,7 +7878,7 @@ ignore-walk@^6.0.0: dependencies: minimatch "^9.0.0" -ignore@5.2.4, ignore@^5.0.4, ignore@^5.2.0: +ignore@5.2.4, ignore@^5.0.4, ignore@^5.2.0, ignore@^5.2.4: version "5.2.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== @@ -7444,7 +8041,7 @@ install-artifact-from-github@^1.3.3: resolved "https://registry.yarnpkg.com/install-artifact-from-github/-/install-artifact-from-github-1.3.3.tgz#57d89bacfa0f47d7307fe41b6247cda9f9a8079c" integrity sha512-x79SL0d8WOi1ZjXSTUqqs0GPQZ92YArJAN9O46wgU9wdH2U9ecyyhB9YGDbPe2OLV4ptmt6AZYRQZ2GydQZosQ== -internal-slot@^1.0.4: +internal-slot@^1.0.4, internal-slot@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== @@ -7556,7 +8153,7 @@ is-builtin-module@^3.2.1: dependencies: builtin-modules "^3.3.0" -is-callable@^1.1.3: +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== @@ -7575,7 +8172,14 @@ is-core-module@^2.11.0, is-core-module@^2.8.1: dependencies: has "^1.0.3" -is-date-object@^1.0.5: +is-core-module@^2.13.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db" + integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ== + dependencies: + has "^1.0.3" + +is-date-object@^1.0.1, is-date-object@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== @@ -7602,7 +8206,7 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -7637,6 +8241,11 @@ is-module@^1.0.0: resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" integrity sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g== +is-negative-zero@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== + is-npm@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-5.0.0.tgz#43e8d65cc56e1b67f8d47262cf667099193f45a8" @@ -7683,7 +8292,7 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" -is-path-inside@^3.0.2: +is-path-inside@^3.0.2, is-path-inside@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== @@ -7747,7 +8356,7 @@ is-subset@^0.1.1: resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" integrity sha512-6Ybun0IkarhmEqxXCNw/C0bna6Zb/TkfUX9UbwJtK6ObwAVCxmAP308WWTHviM/zAqXk05cdhYsUsZeGQh99iw== -is-symbol@^1.0.3: +is-symbol@^1.0.2, is-symbol@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== @@ -7772,6 +8381,13 @@ is-typed-array@^1.1.10: gopd "^1.0.1" has-tostringtag "^1.0.0" +is-typed-array@^1.1.9: + version "1.1.12" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" + integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== + dependencies: + which-typed-array "^1.1.11" + is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -7797,6 +8413,13 @@ is-weakmap@^2.0.1: resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2" integrity sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA== +is-weakref@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" + is-weakset@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.2.tgz#4569d67a747a1ce5a994dfd4ef6dcea76e7c0a1d" @@ -8104,6 +8727,11 @@ json-bigint@^1.0.0: dependencies: bignumber.js "^9.0.0" +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -8146,6 +8774,11 @@ json-schema@0.4.0: resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== + json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -8366,6 +8999,13 @@ karma@~6.4.0: ua-parser-js "^0.7.30" yargs "^16.1.1" +keyv@^4.5.3: + version "4.5.3" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.3.tgz#00873d2b046df737963157bd04f294ca818c9c25" + integrity sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug== + dependencies: + json-buffer "3.0.1" + kind-of@^3.0.2: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -8444,6 +9084,14 @@ leven@^3.1.0: resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -8639,6 +9287,11 @@ lodash.isstring@^4.0.1: resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" integrity sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw== +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + lodash.once@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" @@ -9025,7 +9678,7 @@ minimalistic-assert@^1.0.0: resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -9278,6 +9931,11 @@ nanoid@^3.3.6: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== + ncp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" @@ -9657,6 +10315,57 @@ nx@16.2.2: "@nx/nx-win32-arm64-msvc" "16.2.2" "@nx/nx-win32-x64-msvc" "16.2.2" +nx@16.5.1: + version "16.5.1" + resolved "https://registry.yarnpkg.com/nx/-/nx-16.5.1.tgz#fc0d19090d8faae5f431f9fec199adf95881150c" + integrity sha512-I3hJRE4hG7JWAtncWwDEO3GVeGPpN0TtM8xH5ArZXyDuVeTth/i3TtJzdDzqXO1HHtIoAQN0xeq4n9cLuMil5g== + dependencies: + "@nrwl/tao" "16.5.1" + "@parcel/watcher" "2.0.4" + "@yarnpkg/lockfile" "^1.1.0" + "@yarnpkg/parsers" "3.0.0-rc.46" + "@zkochan/js-yaml" "0.0.6" + axios "^1.0.0" + chalk "^4.1.0" + cli-cursor "3.1.0" + cli-spinners "2.6.1" + cliui "^7.0.2" + dotenv "~10.0.0" + enquirer "~2.3.6" + fast-glob "3.2.7" + figures "3.2.0" + flat "^5.0.2" + fs-extra "^11.1.0" + glob "7.1.4" + ignore "^5.0.4" + js-yaml "4.1.0" + jsonc-parser "3.2.0" + lines-and-columns "~2.0.3" + minimatch "3.0.5" + npm-run-path "^4.0.1" + open "^8.4.0" + semver "7.5.3" + string-width "^4.2.3" + strong-log-transformer "^2.1.0" + tar-stream "~2.2.0" + tmp "~0.2.1" + tsconfig-paths "^4.1.2" + tslib "^2.3.0" + v8-compile-cache "2.3.0" + yargs "^17.6.2" + yargs-parser "21.1.1" + optionalDependencies: + "@nx/nx-darwin-arm64" "16.5.1" + "@nx/nx-darwin-x64" "16.5.1" + "@nx/nx-freebsd-x64" "16.5.1" + "@nx/nx-linux-arm-gnueabihf" "16.5.1" + "@nx/nx-linux-arm64-gnu" "16.5.1" + "@nx/nx-linux-arm64-musl" "16.5.1" + "@nx/nx-linux-x64-gnu" "16.5.1" + "@nx/nx-linux-x64-musl" "16.5.1" + "@nx/nx-win32-arm64-msvc" "16.5.1" + "@nx/nx-win32-x64-msvc" "16.5.1" + oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" @@ -9672,7 +10381,7 @@ object-hash@^3.0.0: resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9" integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw== -object-inspect@^1.9.0: +object-inspect@^1.12.3, object-inspect@^1.9.0: version "1.12.3" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== @@ -9700,6 +10409,34 @@ object.assign@^4.1.4: has-symbols "^1.0.3" object-keys "^1.1.1" +object.fromentries@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.6.tgz#cdb04da08c539cffa912dcd368b886e0904bfa73" + integrity sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +object.groupby@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object.groupby/-/object.groupby-1.0.1.tgz#d41d9f3c8d6c778d9cbac86b4ee9f5af103152ee" + integrity sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" + +object.values@^1.1.6: + version "1.1.7" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.7.tgz#617ed13272e7e1071b43973aa1655d9291b8442a" + integrity sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" @@ -9785,6 +10522,18 @@ optionator@^0.8.1: type-check "~0.3.2" word-wrap "~1.2.3" +optionator@^0.9.3: + version "0.9.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" + integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== + dependencies: + "@aashutoshrathi/word-wrap" "^1.2.3" + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + ora@5.4.1, ora@^5.1.0, ora@^5.3.0, ora@^5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" @@ -10297,6 +11046,11 @@ postcss@8.4.24, postcss@^8.2.14, postcss@^8.4.16, postcss@^8.4.21, postcss@^8.4. picocolors "^1.0.0" source-map-js "^1.0.2" +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -10995,6 +11749,15 @@ resolve@1.22.2, resolve@>=1.9.0, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14. path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +resolve@^1.22.4: + version "1.22.4" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.4.tgz#1dc40df46554cdaf8948a486a10f6ba1e2026c34" + integrity sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg== + dependencies: + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" @@ -11154,6 +11917,16 @@ rxjs@^6.4.0, rxjs@^6.5.3, rxjs@^6.6.2: dependencies: tslib "^1.9.0" +safe-array-concat@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.0.tgz#2064223cba3c08d2ee05148eedbc563cd6d84060" + integrity sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + has-symbols "^1.0.3" + isarray "^2.0.5" + safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -11164,6 +11937,15 @@ safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +safe-regex-test@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" + integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + is-regex "^1.1.4" + safe-stable-stringify@^2.3.1: version "2.4.3" resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz#138c84b6f6edb3db5f8ef3ef7115b8f55ccbf886" @@ -11332,6 +12114,18 @@ semver@^4.3.3: resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" integrity sha512-IrpJ+yoG4EOH8DFWuVg+8H1kW1Oaof0Wxe7cPcXW3x9BjkN/eVo54F15LyqemnDIUYskQWr9qvl/RihmSy6+xQ== +semver@^6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.5.4: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + send@0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" @@ -11837,6 +12631,33 @@ string-width@^5.0.1, string-width@^5.1.2: emoji-regex "^9.2.2" strip-ansi "^7.0.1" +string.prototype.trim@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz#a68352740859f6893f14ce3ef1bb3037f7a90533" + integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +string.prototype.trimend@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" + integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +string.prototype.trimstart@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" + integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" @@ -11913,7 +12734,7 @@ strip-indent@^2.0.0: resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" integrity sha512-RsSNPLpq6YUL7QYy44RnPVTn/lcVZtb48Uof3X5JLbF4zD/Gs7ZFDv2HWol+leoQN2mT86LAzSshGfkTlSOpsA== -strip-json-comments@3.1.1, strip-json-comments@^3.1.0: +strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -12158,7 +12979,7 @@ text-hex@1.0.x: resolved "https://registry.yarnpkg.com/text-hex/-/text-hex-1.0.0.tgz#69dc9c1b17446ee79a92bf5b884bb4b9127506f5" integrity sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg== -text-table@0.2.0: +text-table@0.2.0, text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== @@ -12296,12 +13117,17 @@ triple-beam@^1.3.0: resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.3.0.tgz#a595214c7298db8339eeeee083e4d10bd8cb8dd9" integrity sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw== +ts-api-utils@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.2.tgz#7c094f753b6705ee4faee25c3c684ade52d66d99" + integrity sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ== + ts-transformer-keys@^0.4.2: version "0.4.4" resolved "https://registry.yarnpkg.com/ts-transformer-keys/-/ts-transformer-keys-0.4.4.tgz#c185508b3ae9b79236aac58f788c85ca3ac807d7" integrity sha512-LrqgvaFvar01/5mbunRyeLTSIkqoC2xfcpL/90aDY6vR07DGyH+UaYGdIEsUudnlAw2Sr0pxFgdZvE0QIyI4qA== -tsconfig-paths@^3.8.0: +tsconfig-paths@^3.14.2, tsconfig-paths@^3.8.0: version "3.14.2" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088" integrity sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g== @@ -12401,6 +13227,13 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" @@ -12441,6 +13274,45 @@ type@^2.7.2: resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== +typed-array-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz#18de3e7ed7974b0a729d3feecb94338d1472cd60" + integrity sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + is-typed-array "^1.1.10" + +typed-array-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz#d787a24a995711611fb2b87a4052799517b230d0" + integrity sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + +typed-array-byte-offset@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz#cbbe89b51fdef9cd6aaf07ad4707340abbc4ea0b" + integrity sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + +typed-array-length@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" + integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + is-typed-array "^1.1.9" + typed-assert@^1.0.8: version "1.0.9" resolved "https://registry.yarnpkg.com/typed-assert/-/typed-assert-1.0.9.tgz#8af9d4f93432c4970ec717e3006f33f135b06213" @@ -12530,6 +13402,16 @@ uglify-to-browserify@~1.0.0: resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" integrity sha512-vb2s1lYx2xBtUgy+ta+b2J/GLVUR+wmpINwHePmPRhOsIVCG2wDzKJ0n14GslH1BifsqVzSOwQhRaCAsZ/nI4Q== +unbox-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" + integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== + dependencies: + call-bind "^1.0.2" + has-bigints "^1.0.2" + has-symbols "^1.0.3" + which-boxed-primitive "^1.0.2" + underscore@>=1.8.3, underscore@^1.9.1, underscore@~1.13.2: version "1.13.6" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.6.tgz#04786a1f589dc6c09f761fc5f45b89e935136441" @@ -13006,6 +13888,17 @@ which-pm-runs@^1.0.0: resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.1.0.tgz#35ccf7b1a0fce87bd8b92a478c9d045785d3bf35" integrity sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA== +which-typed-array@^1.1.10, which-typed-array@^1.1.11: + version "1.1.11" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.11.tgz#99d691f23c72aab6768680805a271b69761ed61a" + integrity sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + which-typed-array@^1.1.9: version "1.1.9" resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" From 1cb541273133e97fe637af4897e510e41b71a82d Mon Sep 17 00:00:00 2001 From: robertIsaac Date: Tue, 29 Aug 2023 12:33:01 +0300 Subject: [PATCH 2/2] cleanup build.ts --- tools/build.ts | 87 +++----------------------------------------------- 1 file changed, 5 insertions(+), 82 deletions(-) diff --git a/tools/build.ts b/tools/build.ts index 975145167..2d906487d 100644 --- a/tools/build.ts +++ b/tools/build.ts @@ -1,20 +1,6 @@ -import { spawn } from 'cross-spawn'; -import { copy, readFile, writeFile } from 'fs-extra'; -import { prettySize } from 'pretty-size'; -import { file as gzipSizeFile } from 'gzip-size'; import { join } from 'path'; - -// TODO infer these from the package.json -const MODULES = [ - 'core', 'app', 'app-check', 'auth-guard', 'compat', 'analytics', 'auth', 'database', 'firestore', 'functions', - 'remote-config', 'storage', 'messaging', 'performance', 'compat/analytics', - 'compat/auth-guard', 'compat/auth', 'compat/database', 'compat/firestore', - 'compat/functions', 'compat/remote-config', 'compat/storage', 'compat/messaging', - 'compat/performance', 'firestore/lite', -]; -const LAZY_MODULES = ['compat/analytics', 'compat/auth', 'compat/functions', 'compat/messaging', 'compat/remote-config']; -const UMD_NAMES = MODULES.map(m => m === 'core' ? 'angular-fire' : `angular-fire-${m.replace('/', '-')}`); -const ENTRY_NAMES = MODULES.map(m => m === 'core' ? '@angular/fire' : `@angular/fire/${m}`); +import { spawn } from 'cross-spawn'; +import { copy, writeFile } from 'fs-extra'; interface OverrideOptions { exportName?: string; @@ -32,10 +18,11 @@ function zoneWrapExports() { overrides: Record = {} ) => { const imported = await import(path); - const toBeExported: Array<[string, string, boolean]> = exports. + const toBeExported: [string, string, boolean][] = exports. filter(it => !it.startsWith('_') && overrides[it] !== null && overrides[it]?.override !== true). map(importName => { const zoneWrap = typeof imported[importName] === 'function' && + // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with (overrides[importName]?.zoneWrap ?? importName[0] !== importName[0].toUpperCase()); const exportName = overrides[importName]?.exportName ?? importName; return [importName, exportName, zoneWrap]; @@ -134,33 +121,6 @@ ${exportedZoneWrappedFns} ]); } -function webpackFirestoreProtos() { - const path = dest('firestore-protos.js'); - console.log({ path }) - return writeFile(dest('firestore-protos.js'), `/** - * @deprecated No longer needed since Firebase JS SDK 9.6.3 - */ -export {};`); -} - -function proxyPolyfillCompat() { - const defaultObject = { - 'compat/analytics': ["app", "logEvent", "setCurrentScreen", "setUserId", "setUserProperties", "setAnalyticsCollectionEnabled"], - 'compat/auth': ["name", "config", "emulatorConfig", "app", "applyActionCode", "checkActionCode", "confirmPasswordReset", "createUserWithEmailAndPassword", "currentUser", "fetchSignInMethodsForEmail", "isSignInWithEmailLink", "getRedirectResult", "languageCode", "settings", "onAuthStateChanged", "onIdTokenChanged", "sendSignInLinkToEmail", "sendPasswordResetEmail", "setPersistence", "signInAndRetrieveDataWithCredential", "signInAnonymously", "signInWithCredential", "signInWithCustomToken", "signInWithEmailAndPassword", "signInWithPhoneNumber", "signInWithEmailLink", "signInWithPopup", "signInWithRedirect", "signOut", "tenantId", "updateCurrentUser", "useDeviceLanguage", "useEmulator", "verifyPasswordResetCode"], - 'compat/functions': ["useEmulator", "useFunctionsEmulator", "httpsCallable"], - 'compat/messaging': ["deleteToken", "getToken", "onMessage", "onBackgroundMessage"], - 'compat/performance': ["app", "trace", "instrumentationEnabled", "dataCollectionEnabled"], - 'compat/remote-config': ["app", "settings", "defaultConfig", "fetchTimeMillis", "lastFetchStatus", "activate", "ensureInitialized", "fetch", "fetchAndActivate", "getAll", "getBoolean", "getNumber", "getString", "getValue", "setLogLevel"], -}; - return Promise.all(Object.keys(defaultObject).map(module => - writeFile(join(process.cwd(), 'src', `${module}/base.ts`), `// DO NOT MODIFY, this file is autogenerated by tools/build.ts -// Export a null object with the same keys as firebase/${module}, so Proxy can work with proxy-polyfill in Internet Explorer -export const proxyPolyfillCompat = { -${defaultObject[module].map(it => ` ${it}: null,`).join('\n')} -};\n`) - )); -} - const src = (...args: string[]) => join(process.cwd(), 'src', ...args); const dest = (...args: string[]) => join(process.cwd(), 'dist', '@angular/fire', ...args); const destPacakges = (...args: string[]) => join(process.cwd(), 'dist/packages-dist', ...args); @@ -169,6 +129,7 @@ const rootPackage = import(join(process.cwd(), 'package.json')); async function replacePackageCoreVersion() { const root = await rootPackage; + // eslint-disable-next-line @typescript-eslint/no-var-requires const replace = require('replace-in-file'); const files = destPacakges('package.json'); return replace({ @@ -215,39 +176,7 @@ async function compileSchematics() { ]); } -async function measure(module: string) { - const path = dest('bundles', `${module}.umd.js`); - const file = await readFile(path); - const size = prettySize(file.byteLength, true); - const gzip = prettySize(await gzipSizeFile(path), true); - return { size, gzip }; -} - -async function fixImportForLazyModules() { - await Promise.all(LAZY_MODULES.map(async module => { - const packageJson = JSON.parse((await readFile(dest(module, 'package.json'))).toString()); - const entries = Array.from(new Set(Object.values(packageJson).filter(v => typeof v === 'string' && v.endsWith('.js')))) as string[]; - // TODO don't hardcode esm2015 here, perhaps we should scan all the entry directories - // e.g, if ng-packagr starts building other non-flattened entries we'll lose the dynamic import - // TODO fix in Windows - entries.push(`../${module.includes('/') ? '../' : ''}esm2015/${module}/public_api.js`); - await Promise.all(entries.map(async path => { - const source = (await readFile(dest(module, path))).toString(); - let newSource: string; - if (path.endsWith('.umd.js')) { - // in the UMD for lazy modules replace the dyanamic import - newSource = source.replace(`import('firebase/${module}')`, 'rxjs.of(undefined)'); - } else { - // in everything else get rid of the global side-effect import - newSource = source.replace(new RegExp(`^import 'firebase/${module}'.+$`, 'gm'), ''); - } - await writeFile(dest(module, path), newSource); - })); - })); -} - async function buildLibrary() { - // await proxyPolyfillCompat(); await zoneWrapExports(); await spawnPromise('npx', ['ng', 'build']); await Promise.all([ @@ -256,15 +185,9 @@ async function buildLibrary() { copy(join(process.cwd(), 'docs'), dest('docs')), compileSchematics(), replacePackageCoreVersion(), - // fixImportForLazyModules(), - // webpackFirestoreProtos(), ]); } -function measureLibrary() { - return Promise.all(UMD_NAMES.map(measure)); -} - buildLibrary().catch(err => { console.error(err); process.exit(1);