@nuxt/scripts 0.4.2 → 0.4.4
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/dist/client/200.html +14 -13
- package/dist/client/404.html +14 -13
- package/dist/client/_nuxt/Bf6Ng02J.js +31 -0
- package/dist/client/_nuxt/{iP9mcxdl.js → BsZo98M5.js} +1 -1
- package/dist/client/_nuxt/{BJEDUQYt.js → C0cterrC.js} +1 -1
- package/dist/client/_nuxt/{B9E_xdxs.js → CNkYXcD4.js} +1 -1
- package/dist/client/_nuxt/{DsudziMp.js → COIrKlfF.js} +1 -1
- package/dist/client/_nuxt/C_ZPRiAj.js +26 -0
- package/dist/client/_nuxt/{B4ACM-c0.js → DCjyzNN-.js} +1 -1
- package/dist/client/_nuxt/{DKlGn9uv.js → DGEpfOTx.js} +1 -1
- package/dist/client/_nuxt/Dd6f7Z5P.js +1 -0
- package/dist/client/_nuxt/{PGJIGHGk.js → ISosJq17.js} +1 -1
- package/dist/client/_nuxt/MN12aA4C.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/3255a134-7caf-4d76-96f4-05475e276415.json +1 -0
- package/dist/client/_nuxt/{BcF9sHHc.js → o8H-iTt6.js} +2 -2
- package/dist/client/_nuxt/xtV5iK4E.js +1 -0
- package/dist/client/index.html +14 -13
- package/dist/module.d.mts +1 -1
- package/dist/module.d.ts +1 -1
- package/dist/module.json +2 -2
- package/dist/registry.d.mts +4 -4
- package/dist/registry.d.ts +4 -4
- package/dist/runtime/composables/useAnalyticsPageEvent.d.ts +1 -4
- package/dist/runtime/composables/useConsentScriptTrigger.d.ts +1 -1
- package/dist/runtime/composables/useElementScriptTrigger.d.ts +1 -1
- package/dist/runtime/registry/cloudflare-web-analytics.d.ts +1 -16
- package/dist/runtime/registry/{cloudflare-web-analytics.mjs → cloudflare-web-analytics.js} +1 -2
- package/dist/runtime/registry/fathom-analytics.d.ts +1 -28
- package/dist/runtime/registry/{fathom-analytics.mjs → fathom-analytics.js} +1 -1
- package/dist/runtime/registry/google-analytics.d.ts +1 -8
- package/dist/runtime/registry/{google-analytics.mjs → google-analytics.js} +1 -1
- package/dist/runtime/registry/google-maps.d.ts +1 -9
- package/dist/runtime/registry/{google-maps.mjs → google-maps.js} +1 -1
- package/dist/runtime/registry/google-tag-manager.d.ts +1 -5
- package/dist/runtime/registry/{google-tag-manager.mjs → google-tag-manager.js} +1 -1
- package/dist/runtime/registry/hotjar.d.ts +1 -7
- package/dist/runtime/registry/{hotjar.mjs → hotjar.js} +1 -1
- package/dist/runtime/registry/intercom.d.ts +1 -19
- package/dist/runtime/registry/{intercom.mjs → intercom.js} +1 -1
- package/dist/runtime/registry/{lemon-squeezy.mjs → lemon-squeezy.js} +1 -2
- package/dist/runtime/registry/matomo-analytics.d.ts +1 -11
- package/dist/runtime/registry/{matomo-analytics.mjs → matomo-analytics.js} +1 -2
- package/dist/runtime/registry/meta-pixel.d.ts +1 -5
- package/dist/runtime/registry/{meta-pixel.mjs → meta-pixel.js} +1 -2
- package/dist/runtime/registry/npm.d.ts +1 -11
- package/dist/runtime/registry/{npm.mjs → npm.js} +1 -1
- package/dist/runtime/registry/plausible-analytics.d.ts +1 -7
- package/dist/runtime/registry/{plausible-analytics.mjs → plausible-analytics.js} +1 -1
- package/dist/runtime/registry/segment.d.ts +1 -7
- package/dist/runtime/registry/{segment.mjs → segment.js} +1 -1
- package/dist/runtime/registry/stripe.d.ts +1 -5
- package/dist/runtime/registry/{stripe.mjs → stripe.js} +1 -3
- package/dist/runtime/registry/{vimeo-player.mjs → vimeo-player.js} +1 -1
- package/dist/runtime/registry/x-pixel.d.ts +1 -7
- package/dist/runtime/registry/{x-pixel.mjs → x-pixel.js} +1 -2
- package/dist/runtime/registry/{youtube-player.mjs → youtube-player.js} +1 -2
- package/dist/runtime/types.d.ts +17 -17
- package/dist/runtime/utils.d.ts +3 -3
- package/package.json +33 -29
- package/dist/client/_nuxt/BBSnVM_c.js +0 -31
- package/dist/client/_nuxt/Bsp1M94H.js +0 -1
- package/dist/client/_nuxt/C9UBdavN.js +0 -1
- package/dist/client/_nuxt/Dz2Ca8U2.js +0 -1
- package/dist/client/_nuxt/builds/meta/f37c599d-d78f-4a74-8eda-256234cbc028.json +0 -1
- /package/dist/runtime/composables/{useAnalyticsPageEvent.mjs → useAnalyticsPageEvent.js} +0 -0
- /package/dist/runtime/composables/{useConsentScriptTrigger.mjs → useConsentScriptTrigger.js} +0 -0
- /package/dist/runtime/composables/{useElementScriptTrigger.mjs → useElementScriptTrigger.js} +0 -0
- /package/dist/runtime/composables/{useScript.mjs → useScript.js} +0 -0
- /package/dist/runtime/{types.mjs → types.js} +0 -0
- /package/dist/runtime/{utils.mjs → utils.js} +0 -0
- /package/dist/runtime/validation/{mock.mjs → mock.js} +0 -0
- /package/dist/runtime/validation/{valibot.mjs → valibot.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useRegistryScript } from "../utils.
|
|
1
|
+
import { useRegistryScript } from "../utils.js";
|
|
2
2
|
import { object, optional, string } from "#nuxt-scripts-validator";
|
|
3
3
|
export const XPixelOptions = object({
|
|
4
4
|
id: string(),
|
|
@@ -7,7 +7,6 @@ export const XPixelOptions = object({
|
|
|
7
7
|
export function useScriptXPixel(_options) {
|
|
8
8
|
return useRegistryScript("xPixel", (options) => {
|
|
9
9
|
return {
|
|
10
|
-
// @ts-expect-error TODO fix upstream
|
|
11
10
|
scriptInput: {
|
|
12
11
|
src: "https://static.ads-twitter.com/uwt.js",
|
|
13
12
|
crossorigin: false
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { watch } from "vue";
|
|
2
|
-
import { useRegistryScript } from "../utils.
|
|
2
|
+
import { useRegistryScript } from "../utils.js";
|
|
3
3
|
import { useHead } from "#imports";
|
|
4
4
|
export function useScriptYouTubePlayer(_options) {
|
|
5
5
|
let readyPromise = Promise.resolve();
|
|
6
6
|
const instance = useRegistryScript("youtubePlayer", () => ({
|
|
7
7
|
scriptInput: {
|
|
8
8
|
src: "https://www.youtube.com/iframe_api",
|
|
9
|
-
// @ts-expect-error TODO fix types upstream
|
|
10
9
|
crossorigin: false
|
|
11
10
|
// crossorigin can't be set or it breaks
|
|
12
11
|
},
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -3,23 +3,23 @@ import type { UseScriptInput, VueScriptInstance } from '@unhead/vue';
|
|
|
3
3
|
import type { ComputedRef, Ref } from 'vue';
|
|
4
4
|
import type { Input, ObjectSchema } from 'valibot';
|
|
5
5
|
import type { Import } from 'unimport';
|
|
6
|
-
import type { SegmentInput } from './registry/segment';
|
|
7
|
-
import type { CloudflareWebAnalyticsInput } from './registry/cloudflare-web-analytics';
|
|
8
|
-
import type { MetaPixelInput } from './registry/meta-pixel';
|
|
9
|
-
import type { FathomAnalyticsInput } from './registry/fathom-analytics';
|
|
10
|
-
import type { HotjarInput } from './registry/hotjar';
|
|
11
|
-
import type { IntercomInput } from './registry/intercom';
|
|
12
|
-
import type { GoogleAnalyticsInput } from './registry/google-analytics';
|
|
13
|
-
import type { GoogleMapsInput } from './registry/google-maps';
|
|
14
|
-
import type { GoogleTagManagerInput } from './registry/google-tag-manager';
|
|
15
|
-
import type { MatomoAnalyticsInput } from './registry/matomo-analytics';
|
|
16
|
-
import type { StripeInput } from './registry/stripe';
|
|
17
|
-
import type { VimeoPlayerInput } from './registry/vimeo-player';
|
|
18
|
-
import type { XPixelInput } from './registry/x-pixel';
|
|
19
|
-
import type { YouTubePlayerInput } from './registry/youtube-player';
|
|
20
|
-
import type { PlausibleAnalyticsInput } from './registry/plausible-analytics';
|
|
21
|
-
import type { NpmInput } from './registry/npm';
|
|
22
|
-
import type { LemonSqueezyInput } from './registry/lemon-squeezy';
|
|
6
|
+
import type { SegmentInput } from './registry/segment.js';
|
|
7
|
+
import type { CloudflareWebAnalyticsInput } from './registry/cloudflare-web-analytics.js';
|
|
8
|
+
import type { MetaPixelInput } from './registry/meta-pixel.js';
|
|
9
|
+
import type { FathomAnalyticsInput } from './registry/fathom-analytics.js';
|
|
10
|
+
import type { HotjarInput } from './registry/hotjar.js';
|
|
11
|
+
import type { IntercomInput } from './registry/intercom.js';
|
|
12
|
+
import type { GoogleAnalyticsInput } from './registry/google-analytics.js';
|
|
13
|
+
import type { GoogleMapsInput } from './registry/google-maps.js';
|
|
14
|
+
import type { GoogleTagManagerInput } from './registry/google-tag-manager.js';
|
|
15
|
+
import type { MatomoAnalyticsInput } from './registry/matomo-analytics.js';
|
|
16
|
+
import type { StripeInput } from './registry/stripe.js';
|
|
17
|
+
import type { VimeoPlayerInput } from './registry/vimeo-player.js';
|
|
18
|
+
import type { XPixelInput } from './registry/x-pixel.js';
|
|
19
|
+
import type { YouTubePlayerInput } from './registry/youtube-player.js';
|
|
20
|
+
import type { PlausibleAnalyticsInput } from './registry/plausible-analytics.js';
|
|
21
|
+
import type { NpmInput } from './registry/npm.js';
|
|
22
|
+
import type { LemonSqueezyInput } from './registry/lemon-squeezy.js';
|
|
23
23
|
export type NuxtUseScriptOptions<T = any> = Omit<UseScriptOptions<T>, 'trigger'> & {
|
|
24
24
|
/**
|
|
25
25
|
* The trigger to load the script:
|
package/dist/runtime/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Input, ObjectSchema } from 'valibot';
|
|
2
|
-
import type { UseScriptInput } from '@unhead/vue';
|
|
2
|
+
import type { UseScriptInput, VueScriptInstance } from '@unhead/vue';
|
|
3
3
|
import type { EmptyOptionsSchema, NuxtUseScriptOptions, RegistryScriptInput, ScriptRegistry } from '#nuxt-scripts';
|
|
4
4
|
type OptionsFn<O extends ObjectSchema<any>> = (options: Input<O>) => ({
|
|
5
5
|
scriptInput?: UseScriptInput;
|
|
@@ -7,8 +7,8 @@ type OptionsFn<O extends ObjectSchema<any>> = (options: Input<O>) => ({
|
|
|
7
7
|
schema?: O;
|
|
8
8
|
clientInit?: () => void;
|
|
9
9
|
});
|
|
10
|
-
export declare function scriptRuntimeConfig<T extends keyof ScriptRegistry>(key: T): ScriptRegistry
|
|
10
|
+
export declare function scriptRuntimeConfig<T extends keyof ScriptRegistry>(key: T): ScriptRegistry;
|
|
11
11
|
export declare function useRegistryScript<T extends Record<string | symbol, any>, O extends ObjectSchema<any> = EmptyOptionsSchema>(key: keyof ScriptRegistry | string, optionsFn: OptionsFn<O>, _userOptions?: RegistryScriptInput<O>): T & {
|
|
12
|
-
$script: Promise<T> &
|
|
12
|
+
$script: Promise<T> & VueScriptInstance<T>;
|
|
13
13
|
};
|
|
14
14
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/scripts",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.4",
|
|
5
|
+
"packageManager": "pnpm@9.1.4",
|
|
5
6
|
"description": "Load third-party scripts with better performance, privacy and DX in Nuxt Apps.",
|
|
6
7
|
"author": {
|
|
7
8
|
"website": "https://harlanzw.com",
|
|
@@ -32,6 +33,21 @@
|
|
|
32
33
|
"files": [
|
|
33
34
|
"dist"
|
|
34
35
|
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "pnpm prepack",
|
|
38
|
+
"client:build": "nuxi generate client",
|
|
39
|
+
"client:dev": "nuxi dev client --port 3300",
|
|
40
|
+
"prepack": "nuxt-module-build build && npm run client:build",
|
|
41
|
+
"dev": "nuxi dev playground",
|
|
42
|
+
"dev:ssl": "nuxi dev playground --https",
|
|
43
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
44
|
+
"typecheck": "pnpm dlx vue-tsc --noEmit",
|
|
45
|
+
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
|
|
46
|
+
"lint": "eslint .",
|
|
47
|
+
"lint:fix": "eslint . --fix",
|
|
48
|
+
"test": "vitest",
|
|
49
|
+
"test:types": "npx nuxi typecheck"
|
|
50
|
+
},
|
|
35
51
|
"build": {
|
|
36
52
|
"externals": [
|
|
37
53
|
"@unhead/vue",
|
|
@@ -41,15 +57,15 @@
|
|
|
41
57
|
]
|
|
42
58
|
},
|
|
43
59
|
"dependencies": {
|
|
44
|
-
"@nuxt/devtools-kit": "^1.3.
|
|
45
|
-
"@nuxt/devtools-ui-kit": "^1.3.
|
|
60
|
+
"@nuxt/devtools-kit": "^1.3.2",
|
|
61
|
+
"@nuxt/devtools-ui-kit": "^1.3.2",
|
|
46
62
|
"@nuxt/kit": "^3.11.2",
|
|
47
63
|
"@types/google.maps": "^3.55.9",
|
|
48
64
|
"@types/stripe-v3": "^3.1.33",
|
|
49
65
|
"@types/vimeo__player": "^2.18.3",
|
|
50
66
|
"@types/youtube": "^0.0.50",
|
|
51
|
-
"@unhead/vue": "^1.9.
|
|
52
|
-
"@vueuse/core": "^10.
|
|
67
|
+
"@unhead/vue": "^1.9.12",
|
|
68
|
+
"@vueuse/core": "^10.10.0",
|
|
53
69
|
"consola": "^3.2.3",
|
|
54
70
|
"defu": "^6.1.4",
|
|
55
71
|
"estree-walker": "^3.0.3",
|
|
@@ -61,27 +77,29 @@
|
|
|
61
77
|
"pathe": "^1.1.2",
|
|
62
78
|
"pkg-types": "^1.1.1",
|
|
63
79
|
"semver": "^7.6.2",
|
|
64
|
-
"shiki": "^1.
|
|
80
|
+
"shiki": "^1.6.1",
|
|
65
81
|
"sirv": "^2.0.4",
|
|
66
82
|
"std-env": "^3.7.0",
|
|
67
83
|
"third-party-capital": "^1.0.28",
|
|
68
84
|
"ufo": "^1.5.3",
|
|
69
|
-
"unimport": "^3.7.
|
|
85
|
+
"unimport": "^3.7.2",
|
|
70
86
|
"unplugin": "^1.10.1",
|
|
71
87
|
"unstorage": "^1.10.2",
|
|
72
88
|
"valibot": "^0.30.0"
|
|
73
89
|
},
|
|
74
90
|
"devDependencies": {
|
|
75
|
-
"@antfu/eslint-config": "2.
|
|
76
|
-
"@nuxt/devtools-ui-kit": "^1.3.
|
|
77
|
-
"@nuxt/module-builder": "^0.
|
|
78
|
-
"@nuxt/test-utils": "3.
|
|
79
|
-
"@
|
|
91
|
+
"@antfu/eslint-config": "2.19.1",
|
|
92
|
+
"@nuxt/devtools-ui-kit": "^1.3.2",
|
|
93
|
+
"@nuxt/module-builder": "^0.7.0",
|
|
94
|
+
"@nuxt/test-utils": "3.13.1",
|
|
95
|
+
"@types/semver": "^7.5.8",
|
|
96
|
+
"@unhead/schema": "^1.9.12",
|
|
80
97
|
"acorn-loose": "^8.4.0",
|
|
81
98
|
"bumpp": "^9.4.1",
|
|
82
|
-
"
|
|
99
|
+
"changelogen": "^0.5.5",
|
|
100
|
+
"eslint": "9.3.0",
|
|
83
101
|
"nuxt": "^3.11.2",
|
|
84
|
-
"playwright-core": "^1.44.
|
|
102
|
+
"playwright-core": "^1.44.1",
|
|
85
103
|
"typescript": "^5.4.5",
|
|
86
104
|
"vitest": "^1.6.0",
|
|
87
105
|
"vue": "^3.4.27",
|
|
@@ -93,19 +111,5 @@
|
|
|
93
111
|
"nuxt-scripts-devtools": "workspace:*",
|
|
94
112
|
"vue": "^3.4.27",
|
|
95
113
|
"vue-router": "^4.3.2"
|
|
96
|
-
},
|
|
97
|
-
"scripts": {
|
|
98
|
-
"build": "pnpm prepack",
|
|
99
|
-
"client:build": "nuxi generate client",
|
|
100
|
-
"client:dev": "nuxi dev client --port 3300",
|
|
101
|
-
"dev": "nuxi dev playground",
|
|
102
|
-
"dev:ssl": "nuxi dev playground --https",
|
|
103
|
-
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
104
|
-
"typecheck": "pnpm dlx vue-tsc --noEmit",
|
|
105
|
-
"release": "pnpm build && bumpp && pnpm publish --no-git-checks",
|
|
106
|
-
"lint": "eslint .",
|
|
107
|
-
"lint:fix": "eslint . --fix",
|
|
108
|
-
"test": "vitest",
|
|
109
|
-
"test:types": "npx nuxi typecheck"
|
|
110
114
|
}
|
|
111
|
-
}
|
|
115
|
+
}
|