From 0fe9628f789d7b5d31511c9965f135bc44314132 Mon Sep 17 00:00:00 2001 From: Viorel Mocanu Date: Mon, 30 Oct 2023 23:20:59 +0200 Subject: [PATCH] feat: update analytics for the astro-simpleanalytics-plugin usage --- package.json | 2 +- pnpm-lock.yaml | 38 +++++++++++++++++----------------- src/components/Analytics.astro | 22 ++++++++++++++------ src/layouts/Layout.astro | 2 -- 4 files changed, 36 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 53e1500..36f161c 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "@astrojs/rss": "3.0.0", "@astrojs/sitemap": "3.0.2", "astro": "3.4.0", - "astro-simpleanalytics-plugin": "0.1.4", + "astro-simpleanalytics-plugin": "0.3.3", "astro-webmanifest": "1.0.0", "lite-youtube-embed": "0.3.0", "sass": "1.69.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7e441fb..2126049 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,8 +21,8 @@ dependencies: specifier: 3.4.0 version: 3.4.0(@types/node@18.18.7)(sass@1.69.5)(typescript@5.2.2) astro-simpleanalytics-plugin: - specifier: 0.1.4 - version: 0.1.4(@types/node@18.18.7)(sass@1.69.5)(typescript@5.2.2) + specifier: 0.3.3 + version: 0.3.3(@types/node@18.18.7)(sass@1.69.5)(typescript@5.2.2) astro-webmanifest: specifier: 1.0.0 version: 1.0.0 @@ -1725,8 +1725,8 @@ packages: - supports-color dev: true - /astro-simpleanalytics-plugin@0.1.4(@types/node@18.18.7)(sass@1.69.5)(typescript@5.2.2): - resolution: {integrity: sha512-wJX5vQK8xHPzxU/CYBjLOPAs8/NfF8lCKGXmf1W/ECOaw5QnfUas99BTMgRyzpRLQ1u/Mr4jDVjVsglv5JVn1Q==} + /astro-simpleanalytics-plugin@0.3.3(@types/node@18.18.7)(sass@1.69.5)(typescript@5.2.2): + resolution: {integrity: sha512-CFj1yijZTVjf5F9bz1bkXKpB4vcn0e3DB+Ip5Z1ZY0Ssuva5SGr2JLqWtmwIHb/Pn2fLKypck3kqj+uZyTdl0g==} engines: {node: '>=18', pnpm: '>=8'} dependencies: astro: 3.4.0(@types/node@18.18.7)(sass@1.69.5)(typescript@5.2.2) @@ -1937,8 +1937,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001557 - electron-to-chromium: 1.4.569 + caniuse-lite: 1.0.30001558 + electron-to-chromium: 1.4.570 node-releases: 2.0.13 update-browserslist-db: 1.0.13(browserslist@4.22.1) @@ -2014,8 +2014,8 @@ packages: resolution: {integrity: sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==} engines: {node: '>=14.16'} - /caniuse-lite@1.0.30001557: - resolution: {integrity: sha512-91oR7hLNUP3gG6MLU+n96em322a8Xzes8wWdBKhLgUoiJsAF5irZnxSUCbc+qUZXNnPCfUwLOi9ZCZpkvjQajw==} + /caniuse-lite@1.0.30001558: + resolution: {integrity: sha512-/Et7DwLqpjS47JPEcz6VnxU9PwcIdVi0ciLXRWBQdj1XFye68pSQYpV0QtPTfUKWuOaEig+/Vez2l74eDc1tPQ==} /ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} @@ -2250,7 +2250,7 @@ packages: dependencies: '@types/node': 18.18.7 cosmiconfig: 8.3.6(typescript@5.2.2) - jiti: 1.20.0 + jiti: 1.21.0 typescript: 5.2.2 dev: true @@ -2543,8 +2543,8 @@ packages: /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - /electron-to-chromium@1.4.569: - resolution: {integrity: sha512-LsrJjZ0IbVy12ApW3gpYpcmHS3iRxH4bkKOW98y1/D+3cvDUWGcbzbsFinfUS8knpcZk/PG/2p/RnkMCYN7PVg==} + /electron-to-chromium@1.4.570: + resolution: {integrity: sha512-5GxH0PLSIfXKOUMMHMCT4M0olwj1WwAxsQHzVW5Vh3kbsvGw8b4k7LHQmTLC2aRhsgFzrF57XJomca4XLc/WHA==} /emoji-regex@10.3.0: resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} @@ -3948,8 +3948,8 @@ packages: '@pkgjs/parseargs': 0.11.0 dev: true - /jiti@1.20.0: - resolution: {integrity: sha512-3TV69ZbrvV6U5DfQimop50jE9Dl6J8O1ja1dvBbMba/sZ3YBEQqJ2VZRoQPVnhlzjNtU1vaXRZVrVjU4qtm8yA==} + /jiti@1.21.0: + resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} hasBin: true dev: true @@ -5398,8 +5398,8 @@ packages: end-of-stream: 1.4.4 once: 1.4.0 - /punycode@2.3.0: - resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} + /punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} dev: true @@ -5947,8 +5947,8 @@ packages: transitivePeerDependencies: - supports-color - /streamx@2.15.1: - resolution: {integrity: sha512-fQMzy2O/Q47rgwErk/eGeLu/roaFWV0jVsogDmrszM9uIw8L5OA+t+V93MgYlufNptfjmYR1tOMWhei/Eh7TQA==} + /streamx@2.15.2: + resolution: {integrity: sha512-b62pAV/aeMjUoRN2C/9F0n+G8AfcJjNC0zw/ZmOHeFsIe4m4GzjVW9m6VHXVjk536NbdU9JRwKMJRfkc+zUFTg==} requiresBuild: true dependencies: fast-fifo: 1.3.2 @@ -6154,7 +6154,7 @@ packages: dependencies: b4a: 1.6.4 fast-fifo: 1.3.2 - streamx: 2.15.1 + streamx: 2.15.2 /terser@5.22.0: resolution: {integrity: sha512-hHZVLgRA2z4NWcN6aS5rQDc+7Dcy58HOf2zbYwmFcQ+ua3h6eEFf5lIDKTzbWwlazPyOZsFQO8V80/IjVNExEw==} @@ -6569,7 +6569,7 @@ packages: /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: - punycode: 2.3.0 + punycode: 2.3.1 dev: true /util-deprecate@1.0.2: diff --git a/src/components/Analytics.astro b/src/components/Analytics.astro index bdc371f..02c69da 100644 --- a/src/components/Analytics.astro +++ b/src/components/Analytics.astro @@ -10,19 +10,29 @@ */ import { CLARITY_ID, ENV, PIWIK_ID } from '../config'; +import { SimpleAnalytics } from 'astro-simpleanalytics-plugin'; // @TODO: analyze whether we need light or latest SA script: https://docs.simpleanalytics.com/light --- + + {(ENV !== 'local' && ENV !== 'development') && (
- {/* - - - */}