@nuxt/scripts 0.12.2 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/dist/client/200.html +1 -1
  3. package/dist/client/404.html +1 -1
  4. package/dist/client/_nuxt/{DlfHMoPT.js → BPQ3VLAy.js} +1 -1
  5. package/dist/client/_nuxt/BzljQ-rd.js +162 -0
  6. package/dist/client/_nuxt/DK362SOH.js +1 -0
  7. package/dist/client/_nuxt/PHLQDN5L.js +1 -0
  8. package/dist/client/_nuxt/builds/latest.json +1 -1
  9. package/dist/client/_nuxt/builds/meta/9e8815f0-bd29-4c63-bc27-648fe5a7bddb.json +1 -0
  10. package/dist/client/_nuxt/{entry.Bb8Z00UZ.css → entry.BjfcJo5q.css} +1 -1
  11. package/dist/client/_nuxt/error-404.ZuyiY1vu.css +1 -0
  12. package/dist/client/_nuxt/error-500.BfVWfWcz.css +1 -0
  13. package/dist/client/_nuxt/xoNbWVYj.js +1 -0
  14. package/dist/client/index.html +1 -1
  15. package/dist/module.json +1 -1
  16. package/dist/module.mjs +29 -4
  17. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +223 -0
  18. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +1 -1
  19. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +223 -0
  20. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.d.vue.ts +2 -2
  21. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +1 -1
  22. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue.d.ts +2 -2
  23. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.d.vue.ts +2 -2
  24. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue +1 -1
  25. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue.d.ts +2 -2
  26. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +3 -3
  27. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +3 -3
  28. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +3 -3
  29. package/dist/runtime/components/ScriptVimeoPlayer.d.vue.ts +4 -4
  30. package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +4 -4
  31. package/dist/runtime/components/ScriptYouTubePlayer.d.vue.ts +4 -4
  32. package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +4 -4
  33. package/dist/runtime/composables/useScript.js +7 -0
  34. package/dist/runtime/registry/plausible-analytics.d.ts +81 -7
  35. package/dist/runtime/registry/plausible-analytics.js +64 -11
  36. package/dist/runtime/registry/x-pixel.js +1 -1
  37. package/package.json +28 -25
  38. package/dist/client/_nuxt/C09X5LNe.js +0 -1
  39. package/dist/client/_nuxt/CDuymAca.js +0 -1
  40. package/dist/client/_nuxt/CGGF_5bm.js +0 -179
  41. package/dist/client/_nuxt/Z5EPizOU.js +0 -1
  42. package/dist/client/_nuxt/builds/meta/e404bf6c-6cc5-4a5a-bd29-546b71b82a4b.json +0 -1
  43. package/dist/client/_nuxt/error-404.c-5_FvQE.css +0 -1
  44. package/dist/client/_nuxt/error-500.Dgf4btmt.css +0 -1
@@ -1,5 +1,6 @@
1
1
  import { useRegistryScript } from "../utils.js";
2
- import { array, literal, object, optional, string, union } from "#nuxt-scripts-validator";
2
+ import { any, array, boolean, literal, object, optional, record, string, union } from "#nuxt-scripts-validator";
3
+ import { logger } from "../logger.js";
3
4
  const extensions = [
4
5
  literal("hash"),
5
6
  literal("outbound-links"),
@@ -11,23 +12,75 @@ const extensions = [
11
12
  literal("local"),
12
13
  literal("manual")
13
14
  ];
14
- export const PlausibleAnalyticsOptions = object({
15
- domain: string(),
16
- // required
17
- extension: optional(union([union(extensions), array(union(extensions))]))
15
+ const PlausibleAnalyticsOptionsSchema = object({
16
+ // New October 2025: unique script ID per site (replaces domain)
17
+ scriptId: optional(string()),
18
+ // Legacy: domain-based approach (deprecated)
19
+ domain: optional(string()),
20
+ // Legacy extension support (deprecated)
21
+ extension: optional(union([union(extensions), array(union(extensions))])),
22
+ // New October 2025 init options
23
+ customProperties: optional(record(string(), any())),
24
+ endpoint: optional(string()),
25
+ fileDownloads: optional(object({
26
+ fileExtensions: optional(array(string()))
27
+ })),
28
+ hashBasedRouting: optional(boolean()),
29
+ autoCapturePageviews: optional(boolean()),
30
+ captureOnLocalhost: optional(boolean()),
31
+ trackForms: optional(boolean())
18
32
  });
19
33
  export function useScriptPlausibleAnalytics(_options) {
20
34
  return useRegistryScript("plausibleAnalytics", (options) => {
21
- const extensions2 = Array.isArray(options?.extension) ? options.extension.join(".") : [options?.extension];
35
+ const useNewScript = !!options?.scriptId;
36
+ const useLegacyScript = !!options?.extension;
37
+ if (import.meta.dev) {
38
+ if (!useNewScript && !options?.domain) {
39
+ logger.warn("Plausible Analytics: No `scriptId` or `domain` provided. Please provide either `scriptId` or `domain` (legacy).");
40
+ }
41
+ if (useNewScript && options?.domain) {
42
+ logger.warn("Plausible Analytics: You are using both `scriptId` (new format) and `domain` (deprecated). Please use only `scriptId` for the new format.");
43
+ }
44
+ if (useNewScript && useLegacyScript) {
45
+ logger.warn("Plausible Analytics: You are using both `scriptId` (new format) and `extension` (deprecated). Please use `scriptId` with init options like `hashBasedRouting`, `captureOnLocalhost`, etc. instead.");
46
+ }
47
+ }
48
+ let scriptSrc;
49
+ if (useNewScript) {
50
+ scriptSrc = `https://plausible.io/js/pa-${options.scriptId}.js`;
51
+ } else if (useLegacyScript) {
52
+ const extensions2 = Array.isArray(options.extension) ? options.extension.join(".") : [options.extension];
53
+ scriptSrc = `https://plausible.io/js/script.${extensions2}.js`;
54
+ } else {
55
+ scriptSrc = "https://plausible.io/js/script.js";
56
+ }
57
+ const initOptions = {};
58
+ if (options?.customProperties) initOptions.customProperties = options.customProperties;
59
+ if (options?.endpoint) initOptions.endpoint = options.endpoint;
60
+ if (options?.fileDownloads) initOptions.fileDownloads = options.fileDownloads;
61
+ if (options?.hashBasedRouting !== void 0) initOptions.hashBasedRouting = options.hashBasedRouting;
62
+ if (options?.autoCapturePageviews !== void 0) initOptions.autoCapturePageviews = options.autoCapturePageviews;
63
+ if (options?.captureOnLocalhost !== void 0) initOptions.captureOnLocalhost = options.captureOnLocalhost;
64
+ const scriptInput = !useNewScript && options?.domain ? {
65
+ "src": scriptSrc,
66
+ "data-domain": options.domain
67
+ } : {
68
+ src: scriptSrc
69
+ };
22
70
  return {
23
- scriptInput: {
24
- "src": options?.extension ? `https://plausible.io/js/script.${extensions2}.js` : "https://plausible.io/js/script.js",
25
- "data-domain": options?.domain
26
- },
27
- schema: import.meta.dev ? PlausibleAnalyticsOptions : void 0,
71
+ scriptInput,
72
+ schema: import.meta.dev ? PlausibleAnalyticsOptionsSchema : void 0,
28
73
  scriptOptions: {
29
74
  use() {
30
75
  return { plausible: window.plausible };
76
+ },
77
+ clientInit() {
78
+ window.plausible = window.plausible || function() {
79
+ (plausible.q = plausible.q || []).push(arguments);
80
+ }, plausible.init = plausible.init || function(i) {
81
+ plausible.o = i || {};
82
+ };
83
+ window.plausible.init(initOptions);
31
84
  }
32
85
  }
33
86
  };
@@ -13,7 +13,7 @@ export function useScriptXPixel(_options) {
13
13
  },
14
14
  clientInit: import.meta.server ? void 0 : () => {
15
15
  const s = window.twq = function(...args) {
16
- if (e.exe) {
16
+ if (s.exe) {
17
17
  s.exe(s, args);
18
18
  } else {
19
19
  s.queue.push(args);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/scripts",
3
3
  "type": "module",
4
- "version": "0.12.2",
4
+ "version": "0.13.1",
5
5
  "description": "Load third-party scripts with better performance, privacy and DX in Nuxt Apps.",
6
6
  "author": {
7
7
  "website": "https://harlanzw.com",
@@ -63,6 +63,9 @@
63
63
  "@unhead/vue": "^2.0.3"
64
64
  },
65
65
  "peerDependenciesMeta": {
66
+ "@googlemaps/markerclusterer": {
67
+ "optional": true
68
+ },
66
69
  "@stripe/stripe-js": {
67
70
  "optional": true
68
71
  },
@@ -80,49 +83,49 @@
80
83
  }
81
84
  },
82
85
  "dependencies": {
83
- "@nuxt/kit": "^4.1.3",
84
- "@vueuse/core": "^13.9.0",
86
+ "@nuxt/kit": "^4.2.2",
87
+ "@vueuse/core": "^14.1.0",
85
88
  "consola": "^3.4.2",
86
89
  "defu": "^6.1.4",
87
90
  "h3": "^1.15.4",
88
- "magic-string": "^0.30.19",
89
- "ofetch": "^1.4.1",
91
+ "magic-string": "^0.30.21",
92
+ "ofetch": "^1.5.1",
90
93
  "ohash": "^2.0.11",
91
94
  "pathe": "^2.0.3",
92
95
  "pkg-types": "^2.3.0",
93
96
  "sirv": "^3.0.2",
94
- "std-env": "^3.9.0",
97
+ "std-env": "^3.10.0",
95
98
  "ufo": "^1.6.1",
96
- "unplugin": "^2.3.10",
97
- "unstorage": "^1.17.1",
98
- "valibot": "^1.1.0"
99
+ "unplugin": "^2.3.11",
100
+ "unstorage": "^1.17.3",
101
+ "valibot": "^1.2.0"
99
102
  },
100
103
  "devDependencies": {
101
- "@nuxt/devtools-kit": "^2.6.5",
102
- "@nuxt/devtools-ui-kit": "^2.6.5",
103
- "@nuxt/eslint-config": "^1.9.0",
104
+ "@nuxt/devtools-kit": "^3.1.1",
105
+ "@nuxt/devtools-ui-kit": "^3.1.1",
106
+ "@nuxt/eslint-config": "^1.12.1",
104
107
  "@nuxt/module-builder": "^1.0.2",
105
108
  "@nuxt/test-utils": "3.19.2",
106
109
  "@paypal/paypal-js": "^9.0.1",
107
110
  "@types/semver": "^7.7.1",
108
- "@typescript-eslint/typescript-estree": "^8.46.0",
111
+ "@typescript-eslint/typescript-estree": "^8.49.0",
109
112
  "@vue/test-utils": "^2.4.6",
110
113
  "acorn-loose": "^8.5.2",
111
- "bumpp": "^10.3.1",
114
+ "bumpp": "^10.3.2",
112
115
  "changelogen": "^0.6.2",
113
- "eslint": "^9.37.0",
116
+ "eslint": "^9.39.2",
114
117
  "eslint-plugin-n": "^17.23.1",
115
- "happy-dom": "^20.0.0",
116
- "knitwork": "^1.2.0",
117
- "nuxt": "^4.1.3",
118
- "playwright-core": "^1.56.0",
119
- "shiki": "^3.13.0",
118
+ "happy-dom": "^20.0.11",
119
+ "knitwork": "^1.3.0",
120
+ "nuxt": "^4.2.2",
121
+ "playwright-core": "^1.57.0",
122
+ "shiki": "^3.20.0",
120
123
  "typescript": "5.9.3",
121
- "vitest": "^3.2.4",
122
- "vue": "^3.5.22",
123
- "vue-router": "^4.5.1",
124
- "vue-tsc": "^3.0.9",
125
- "@nuxt/scripts": "0.12.2"
124
+ "vitest": "^4.0.15",
125
+ "vue": "^3.5.25",
126
+ "vue-router": "^4.6.4",
127
+ "vue-tsc": "^3.1.8",
128
+ "@nuxt/scripts": "0.13.1"
126
129
  },
127
130
  "resolutions": {
128
131
  "@nuxt/scripts": "workspace:*"
@@ -1 +0,0 @@
1
- import{_ as o,c as s,o as a,a as t,t as r}from"#entry";import{u as i}from"./Z5EPizOU.js";const u={class:"antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"},l={class:"max-w-520px text-center"},c=["textContent"],d=["textContent"],p=["textContent"],f={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Internal server error"},description:{type:String,default:"This page is temporarily unavailable."},refresh:{type:String,default:"Refresh this page"}},setup(e){const n=e;return i({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(g,h)=>(a(),s("div",u,[t("div",l,[t("h1",{class:"font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]",textContent:r(e.statusCode)},null,8,c),t("h2",{class:"font-semibold mb-2 sm:text-3xl text-2xl",textContent:r(e.statusMessage)},null,8,d),t("p",{class:"mb-4 px-2 text-[#64748B] text-md",textContent:r(e.description)},null,8,p)])]))}},x=o(f,[["__scopeId","data-v-24997d7a"]]);export{x as default};
@@ -1 +0,0 @@
1
- import{_ as s,c as a,o as i,a as t,t as n,b as u,w as c,d as l,e as d}from"#entry";import{u as f}from"./Z5EPizOU.js";const p={class:"antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"},m={class:"max-w-520px text-center"},h=["textContent"],b=["textContent"],g=["textContent"],x={class:"flex items-center justify-center w-full"},y={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},statusCode:{type:Number,default:404},statusMessage:{type:String,default:"Page not found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(e){const r=e;return f({title:`${r.statusCode} - ${r.statusMessage} | ${r.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(k,w)=>{const o=d;return i(),a("div",p,[t("div",m,[t("h1",{class:"font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]",textContent:n(e.statusCode)},null,8,h),t("h2",{class:"font-semibold mb-2 sm:text-3xl text-2xl",textContent:n(e.statusMessage)},null,8,b),t("p",{class:"mb-4 px-2 text-[#64748B] text-md",textContent:n(e.description)},null,8,g),t("div",x,[u(o,{to:"/",class:"font-medium hover:text-[#00DC82] text-sm underline underline-offset-3"},{default:c(()=>[l(n(e.backHome),1)]),_:1})])])])}}},v=s(y,[["__scopeId","data-v-cb0579d3"]]);export{v as default};