@nuxt/scripts 0.5.1 → 0.6.0
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.
- package/README.md +2 -2
- package/dist/client/200.html +19 -16
- package/dist/client/404.html +19 -16
- package/dist/client/_nuxt/B474tPdy.js +66 -0
- package/dist/client/_nuxt/{DMNuDhJC.js → BN0jYG70.js} +1 -1
- package/dist/client/_nuxt/Buoqr_Oi.js +2 -0
- package/dist/client/_nuxt/C2pTd85Q.js +1 -0
- package/dist/client/_nuxt/{DCjyzNN-.js → D4FSFK-1.js} +1 -1
- package/dist/client/_nuxt/DAP_O-zg.js +1 -0
- package/dist/client/_nuxt/{o8H-iTt6.js → DG8tVHNj.js} +1 -1
- package/dist/client/_nuxt/DKGhHdqV.js +31 -0
- package/dist/client/_nuxt/DVC_qXWv.js +1 -0
- package/dist/client/_nuxt/{NL97_oaV.js → GPY1wEXZ.js} +1 -1
- package/dist/client/_nuxt/RyEv5ndP.js +1 -0
- package/dist/client/_nuxt/VQMr7AbF.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/c409c2fe-d448-45a5-84ca-3e109a1e08ad.json +1 -0
- package/dist/client/_nuxt/cW9vKj3g.js +1 -0
- package/dist/client/_nuxt/entry.DvGwvmL9.css +1 -0
- package/dist/client/_nuxt/error-404.DXyehy0d.css +1 -0
- package/dist/client/_nuxt/error-500.a_92Fvyl.css +1 -0
- package/dist/client/index.html +19 -16
- package/dist/module.d.mts +3 -3
- package/dist/module.d.ts +3 -3
- package/dist/module.json +2 -2
- package/dist/module.mjs +191 -59
- package/dist/registry.mjs +15 -2
- package/dist/runtime/components/ScriptCarbonAds.vue +5 -4
- package/dist/runtime/components/ScriptCrisp.vue +84 -0
- package/dist/runtime/components/ScriptGoogleAdsense.vue +23 -4
- package/dist/runtime/components/ScriptGoogleMaps.vue +15 -14
- package/dist/runtime/components/ScriptIntercom.vue +93 -0
- package/dist/runtime/components/ScriptLemonSqueezy.vue +45 -0
- package/dist/runtime/components/ScriptLoadingIndicator.vue +12 -3
- package/dist/runtime/components/ScriptStripePricingTable.vue +30 -18
- package/dist/runtime/components/ScriptVimeoPlayer.vue +13 -3
- package/dist/runtime/components/ScriptYouTubePlayer.vue +13 -3
- package/dist/runtime/composables/useScript.js +6 -1
- package/dist/runtime/composables/useScriptEventPage.d.ts +5 -0
- package/dist/runtime/composables/{useAnalyticsPageEvent.js → useScriptEventPage.js} +1 -1
- package/dist/runtime/composables/{useConsentScriptTrigger.d.ts → useScriptTriggerConsent.d.ts} +1 -1
- package/dist/runtime/composables/{useConsentScriptTrigger.js → useScriptTriggerConsent.js} +1 -1
- package/dist/runtime/composables/{useElementScriptTrigger.d.ts → useScriptTriggerElement.d.ts} +1 -1
- package/dist/runtime/composables/{useElementScriptTrigger.js → useScriptTriggerElement.js} +5 -4
- package/dist/runtime/registry/crisp.d.ts +62 -0
- package/dist/runtime/registry/crisp.js +76 -0
- package/dist/runtime/registry/google-adsense.d.ts +1 -1
- package/dist/runtime/registry/intercom.d.ts +1 -1
- package/dist/runtime/registry/lemon-squeezy.d.ts +19 -12
- package/dist/runtime/registry/stripe.d.ts +0 -1
- package/dist/runtime/registry/vimeo-player.d.ts +1 -1
- package/dist/runtime/registry/youtube-player.d.ts +0 -1
- package/dist/runtime/types.d.ts +14 -8
- package/dist/runtime/utils.js +2 -1
- package/dist/types.d.mts +2 -10
- package/dist/types.d.ts +2 -10
- package/package.json +36 -28
- package/dist/client/_nuxt/Bn0B8vkx.js +0 -1
- package/dist/client/_nuxt/BvlfuC5v.js +0 -31
- package/dist/client/_nuxt/Bx89rGXK.js +0 -1
- package/dist/client/_nuxt/CoEqzGFw.js +0 -44
- package/dist/client/_nuxt/builds/meta/b4275645-e497-405e-b7c0-87516033342e.json +0 -1
- package/dist/client/_nuxt/entry.8LvBfYHJ.css +0 -1
- package/dist/client/_nuxt/error-404.Dbi768NS.css +0 -1
- package/dist/client/_nuxt/error-500.C23YdqXl.css +0 -1
- package/dist/client/_nuxt/jmWmhCGR.js +0 -1
- package/dist/runtime/components/ScriptLemonSqueezyButton.vue +0 -41
- package/dist/runtime/composables/useAnalyticsPageEvent.d.ts +0 -2
package/dist/runtime/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UseScriptOptions } from '@unhead/schema';
|
|
2
|
-
import type { UseScriptInput, VueScriptInstance } from '@unhead/vue';
|
|
1
|
+
import type { UseScriptOptions, DataKeys, SchemaAugmentations, ScriptBase } from '@unhead/schema';
|
|
2
|
+
import type { UseScriptInput, VueScriptInstance, MaybeComputedRefEntriesOnly } from '@unhead/vue';
|
|
3
3
|
import type { ComputedRef, Ref } from 'vue';
|
|
4
4
|
import type { InferInput, ObjectSchema } from 'valibot';
|
|
5
5
|
import type { Import } from 'unimport';
|
|
@@ -20,8 +20,9 @@ import type { NpmInput } from './registry/npm.js';
|
|
|
20
20
|
import type { LemonSqueezyInput } from './registry/lemon-squeezy.js';
|
|
21
21
|
import type { GoogleAdsenseInput } from './registry/google-adsense.js';
|
|
22
22
|
import type { ClarityInput } from './registry/clarity.js';
|
|
23
|
-
import type {
|
|
24
|
-
import type {
|
|
23
|
+
import type { CrispInput } from './registry/crisp.js';
|
|
24
|
+
import type { Input as GoogleTagManagerInput } from '#build/nuxt-scripts/tpc/google-tag-manager';
|
|
25
|
+
import type { Input as GoogleAnalyticsInput } from '#build/nuxt-scripts/tpc/google-analytics';
|
|
25
26
|
export type NuxtUseScriptOptions<T = any> = Omit<UseScriptOptions<T>, 'trigger'> & {
|
|
26
27
|
/**
|
|
27
28
|
* The trigger to load the script:
|
|
@@ -44,7 +45,9 @@ export type NuxtUseScriptOptions<T = any> = Omit<UseScriptOptions<T>, 'trigger'>
|
|
|
44
45
|
*/
|
|
45
46
|
skipValidation?: boolean;
|
|
46
47
|
};
|
|
47
|
-
export type
|
|
48
|
+
export type NuxtUseScriptOptionsSerializable = Omit<NuxtUseScriptOptions, 'use' | 'skipValidation' | 'stub' | 'trigger' | 'eventContext' | 'beforeInit'> & {
|
|
49
|
+
trigger?: 'client' | 'server' | 'onNuxtReady';
|
|
50
|
+
};
|
|
48
51
|
export type NuxtUseScriptInput = UseScriptInput;
|
|
49
52
|
export interface TrackedPage {
|
|
50
53
|
title?: string;
|
|
@@ -76,6 +79,7 @@ export interface NuxtAppScript {
|
|
|
76
79
|
}[];
|
|
77
80
|
}
|
|
78
81
|
export interface ScriptRegistry {
|
|
82
|
+
crisp?: CrispInput;
|
|
79
83
|
clarity?: ClarityInput;
|
|
80
84
|
cloudflareWebAnalytics?: CloudflareWebAnalyticsInput;
|
|
81
85
|
metaPixel?: MetaPixelInput;
|
|
@@ -96,12 +100,14 @@ export interface ScriptRegistry {
|
|
|
96
100
|
vimeoPlayer?: VimeoPlayerInput;
|
|
97
101
|
[key: `${string}-npm`]: NpmInput;
|
|
98
102
|
}
|
|
99
|
-
export type NuxtConfigScriptRegistryEntry<T> = true | 'mock' | T | [T,
|
|
100
|
-
export type NuxtConfigScriptRegistry<T extends keyof ScriptRegistry = keyof ScriptRegistry> = Partial<
|
|
103
|
+
export type NuxtConfigScriptRegistryEntry<T> = true | 'mock' | T | [T, NuxtUseScriptOptionsSerializable];
|
|
104
|
+
export type NuxtConfigScriptRegistry<T extends keyof ScriptRegistry = keyof ScriptRegistry> = Partial<{
|
|
105
|
+
[key in T]: NuxtConfigScriptRegistryEntry<ScriptRegistry[key]>;
|
|
106
|
+
}>;
|
|
101
107
|
declare const emptyOptions: ObjectSchema<{}, undefined>;
|
|
102
108
|
export type EmptyOptionsSchema = typeof emptyOptions;
|
|
103
109
|
export type RegistryScriptInput<T extends ObjectSchema<any, any> = EmptyOptionsSchema, Bundelable extends boolean = true> = InferInput<T> & {
|
|
104
|
-
scriptInput?:
|
|
110
|
+
scriptInput?: MaybeComputedRefEntriesOnly<Omit<ScriptBase & DataKeys & SchemaAugmentations['script'], 'src'>>;
|
|
105
111
|
scriptOptions?: Bundelable extends true ? Omit<NuxtUseScriptOptions, 'use'> : Omit<NuxtUseScriptOptions, 'bundle' | 'use'>;
|
|
106
112
|
};
|
|
107
113
|
export interface RegistryScript {
|
package/dist/runtime/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defu } from "defu";
|
|
2
|
+
import { useScript } from "./composables/useScript.js";
|
|
2
3
|
import { parse } from "#nuxt-scripts-validator";
|
|
3
|
-
import { useRuntimeConfig
|
|
4
|
+
import { useRuntimeConfig } from "#imports";
|
|
4
5
|
function validateScriptInputSchema(key, schema, options) {
|
|
5
6
|
if (import.meta.dev) {
|
|
6
7
|
try {
|
package/dist/types.d.mts
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ModuleOptions, ModuleHooks } from './module.js'
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { ModuleHooks } from './module.js'
|
|
5
2
|
|
|
6
3
|
declare module '@nuxt/schema' {
|
|
7
|
-
interface NuxtConfig { ['scripts']?: Partial<ModuleOptions> }
|
|
8
|
-
interface NuxtOptions { ['scripts']?: ModuleOptions }
|
|
9
4
|
interface NuxtHooks extends ModuleHooks {}
|
|
10
5
|
}
|
|
11
6
|
|
|
12
7
|
declare module 'nuxt/schema' {
|
|
13
|
-
interface NuxtConfig { ['scripts']?: Partial<ModuleOptions> }
|
|
14
|
-
interface NuxtOptions { ['scripts']?: ModuleOptions }
|
|
15
8
|
interface NuxtHooks extends ModuleHooks {}
|
|
16
9
|
}
|
|
17
10
|
|
|
18
|
-
|
|
19
|
-
export type { ModuleHooks, ModuleOptions, default } from './module.js'
|
|
11
|
+
export { type ModuleHooks, type ModuleOptions, default } from './module.js'
|
package/dist/types.d.ts
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ModuleOptions, ModuleHooks } from './module'
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { ModuleHooks } from './module'
|
|
5
2
|
|
|
6
3
|
declare module '@nuxt/schema' {
|
|
7
|
-
interface NuxtConfig { ['scripts']?: Partial<ModuleOptions> }
|
|
8
|
-
interface NuxtOptions { ['scripts']?: ModuleOptions }
|
|
9
4
|
interface NuxtHooks extends ModuleHooks {}
|
|
10
5
|
}
|
|
11
6
|
|
|
12
7
|
declare module 'nuxt/schema' {
|
|
13
|
-
interface NuxtConfig { ['scripts']?: Partial<ModuleOptions> }
|
|
14
|
-
interface NuxtOptions { ['scripts']?: ModuleOptions }
|
|
15
8
|
interface NuxtHooks extends ModuleHooks {}
|
|
16
9
|
}
|
|
17
10
|
|
|
18
|
-
|
|
19
|
-
export type { ModuleHooks, ModuleOptions, default } from './module'
|
|
11
|
+
export { type ModuleHooks, type ModuleOptions, default } from './module'
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/scripts",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@9.
|
|
4
|
+
"version": "0.6.0",
|
|
5
|
+
"packageManager": "pnpm@9.4.0",
|
|
6
6
|
"description": "Load third-party scripts with better performance, privacy and DX in Nuxt Apps.",
|
|
7
7
|
"author": {
|
|
8
8
|
"website": "https://harlanzw.com",
|
|
@@ -57,64 +57,72 @@
|
|
|
57
57
|
"#nuxt-scripts",
|
|
58
58
|
"#nuxt-scripts-validator",
|
|
59
59
|
"third-party-capital",
|
|
60
|
-
"knitwork"
|
|
60
|
+
"knitwork",
|
|
61
|
+
"estree-walker",
|
|
62
|
+
"#build/nuxt-scripts/tpc/google-tag-manager",
|
|
63
|
+
"#build/nuxt-scripts/tpc/google-analytics",
|
|
64
|
+
"@vimeo/player",
|
|
65
|
+
"esbuild"
|
|
61
66
|
]
|
|
62
67
|
},
|
|
63
68
|
"dependencies": {
|
|
64
|
-
"@nuxt/devtools-kit": "^1.3.
|
|
65
|
-
"@nuxt/devtools-ui-kit": "^1.3.
|
|
66
|
-
"@nuxt/kit": "^3.12.
|
|
67
|
-
"@types/google.maps": "^3.55.
|
|
69
|
+
"@nuxt/devtools-kit": "^1.3.9",
|
|
70
|
+
"@nuxt/devtools-ui-kit": "^1.3.9",
|
|
71
|
+
"@nuxt/kit": "^3.12.3",
|
|
72
|
+
"@types/google.maps": "^3.55.11",
|
|
68
73
|
"@types/stripe-v3": "^3.1.33",
|
|
69
74
|
"@types/vimeo__player": "^2.18.3",
|
|
70
75
|
"@types/youtube": "^0.0.50",
|
|
71
|
-
"@unhead/vue": "^1.9.
|
|
72
|
-
"@vueuse/core": "^10.
|
|
76
|
+
"@unhead/vue": "^1.9.15",
|
|
77
|
+
"@vueuse/core": "^10.11.0",
|
|
78
|
+
"acorn": "^8.12.1",
|
|
73
79
|
"consola": "^3.2.3",
|
|
74
80
|
"defu": "^6.1.4",
|
|
75
|
-
"
|
|
76
|
-
"h3": "^1.11.1",
|
|
81
|
+
"h3": "^1.12.0",
|
|
77
82
|
"magic-string": "^0.30.10",
|
|
78
83
|
"mlly": "^1.7.1",
|
|
84
|
+
"nuxt-scripts-devtools": "workspace:*",
|
|
79
85
|
"ofetch": "^1.3.4",
|
|
80
86
|
"ohash": "^1.1.3",
|
|
81
87
|
"pathe": "^1.1.2",
|
|
82
|
-
"pkg-types": "^1.1.
|
|
88
|
+
"pkg-types": "^1.1.3",
|
|
83
89
|
"semver": "^7.6.2",
|
|
84
|
-
"shiki": "^1.
|
|
90
|
+
"shiki": "^1.10.1",
|
|
85
91
|
"sirv": "^2.0.4",
|
|
86
92
|
"std-env": "^3.7.0",
|
|
87
|
-
"third-party-capital": "^1.0.
|
|
93
|
+
"third-party-capital": "^1.0.31",
|
|
88
94
|
"ufo": "^1.5.3",
|
|
89
95
|
"unimport": "^3.7.2",
|
|
90
|
-
"unplugin": "^1.
|
|
96
|
+
"unplugin": "^1.11.0",
|
|
91
97
|
"unstorage": "^1.10.2",
|
|
92
|
-
"valibot": "^0.
|
|
98
|
+
"valibot": "^0.36.0"
|
|
93
99
|
},
|
|
94
100
|
"devDependencies": {
|
|
95
|
-
"@nuxt/devtools-ui-kit": "^1.3.
|
|
101
|
+
"@nuxt/devtools-ui-kit": "^1.3.9",
|
|
96
102
|
"@nuxt/eslint-config": "^0.3.13",
|
|
97
|
-
"@nuxt/module-builder": "^0.
|
|
103
|
+
"@nuxt/module-builder": "^0.8.1",
|
|
98
104
|
"@nuxt/test-utils": "3.13.1",
|
|
99
105
|
"@types/semver": "^7.5.8",
|
|
100
|
-
"@
|
|
106
|
+
"@typescript-eslint/typescript-estree": "^7.15.0",
|
|
107
|
+
"@unhead/schema": "^1.9.15",
|
|
101
108
|
"acorn-loose": "^8.4.0",
|
|
102
109
|
"bumpp": "^9.4.1",
|
|
103
110
|
"changelogen": "^0.5.5",
|
|
104
|
-
"eslint": "9.
|
|
111
|
+
"eslint": "9.6.0",
|
|
112
|
+
"eslint-plugin-n": "^17.9.0",
|
|
105
113
|
"knitwork": "^1.1.0",
|
|
106
|
-
"nuxt": "^3.12.
|
|
107
|
-
"playwright-core": "^1.
|
|
108
|
-
"typescript": "^5.
|
|
114
|
+
"nuxt": "^3.12.3",
|
|
115
|
+
"playwright-core": "^1.45.1",
|
|
116
|
+
"typescript": "^5.5.3",
|
|
109
117
|
"vitest": "^1.6.0",
|
|
110
|
-
"vue": "^3.4.
|
|
111
|
-
"vue-router": "^4.
|
|
118
|
+
"vue": "^3.4.31",
|
|
119
|
+
"vue-router": "^4.4.0"
|
|
112
120
|
},
|
|
113
121
|
"resolutions": {
|
|
114
122
|
"@nuxt/scripts": "workspace:*",
|
|
115
|
-
"nuxt": "^3.12.
|
|
123
|
+
"nuxt": "^3.12.3",
|
|
116
124
|
"nuxt-scripts-devtools": "workspace:*",
|
|
117
|
-
"vue": "^3.4.
|
|
118
|
-
"vue-router": "^4.
|
|
125
|
+
"vue": "^3.4.31",
|
|
126
|
+
"vue-router": "^4.4.0"
|
|
119
127
|
}
|
|
120
128
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as u,r as c,f,g as v,h as d,j as l,k as i,l as h,m as p}from"./BvlfuC5v.js";function g(t,a={}){const e=a.head||u();if(e)return e.ssr?e.push(t,a):m(e,t,a)}function m(t,a,e={}){const s=c(!1),n=c({});f(()=>{n.value=s.value?{}:h(a)});const r=t.push(n.value,e);return v(n,o=>{r.patch(o)}),p()&&(d(()=>{r.dispose()}),l(()=>{s.value=!0}),i(()=>{s.value=!1})),r}const I=(t,a)=>{const e=t.__vccOpts||t;for(const[s,n]of a)e[s]=n;return e};export{I as _,g as u};
|