diff --git a/.opensource/project.json b/.opensource/project.json index 78b425e0..dd02985d 100644 --- a/.opensource/project.json +++ b/.opensource/project.json @@ -1,19 +1,13 @@ { - "name": "FirebaseUI for Web", - - "platforms": [ - "Web" - ], - - "content": "README.md", + "name": "FirebaseUI for Web", - "pages" : { - "LANGUAGES.md": "Supported Languages" - }, - - "related": [ - "firebase/firebaseui-android", - "firebase/firebaseui-ios", - "firebase/firebaseui-web-react" - ] + "platforms": ["Web"], + + "content": "README.md", + + "pages": { + "LANGUAGES.md": "Supported Languages" + }, + + "related": ["firebase/firebaseui-android", "firebase/firebaseui-ios", "firebase/firebaseui-web-react"] } diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..02f82250 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,22 @@ +# Dependencies +node_modules/ +pnpm-lock.yaml +package-lock.json +yarn.lock + +# Build outputs +dist/ +build/ +.angular/ +releases/ + +# Generated files +*.min.js +*.min.css + +# Logs +*.log + +# OS generated files +.DS_Store +Thumbs.db diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..37702140 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,9 @@ +{ + "semi": true, + "trailingComma": "es5", + "singleQuote": false, + "printWidth": 120, + "tabWidth": 2, + "useTabs": false, + "endOfLine": "auto" +} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..c6aaaeae --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,62 @@ +/** + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import js from "@eslint/js"; +import prettier from "eslint-config-prettier"; + +export default [ + { ignores: ["**/dist/**", "**/node_modules/**", "**/releases/**", "**/.angular/**"] }, + js.configs.recommended, + prettier, + { + files: ["**/*.{js,jsx,ts,tsx}"], + languageOptions: { + ecmaVersion: 2022, + sourceType: "module", + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, + rules: { + // Core JavaScript rules + "no-unused-vars": ["error", { varsIgnorePattern: "^_", argsIgnorePattern: "^_" }], + "no-console": "warn", + "prefer-const": "error", + "no-var": "error", + + // Security and best practices + "no-debugger": "error", + "no-eval": "error", + "no-implied-eval": "error", + "no-new-func": "error", + "no-script-url": "error", + "no-with": "error", + + // Modern JavaScript preferences + "prefer-arrow-callback": "error", + "prefer-template": "error", + "prefer-destructuring": ["error", { object: true, array: false }], + + // Code quality + eqeqeq: ["error", "always"], + "no-duplicate-imports": "error", + "no-useless-return": "error", + "no-useless-concat": "error", + }, + }, +]; diff --git a/examples/angular/.postcssrc.json b/examples/angular/.postcssrc.json index 72f908df..e092dc7c 100644 --- a/examples/angular/.postcssrc.json +++ b/examples/angular/.postcssrc.json @@ -2,4 +2,4 @@ "plugins": { "@tailwindcss/postcss": {} } -} \ No newline at end of file +} diff --git a/examples/angular/.prettierrc b/examples/angular/.prettierrc new file mode 100644 index 00000000..37702140 --- /dev/null +++ b/examples/angular/.prettierrc @@ -0,0 +1,9 @@ +{ + "semi": true, + "trailingComma": "es5", + "singleQuote": false, + "printWidth": 120, + "tabWidth": 2, + "useTabs": false, + "endOfLine": "auto" +} diff --git a/examples/angular/angular.json b/examples/angular/angular.json index 3fdb95dd..6b639cf2 100644 --- a/examples/angular/angular.json +++ b/examples/angular/angular.json @@ -15,9 +15,7 @@ "outputPath": "dist/angular-ssr", "index": "src/index.html", "browser": "src/main.ts", - "polyfills": [ - "zone.js" - ], + "polyfills": ["zone.js"], "tsConfig": "tsconfig.app.json", "assets": [ { @@ -25,9 +23,7 @@ "input": "public" } ], - "styles": [ - "src/styles.css" - ], + "styles": ["src/styles.css"], "scripts": [], "server": "src/main.server.ts", "prerender": true, @@ -77,10 +73,7 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "polyfills": [ - "zone.js", - "zone.js/testing" - ], + "polyfills": ["zone.js", "zone.js/testing"], "tsConfig": "tsconfig.spec.json", "assets": [ { @@ -88,9 +81,7 @@ "input": "public" } ], - "styles": [ - "src/styles.css" - ], + "styles": ["src/styles.css"], "scripts": [] } } @@ -121,10 +112,7 @@ "builder": "@angular-devkit/build-angular:karma", "options": { "tsConfig": "projects/firebaseui-angular/tsconfig.spec.json", - "polyfills": [ - "zone.js", - "zone.js/testing" - ] + "polyfills": ["zone.js", "zone.js/testing"] } } } diff --git a/examples/angular/eslint.config.js b/examples/angular/eslint.config.js new file mode 100644 index 00000000..a01e7e6b --- /dev/null +++ b/examples/angular/eslint.config.js @@ -0,0 +1,42 @@ +/** + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import js from "@eslint/js"; +import prettier from "eslint-config-prettier"; + +export default [ + { ignores: ["dist/**", "node_modules/**", ".angular/**"] }, + js.configs.recommended, + prettier, + { + files: ["**/*.ts"], + languageOptions: { + ecmaVersion: 2022, + sourceType: "module", + parserOptions: { + project: "./tsconfig.json", + }, + }, + rules: { + "no-unused-vars": ["error", { varsIgnorePattern: "^_", argsIgnorePattern: "^_" }], + "no-console": "warn", + "prefer-const": "error", + "no-var": "error", + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/no-unused-vars": ["error", { varsIgnorePattern: "^_", argsIgnorePattern: "^_" }], + }, + }, +]; diff --git a/examples/angular/package.json b/examples/angular/package.json index 228b6155..67c1885d 100644 --- a/examples/angular/package.json +++ b/examples/angular/package.json @@ -11,7 +11,11 @@ "test": "ng test", "test:unit": "ng test --exclude=\"**/integration/**\" --no-watch --no-progress --browsers=ChromeHeadless", "test:integration": "ng test --include=\"**/tests/integration/**/*.spec.ts\" --no-watch --no-progress --browsers=ChromeHeadless", - "serve:ssr:angular-ssr": "node dist/angular-ssr/server/server.mjs" + "serve:ssr:angular-ssr": "node dist/angular-ssr/server/server.mjs", + "lint": "eslint . --ext .ts", + "lint:fix": "eslint . --ext .ts --fix", + "format": "prettier --write \"src/**/*.{ts,html,css,scss}\"", + "format:check": "prettier --check \"src/**/*.{ts,html,css,scss}\"" }, "dependencies": { "@angular/animations": "^19.1.0", @@ -41,10 +45,13 @@ "@angular-devkit/build-angular": "^19.1.7", "@angular/cli": "^19.1.7", "@angular/compiler-cli": "^19.1.0", + "@eslint/js": "^9.22.0", "@tanstack/angular-form": "^0.42.0", "@types/express": "^4.17.17", "@types/jasmine": "~5.1.0", "@types/node": "^18.18.0", + "eslint": "^9.22.0", + "eslint-config-prettier": "^9.1.0", "firebase": "^11", "jasmine-core": "~5.5.0", "karma": "~6.4.0", @@ -54,6 +61,7 @@ "karma-jasmine-html-reporter": "~2.1.0", "nanostores": "^0.11.3", "ng-packagr": "^19.1.0", + "prettier": "^3.1.1", "typescript": "~5.7.2" } } diff --git a/examples/angular/src/app/app.component.css b/examples/angular/src/app/app.component.css index e1ea07bd..2ef08e38 100644 --- a/examples/angular/src/app/app.component.css +++ b/examples/angular/src/app/app.component.css @@ -13,4 +13,3 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - diff --git a/examples/angular/src/app/app.component.ts b/examples/angular/src/app/app.component.ts index 2aefe9a0..4c071815 100644 --- a/examples/angular/src/app/app.component.ts +++ b/examples/angular/src/app/app.component.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import { Component } from '@angular/core'; -import { RouterOutlet } from '@angular/router'; -import { CommonModule } from '@angular/common'; -import { HeaderComponent } from './components/header'; +import { Component } from "@angular/core"; +import { RouterOutlet } from "@angular/router"; +import { CommonModule } from "@angular/common"; +import { HeaderComponent } from "./components/header"; @Component({ - selector: 'app-root', + selector: "app-root", standalone: true, imports: [CommonModule, RouterOutlet, HeaderComponent], template: ` @@ -29,20 +29,28 @@ import { HeaderComponent } from './components/header'; `, - styles: [` - .app-container { - max-width: 1200px; - margin: 0 auto; - } - - :host { - display: block; - min-height: 100vh; - background-color: #f9fafb; - font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; - } - `] + styles: [ + ` + .app-container { + max-width: 1200px; + margin: 0 auto; + } + + :host { + display: block; + min-height: 100vh; + background-color: #f9fafb; + font-family: + system-ui, + -apple-system, + BlinkMacSystemFont, + "Segoe UI", + Roboto, + sans-serif; + } + `, + ], }) export class AppComponent { - title = 'Firebase UI Angular Example'; + title = "Firebase UI Angular Example"; } diff --git a/examples/angular/src/app/app.config.server.ts b/examples/angular/src/app/app.config.server.ts index dcbea9e1..34c8210a 100644 --- a/examples/angular/src/app/app.config.server.ts +++ b/examples/angular/src/app/app.config.server.ts @@ -14,14 +14,12 @@ * limitations under the License. */ -import { mergeApplicationConfig, ApplicationConfig } from '@angular/core'; -import { provideServerRendering } from '@angular/platform-server'; -import { appConfig } from './app.config'; +import { mergeApplicationConfig, ApplicationConfig } from "@angular/core"; +import { provideServerRendering } from "@angular/platform-server"; +import { appConfig } from "./app.config"; const serverConfig: ApplicationConfig = { - providers: [ - provideServerRendering(), - ] + providers: [provideServerRendering()], }; export const config = mergeApplicationConfig(appConfig, serverConfig); diff --git a/examples/angular/src/app/app.config.ts b/examples/angular/src/app/app.config.ts index f146c704..e4bb5910 100644 --- a/examples/angular/src/app/app.config.ts +++ b/examples/angular/src/app/app.config.ts @@ -14,26 +14,16 @@ * limitations under the License. */ -import { - ApplicationConfig, - provideZoneChangeDetection, - isDevMode, -} from '@angular/core'; -import { provideRouter } from '@angular/router'; +import { ApplicationConfig, provideZoneChangeDetection, isDevMode } from "@angular/core"; +import { provideRouter } from "@angular/router"; -import { routes } from './app.routes'; -import { - provideClientHydration, - withEventReplay, -} from '@angular/platform-browser'; +import { routes } from "./app.routes"; +import { provideClientHydration, withEventReplay } from "@angular/platform-browser"; -import { provideFirebaseApp, initializeApp } from '@angular/fire/app'; -import { provideAuth, getAuth, connectAuthEmulator } from '@angular/fire/auth'; -import { - provideFirebaseUI, - provideFirebaseUIPolicies, -} from '@firebase-ui/angular'; -import { initializeUI } from '@firebase-ui/core'; +import { provideFirebaseApp, initializeApp } from "@angular/fire/app"; +import { provideAuth, getAuth, connectAuthEmulator } from "@angular/fire/auth"; +import { provideFirebaseUI, provideFirebaseUIPolicies } from "@firebase-ui/angular"; +import { initializeUI } from "@firebase-ui/core"; const firebaseConfig = { // your Firebase config here @@ -50,15 +40,15 @@ export const appConfig: ApplicationConfig = { if (isDevMode()) { /** Enable emulators in development */ - connectAuthEmulator(auth, 'http://localhost:9099'); + connectAuthEmulator(auth, "http://localhost:9099"); } return auth; }), provideFirebaseUI((apps) => initializeUI({ app: apps[0] })), provideFirebaseUIPolicies(() => ({ - termsOfServiceUrl: 'https://www.google.com', - privacyPolicyUrl: 'https://www.google.com', + termsOfServiceUrl: "https://www.google.com", + privacyPolicyUrl: "https://www.google.com", })), ], }; diff --git a/examples/angular/src/app/app.routes.ts b/examples/angular/src/app/app.routes.ts index 152315fb..b5c78d86 100644 --- a/examples/angular/src/app/app.routes.ts +++ b/examples/angular/src/app/app.routes.ts @@ -14,82 +14,82 @@ * limitations under the License. */ -import { Routes } from '@angular/router'; +import { Routes } from "@angular/router"; export const routes: Routes = [ { - path: '', - loadComponent: () => import('./home').then(m => m.HomeComponent) + path: "", + loadComponent: () => import("./home").then((m) => m.HomeComponent), }, // Direct auth routes (matching NextJS paths) { - path: 'sign-in', - loadComponent: () => import('./auth/sign-in').then(m => m.SignInComponent) + path: "sign-in", + loadComponent: () => import("./auth/sign-in").then((m) => m.SignInComponent), }, { - path: 'register', - loadComponent: () => import('./auth/register').then(m => m.RegisterComponent) + path: "register", + loadComponent: () => import("./auth/register").then((m) => m.RegisterComponent), }, { - path: 'forgot-password', - loadComponent: () => import('./auth/forgot-password').then(m => m.ForgotPasswordComponent) + path: "forgot-password", + loadComponent: () => import("./auth/forgot-password").then((m) => m.ForgotPasswordComponent), }, // Sign-in subdirectories { - path: 'sign-in/phone', - loadComponent: () => import('./auth/phone').then(m => m.PhoneComponent) + path: "sign-in/phone", + loadComponent: () => import("./auth/phone").then((m) => m.PhoneComponent), }, { - path: 'sign-in/email', - loadComponent: () => import('./auth/email-link').then(m => m.EmailLinkComponent) + path: "sign-in/email", + loadComponent: () => import("./auth/email-link").then((m) => m.EmailLinkComponent), }, // Screen routes { - path: 'screens/sign-in-auth-screen', - loadComponent: () => import('./auth/sign-in-screen').then(m => m.SignInScreenComponent) + path: "screens/sign-in-auth-screen", + loadComponent: () => import("./auth/sign-in-screen").then((m) => m.SignInScreenComponent), }, { - path: 'screens/sign-in-auth-screen-w-handlers', - loadComponent: () => import('./auth/sign-in-handlers').then(m => m.SignInHandlersComponent) + path: "screens/sign-in-auth-screen-w-handlers", + loadComponent: () => import("./auth/sign-in-handlers").then((m) => m.SignInHandlersComponent), }, { - path: 'screens/sign-in-auth-screen-w-oauth', - loadComponent: () => import('./auth/sign-in-oauth').then(m => m.SignInOAuthComponent) + path: "screens/sign-in-auth-screen-w-oauth", + loadComponent: () => import("./auth/sign-in-oauth").then((m) => m.SignInOAuthComponent), }, { - path: 'screens/email-link-auth-screen', - loadComponent: () => import('./auth/email-link-screen').then(m => m.EmailLinkScreenComponent) + path: "screens/email-link-auth-screen", + loadComponent: () => import("./auth/email-link-screen").then((m) => m.EmailLinkScreenComponent), }, { - path: 'screens/email-link-auth-screen-w-oauth', - loadComponent: () => import('./auth/email-link-oauth').then(m => m.EmailLinkOAuthComponent) + path: "screens/email-link-auth-screen-w-oauth", + loadComponent: () => import("./auth/email-link-oauth").then((m) => m.EmailLinkOAuthComponent), }, { - path: 'screens/phone-auth-screen', - loadComponent: () => import('./auth/phone-screen').then(m => m.PhoneScreenComponent) + path: "screens/phone-auth-screen", + loadComponent: () => import("./auth/phone-screen").then((m) => m.PhoneScreenComponent), }, { - path: 'screens/phone-auth-screen-w-oauth', - loadComponent: () => import('./auth/phone-oauth').then(m => m.PhoneOAuthComponent) + path: "screens/phone-auth-screen-w-oauth", + loadComponent: () => import("./auth/phone-oauth").then((m) => m.PhoneOAuthComponent), }, { - path: 'screens/sign-up-auth-screen', - loadComponent: () => import('./auth/sign-up').then(m => m.SignUpComponent) + path: "screens/sign-up-auth-screen", + loadComponent: () => import("./auth/sign-up").then((m) => m.SignUpComponent), }, { - path: 'screens/sign-up-auth-screen-w-oauth', - loadComponent: () => import('./auth/register-oauth').then(m => m.RegisterOAuthComponent) + path: "screens/sign-up-auth-screen-w-oauth", + loadComponent: () => import("./auth/register-oauth").then((m) => m.RegisterOAuthComponent), }, { - path: 'screens/oauth-screen', - loadComponent: () => import('./auth/oauth').then(m => m.OAuthComponent) + path: "screens/oauth-screen", + loadComponent: () => import("./auth/oauth").then((m) => m.OAuthComponent), }, { - path: 'screens/password-reset-screen', - loadComponent: () => import('./auth/password-reset').then(m => m.PasswordResetComponent) + path: "screens/password-reset-screen", + loadComponent: () => import("./auth/password-reset").then((m) => m.PasswordResetComponent), }, { - path: '**', - redirectTo: '' - } + path: "**", + redirectTo: "", + }, ]; diff --git a/examples/angular/src/app/auth/email-link-oauth/email-link-oauth.component.ts b/examples/angular/src/app/auth/email-link-oauth/email-link-oauth.component.ts index 4093bb16..b974c1cc 100644 --- a/examples/angular/src/app/auth/email-link-oauth/email-link-oauth.component.ts +++ b/examples/angular/src/app/auth/email-link-oauth/email-link-oauth.component.ts @@ -14,24 +14,16 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { - EmailLinkAuthScreenComponent, - GoogleSignInButtonComponent, -} from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { EmailLinkAuthScreenComponent, GoogleSignInButtonComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-email-link-oauth', + selector: "app-email-link-oauth", standalone: true, - imports: [ - CommonModule, - RouterModule, - EmailLinkAuthScreenComponent, - GoogleSignInButtonComponent, - ], + imports: [CommonModule, RouterModule, EmailLinkAuthScreenComponent, GoogleSignInButtonComponent], template: ` @@ -47,7 +39,7 @@ export class EmailLinkOAuthComponent implements OnInit { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/auth/email-link-oauth/index.ts b/examples/angular/src/app/auth/email-link-oauth/index.ts index 1fc5413f..c803a7ce 100644 --- a/examples/angular/src/app/auth/email-link-oauth/index.ts +++ b/examples/angular/src/app/auth/email-link-oauth/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './email-link-oauth.component'; +export * from "./email-link-oauth.component"; diff --git a/examples/angular/src/app/auth/email-link-screen/email-link-screen.component.ts b/examples/angular/src/app/auth/email-link-screen/email-link-screen.component.ts index 4db81c51..e9c39aec 100644 --- a/examples/angular/src/app/auth/email-link-screen/email-link-screen.component.ts +++ b/examples/angular/src/app/auth/email-link-screen/email-link-screen.component.ts @@ -14,30 +14,28 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { EmailLinkAuthScreenComponent } from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { EmailLinkAuthScreenComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-email-link-screen', + selector: "app-email-link-screen", standalone: true, imports: [CommonModule, RouterModule, EmailLinkAuthScreenComponent], - template: ` - - `, - styles: [] + template: ` `, + styles: [], }) export class EmailLinkScreenComponent implements OnInit { private auth = inject(Auth); private router = inject(Router); - + ngOnInit() { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/auth/email-link-screen/index.ts b/examples/angular/src/app/auth/email-link-screen/index.ts index 28546d59..227407f4 100644 --- a/examples/angular/src/app/auth/email-link-screen/index.ts +++ b/examples/angular/src/app/auth/email-link-screen/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './email-link-screen.component'; +export * from "./email-link-screen.component"; diff --git a/examples/angular/src/app/auth/email-link/email-link.component.ts b/examples/angular/src/app/auth/email-link/email-link.component.ts index b5488225..7d7716ef 100644 --- a/examples/angular/src/app/auth/email-link/email-link.component.ts +++ b/examples/angular/src/app/auth/email-link/email-link.component.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { EmailLinkAuthScreenComponent } from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { EmailLinkAuthScreenComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-email-link', + selector: "app-email-link", standalone: true, imports: [CommonModule, RouterModule, EmailLinkAuthScreenComponent], template: ` `, @@ -35,7 +35,7 @@ export class EmailLinkComponent implements OnInit { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/auth/email-link/index.ts b/examples/angular/src/app/auth/email-link/index.ts index 25f83812..dc924e64 100644 --- a/examples/angular/src/app/auth/email-link/index.ts +++ b/examples/angular/src/app/auth/email-link/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './email-link.component'; +export * from "./email-link.component"; diff --git a/examples/angular/src/app/auth/forgot-password/forgot-password.component.ts b/examples/angular/src/app/auth/forgot-password/forgot-password.component.ts index 5f18863e..7f582aa3 100644 --- a/examples/angular/src/app/auth/forgot-password/forgot-password.component.ts +++ b/examples/angular/src/app/auth/forgot-password/forgot-password.component.ts @@ -14,30 +14,28 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { PasswordResetScreenComponent } from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { PasswordResetScreenComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-forgot-password', + selector: "app-forgot-password", standalone: true, imports: [CommonModule, RouterModule, PasswordResetScreenComponent], - template: ` - - `, - styles: [] + template: ` `, + styles: [], }) export class ForgotPasswordComponent implements OnInit { private auth = inject(Auth); private router = inject(Router); - + ngOnInit() { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/auth/forgot-password/index.ts b/examples/angular/src/app/auth/forgot-password/index.ts index 002abd14..9b8b5f8b 100644 --- a/examples/angular/src/app/auth/forgot-password/index.ts +++ b/examples/angular/src/app/auth/forgot-password/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './forgot-password.component'; +export * from "./forgot-password.component"; diff --git a/examples/angular/src/app/auth/oauth/index.ts b/examples/angular/src/app/auth/oauth/index.ts index 4d3a3495..a85640fd 100644 --- a/examples/angular/src/app/auth/oauth/index.ts +++ b/examples/angular/src/app/auth/oauth/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './oauth.component'; +export * from "./oauth.component"; diff --git a/examples/angular/src/app/auth/oauth/oauth.component.ts b/examples/angular/src/app/auth/oauth/oauth.component.ts index cfad53ec..a8648b0c 100644 --- a/examples/angular/src/app/auth/oauth/oauth.component.ts +++ b/examples/angular/src/app/auth/oauth/oauth.component.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { OAuthScreenComponent, GoogleSignInButtonComponent } from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { OAuthScreenComponent, GoogleSignInButtonComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-oauth', + selector: "app-oauth", standalone: true, imports: [CommonModule, RouterModule, OAuthScreenComponent, GoogleSignInButtonComponent], template: ` @@ -29,17 +29,17 @@ import { OAuthScreenComponent, GoogleSignInButtonComponent } from '@firebase-ui/ `, - styles: [] + styles: [], }) export class OAuthComponent implements OnInit { private auth = inject(Auth); private router = inject(Router); - + ngOnInit() { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/auth/password-reset/index.ts b/examples/angular/src/app/auth/password-reset/index.ts index f969fada..341d2852 100644 --- a/examples/angular/src/app/auth/password-reset/index.ts +++ b/examples/angular/src/app/auth/password-reset/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './password-reset.component'; +export * from "./password-reset.component"; diff --git a/examples/angular/src/app/auth/password-reset/password-reset.component.ts b/examples/angular/src/app/auth/password-reset/password-reset.component.ts index 56084b1c..fc4735de 100644 --- a/examples/angular/src/app/auth/password-reset/password-reset.component.ts +++ b/examples/angular/src/app/auth/password-reset/password-reset.component.ts @@ -14,21 +14,17 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { PasswordResetScreenComponent } from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { PasswordResetScreenComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-password-reset', + selector: "app-password-reset", standalone: true, imports: [CommonModule, RouterModule, PasswordResetScreenComponent], - template: ` - - `, + template: ` `, styles: [], }) export class PasswordResetComponent implements OnInit { @@ -39,7 +35,7 @@ export class PasswordResetComponent implements OnInit { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/auth/phone-oauth/index.ts b/examples/angular/src/app/auth/phone-oauth/index.ts index d18142d1..33d2bb1d 100644 --- a/examples/angular/src/app/auth/phone-oauth/index.ts +++ b/examples/angular/src/app/auth/phone-oauth/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './phone-oauth.component'; +export * from "./phone-oauth.component"; diff --git a/examples/angular/src/app/auth/phone-oauth/phone-oauth.component.ts b/examples/angular/src/app/auth/phone-oauth/phone-oauth.component.ts index df3f2555..113e8e83 100644 --- a/examples/angular/src/app/auth/phone-oauth/phone-oauth.component.ts +++ b/examples/angular/src/app/auth/phone-oauth/phone-oauth.component.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { PhoneAuthScreenComponent, GoogleSignInButtonComponent } from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { PhoneAuthScreenComponent, GoogleSignInButtonComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-phone-oauth', + selector: "app-phone-oauth", standalone: true, imports: [CommonModule, RouterModule, PhoneAuthScreenComponent, GoogleSignInButtonComponent], template: ` @@ -29,17 +29,17 @@ import { PhoneAuthScreenComponent, GoogleSignInButtonComponent } from '@firebase `, - styles: [] + styles: [], }) export class PhoneOAuthComponent implements OnInit { private auth = inject(Auth); private router = inject(Router); - + ngOnInit() { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/auth/phone-screen/index.ts b/examples/angular/src/app/auth/phone-screen/index.ts index 8a203ed3..da351973 100644 --- a/examples/angular/src/app/auth/phone-screen/index.ts +++ b/examples/angular/src/app/auth/phone-screen/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './phone-screen.component'; +export * from "./phone-screen.component"; diff --git a/examples/angular/src/app/auth/phone-screen/phone-screen.component.ts b/examples/angular/src/app/auth/phone-screen/phone-screen.component.ts index 1c836da8..27e8e517 100644 --- a/examples/angular/src/app/auth/phone-screen/phone-screen.component.ts +++ b/examples/angular/src/app/auth/phone-screen/phone-screen.component.ts @@ -14,30 +14,28 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { PhoneAuthScreenComponent } from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { PhoneAuthScreenComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-phone-screen', + selector: "app-phone-screen", standalone: true, imports: [CommonModule, RouterModule, PhoneAuthScreenComponent], - template: ` - - `, - styles: [] + template: ` `, + styles: [], }) export class PhoneScreenComponent implements OnInit { private auth = inject(Auth); private router = inject(Router); - + ngOnInit() { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/auth/phone/index.ts b/examples/angular/src/app/auth/phone/index.ts index 4d53ab9c..43793a94 100644 --- a/examples/angular/src/app/auth/phone/index.ts +++ b/examples/angular/src/app/auth/phone/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './phone.component'; +export * from "./phone.component"; diff --git a/examples/angular/src/app/auth/phone/phone.component.ts b/examples/angular/src/app/auth/phone/phone.component.ts index 31d134f5..86d505fa 100644 --- a/examples/angular/src/app/auth/phone/phone.component.ts +++ b/examples/angular/src/app/auth/phone/phone.component.ts @@ -14,30 +14,28 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { PhoneAuthScreenComponent } from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { PhoneAuthScreenComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-phone', + selector: "app-phone", standalone: true, imports: [CommonModule, RouterModule, PhoneAuthScreenComponent], - template: ` - - `, - styles: [] + template: ` `, + styles: [], }) export class PhoneComponent implements OnInit { private auth = inject(Auth); private router = inject(Router); - + ngOnInit() { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/auth/register-oauth/index.ts b/examples/angular/src/app/auth/register-oauth/index.ts index 3a01dfd0..9c417266 100644 --- a/examples/angular/src/app/auth/register-oauth/index.ts +++ b/examples/angular/src/app/auth/register-oauth/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './register-oauth.component'; +export * from "./register-oauth.component"; diff --git a/examples/angular/src/app/auth/register-oauth/register-oauth.component.ts b/examples/angular/src/app/auth/register-oauth/register-oauth.component.ts index c92c0f7a..52560124 100644 --- a/examples/angular/src/app/auth/register-oauth/register-oauth.component.ts +++ b/examples/angular/src/app/auth/register-oauth/register-oauth.component.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { SignUpAuthScreenComponent, GoogleSignInButtonComponent } from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { SignUpAuthScreenComponent, GoogleSignInButtonComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-register-oauth', + selector: "app-register-oauth", standalone: true, imports: [CommonModule, RouterModule, SignUpAuthScreenComponent, GoogleSignInButtonComponent], template: ` @@ -29,17 +29,17 @@ import { SignUpAuthScreenComponent, GoogleSignInButtonComponent } from '@firebas `, - styles: [] + styles: [], }) export class RegisterOAuthComponent implements OnInit { private auth = inject(Auth); private router = inject(Router); - + ngOnInit() { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/auth/register/index.ts b/examples/angular/src/app/auth/register/index.ts index 098cc921..1197c752 100644 --- a/examples/angular/src/app/auth/register/index.ts +++ b/examples/angular/src/app/auth/register/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './register.component'; +export * from "./register.component"; diff --git a/examples/angular/src/app/auth/register/register.component.ts b/examples/angular/src/app/auth/register/register.component.ts index 927def91..09d866b3 100644 --- a/examples/angular/src/app/auth/register/register.component.ts +++ b/examples/angular/src/app/auth/register/register.component.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { SignUpAuthScreenComponent, GoogleSignInButtonComponent } from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { SignUpAuthScreenComponent, GoogleSignInButtonComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-register', + selector: "app-register", standalone: true, imports: [CommonModule, RouterModule, SignUpAuthScreenComponent, GoogleSignInButtonComponent], template: ` @@ -29,17 +29,17 @@ import { SignUpAuthScreenComponent, GoogleSignInButtonComponent } from '@firebas `, - styles: [] + styles: [], }) export class RegisterComponent implements OnInit { private auth = inject(Auth); private router = inject(Router); - + ngOnInit() { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/auth/sign-in-handlers/index.ts b/examples/angular/src/app/auth/sign-in-handlers/index.ts index c64161dc..e6d50480 100644 --- a/examples/angular/src/app/auth/sign-in-handlers/index.ts +++ b/examples/angular/src/app/auth/sign-in-handlers/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './sign-in-handlers.component'; +export * from "./sign-in-handlers.component"; diff --git a/examples/angular/src/app/auth/sign-in-handlers/sign-in-handlers.component.ts b/examples/angular/src/app/auth/sign-in-handlers/sign-in-handlers.component.ts index 09394061..0bc60628 100644 --- a/examples/angular/src/app/auth/sign-in-handlers/sign-in-handlers.component.ts +++ b/examples/angular/src/app/auth/sign-in-handlers/sign-in-handlers.component.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { SignInAuthScreenComponent } from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { SignInAuthScreenComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-sign-in-handlers', + selector: "app-sign-in-handlers", standalone: true, imports: [CommonModule, RouterModule, SignInAuthScreenComponent], template: ` @@ -40,7 +40,7 @@ export class SignInHandlersComponent implements OnInit { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/auth/sign-in-oauth/index.ts b/examples/angular/src/app/auth/sign-in-oauth/index.ts index 469faac8..8fff1e0d 100644 --- a/examples/angular/src/app/auth/sign-in-oauth/index.ts +++ b/examples/angular/src/app/auth/sign-in-oauth/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './sign-in-oauth.component'; +export * from "./sign-in-oauth.component"; diff --git a/examples/angular/src/app/auth/sign-in-oauth/sign-in-oauth.component.ts b/examples/angular/src/app/auth/sign-in-oauth/sign-in-oauth.component.ts index d4b10a76..b7eb9163 100644 --- a/examples/angular/src/app/auth/sign-in-oauth/sign-in-oauth.component.ts +++ b/examples/angular/src/app/auth/sign-in-oauth/sign-in-oauth.component.ts @@ -14,29 +14,18 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { - SignInAuthScreenComponent, - GoogleSignInButtonComponent, -} from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { SignInAuthScreenComponent, GoogleSignInButtonComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-sign-in-oauth', + selector: "app-sign-in-oauth", standalone: true, - imports: [ - CommonModule, - RouterModule, - SignInAuthScreenComponent, - GoogleSignInButtonComponent, - ], + imports: [CommonModule, RouterModule, SignInAuthScreenComponent, GoogleSignInButtonComponent], template: ` - + `, @@ -45,12 +34,12 @@ import { export class SignInOAuthComponent implements OnInit { private auth = inject(Auth); private router = inject(Router); - + ngOnInit() { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/auth/sign-in-screen/index.ts b/examples/angular/src/app/auth/sign-in-screen/index.ts index 8ebca5e9..9fe9f801 100644 --- a/examples/angular/src/app/auth/sign-in-screen/index.ts +++ b/examples/angular/src/app/auth/sign-in-screen/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './sign-in-screen.component'; +export * from "./sign-in-screen.component"; diff --git a/examples/angular/src/app/auth/sign-in-screen/sign-in-screen.component.ts b/examples/angular/src/app/auth/sign-in-screen/sign-in-screen.component.ts index 654a0b91..b71acd1d 100644 --- a/examples/angular/src/app/auth/sign-in-screen/sign-in-screen.component.ts +++ b/examples/angular/src/app/auth/sign-in-screen/sign-in-screen.component.ts @@ -14,30 +14,28 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { SignInAuthScreenComponent } from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { SignInAuthScreenComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-sign-in-screen', + selector: "app-sign-in-screen", standalone: true, imports: [CommonModule, RouterModule, SignInAuthScreenComponent], - template: ` - - `, - styles: [] + template: ` `, + styles: [], }) export class SignInScreenComponent implements OnInit { private auth = inject(Auth); private router = inject(Router); - + ngOnInit() { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/auth/sign-in/index.ts b/examples/angular/src/app/auth/sign-in/index.ts index 174cbf53..795feab0 100644 --- a/examples/angular/src/app/auth/sign-in/index.ts +++ b/examples/angular/src/app/auth/sign-in/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './sign-in.component'; +export * from "./sign-in.component"; diff --git a/examples/angular/src/app/auth/sign-in/sign-in.component.ts b/examples/angular/src/app/auth/sign-in/sign-in.component.ts index 6840eef7..ea5ecf14 100644 --- a/examples/angular/src/app/auth/sign-in/sign-in.component.ts +++ b/examples/angular/src/app/auth/sign-in/sign-in.component.ts @@ -14,29 +14,18 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { - SignInAuthScreenComponent, - GoogleSignInButtonComponent, -} from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { SignInAuthScreenComponent, GoogleSignInButtonComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-sign-in', + selector: "app-sign-in", standalone: true, - imports: [ - CommonModule, - RouterModule, - SignInAuthScreenComponent, - GoogleSignInButtonComponent, - ], + imports: [CommonModule, RouterModule, SignInAuthScreenComponent, GoogleSignInButtonComponent], template: ` - +
Sign in with phone number @@ -51,12 +40,12 @@ import { export class SignInComponent implements OnInit { private auth = inject(Auth); private router = inject(Router); - + ngOnInit() { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/auth/sign-up/index.ts b/examples/angular/src/app/auth/sign-up/index.ts index 6da9f31f..9c6736ce 100644 --- a/examples/angular/src/app/auth/sign-up/index.ts +++ b/examples/angular/src/app/auth/sign-up/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './sign-up.component'; +export * from "./sign-up.component"; diff --git a/examples/angular/src/app/auth/sign-up/sign-up.component.ts b/examples/angular/src/app/auth/sign-up/sign-up.component.ts index 09e4b96e..35037e83 100644 --- a/examples/angular/src/app/auth/sign-up/sign-up.component.ts +++ b/examples/angular/src/app/auth/sign-up/sign-up.component.ts @@ -14,30 +14,28 @@ * limitations under the License. */ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router, RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { SignUpAuthScreenComponent } from '@firebase-ui/angular'; +import { Component, OnInit, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { Router, RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { SignUpAuthScreenComponent } from "@firebase-ui/angular"; @Component({ - selector: 'app-sign-up', + selector: "app-sign-up", standalone: true, imports: [CommonModule, RouterModule, SignUpAuthScreenComponent], - template: ` - - `, - styles: [] + template: ` `, + styles: [], }) export class SignUpComponent implements OnInit { private auth = inject(Auth); private router = inject(Router); - + ngOnInit() { // Check if user is already authenticated and redirect to home page authState(this.auth).subscribe((user: User | null) => { if (user) { - this.router.navigate(['/']); + this.router.navigate(["/"]); } }); } diff --git a/examples/angular/src/app/components/header/header.component.ts b/examples/angular/src/app/components/header/header.component.ts index ec66f145..a86dd491 100644 --- a/examples/angular/src/app/components/header/header.component.ts +++ b/examples/angular/src/app/components/header/header.component.ts @@ -14,15 +14,15 @@ * limitations under the License. */ -import { Component, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { RouterModule } from '@angular/router'; -import { Auth, User, authState, signOut } from '@angular/fire/auth'; -import { Router } from '@angular/router'; -import { Observable } from 'rxjs'; +import { Component, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { RouterModule } from "@angular/router"; +import { Auth, User, authState, signOut } from "@angular/fire/auth"; +import { Router } from "@angular/router"; +import { Observable } from "rxjs"; @Component({ - selector: 'app-header', + selector: "app-header", standalone: true, imports: [CommonModule, RouterModule], template: ` @@ -33,7 +33,7 @@ import { Observable } from 'rxjs';
    -
  • +
  • @@ -44,64 +44,66 @@ import { Observable } from 'rxjs';
`, - styles: [` - .border-b { - border-bottom-width: 1px; - } - .border-gray-200 { - border-color: #e5e7eb; - } - .max-w-6xl { - max-width: 72rem; - } - .mx-auto { - margin-left: auto; - margin-right: auto; - } - .h-12 { - height: 3rem; - } - .px-4 { - padding-left: 1rem; - padding-right: 1rem; - } - .flex { - display: flex; - } - .items-center { - align-items: center; - } - .font-bold { - font-weight: 700; - } - .flex-grow { - flex-grow: 1; - } - .justify-end { - justify-content: flex-end; - } - .text-sm { - font-size: 0.875rem; - line-height: 1.25rem; - } - .gap-6 { - gap: 1.5rem; - } - button { - background: none; - border: none; - cursor: pointer; - font: inherit; - color: inherit; - } - a { - text-decoration: none; - color: inherit; - } - *:hover { - opacity: 0.75; - } - `] + styles: [ + ` + .border-b { + border-bottom-width: 1px; + } + .border-gray-200 { + border-color: #e5e7eb; + } + .max-w-6xl { + max-width: 72rem; + } + .mx-auto { + margin-left: auto; + margin-right: auto; + } + .h-12 { + height: 3rem; + } + .px-4 { + padding-left: 1rem; + padding-right: 1rem; + } + .flex { + display: flex; + } + .items-center { + align-items: center; + } + .font-bold { + font-weight: 700; + } + .flex-grow { + flex-grow: 1; + } + .justify-end { + justify-content: flex-end; + } + .text-sm { + font-size: 0.875rem; + line-height: 1.25rem; + } + .gap-6 { + gap: 1.5rem; + } + button { + background: none; + border: none; + cursor: pointer; + font: inherit; + color: inherit; + } + a { + text-decoration: none; + color: inherit; + } + *:hover { + opacity: 0.75; + } + `, + ], }) export class HeaderComponent { private auth = inject(Auth); @@ -110,6 +112,6 @@ export class HeaderComponent { async onSignOut() { await signOut(this.auth); - this.router.navigate(['/auth/sign-in']); + this.router.navigate(["/auth/sign-in"]); } } diff --git a/examples/angular/src/app/components/header/index.ts b/examples/angular/src/app/components/header/index.ts index ee198593..7df71702 100644 --- a/examples/angular/src/app/components/header/index.ts +++ b/examples/angular/src/app/components/header/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './header.component'; +export * from "./header.component"; diff --git a/examples/angular/src/app/home/home.component.ts b/examples/angular/src/app/home/home.component.ts index d14d8909..5148e35d 100644 --- a/examples/angular/src/app/home/home.component.ts +++ b/examples/angular/src/app/home/home.component.ts @@ -14,110 +14,69 @@ * limitations under the License. */ -import { Component, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { RouterModule } from '@angular/router'; -import { Auth, User, authState } from '@angular/fire/auth'; -import { Observable } from 'rxjs'; +import { Component, inject } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { RouterModule } from "@angular/router"; +import { Auth, User, authState } from "@angular/fire/auth"; +import { Observable } from "rxjs"; @Component({ - selector: 'app-home', + selector: "app-home", standalone: true, imports: [CommonModule, RouterModule], template: ` `, - styles: [] + styles: [], }) export class HomeComponent { private auth = inject(Auth); user$: Observable = authState(this.auth); - + signOut() { this.auth.signOut(); } diff --git a/examples/angular/src/app/home/index.ts b/examples/angular/src/app/home/index.ts index 328ded55..099bc938 100644 --- a/examples/angular/src/app/home/index.ts +++ b/examples/angular/src/app/home/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './home.component'; +export * from "./home.component"; diff --git a/examples/angular/src/app/policies/policy.config.ts b/examples/angular/src/app/policies/policy.config.ts index b4ad6815..f1db00d7 100644 --- a/examples/angular/src/app/policies/policy.config.ts +++ b/examples/angular/src/app/policies/policy.config.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import { InjectionToken } from '@angular/core'; +import { InjectionToken } from "@angular/core"; export interface PolicyConfig { termsOfServiceUrl: string; privacyPolicyUrl: string; } -export const POLICY_CONFIG = new InjectionToken('PolicyConfig'); +export const POLICY_CONFIG = new InjectionToken("PolicyConfig"); diff --git a/examples/angular/src/app/policies/providePolicies.ts b/examples/angular/src/app/policies/providePolicies.ts index 754f6f39..78cfe79e 100644 --- a/examples/angular/src/app/policies/providePolicies.ts +++ b/examples/angular/src/app/policies/providePolicies.ts @@ -15,15 +15,15 @@ */ // src/app/policies/providePolicies.ts -import { Provider } from '@angular/core'; -import { POLICY_CONFIG, PolicyConfig } from './policy.config'; +import { Provider } from "@angular/core"; +import { POLICY_CONFIG, PolicyConfig } from "./policy.config"; export function providePolicies(): Provider { return { provide: POLICY_CONFIG, useValue: { - termsOfServiceUrl: 'https://yourdomain.com/terms', - privacyPolicyUrl: 'https://yourdomain.com/privacy', + termsOfServiceUrl: "https://yourdomain.com/terms", + privacyPolicyUrl: "https://yourdomain.com/privacy", } satisfies PolicyConfig, }; } diff --git a/examples/angular/src/main.server.ts b/examples/angular/src/main.server.ts index 0577da24..aa5749a0 100644 --- a/examples/angular/src/main.server.ts +++ b/examples/angular/src/main.server.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import { bootstrapApplication } from '@angular/platform-browser'; -import { AppComponent } from './app/app.component'; -import { config } from './app/app.config.server'; +import { bootstrapApplication } from "@angular/platform-browser"; +import { AppComponent } from "./app/app.component"; +import { config } from "./app/app.config.server"; const bootstrap = () => bootstrapApplication(AppComponent, config); diff --git a/examples/angular/src/main.ts b/examples/angular/src/main.ts index 0e450bde..c846a576 100644 --- a/examples/angular/src/main.ts +++ b/examples/angular/src/main.ts @@ -14,9 +14,8 @@ * limitations under the License. */ -import { bootstrapApplication } from '@angular/platform-browser'; -import { appConfig } from './app/app.config'; -import { AppComponent } from './app/app.component'; +import { bootstrapApplication } from "@angular/platform-browser"; +import { appConfig } from "./app/app.config"; +import { AppComponent } from "./app/app.component"; -bootstrapApplication(AppComponent, appConfig) - .catch((err) => console.error(err)); +bootstrapApplication(AppComponent, appConfig).catch((err) => console.error(err)); diff --git a/examples/angular/src/server.ts b/examples/angular/src/server.ts index 8ded1a83..0e635d44 100644 --- a/examples/angular/src/server.ts +++ b/examples/angular/src/server.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import { APP_BASE_HREF } from '@angular/common'; -import { CommonEngine, isMainModule } from '@angular/ssr/node'; -import express from 'express'; -import { dirname, join, resolve } from 'node:path'; -import { fileURLToPath } from 'node:url'; -import bootstrap from './main.server'; +import { APP_BASE_HREF } from "@angular/common"; +import { CommonEngine, isMainModule } from "@angular/ssr/node"; +import express from "express"; +import { dirname, join, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; +import bootstrap from "./main.server"; const serverDistFolder = dirname(fileURLToPath(import.meta.url)); -const browserDistFolder = resolve(serverDistFolder, '../browser'); -const indexHtml = join(serverDistFolder, 'index.server.html'); +const browserDistFolder = resolve(serverDistFolder, "../browser"); +const indexHtml = join(serverDistFolder, "index.server.html"); const app = express(); const commonEngine = new CommonEngine(); @@ -44,17 +44,17 @@ const commonEngine = new CommonEngine(); * Serve static files from /browser */ app.get( - '**', + "**", express.static(browserDistFolder, { - maxAge: '1y', - index: 'index.html' - }), + maxAge: "1y", + index: "index.html", + }) ); /** * Handle all other requests by rendering the Angular application. */ -app.get('**', (req, res, next) => { +app.get("**", (req, res, next) => { const { protocol, originalUrl, baseUrl, headers } = req; commonEngine @@ -74,7 +74,7 @@ app.get('**', (req, res, next) => { * The server listens on the port defined by the `PORT` environment variable, or defaults to 4000. */ if (isMainModule(import.meta.url)) { - const port = process.env['PORT'] || 4000; + const port = process.env["PORT"] || 4000; app.listen(port, () => { console.log(`Node Express server listening on http://localhost:${port}`); }); diff --git a/examples/angular/src/styles.css b/examples/angular/src/styles.css index 2929acf1..5c046d63 100644 --- a/examples/angular/src/styles.css +++ b/examples/angular/src/styles.css @@ -16,4 +16,4 @@ /* You can add global styles to this file, and also import other style files */ @import "tailwindcss"; -@import "@firebase-ui/styles/src/base.css"; \ No newline at end of file +@import "@firebase-ui/styles/src/base.css"; diff --git a/examples/angular/tsconfig.app.json b/examples/angular/tsconfig.app.json index 9ab8527b..d2329c51 100644 --- a/examples/angular/tsconfig.app.json +++ b/examples/angular/tsconfig.app.json @@ -4,16 +4,8 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", - "types": [ - "node" - ] + "types": ["node"] }, - "files": [ - "src/main.ts", - "src/main.server.ts", - "src/server.ts" - ], - "include": [ - "src/**/*.d.ts" - ] + "files": ["src/main.ts", "src/main.server.ts", "src/server.ts"], + "include": ["src/**/*.d.ts"] } diff --git a/examples/angular/tsconfig.json b/examples/angular/tsconfig.json index 414ea278..c5850139 100644 --- a/examples/angular/tsconfig.json +++ b/examples/angular/tsconfig.json @@ -17,7 +17,7 @@ "importHelpers": true, "target": "ES2022", "module": "ES2022", - "baseUrl": ".", + "baseUrl": "." }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, diff --git a/examples/angular/tsconfig.spec.json b/examples/angular/tsconfig.spec.json index abe45975..aca82878 100644 --- a/examples/angular/tsconfig.spec.json +++ b/examples/angular/tsconfig.spec.json @@ -4,14 +4,7 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/spec", - "types": [ - "jasmine" - ] + "types": ["jasmine"] }, - "include": [ - "src/**/*.spec.ts", - "src/**/*.d.ts", - "projects/**/*.spec.ts", - "projects/**/*.d.ts" - ] -} \ No newline at end of file + "include": ["src/**/*.spec.ts", "src/**/*.d.ts", "projects/**/*.spec.ts", "projects/**/*.d.ts"] +} diff --git a/examples/nextjs/.prettierrc b/examples/nextjs/.prettierrc new file mode 100644 index 00000000..37702140 --- /dev/null +++ b/examples/nextjs/.prettierrc @@ -0,0 +1,9 @@ +{ + "semi": true, + "trailingComma": "es5", + "singleQuote": false, + "printWidth": 120, + "tabWidth": 2, + "useTabs": false, + "endOfLine": "auto" +} diff --git a/examples/nextjs/app/forgot-password/screen.tsx b/examples/nextjs/app/forgot-password/screen.tsx index 2cc97888..f98c5758 100644 --- a/examples/nextjs/app/forgot-password/screen.tsx +++ b/examples/nextjs/app/forgot-password/screen.tsx @@ -22,7 +22,5 @@ import { useRouter } from "next/navigation"; export default function Screen() { const router = useRouter(); - return ( - router.push("/sign-in")} /> - ); + return router.push("/sign-in")} />; } diff --git a/examples/nextjs/app/globals.css b/examples/nextjs/app/globals.css index fd915417..731524bd 100644 --- a/examples/nextjs/app/globals.css +++ b/examples/nextjs/app/globals.css @@ -18,4 +18,4 @@ @import "@firebase-ui/styles/src/base.css"; /* @import "@firebase-ui/styles/src/themes/dark.css"; */ -/* @import "@firebase-ui/styles/src/themes/brutalist.css"; */ \ No newline at end of file +/* @import "@firebase-ui/styles/src/themes/brutalist.css"; */ diff --git a/examples/nextjs/app/layout.tsx b/examples/nextjs/app/layout.tsx index 8c282b99..e34f4639 100644 --- a/examples/nextjs/app/layout.tsx +++ b/examples/nextjs/app/layout.tsx @@ -46,9 +46,7 @@ export default async function RootLayout({ return ( - +
{children} diff --git a/examples/nextjs/app/page.tsx b/examples/nextjs/app/page.tsx index 84f16212..3e60dfe0 100644 --- a/examples/nextjs/app/page.tsx +++ b/examples/nextjs/app/page.tsx @@ -25,97 +25,62 @@ export default function Home() { return (

Firebase UI Demo

-
- {user &&
Welcome: {user.email || user.phoneNumber}
} -
+
{user &&
Welcome: {user.email || user.phoneNumber}
}

Auth Screens

  • - + Sign In Auth Screen
  • - + Sign In Auth Screen with Handlers
  • - + Sign In Auth Screen with OAuth
  • - + Email Link Auth Screen
  • - + Email Link Auth Screen with OAuth
  • - + Phone Auth Screen
  • - + Phone Auth Screen with OAuth
  • - + Sign Up Auth Screen
  • - + Sign Up Auth Screen with OAuth
  • - + OAuth Screen
  • - + Password Reset Screen
  • diff --git a/examples/nextjs/app/screens/password-reset-screen/page.tsx b/examples/nextjs/app/screens/password-reset-screen/page.tsx index 0bea4b34..f81d1c7d 100644 --- a/examples/nextjs/app/screens/password-reset-screen/page.tsx +++ b/examples/nextjs/app/screens/password-reset-screen/page.tsx @@ -19,9 +19,5 @@ import { PasswordResetScreen } from "@firebase-ui/react"; export default function PasswordResetScreenPage() { - return ( - {}} - /> - ); + return {}} />; } diff --git a/examples/nextjs/app/screens/sign-in-auth-screen-w-handlers/page.tsx b/examples/nextjs/app/screens/sign-in-auth-screen-w-handlers/page.tsx index a968d8e7..6299fd5f 100644 --- a/examples/nextjs/app/screens/sign-in-auth-screen-w-handlers/page.tsx +++ b/examples/nextjs/app/screens/sign-in-auth-screen-w-handlers/page.tsx @@ -19,10 +19,5 @@ import { SignInAuthScreen } from "@firebase-ui/react"; export default function SignInAuthScreenWithHandlersPage() { - return ( - {}} - onRegisterClick={() => {}} - /> - ); + return {}} onRegisterClick={() => {}} />; } diff --git a/examples/nextjs/lib/components/header.tsx b/examples/nextjs/lib/components/header.tsx index 4e43e331..8de069ce 100644 --- a/examples/nextjs/lib/components/header.tsx +++ b/examples/nextjs/lib/components/header.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -'use client'; +"use client"; import Link from "next/link"; import { useUser } from "../firebase/hooks"; @@ -39,10 +39,18 @@ export function Header(props: { currentUser: User | null }) {
    - {user ?
  • :
  • Sign In
  • } + {user ? ( +
  • + +
  • + ) : ( +
  • + Sign In +
  • + )}
); -} \ No newline at end of file +} diff --git a/examples/nextjs/lib/examples/1/page.tsx b/examples/nextjs/lib/examples/1/page.tsx index 2ab4ec19..7ab2e03d 100644 --- a/examples/nextjs/lib/examples/1/page.tsx +++ b/examples/nextjs/lib/examples/1/page.tsx @@ -71,9 +71,7 @@ export default function Example1() {

Create Account

-

- Join thousands of users worldwide -

+

Join thousands of users worldwide

@@ -86,9 +84,7 @@ export default function Example1() {

Welcome Back

-

- Sign in to your account to continue -

+

Sign in to your account to continue

{}} />
@@ -98,9 +94,7 @@ export default function Example1() {

New Here?

-

- Create an account and get access to all features -

+

Create an account and get access to all features

@@ -112,19 +106,12 @@ export default function Example1() { viewBox="0 0 24 24" stroke="currentColor" > - +

Free Forever

-

- Get started with our free plan and upgrade anytime -

+

Get started with our free plan and upgrade anytime

@@ -135,19 +122,12 @@ export default function Example1() { viewBox="0 0 24 24" stroke="currentColor" > - +

Premium Support

-

- 24/7 support for all your questions -

+

24/7 support for all your questions

@@ -158,19 +138,12 @@ export default function Example1() { viewBox="0 0 24 24" stroke="currentColor" > - +

Regular Updates

-

- New features and improvements every month -

+

New features and improvements every month

@@ -193,28 +166,16 @@ export default function Example1() {

Product

@@ -222,28 +183,16 @@ export default function Example1() {

Resources

@@ -251,28 +200,16 @@ export default function Example1() {

Company

@@ -280,28 +217,16 @@ export default function Example1() {

Legal

diff --git a/examples/nextjs/lib/examples/2/page.tsx b/examples/nextjs/lib/examples/2/page.tsx index b66edb00..071452f1 100644 --- a/examples/nextjs/lib/examples/2/page.tsx +++ b/examples/nextjs/lib/examples/2/page.tsx @@ -17,14 +17,7 @@ "use client"; import { useState } from "react"; -import { - EmailPasswordForm, - RegisterForm, - Card, - CardHeader, - CardTitle, - CardSubtitle, -} from "@firebase-ui/react"; +import { EmailPasswordForm, RegisterForm, Card, CardHeader, CardTitle, CardSubtitle } from "@firebase-ui/react"; export default function Example2() { const [showRegister, setShowRegister] = useState(false); @@ -70,13 +63,9 @@ export default function Example2() {
- - {showRegister ? "Join DemoStyle" : "Welcome Back"} - + {showRegister ? "Join DemoStyle" : "Welcome Back"} - {showRegister - ? "Experience this demo styling" - : "Sign in to continue your journey"} + {showRegister ? "Experience this demo styling" : "Sign in to continue your journey"} {showRegister ? ( @@ -91,9 +80,7 @@ export default function Example2() { {}} />
- - Example Style Demo - + Example Style Demo
@@ -105,9 +92,7 @@ export default function Example2() {