feat: add umami tracking for app launch and exit events; update dependencies in package.json and bun.lock
This commit is contained in:
3
bun.lock
3
bun.lock
@@ -14,6 +14,7 @@
|
|||||||
"@tauri-apps/plugin-dialog": "^2.4.0",
|
"@tauri-apps/plugin-dialog": "^2.4.0",
|
||||||
"@tauri-apps/plugin-fs": "^2.4.2",
|
"@tauri-apps/plugin-fs": "^2.4.2",
|
||||||
"@tauri-apps/plugin-shell": "^2.3.1",
|
"@tauri-apps/plugin-shell": "^2.3.1",
|
||||||
|
"@types/umami": "^2.10.1",
|
||||||
"animejs": "^4.1.3",
|
"animejs": "^4.1.3",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
@@ -347,6 +348,8 @@
|
|||||||
|
|
||||||
"@types/semver": ["@types/semver@7.7.1", "", {}, "sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA=="],
|
"@types/semver": ["@types/semver@7.7.1", "", {}, "sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA=="],
|
||||||
|
|
||||||
|
"@types/umami": ["@types/umami@2.10.1", "", {}, "sha512-CvOEMq+BFOUXj8yciq4hPsdOt0o9KBg5jQXnF1FrdOMKZMxJiwryyZNLa9Ud2NVO6nXSwU22YMKR3E+Xhbo+DA=="],
|
||||||
|
|
||||||
"@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.42.0", "", { "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "8.42.0", "@typescript-eslint/type-utils": "8.42.0", "@typescript-eslint/utils": "8.42.0", "@typescript-eslint/visitor-keys": "8.42.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.42.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-Aq2dPqsQkxHOLfb2OPv43RnIvfj05nw8v/6n3B2NABIPpHnjQnaLo9QGMTvml+tv4korl/Cjfrb/BYhoL8UUTQ=="],
|
"@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.42.0", "", { "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "8.42.0", "@typescript-eslint/type-utils": "8.42.0", "@typescript-eslint/utils": "8.42.0", "@typescript-eslint/visitor-keys": "8.42.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.42.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-Aq2dPqsQkxHOLfb2OPv43RnIvfj05nw8v/6n3B2NABIPpHnjQnaLo9QGMTvml+tv4korl/Cjfrb/BYhoL8UUTQ=="],
|
||||||
|
|
||||||
"@typescript-eslint/parser": ["@typescript-eslint/parser@8.42.0", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.42.0", "@typescript-eslint/types": "8.42.0", "@typescript-eslint/typescript-estree": "8.42.0", "@typescript-eslint/visitor-keys": "8.42.0", "debug": "^4.3.4" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-r1XG74QgShUgXph1BYseJ+KZd17bKQib/yF3SR+demvytiRXrwd12Blnz5eYGm8tXaeRdd4x88MlfwldHoudGg=="],
|
"@typescript-eslint/parser": ["@typescript-eslint/parser@8.42.0", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.42.0", "@typescript-eslint/types": "8.42.0", "@typescript-eslint/typescript-estree": "8.42.0", "@typescript-eslint/visitor-keys": "8.42.0", "debug": "^4.3.4" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-r1XG74QgShUgXph1BYseJ+KZd17bKQib/yF3SR+demvytiRXrwd12Blnz5eYGm8tXaeRdd4x88MlfwldHoudGg=="],
|
||||||
|
|||||||
@@ -28,13 +28,14 @@
|
|||||||
"@tauri-apps/plugin-dialog": "^2.4.0",
|
"@tauri-apps/plugin-dialog": "^2.4.0",
|
||||||
"@tauri-apps/plugin-fs": "^2.4.2",
|
"@tauri-apps/plugin-fs": "^2.4.2",
|
||||||
"@tauri-apps/plugin-shell": "^2.3.1",
|
"@tauri-apps/plugin-shell": "^2.3.1",
|
||||||
|
"@types/umami": "^2.10.1",
|
||||||
"animejs": "^4.1.3",
|
"animejs": "^4.1.3",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"lucide-svelte": "^0.542.0",
|
"lucide-svelte": "^0.542.0",
|
||||||
"semver": "^7.7.2",
|
"semver": "^7.7.2",
|
||||||
"tw-animate-css": "^1.3.8",
|
"svelte-confetti": "^2.3.2",
|
||||||
"svelte-confetti": "^2.3.2"
|
"tw-animate-css": "^1.3.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/compat": "^1.3.2",
|
"@eslint/compat": "^1.3.2",
|
||||||
|
|||||||
22
src/app.html
22
src/app.html
@@ -1,13 +1,15 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en" class="dark">
|
<html lang="en" class="dark">
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
||||||
<title>EZPPLauncher</title>
|
|
||||||
%sveltekit.head%
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="bg-theme-950" data-sveltekit-preload-data="hover">
|
<head>
|
||||||
<div style="display: contents">%sveltekit.body%</div>
|
<meta charset="utf-8" />
|
||||||
</body>
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
</html>
|
<title>EZPPLauncher</title>
|
||||||
|
%sveltekit.head%
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="bg-theme-950" data-sveltekit-preload-data="hover">
|
||||||
|
<div style="display: contents">%sveltekit.body%</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -9,7 +9,7 @@ export function estimateRefreshRate(): Promise<number> {
|
|||||||
|
|
||||||
if (now - last >= 1000) {
|
if (now - last >= 1000) {
|
||||||
console.log(`Estimated Refresh Rate: ${frames - 2} FPS`);
|
console.log(`Estimated Refresh Rate: ${frames - 2} FPS`);
|
||||||
resolve(frames - 2); // estimated Hz
|
resolve(frames - 2);
|
||||||
} else {
|
} else {
|
||||||
requestAnimationFrame(loop);
|
requestAnimationFrame(loop);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,21 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { currentView } from '@/global';
|
import { currentView, launcherVersion } from '@/global';
|
||||||
import { fade } from 'svelte/transition';
|
import { fade } from 'svelte/transition';
|
||||||
|
|
||||||
const View = $derived($currentView);
|
const View = $derived($currentView);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
{#if $launcherVersion !== ''}
|
||||||
|
<script
|
||||||
|
defer
|
||||||
|
src="https://analytics.ez-pp.farm/script.js"
|
||||||
|
data-website-id="b03f0013-64f0-42ce-85c0-abd56e8b3c64"
|
||||||
|
data-tag={$launcherVersion}
|
||||||
|
></script>
|
||||||
|
{/if}
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
{#key View}
|
{#key View}
|
||||||
<div in:fade={{ duration: 300 }}>
|
<div in:fade={{ duration: 300 }}>
|
||||||
<View />
|
<View />
|
||||||
|
|||||||
@@ -177,6 +177,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const launch = async () => {
|
const launch = async () => {
|
||||||
|
umami.track('app_launch_osu');
|
||||||
const osuRunning = await isOsuRunning();
|
const osuRunning = await isOsuRunning();
|
||||||
if (osuRunning) {
|
if (osuRunning) {
|
||||||
toast.error('Hold on a second!', {
|
toast.error('Hold on a second!', {
|
||||||
@@ -480,7 +481,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
await runOsu(osuPath, true);
|
await runOsu(osuPath, true);
|
||||||
|
umami.track('app_exit_osu');
|
||||||
launchInfo = 'Cleaning up...';
|
launchInfo = 'Cleaning up...';
|
||||||
await getCurrentWindow().show();
|
await getCurrentWindow().show();
|
||||||
if (presenceUpdater) {
|
if (presenceUpdater) {
|
||||||
@@ -531,6 +532,7 @@
|
|||||||
description: 'Failed to launch.',
|
description: 'Failed to launch.',
|
||||||
});
|
});
|
||||||
launching.set(false);
|
launching.set(false);
|
||||||
|
umami.track('app_launch_fail', { error: err });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -1283,4 +1285,4 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user