@nuxt/scripts 0.13.2 → 1.0.0-beta.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 (58) hide show
  1. package/README.md +9 -0
  2. package/dist/client/200.html +1 -1
  3. package/dist/client/404.html +1 -1
  4. package/dist/client/_nuxt/{iNmKC7TZ.js → Bdf7Qtwg.js} +1 -1
  5. package/dist/client/_nuxt/CoyZWCgl.js +162 -0
  6. package/dist/client/_nuxt/{Bje-0OHL.js → DTDyDxvR.js} +1 -1
  7. package/dist/client/_nuxt/{rttsH3SL.js → Ds1k3yKJ.js} +1 -1
  8. package/dist/client/_nuxt/builds/latest.json +1 -1
  9. package/dist/client/_nuxt/builds/meta/62574f80-71d4-4f9e-8b96-145c85230d99.json +1 -0
  10. package/dist/client/_nuxt/error-404.D45Vtjcx.css +1 -0
  11. package/dist/client/_nuxt/error-500.BOm1rWQf.css +1 -0
  12. package/dist/client/index.html +1 -1
  13. package/dist/module.d.mts +26 -2
  14. package/dist/module.json +1 -1
  15. package/dist/module.mjs +98 -54
  16. package/dist/registry.mjs +53 -0
  17. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +29 -1
  18. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +35 -10
  19. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +29 -1
  20. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +20 -8
  21. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +2 -2
  22. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +20 -8
  23. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue +7 -1
  24. package/dist/runtime/components/ScriptCrisp.d.vue.ts +1 -1
  25. package/dist/runtime/components/ScriptCrisp.vue.d.ts +1 -1
  26. package/dist/runtime/components/ScriptIntercom.d.vue.ts +1 -1
  27. package/dist/runtime/components/ScriptIntercom.vue.d.ts +1 -1
  28. package/dist/runtime/components/ScriptVimeoPlayer.d.vue.ts +2 -2
  29. package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +2 -2
  30. package/dist/runtime/components/ScriptYouTubePlayer.d.vue.ts +12 -1
  31. package/dist/runtime/components/ScriptYouTubePlayer.vue +41 -16
  32. package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +12 -1
  33. package/dist/runtime/composables/useScript.js +10 -0
  34. package/dist/runtime/npm-script-stub.d.ts +20 -0
  35. package/dist/runtime/npm-script-stub.js +73 -0
  36. package/dist/runtime/registry/google-recaptcha.d.ts +27 -0
  37. package/dist/runtime/registry/google-recaptcha.js +45 -0
  38. package/dist/runtime/registry/google-sign-in.d.ts +84 -0
  39. package/dist/runtime/registry/google-sign-in.js +50 -0
  40. package/dist/runtime/registry/google-tag-manager.d.ts +3 -1
  41. package/dist/runtime/registry/google-tag-manager.js +15 -5
  42. package/dist/runtime/registry/matomo-analytics.js +1 -1
  43. package/dist/runtime/registry/plausible-analytics.js +8 -6
  44. package/dist/runtime/registry/posthog.d.ts +26 -0
  45. package/dist/runtime/registry/posthog.js +92 -0
  46. package/dist/runtime/registry/rybbit-analytics.js +38 -8
  47. package/dist/runtime/registry/tiktok-pixel.d.ts +43 -0
  48. package/dist/runtime/registry/tiktok-pixel.js +43 -0
  49. package/dist/runtime/server/google-static-maps-proxy.d.ts +2 -0
  50. package/dist/runtime/server/google-static-maps-proxy.js +54 -0
  51. package/dist/runtime/types.d.ts +13 -1
  52. package/dist/runtime/utils.d.ts +2 -1
  53. package/dist/runtime/utils.js +9 -0
  54. package/package.json +25 -19
  55. package/dist/client/_nuxt/DMut0W-e.js +0 -162
  56. package/dist/client/_nuxt/builds/meta/5e0206fe-a683-423c-8d59-2596d0b16fee.json +0 -1
  57. package/dist/client/_nuxt/error-404.B0ZhSNwd.css +0 -1
  58. package/dist/client/_nuxt/error-500.D4MdgPaC.css +0 -1
@@ -1,6 +1,7 @@
1
1
  import { defu } from "defu";
2
2
  import { useRuntimeConfig } from "nuxt/app";
3
3
  import { useScript } from "./composables/useScript.js";
4
+ import { createNpmScriptStub } from "./npm-script-stub.js";
4
5
  import { parse } from "#nuxt-scripts-validator";
5
6
  import { parseURL, withQuery, parseQuery } from "ufo";
6
7
  function validateScriptInputSchema(key, schema, options) {
@@ -20,6 +21,14 @@ export function useRegistryScript(registryKey, optionsFn, _userOptions) {
20
21
  const scriptConfig = scriptRuntimeConfig(registryKey);
21
22
  const userOptions = Object.assign(_userOptions || {}, typeof scriptConfig === "object" ? scriptConfig : {});
22
23
  const options = optionsFn(userOptions, { scriptInput: userOptions.scriptInput });
24
+ if (options.scriptMode === "npm") {
25
+ return createNpmScriptStub({
26
+ key: String(registryKey),
27
+ use: options.scriptOptions?.use,
28
+ clientInit: options.clientInit,
29
+ trigger: userOptions.scriptOptions?.trigger
30
+ });
31
+ }
23
32
  let finalScriptInput = options.scriptInput;
24
33
  const userSrc = userOptions.scriptInput?.src;
25
34
  const optionsSrc = options.scriptInput?.src;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@nuxt/scripts",
3
3
  "type": "module",
4
- "version": "0.13.2",
4
+ "version": "1.0.0-beta.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",
8
8
  "name": "Harlan Wilton",
9
- "url": "harlan@harlanzw.com"
9
+ "email": "harlan@harlanzw.com"
10
10
  },
11
11
  "license": "MIT",
12
12
  "repository": {
@@ -43,14 +43,14 @@
43
43
  "@unhead/vue",
44
44
  "@unhead/schema",
45
45
  "knitwork",
46
- "estree-walker",
47
46
  "#build/modules/nuxt-scripts-gtm",
48
47
  "#build/modules/nuxt-scripts-ga",
49
48
  "@vimeo/player",
50
49
  "esbuild",
51
50
  "unimport",
52
51
  "#nuxt-scripts/types",
53
- "#nuxt-scripts-validator"
52
+ "#nuxt-scripts-validator",
53
+ "posthog-js"
54
54
  ]
55
55
  },
56
56
  "peerDependencies": {
@@ -60,7 +60,8 @@
60
60
  "@types/google.maps": "^3.58.1",
61
61
  "@types/vimeo__player": "^2.18.3",
62
62
  "@types/youtube": "^0.1.0",
63
- "@unhead/vue": "^2.0.3"
63
+ "@unhead/vue": "^2.0.3",
64
+ "posthog-js": "^1.0.0"
64
65
  },
65
66
  "peerDependenciesMeta": {
66
67
  "@googlemaps/markerclusterer": {
@@ -80,6 +81,9 @@
80
81
  },
81
82
  "@types/youtube": {
82
83
  "optional": true
84
+ },
85
+ "posthog-js": {
86
+ "optional": true
83
87
  }
84
88
  },
85
89
  "dependencies": {
@@ -87,7 +91,8 @@
87
91
  "@vueuse/core": "^14.1.0",
88
92
  "consola": "^3.4.2",
89
93
  "defu": "^6.1.4",
90
- "h3": "^1.15.4",
94
+ "estree-walker": "^3.0.3",
95
+ "h3": "^1.15.5",
91
96
  "magic-string": "^0.30.21",
92
97
  "ofetch": "^1.5.1",
93
98
  "ohash": "^2.0.11",
@@ -95,9 +100,9 @@
95
100
  "pkg-types": "^2.3.0",
96
101
  "sirv": "^3.0.2",
97
102
  "std-env": "^3.10.0",
98
- "ufo": "^1.6.1",
103
+ "ufo": "^1.6.3",
99
104
  "unplugin": "^2.3.11",
100
- "unstorage": "^1.17.3",
105
+ "unstorage": "^1.17.4",
101
106
  "valibot": "^1.2.0"
102
107
  },
103
108
  "devDependencies": {
@@ -106,26 +111,27 @@
106
111
  "@nuxt/eslint-config": "^1.12.1",
107
112
  "@nuxt/module-builder": "^1.0.2",
108
113
  "@nuxt/test-utils": "3.19.2",
109
- "@paypal/paypal-js": "^9.1.0",
114
+ "@paypal/paypal-js": "^9.2.0",
110
115
  "@types/semver": "^7.7.1",
111
- "@typescript-eslint/typescript-estree": "^8.50.0",
116
+ "@typescript-eslint/typescript-estree": "^8.53.1",
112
117
  "@vue/test-utils": "^2.4.6",
113
118
  "acorn-loose": "^8.5.2",
114
- "bumpp": "^10.3.2",
119
+ "bumpp": "^10.4.0",
115
120
  "changelogen": "^0.6.2",
116
121
  "eslint": "^9.39.2",
117
- "eslint-plugin-n": "^17.23.1",
118
- "happy-dom": "^20.0.11",
122
+ "eslint-plugin-n": "^17.23.2",
123
+ "happy-dom": "^20.3.4",
119
124
  "knitwork": "^1.3.0",
120
125
  "nuxt": "^4.2.2",
121
126
  "playwright-core": "^1.57.0",
122
- "shiki": "^3.20.0",
127
+ "posthog-js": "^1.331.0",
128
+ "shiki": "^3.21.0",
123
129
  "typescript": "5.9.3",
124
- "vitest": "^4.0.16",
125
- "vue": "^3.5.26",
130
+ "vitest": "^4.0.17",
131
+ "vue": "^3.5.27",
126
132
  "vue-router": "^4.6.4",
127
- "vue-tsc": "^3.1.8",
128
- "@nuxt/scripts": "0.13.2"
133
+ "vue-tsc": "^3.2.2",
134
+ "@nuxt/scripts": "1.0.0-beta.1"
129
135
  },
130
136
  "resolutions": {
131
137
  "@nuxt/scripts": "workspace:*"
@@ -144,6 +150,6 @@
144
150
  "lint": "eslint .",
145
151
  "lint:fix": "eslint . --fix",
146
152
  "test": "pnpm dev:prepare && vitest --run",
147
- "test:types": "echo 'broken due to type regeneration, use pnpm typecheck' && npx nuxi typecheck"
153
+ "test:types": "vitest run --project typecheck"
148
154
  }
149
155
  }