From dc62ef784c015ce211a8757744bee6d29d244e35 Mon Sep 17 00:00:00 2001 From: Dartegnian Date: Tue, 16 Apr 2024 17:42:28 +0800 Subject: [PATCH] Install Vercel analytics --- package-lock.json | 26 ++++++++++++++++++++++++++ package.json | 1 + src/app/app.component.ts | 2 ++ 3 files changed, 29 insertions(+) diff --git a/package-lock.json b/package-lock.json index e6e84c8..bc4d4ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "@angular/service-worker": "^17.3.2", "@angular/ssr": "^17.3.2", "@material/material-color-utilities": "^0.2.7", + "@vercel/analytics": "^1.2.2", "bootstrap": "^5.3.3", "colorthief": "^2.4.0", "express": "^4.19.2", @@ -3781,6 +3782,26 @@ "@types/node": "*" } }, + "node_modules/@vercel/analytics": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vercel/analytics/-/analytics-1.2.2.tgz", + "integrity": "sha512-X0rctVWkQV1e5Y300ehVNqpOfSOufo7ieA5PIdna8yX/U7Vjz0GFsGf4qvAhxV02uQ2CVt7GYcrFfddXXK2Y4A==", + "dependencies": { + "server-only": "^0.0.1" + }, + "peerDependencies": { + "next": ">= 13", + "react": "^18 || ^19" + }, + "peerDependenciesMeta": { + "next": { + "optional": true + }, + "react": { + "optional": true + } + } + }, "node_modules/@vitejs/plugin-basic-ssl": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@vitejs/plugin-basic-ssl/-/plugin-basic-ssl-1.1.0.tgz", @@ -14075,6 +14096,11 @@ "node": ">= 0.8.0" } }, + "node_modules/server-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/server-only/-/server-only-0.0.1.tgz", + "integrity": "sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==" + }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", diff --git a/package.json b/package.json index a72479b..598f560 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "@angular/service-worker": "^17.3.2", "@angular/ssr": "^17.3.2", "@material/material-color-utilities": "^0.2.7", + "@vercel/analytics": "^1.2.2", "bootstrap": "^5.3.3", "colorthief": "^2.4.0", "express": "^4.19.2", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 1232418..240d502 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -3,6 +3,7 @@ import { Component, OnInit, Inject, PLATFORM_ID } from '@angular/core'; import { AccentService } from '@services/accent-service.service'; import { IdbService } from '@services/idb.service'; import { UpdateService } from '@services/update.service'; +import { inject } from '@vercel/analytics'; @Component({ selector: 'app-root', @@ -20,6 +21,7 @@ export class AppComponent implements OnInit { ) { this.sw.checkForUpdates(); this.isBrowser = isPlatformBrowser(this.platformId); + inject(); } async ngOnInit() {