nuxt-umami
Advanced tools
Comparing version 3.0.0 to 3.0.1
import * as _nuxt_schema from '@nuxt/schema'; | ||
declare const _default: _nuxt_schema.NuxtModule<Partial<{ | ||
enabled: boolean; | ||
host: string; | ||
@@ -14,4 +15,5 @@ id: string; | ||
proxy: false | "direct" | "cloak"; | ||
trailingSlash: "any" | "always" | "never"; | ||
}>, Partial<{ | ||
enabled: boolean; | ||
}>, Partial<{ | ||
host: string; | ||
@@ -27,5 +29,5 @@ id: string; | ||
proxy: false | "direct" | "cloak"; | ||
enabled: boolean; | ||
trailingSlash: "any" | "always" | "never"; | ||
}>, false>; | ||
export { _default as default }; |
{ | ||
"name": "nuxt-umami", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"configKey": "umami", | ||
@@ -9,5 +9,5 @@ "compatibility": { | ||
"builder": { | ||
"@nuxt/module-builder": "0.8.3", | ||
"@nuxt/module-builder": "0.8.4", | ||
"unbuild": "2.0.0" | ||
} | ||
} |
import { earlyPromise, flattenObject, isValidString } from "./utils.js"; | ||
import { collect, config, logger } from "#build/umami.config.mjs"; | ||
import { buildPathUrl, collect, config, logger } from "#build/umami.config.mjs"; | ||
let configChecks; | ||
let staticPayload; | ||
let queryRef; | ||
function runPreflight() { | ||
@@ -39,7 +40,13 @@ if (typeof window === "undefined") | ||
} | ||
function getQueryRef() { | ||
if (typeof queryRef === "string") | ||
return queryRef; | ||
const params = new URL(window.location.href).searchParams; | ||
queryRef = params.get("referrer") || params.get("ref") || ""; | ||
return queryRef; | ||
} | ||
function getPayload() { | ||
const { referrer, title } = window.document; | ||
const pageUrl = new URL(window.location.href); | ||
const ref = referrer || pageUrl.searchParams.get("referrer") || pageUrl.searchParams.get("ref") || ""; | ||
const url = config.excludeQueryParams ? pageUrl.pathname : pageUrl.pathname + pageUrl.search; | ||
const ref = referrer || getQueryRef(); | ||
const url = buildPathUrl(); | ||
return { | ||
@@ -46,0 +53,0 @@ ...getStaticPayload(), |
@@ -27,3 +27,4 @@ function earlyPromise(ok) { | ||
logErrors = false, | ||
enabled = true | ||
enabled = true, | ||
trailingSlash = "any" | ||
} = options; | ||
@@ -47,2 +48,7 @@ return { | ||
}(), | ||
trailingSlash: function() { | ||
if (isValidString(trailingSlash) && ["always", "never"].includes(trailingSlash.trim())) | ||
return trailingSlash.trim(); | ||
return "any"; | ||
}(), | ||
ignoreLocalhost: ignoreLocalhost === true, | ||
@@ -49,0 +55,0 @@ autoTrack: autoTrack !== false, |
{ | ||
"name": "nuxt-umami", | ||
"type": "module", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Integrate Umami Analytics into Nuxt", | ||
@@ -16,3 +16,3 @@ "author": "Moses Laurence <me@ijkml.dev>", | ||
}, | ||
"packageManager": "pnpm@9.9.0", | ||
"packageManager": "pnpm@9.10.0", | ||
"exports": { | ||
@@ -46,4 +46,4 @@ ".": { | ||
"devDependencies": { | ||
"@nuxt/eslint-config": "^0.5.6", | ||
"@nuxt/module-builder": "^0.8.3", | ||
"@nuxt/eslint-config": "^0.5.7", | ||
"@nuxt/module-builder": "^0.8.4", | ||
"@nuxt/schema": "^3.13.1", | ||
@@ -53,3 +53,3 @@ "@types/node": "^22.5.4", | ||
"bumpp": "^9.5.2", | ||
"eslint": "^9.9.1", | ||
"eslint": "^9.10.0", | ||
"nuxt": "^3.13.1", | ||
@@ -56,0 +56,0 @@ "typescript": "latest", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27305
723