From 5011829e6e42b330ab9e83e0beac59e474a0e39b Mon Sep 17 00:00:00 2001 From: Sean Morley Date: Mon, 28 Oct 2024 19:10:40 -0400 Subject: [PATCH] Refactor frontend configuration and add optional Umami Analytics integration --- frontend/.env.example | 7 ++++++- frontend/package.json | 1 + frontend/pnpm-lock.yaml | 12 ++++++++++++ frontend/src/routes/+layout.svelte | 3 +++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/frontend/.env.example b/frontend/.env.example index 85a177f..88f6c69 100644 --- a/frontend/.env.example +++ b/frontend/.env.example @@ -1,2 +1,7 @@ PUBLIC_SERVER_URL=http://127.0.0.1:8000 -BODY_SIZE_LIMIT=Infinity \ No newline at end of file +BODY_SIZE_LIMIT=Infinity + + +# OPTIONAL VARIABLES FOR UMAMI ANALYTICS +PUBLIC_UMAMI_SRC= +PUBLIC_UMAMI_WEBSITE_ID= \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index 92f9343..7842a94 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -35,6 +35,7 @@ }, "type": "module", "dependencies": { + "@lukulent/svelte-umami": "^0.0.3", "svelte-i18n": "^4.0.1", "svelte-maplibre": "^0.9.8" } diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index b2d74ae..d545c4c 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + '@lukulent/svelte-umami': + specifier: ^0.0.3 + version: 0.0.3(svelte@4.2.19) svelte-i18n: specifier: ^4.0.1 version: 4.0.1(svelte@4.2.19) @@ -421,6 +424,11 @@ packages: resolution: {integrity: sha512-f5DRIOZf7wxogefH03RjMPMdBF7ADTWUMoOs9kaJo06EfwF+aFhMZMDZxHg/Xe12hptN9xoZjGso2fdjapBRIA==} engines: {node: '>=10'} + '@lukulent/svelte-umami@0.0.3': + resolution: {integrity: sha512-4pL0sJapfy14yDj6CyZgewbRDadRoBJtk/dLqCJh7/tQuX7HO4hviBzhrVa4Osxaq2kcGEKdpkhAKAoaNdlNSA==} + peerDependencies: + svelte: ^4.0.0 + '@mapbox/geojson-rewind@0.5.2': resolution: {integrity: sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==} hasBin: true @@ -2235,6 +2243,10 @@ snapshots: string-argv: 0.3.2 type-detect: 4.0.8 + '@lukulent/svelte-umami@0.0.3(svelte@4.2.19)': + dependencies: + svelte: 4.2.19 + '@mapbox/geojson-rewind@0.5.2': dependencies: get-stream: 6.0.1 diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte index 0f26491..015570f 100644 --- a/frontend/src/routes/+layout.svelte +++ b/frontend/src/routes/+layout.svelte @@ -1,6 +1,7 @@