diff --git a/src/lib/api/auth.ts b/src/lib/api/auth.ts index c11a43aa..304b1121 100644 --- a/src/lib/api/auth.ts +++ b/src/lib/api/auth.ts @@ -28,7 +28,7 @@ import { page } from '$app/stores'; import { isActiveContains } from '../util/isActive'; import type { Garden } from '../types/Garden'; import type { User as FirebaseUser } from 'firebase/auth'; -import trackEvent from '$lib/util/track-event'; +import { trackEvent } from '$lib/util'; import { PlausibleEvent } from '$lib/types/Plausible'; // These are not Svelte stores, because we do not wish to listen to updates on them. diff --git a/src/lib/api/user.ts b/src/lib/api/user.ts index da11d13d..62e639e8 100644 --- a/src/lib/api/user.ts +++ b/src/lib/api/user.ts @@ -4,7 +4,7 @@ import { doc, DocumentReference, getDoc, updateDoc } from 'firebase/firestore'; import { db } from './firebase'; import { getUser } from '$lib/stores/auth'; -import trackEvent from '$lib/util/track-event'; +import { trackEvent } from '$lib/util'; import { PlausibleEvent } from '$lib/types/Plausible'; import type { UserPublic } from '$lib/models/User'; diff --git a/src/lib/util/index.js b/src/lib/util/index.js index dfbb6a39..a5ca0378 100644 --- a/src/lib/util/index.js +++ b/src/lib/util/index.js @@ -10,3 +10,4 @@ export { parse, pick } from './accept-language-parser'; export { slugify } from './slugify'; export { default as getFileExtension } from './getFileExtension'; export { default as fetchFrom } from './fetchFrom'; +export { default as trackEvent } from './track-plausible'; diff --git a/src/lib/util/track-event.ts b/src/lib/util/track-plausible.ts similarity index 89% rename from src/lib/util/track-event.ts rename to src/lib/util/track-plausible.ts index 147dfa34..80d1e870 100644 --- a/src/lib/util/track-event.ts +++ b/src/lib/util/track-plausible.ts @@ -1,3 +1,9 @@ +// NOTE: the filename of this file used to be "track-event.ts", but in some @sveltejs/kit@>1.0.0 version, +// this started bundling to /_app/immutable/chunks/track-event.edc71b85.js (or similar), which is blocked by the EasyPrivacy rule "/track-event.": +// https://github.com/easylist/easylist/blob/55a90a03050c5a278c1497d8443143dfd3d8810f/easyprivacy/easyprivacy_general.txt#L3150 +// Previously, the chuck would have been named /track-event-edc71b85.js, which doesn't match the rule due to the '-' instead of the '.' +// +// Do not name it track-event again. import { dev } from '$app/environment'; import { user } from '$lib/stores/auth'; import { diff --git a/src/lib/util/translation-helpers.ts b/src/lib/util/translation-helpers.ts index 57b8f3ca..fc6a7397 100644 --- a/src/lib/util/translation-helpers.ts +++ b/src/lib/util/translation-helpers.ts @@ -6,7 +6,7 @@ export type MessageFormatter = Flatten; import { UTM_MEMBERSHIP_CAMPAIGN, WTMG_BLOG_BASE_URL } from '$lib/constants'; import createUrl from './create-url'; import { goto } from './navigate'; -import trackEvent from './track-event'; +import trackEvent from './track-plausible'; if (window) { // This function is referenced below in the inline onclick handler.