@nuxt/scripts 1.0.0-beta.3 → 1.0.0-beta.30
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 +3 -3
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/{Ds2G8aQM.js → AwAKM0sG.js} +1 -1
- package/dist/client/_nuxt/Bl23o3st.js +162 -0
- package/dist/client/_nuxt/{DdVDSbUA.js → CYlYSSNW.js} +1 -1
- package/dist/client/_nuxt/{CD5B-xvT.js → D5FIkDae.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/f0b4dd20-8496-4003-b7a3-05cbae515923.json +1 -0
- package/dist/client/_nuxt/entry.C5SUNdim.css +1 -0
- package/dist/client/_nuxt/error-404.1K8v8Su2.css +1 -0
- package/dist/client/_nuxt/error-500.B9qvKpQm.css +1 -0
- package/dist/client/index.html +1 -1
- package/dist/module.d.mts +7 -19
- package/dist/module.d.ts +164 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +935 -645
- package/dist/registry.d.ts +6 -0
- package/dist/registry.mjs +235 -69
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +16 -9
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +57 -30
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +16 -9
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.d.vue.ts +22 -39
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +69 -72
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue.d.ts +22 -39
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.d.vue.ts +5 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue +25 -38
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue.d.ts +5 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.d.vue.ts +43 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.vue +61 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.vue.d.ts +43 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.d.vue.ts +4 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue +22 -26
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue.d.ts +4 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.d.vue.ts +9 -5
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue +62 -53
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue.d.ts +9 -5
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.d.vue.ts +26 -11
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue +48 -45
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue.d.ts +26 -11
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +10 -2
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +38 -37
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +10 -2
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.d.vue.ts +63 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue +160 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue.d.ts +63 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.d.vue.ts +4 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue +23 -32
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue.d.ts +4 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.d.vue.ts +7 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue +24 -38
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue.d.ts +7 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.d.vue.ts +7 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue +24 -38
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue.d.ts +7 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.d.vue.ts +7 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue +25 -38
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue.d.ts +7 -3
- package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.d.ts +13 -0
- package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.js +8 -0
- package/dist/runtime/components/GoogleMaps/injectionKeys.d.ts +13 -0
- package/dist/runtime/components/GoogleMaps/injectionKeys.js +3 -0
- package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.d.ts +26 -0
- package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.js +42 -0
- package/dist/runtime/components/ScriptBlueskyEmbed.d.vue.ts +87 -0
- package/dist/runtime/components/ScriptBlueskyEmbed.vue +85 -0
- package/dist/runtime/components/ScriptBlueskyEmbed.vue.d.ts +87 -0
- package/dist/runtime/components/ScriptCrisp.vue +1 -1
- package/dist/runtime/components/ScriptGoogleAdsense.vue +1 -1
- package/dist/runtime/components/ScriptGravatar.d.vue.ts +22 -0
- package/dist/runtime/components/ScriptGravatar.vue +46 -0
- package/dist/runtime/components/ScriptGravatar.vue.d.ts +22 -0
- package/dist/runtime/components/ScriptInstagramEmbed.d.vue.ts +2 -2
- package/dist/runtime/components/ScriptInstagramEmbed.vue +5 -2
- package/dist/runtime/components/ScriptInstagramEmbed.vue.d.ts +2 -2
- package/dist/runtime/components/ScriptIntercom.vue +4 -3
- package/dist/runtime/components/ScriptPayPalButtons.d.vue.ts +43 -32
- package/dist/runtime/components/ScriptPayPalButtons.vue +48 -79
- package/dist/runtime/components/ScriptPayPalButtons.vue.d.ts +43 -32
- package/dist/runtime/components/ScriptPayPalMessages.d.vue.ts +37 -23
- package/dist/runtime/components/ScriptPayPalMessages.vue +46 -50
- package/dist/runtime/components/ScriptPayPalMessages.vue.d.ts +37 -23
- package/dist/runtime/components/ScriptStripePricingTable.vue +2 -2
- package/dist/runtime/components/ScriptVimeoPlayer.d.vue.ts +9 -0
- package/dist/runtime/components/ScriptVimeoPlayer.vue +13 -10
- package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +9 -0
- package/dist/runtime/components/ScriptXEmbed.d.vue.ts +2 -2
- package/dist/runtime/components/ScriptXEmbed.vue +6 -3
- package/dist/runtime/components/ScriptXEmbed.vue.d.ts +2 -2
- package/dist/runtime/components/ScriptYouTubePlayer.d.vue.ts +2 -2
- package/dist/runtime/components/ScriptYouTubePlayer.vue +11 -5
- package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +2 -2
- package/dist/runtime/composables/useScript.js +13 -6
- package/dist/runtime/composables/useScriptEventPage.js +2 -2
- package/dist/runtime/composables/useScriptTriggerConsent.d.ts +10 -0
- package/dist/runtime/composables/useScriptTriggerConsent.js +33 -20
- package/dist/runtime/composables/useScriptTriggerElement.js +1 -1
- package/dist/runtime/composables/useScriptTriggerIdleTimeout.js +1 -1
- package/dist/runtime/registry/bing-uet.d.ts +20 -0
- package/dist/runtime/registry/bing-uet.js +29 -0
- package/dist/runtime/registry/bluesky-embed.d.ts +116 -0
- package/dist/runtime/registry/bluesky-embed.js +72 -0
- package/dist/runtime/registry/clarity.d.ts +10 -15
- package/dist/runtime/registry/clarity.js +22 -31
- package/dist/runtime/registry/cloudflare-web-analytics.d.ts +2 -13
- package/dist/runtime/registry/cloudflare-web-analytics.js +2 -14
- package/dist/runtime/registry/crisp.d.ts +10 -40
- package/dist/runtime/registry/crisp.js +2 -33
- package/dist/runtime/registry/databuddy-analytics.d.ts +2 -35
- package/dist/runtime/registry/databuddy-analytics.js +20 -45
- package/dist/runtime/registry/fathom-analytics.d.ts +7 -26
- package/dist/runtime/registry/fathom-analytics.js +2 -24
- package/dist/runtime/registry/google-adsense.d.ts +3 -11
- package/dist/runtime/registry/google-adsense.js +2 -11
- package/dist/runtime/registry/google-analytics.d.ts +3 -5
- package/dist/runtime/registry/google-analytics.js +3 -8
- package/dist/runtime/registry/google-maps.d.ts +3 -9
- package/dist/runtime/registry/google-maps.js +2 -8
- package/dist/runtime/registry/google-recaptcha.d.ts +2 -6
- package/dist/runtime/registry/google-recaptcha.js +4 -12
- package/dist/runtime/registry/google-sign-in.d.ts +2 -13
- package/dist/runtime/registry/google-sign-in.js +2 -22
- package/dist/runtime/registry/google-tag-manager.d.ts +3 -28
- package/dist/runtime/registry/google-tag-manager.js +4 -27
- package/dist/runtime/registry/gravatar.d.ts +26 -0
- package/dist/runtime/registry/gravatar.js +33 -0
- package/dist/runtime/registry/hotjar.d.ts +4 -6
- package/dist/runtime/registry/hotjar.js +2 -5
- package/dist/runtime/registry/instagram-embed.d.ts +3 -18
- package/dist/runtime/registry/instagram-embed.js +4 -19
- package/dist/runtime/registry/intercom.d.ts +4 -12
- package/dist/runtime/registry/intercom.js +2 -12
- package/dist/runtime/registry/matomo-analytics.d.ts +3 -12
- package/dist/runtime/registry/matomo-analytics.js +3 -12
- package/dist/runtime/registry/meta-pixel.d.ts +4 -6
- package/dist/runtime/registry/meta-pixel.js +2 -4
- package/dist/runtime/registry/mixpanel-analytics.d.ts +22 -0
- package/dist/runtime/registry/mixpanel-analytics.js +46 -0
- package/dist/runtime/registry/npm.d.ts +3 -7
- package/dist/runtime/registry/npm.js +2 -9
- package/dist/runtime/registry/paypal.d.ts +4 -25
- package/dist/runtime/registry/paypal.js +3 -66
- package/dist/runtime/registry/plausible-analytics.js +18 -13
- package/dist/runtime/registry/posthog.d.ts +10 -12
- package/dist/runtime/registry/posthog.js +7 -14
- package/dist/runtime/registry/reddit-pixel.d.ts +5 -6
- package/dist/runtime/registry/reddit-pixel.js +2 -4
- package/dist/runtime/registry/rybbit-analytics.d.ts +2 -14
- package/dist/runtime/registry/rybbit-analytics.js +10 -20
- package/dist/runtime/registry/schemas.d.ts +982 -0
- package/dist/runtime/registry/schemas.js +937 -0
- package/dist/runtime/registry/segment.d.ts +2 -5
- package/dist/runtime/registry/segment.js +2 -5
- package/dist/runtime/registry/snapchat-pixel.d.ts +4 -33
- package/dist/runtime/registry/snapchat-pixel.js +2 -20
- package/dist/runtime/registry/stripe.d.ts +3 -4
- package/dist/runtime/registry/stripe.js +2 -4
- package/dist/runtime/registry/tiktok-pixel.d.ts +4 -7
- package/dist/runtime/registry/tiktok-pixel.js +2 -6
- package/dist/runtime/registry/umami-analytics.d.ts +2 -31
- package/dist/runtime/registry/umami-analytics.js +2 -36
- package/dist/runtime/registry/vercel-analytics.d.ts +29 -0
- package/dist/runtime/registry/vercel-analytics.js +84 -0
- package/dist/runtime/registry/vimeo-player.d.ts +2 -2
- package/dist/runtime/registry/vimeo-player.js +1 -1
- package/dist/runtime/registry/x-embed.d.ts +3 -17
- package/dist/runtime/registry/x-embed.js +3 -18
- package/dist/runtime/registry/x-pixel.d.ts +4 -7
- package/dist/runtime/registry/x-pixel.js +2 -5
- package/dist/runtime/registry/youtube-player.d.ts +7 -7
- package/dist/runtime/registry/youtube-player.js +1 -1
- package/dist/runtime/server/{sw-handler.d.ts → bluesky-embed-image.d.ts} +1 -1
- package/dist/runtime/server/bluesky-embed-image.js +7 -0
- package/dist/runtime/server/bluesky-embed.d.ts +16 -0
- package/dist/runtime/server/bluesky-embed.js +59 -0
- package/dist/runtime/server/google-maps-geocode-proxy.d.ts +2 -0
- package/dist/runtime/server/google-maps-geocode-proxy.js +34 -0
- package/dist/runtime/server/google-static-maps-proxy.js +2 -13
- package/dist/runtime/server/gravatar-proxy.d.ts +2 -0
- package/dist/runtime/server/gravatar-proxy.js +46 -0
- package/dist/runtime/server/instagram-embed-asset.js +8 -41
- package/dist/runtime/server/instagram-embed-image.js +6 -53
- package/dist/runtime/server/instagram-embed.d.ts +16 -0
- package/dist/runtime/server/instagram-embed.js +173 -35
- package/dist/runtime/server/proxy-handler.js +134 -93
- package/dist/runtime/server/utils/image-proxy.d.ts +12 -0
- package/dist/runtime/server/utils/image-proxy.js +70 -0
- package/dist/runtime/server/utils/privacy.d.ts +1 -2
- package/dist/runtime/server/utils/privacy.js +54 -34
- package/dist/runtime/server/x-embed-image.js +5 -49
- package/dist/runtime/server/x-embed.js +3 -2
- package/dist/runtime/types.d.ts +74 -40
- package/dist/runtime/utils/pure.d.ts +1 -5
- package/dist/runtime/utils/pure.js +0 -67
- package/dist/runtime/utils.d.ts +4 -3
- package/dist/runtime/utils.js +24 -10
- package/dist/shared/scripts.ViOoYQXH.mjs +381 -0
- package/dist/stats.d.mts +202 -0
- package/dist/stats.d.ts +202 -0
- package/dist/stats.mjs +3868 -0
- package/dist/types-source.d.mts +17 -0
- package/dist/types-source.d.ts +17 -0
- package/dist/types-source.mjs +3600 -0
- package/package.json +52 -38
- package/dist/client/_nuxt/D-kOnTuH.js +0 -162
- package/dist/client/_nuxt/builds/meta/f1474569-6922-450d-bc3f-4fd5f3e1391a.json +0 -1
- package/dist/client/_nuxt/entry.D45OuV0w.css +0 -1
- package/dist/client/_nuxt/error-404.B57D-jUQ.css +0 -1
- package/dist/client/_nuxt/error-500.DTHUW7BI.css +0 -1
- package/dist/runtime/components/ScriptPayPalMarks.d.vue.ts +0 -52
- package/dist/runtime/components/ScriptPayPalMarks.vue +0 -69
- package/dist/runtime/components/ScriptPayPalMarks.vue.d.ts +0 -52
- package/dist/runtime/plugins/sw-register.client.d.ts +0 -2
- package/dist/runtime/plugins/sw-register.client.js +0 -12
- package/dist/runtime/server/sw-handler.js +0 -25
- package/dist/runtime/sw/proxy-sw.template.d.ts +0 -1
- package/dist/runtime/sw/proxy-sw.template.js +0 -54
|
@@ -1,53 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const query = getQuery(event);
|
|
5
|
-
const url = query.url;
|
|
6
|
-
if (!url) {
|
|
7
|
-
throw createError({
|
|
8
|
-
statusCode: 400,
|
|
9
|
-
statusMessage: "Image URL is required"
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
let parsedUrl;
|
|
13
|
-
try {
|
|
14
|
-
parsedUrl = new URL(url);
|
|
15
|
-
} catch {
|
|
16
|
-
throw createError({
|
|
17
|
-
statusCode: 400,
|
|
18
|
-
statusMessage: "Invalid image URL"
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
if (parsedUrl.protocol !== "http:" && parsedUrl.protocol !== "https:") {
|
|
22
|
-
throw createError({
|
|
23
|
-
statusCode: 400,
|
|
24
|
-
statusMessage: "Invalid URL scheme"
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
const allowedDomains = [
|
|
1
|
+
import { createImageProxyHandler } from "./utils/image-proxy.js";
|
|
2
|
+
export default createImageProxyHandler({
|
|
3
|
+
allowedDomains: [
|
|
28
4
|
"pbs.twimg.com",
|
|
29
5
|
"abs.twimg.com",
|
|
30
6
|
"video.twimg.com"
|
|
31
|
-
]
|
|
32
|
-
|
|
33
|
-
throw createError({
|
|
34
|
-
statusCode: 403,
|
|
35
|
-
statusMessage: "Domain not allowed"
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
const response = await $fetch.raw(url, {
|
|
39
|
-
timeout: 5e3,
|
|
40
|
-
headers: {
|
|
41
|
-
"Accept": "image/webp,image/jpeg,image/png,image/*,*/*;q=0.8",
|
|
42
|
-
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36"
|
|
43
|
-
}
|
|
44
|
-
}).catch((error) => {
|
|
45
|
-
throw createError({
|
|
46
|
-
statusCode: error.statusCode || 500,
|
|
47
|
-
statusMessage: error.statusMessage || "Failed to fetch image"
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
setHeader(event, "Content-Type", response.headers.get("content-type") || "image/jpeg");
|
|
51
|
-
setHeader(event, "Cache-Control", "public, max-age=3600, s-maxage=3600");
|
|
52
|
-
return response._data;
|
|
7
|
+
],
|
|
8
|
+
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36"
|
|
53
9
|
});
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { createError, defineEventHandler, getQuery, setHeader } from "h3";
|
|
2
2
|
import { $fetch } from "ofetch";
|
|
3
|
+
const TWEET_ID_RE = /^\d+$/;
|
|
3
4
|
export default defineEventHandler(async (event) => {
|
|
4
5
|
const query = getQuery(event);
|
|
5
6
|
const tweetId = query.id;
|
|
6
|
-
if (!tweetId ||
|
|
7
|
+
if (!tweetId || !TWEET_ID_RE.test(tweetId)) {
|
|
7
8
|
throw createError({
|
|
8
9
|
statusCode: 400,
|
|
9
10
|
statusMessage: "Valid Tweet ID is required"
|
|
10
11
|
});
|
|
11
12
|
}
|
|
12
|
-
const randomToken =
|
|
13
|
+
const randomToken = Array.from(Array.from({ length: 11 }), () => (Math.random() * 36).toString(36)[2]).join("");
|
|
13
14
|
const params = new URLSearchParams({ id: tweetId, token: randomToken });
|
|
14
15
|
const tweetData = await $fetch(
|
|
15
16
|
`https://cdn.syndication.twimg.com/tweet-result?${params.toString()}`,
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -1,37 +1,45 @@
|
|
|
1
|
+
import type { UseScriptInput, UseScriptOptions, VueScriptInstance } from '@unhead/vue';
|
|
1
2
|
import type { Script } from '@unhead/vue/types';
|
|
2
|
-
import type { UseScriptInput, VueScriptInstance, UseScriptOptions } from '@unhead/vue';
|
|
3
|
-
import type { ComputedRef, Ref } from 'vue';
|
|
4
|
-
import type { InferInput, ObjectSchema, ValiError } from 'valibot';
|
|
5
3
|
import type { Import } from 'unimport';
|
|
6
|
-
import type {
|
|
4
|
+
import type { InferInput, ObjectSchema, UnionSchema, ValiError } from 'valibot';
|
|
5
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
6
|
+
import type { BingUetInput } from './registry/bing-uet.js';
|
|
7
|
+
import type { BlueskyEmbedInput } from './registry/bluesky-embed.js';
|
|
8
|
+
import type { ClarityInput } from './registry/clarity.js';
|
|
7
9
|
import type { CloudflareWebAnalyticsInput } from './registry/cloudflare-web-analytics.js';
|
|
10
|
+
import type { CrispInput } from './registry/crisp.js';
|
|
8
11
|
import type { DatabuddyAnalyticsInput } from './registry/databuddy-analytics.js';
|
|
9
|
-
import type { MetaPixelInput } from './registry/meta-pixel.js';
|
|
10
12
|
import type { FathomAnalyticsInput } from './registry/fathom-analytics.js';
|
|
13
|
+
import type { GoogleAdsenseInput } from './registry/google-adsense.js';
|
|
14
|
+
import type { GoogleAnalyticsInput } from './registry/google-analytics.js';
|
|
15
|
+
import type { GoogleMapsInput } from './registry/google-maps.js';
|
|
16
|
+
import type { GoogleRecaptchaInput } from './registry/google-recaptcha.js';
|
|
17
|
+
import type { GoogleSignInInput } from './registry/google-sign-in.js';
|
|
18
|
+
import type { GoogleTagManagerInput } from './registry/google-tag-manager.js';
|
|
19
|
+
import type { GravatarInput } from './registry/gravatar.js';
|
|
11
20
|
import type { HotjarInput } from './registry/hotjar.js';
|
|
21
|
+
import type { InstagramEmbedInput } from './registry/instagram-embed.js';
|
|
12
22
|
import type { IntercomInput } from './registry/intercom.js';
|
|
13
|
-
import type {
|
|
23
|
+
import type { LemonSqueezyInput } from './registry/lemon-squeezy.js';
|
|
14
24
|
import type { MatomoAnalyticsInput } from './registry/matomo-analytics.js';
|
|
15
|
-
import type {
|
|
16
|
-
import type {
|
|
17
|
-
import type { XPixelInput } from './registry/x-pixel.js';
|
|
18
|
-
import type { SnapTrPixelInput } from './registry/snapchat-pixel.js';
|
|
19
|
-
import type { YouTubePlayerInput } from './registry/youtube-player.js';
|
|
20
|
-
import type { PlausibleAnalyticsInput } from './registry/plausible-analytics.js';
|
|
25
|
+
import type { MetaPixelInput } from './registry/meta-pixel.js';
|
|
26
|
+
import type { MixpanelAnalyticsInput } from './registry/mixpanel-analytics.js';
|
|
21
27
|
import type { NpmInput } from './registry/npm.js';
|
|
22
|
-
import type { LemonSqueezyInput } from './registry/lemon-squeezy.js';
|
|
23
|
-
import type { GoogleAdsenseInput } from './registry/google-adsense.js';
|
|
24
|
-
import type { ClarityInput } from './registry/clarity.js';
|
|
25
|
-
import type { CrispInput } from './registry/crisp.js';
|
|
26
|
-
import type { GoogleAnalyticsInput } from './registry/google-analytics.js';
|
|
27
|
-
import type { GoogleTagManagerInput } from './registry/google-tag-manager.js';
|
|
28
|
-
import type { UmamiAnalyticsInput } from './registry/umami-analytics.js';
|
|
29
|
-
import type { RybbitAnalyticsInput } from './registry/rybbit-analytics.js';
|
|
30
|
-
import type { RedditPixelInput } from './registry/reddit-pixel.js';
|
|
31
28
|
import type { PayPalInput } from './registry/paypal.js';
|
|
29
|
+
import type { PlausibleAnalyticsInput } from './registry/plausible-analytics.js';
|
|
32
30
|
import type { PostHogInput } from './registry/posthog.js';
|
|
33
|
-
import type {
|
|
31
|
+
import type { RedditPixelInput } from './registry/reddit-pixel.js';
|
|
32
|
+
import type { RybbitAnalyticsInput } from './registry/rybbit-analytics.js';
|
|
33
|
+
import type { SegmentInput } from './registry/segment.js';
|
|
34
|
+
import type { SnapTrPixelInput } from './registry/snapchat-pixel.js';
|
|
35
|
+
import type { StripeInput } from './registry/stripe.js';
|
|
34
36
|
import type { TikTokPixelInput } from './registry/tiktok-pixel.js';
|
|
37
|
+
import type { UmamiAnalyticsInput } from './registry/umami-analytics.js';
|
|
38
|
+
import type { VercelAnalyticsInput } from './registry/vercel-analytics.js';
|
|
39
|
+
import type { VimeoPlayerInput } from './registry/vimeo-player.js';
|
|
40
|
+
import type { XEmbedInput } from './registry/x-embed.js';
|
|
41
|
+
import type { XPixelInput } from './registry/x-pixel.js';
|
|
42
|
+
import type { YouTubePlayerInput } from './registry/youtube-player.js';
|
|
35
43
|
export type WarmupStrategy = false | 'preload' | 'preconnect' | 'dns-prefetch';
|
|
36
44
|
export type UseScriptContext<T extends Record<symbol | string, any>> = VueScriptInstance<T> & {
|
|
37
45
|
/**
|
|
@@ -152,17 +160,22 @@ export interface NuxtDevToolsScriptInstance {
|
|
|
152
160
|
}[];
|
|
153
161
|
}
|
|
154
162
|
export interface ScriptRegistry {
|
|
163
|
+
bingUet?: BingUetInput;
|
|
164
|
+
blueskyEmbed?: BlueskyEmbedInput;
|
|
165
|
+
carbonAds?: true;
|
|
155
166
|
crisp?: CrispInput;
|
|
156
167
|
clarity?: ClarityInput;
|
|
157
168
|
cloudflareWebAnalytics?: CloudflareWebAnalyticsInput;
|
|
158
169
|
databuddyAnalytics?: DatabuddyAnalyticsInput;
|
|
159
170
|
metaPixel?: MetaPixelInput;
|
|
160
171
|
fathomAnalytics?: FathomAnalyticsInput;
|
|
172
|
+
instagramEmbed?: InstagramEmbedInput;
|
|
161
173
|
plausibleAnalytics?: PlausibleAnalyticsInput;
|
|
162
174
|
googleAdsense?: GoogleAdsenseInput;
|
|
163
175
|
googleAnalytics?: GoogleAnalyticsInput;
|
|
164
176
|
googleMaps?: GoogleMapsInput;
|
|
165
177
|
googleRecaptcha?: GoogleRecaptchaInput;
|
|
178
|
+
googleSignIn?: GoogleSignInInput;
|
|
166
179
|
lemonSqueezy?: LemonSqueezyInput;
|
|
167
180
|
googleTagManager?: GoogleTagManagerInput;
|
|
168
181
|
hotjar?: HotjarInput;
|
|
@@ -170,58 +183,75 @@ export interface ScriptRegistry {
|
|
|
170
183
|
paypal?: PayPalInput;
|
|
171
184
|
posthog?: PostHogInput;
|
|
172
185
|
matomoAnalytics?: MatomoAnalyticsInput;
|
|
186
|
+
mixpanelAnalytics?: MixpanelAnalyticsInput;
|
|
173
187
|
rybbitAnalytics?: RybbitAnalyticsInput;
|
|
174
188
|
redditPixel?: RedditPixelInput;
|
|
175
189
|
segment?: SegmentInput;
|
|
176
190
|
stripe?: StripeInput;
|
|
177
191
|
tiktokPixel?: TikTokPixelInput;
|
|
192
|
+
xEmbed?: XEmbedInput;
|
|
178
193
|
xPixel?: XPixelInput;
|
|
179
194
|
snapchatPixel?: SnapTrPixelInput;
|
|
180
195
|
youtubePlayer?: YouTubePlayerInput;
|
|
196
|
+
vercelAnalytics?: VercelAnalyticsInput;
|
|
181
197
|
vimeoPlayer?: VimeoPlayerInput;
|
|
182
198
|
umamiAnalytics?: UmamiAnalyticsInput;
|
|
199
|
+
gravatar?: GravatarInput;
|
|
200
|
+
npm?: NpmInput;
|
|
183
201
|
[key: `${string}-npm`]: NpmInput;
|
|
184
202
|
}
|
|
185
|
-
|
|
203
|
+
/**
|
|
204
|
+
* Built-in registry script keys — not affected by module augmentation.
|
|
205
|
+
* Use this to type-check records that must enumerate all built-in scripts (logos, meta, etc.).
|
|
206
|
+
*/
|
|
207
|
+
export type BuiltInRegistryScriptKey = 'bingUet' | 'blueskyEmbed' | 'carbonAds' | 'crisp' | 'clarity' | 'cloudflareWebAnalytics' | 'databuddyAnalytics' | 'metaPixel' | 'fathomAnalytics' | 'instagramEmbed' | 'plausibleAnalytics' | 'googleAdsense' | 'googleAnalytics' | 'googleMaps' | 'googleRecaptcha' | 'googleSignIn' | 'lemonSqueezy' | 'googleTagManager' | 'hotjar' | 'intercom' | 'paypal' | 'posthog' | 'matomoAnalytics' | 'mixpanelAnalytics' | 'rybbitAnalytics' | 'redditPixel' | 'segment' | 'stripe' | 'tiktokPixel' | 'xEmbed' | 'xPixel' | 'snapchatPixel' | 'youtubePlayer' | 'vercelAnalytics' | 'vimeoPlayer' | 'umamiAnalytics' | 'gravatar' | 'npm';
|
|
208
|
+
/**
|
|
209
|
+
* Union of all explicit registry script keys (excludes npm pattern).
|
|
210
|
+
* Includes both built-in and augmented keys.
|
|
211
|
+
*/
|
|
212
|
+
export type RegistryScriptKey = Exclude<keyof ScriptRegistry, `${string}-npm`>;
|
|
213
|
+
export type NuxtConfigScriptRegistryEntry<T> = true | false | 'mock' | T | [T, NuxtUseScriptOptionsSerializable];
|
|
186
214
|
export type NuxtConfigScriptRegistry<T extends keyof ScriptRegistry = keyof ScriptRegistry> = Partial<{
|
|
187
215
|
[key in T]: NuxtConfigScriptRegistryEntry<ScriptRegistry[key]>;
|
|
188
|
-
}
|
|
216
|
+
}> & Record<string & {}, NuxtConfigScriptRegistryEntry<any>>;
|
|
189
217
|
export type UseFunctionType<T, U> = T extends {
|
|
190
218
|
use: infer V;
|
|
191
219
|
} ? V extends (...args: any) => any ? ReturnType<V> : U : U;
|
|
192
220
|
declare const _emptyOptions: ObjectSchema<{}, undefined>;
|
|
193
221
|
export type EmptyOptionsSchema = typeof _emptyOptions;
|
|
194
222
|
type ScriptInput = Script;
|
|
195
|
-
export type InferIfSchema<T> = T extends ObjectSchema<any, any> ? InferInput<T> : T;
|
|
196
|
-
export
|
|
223
|
+
export type InferIfSchema<T> = T extends ObjectSchema<any, any> | UnionSchema<any, any> ? InferInput<T> : T;
|
|
224
|
+
export interface RegistryScriptInputExtras<Bundelable extends boolean = true, Usable extends boolean = false> {
|
|
197
225
|
/**
|
|
198
226
|
* A unique key to use for the script, this can be used to load multiple of the same script with different options.
|
|
199
227
|
*/
|
|
200
228
|
key?: string;
|
|
201
229
|
scriptInput?: ScriptInput;
|
|
202
230
|
scriptOptions?: Omit<NuxtUseScriptOptions, Bundelable extends true ? '' : 'bundle' | Usable extends true ? '' : 'use'>;
|
|
203
|
-
}
|
|
231
|
+
}
|
|
232
|
+
export type RegistryScriptInput<T = EmptyOptionsSchema, Bundelable extends boolean = true, Usable extends boolean = false> = Partial<InferIfSchema<T>> & RegistryScriptInputExtras<Bundelable, Usable>;
|
|
233
|
+
export interface RegistryScriptServerHandler {
|
|
234
|
+
route: string;
|
|
235
|
+
handler: string;
|
|
236
|
+
middleware?: boolean;
|
|
237
|
+
}
|
|
238
|
+
export interface RegistryScript {
|
|
204
239
|
/**
|
|
205
|
-
*
|
|
240
|
+
* The config key used in `scripts.registry` in nuxt.config (e.g., 'googleAnalytics', 'plausibleAnalytics').
|
|
241
|
+
* Used for direct lookup from config to script — avoids fragile import name convention matching.
|
|
206
242
|
*/
|
|
207
|
-
|
|
208
|
-
scriptInput: Required<Pick<ScriptInput, 'src'>> & ScriptInput;
|
|
209
|
-
scriptOptions?: Omit<NuxtUseScriptOptions, Bundelable extends true ? '' : 'bundle' | Usable extends true ? '' : 'use'>;
|
|
210
|
-
} : never);
|
|
211
|
-
export interface RegistryScript {
|
|
243
|
+
registryKey?: RegistryScriptKey;
|
|
212
244
|
import?: Import;
|
|
213
245
|
scriptBundling?: false | ((options?: any) => string | false);
|
|
214
246
|
/**
|
|
215
|
-
* First-party
|
|
216
|
-
*
|
|
217
|
-
* - `false` - Explicitly disable first-party routing for this script
|
|
218
|
-
* - `undefined` - Use the default key derived from the function name
|
|
247
|
+
* First-party proxy config alias. Only needed when a script shares another script's
|
|
248
|
+
* proxy config (e.g., googleAdsense uses `proxy: 'googleAnalytics'`).
|
|
219
249
|
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
250
|
+
* By default, the proxy config is looked up by `registryKey`. Set to `false` to
|
|
251
|
+
* explicitly disable first-party routing for this script.
|
|
222
252
|
* @internal
|
|
223
253
|
*/
|
|
224
|
-
proxy?:
|
|
254
|
+
proxy?: RegistryScriptKey | false;
|
|
225
255
|
label?: string;
|
|
226
256
|
src?: string | false;
|
|
227
257
|
category?: string;
|
|
@@ -229,6 +259,10 @@ export interface RegistryScript {
|
|
|
229
259
|
light: string;
|
|
230
260
|
dark: string;
|
|
231
261
|
};
|
|
262
|
+
/**
|
|
263
|
+
* Server handlers (routes/middleware) to register when this script is enabled via registry config.
|
|
264
|
+
*/
|
|
265
|
+
serverHandlers?: RegistryScriptServerHandler[];
|
|
232
266
|
}
|
|
233
267
|
export type ElementScriptTrigger = 'immediate' | 'visible' | string | string[] | false;
|
|
234
268
|
export type RegistryScripts = RegistryScript[];
|
|
@@ -4,10 +4,6 @@
|
|
|
4
4
|
export interface ProxyRewrite {
|
|
5
5
|
/** Domain and path to match (e.g., 'www.google-analytics.com/g/collect') */
|
|
6
6
|
from: string;
|
|
7
|
-
/** Local path to rewrite to (e.g., '/_scripts/
|
|
7
|
+
/** Local path to rewrite to (e.g., '/_scripts/p/ga/g/collect') */
|
|
8
8
|
to: string;
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
* Rewrite URLs in script content based on proxy config.
|
|
12
|
-
*/
|
|
13
|
-
export declare function rewriteScriptUrls(content: string, rewrites: ProxyRewrite[]): string;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { parseURL, joinURL } from "ufo";
|
|
2
|
-
export function rewriteScriptUrls(content, rewrites) {
|
|
3
|
-
let result = content;
|
|
4
|
-
const literalRegex = /(['"`])(.*?)\1/g;
|
|
5
|
-
for (const { from, to } of rewrites) {
|
|
6
|
-
const isSuffixMatch = from.startsWith(".");
|
|
7
|
-
const fromSlashIdx = from.indexOf("/");
|
|
8
|
-
const fromHost = fromSlashIdx > 0 ? from.slice(0, fromSlashIdx) : from;
|
|
9
|
-
const fromPath = fromSlashIdx > 0 ? from.slice(fromSlashIdx) : "";
|
|
10
|
-
result = result.replace(literalRegex, (match, quote, inner) => {
|
|
11
|
-
if (!inner.includes(fromHost)) return match;
|
|
12
|
-
const url = parseURL(inner);
|
|
13
|
-
let shouldRewrite = false;
|
|
14
|
-
let rewriteSuffix = "";
|
|
15
|
-
if (url.host) {
|
|
16
|
-
const hostMatches = isSuffixMatch ? url.host.endsWith(fromHost) : url.host === fromHost;
|
|
17
|
-
if (hostMatches) {
|
|
18
|
-
const fullPath = url.pathname + (url.search || "") + (url.hash || "");
|
|
19
|
-
if (fromPath && fullPath.startsWith(fromPath)) {
|
|
20
|
-
shouldRewrite = true;
|
|
21
|
-
rewriteSuffix = fullPath.slice(fromPath.length);
|
|
22
|
-
} else if (!fromPath) {
|
|
23
|
-
shouldRewrite = true;
|
|
24
|
-
rewriteSuffix = fullPath;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
} else if (inner.startsWith("//")) {
|
|
28
|
-
const hostPart = inner.slice(2).split("/")[0];
|
|
29
|
-
const hostMatches = isSuffixMatch ? hostPart?.endsWith(fromHost) ?? false : hostPart === fromHost;
|
|
30
|
-
if (hostMatches) {
|
|
31
|
-
const remainder = inner.slice(2 + (hostPart?.length ?? 0));
|
|
32
|
-
if (fromPath && remainder.startsWith(fromPath)) {
|
|
33
|
-
shouldRewrite = true;
|
|
34
|
-
rewriteSuffix = remainder.slice(fromPath.length);
|
|
35
|
-
} else if (!fromPath) {
|
|
36
|
-
shouldRewrite = true;
|
|
37
|
-
rewriteSuffix = remainder;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
} else if (fromPath && (inner.startsWith(from) || isSuffixMatch && inner.includes(from))) {
|
|
41
|
-
const domainEnd = inner.indexOf(from) + from.length;
|
|
42
|
-
const nextChar = inner[domainEnd];
|
|
43
|
-
if (!nextChar || nextChar === "/" || nextChar === "?" || nextChar === "#") {
|
|
44
|
-
shouldRewrite = true;
|
|
45
|
-
rewriteSuffix = inner.slice(domainEnd);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
if (shouldRewrite) {
|
|
49
|
-
const rewritten = rewriteSuffix === "/" || rewriteSuffix.startsWith("?") || rewriteSuffix.startsWith("#") ? to + rewriteSuffix : joinURL(to, rewriteSuffix);
|
|
50
|
-
return quote + rewritten + quote;
|
|
51
|
-
}
|
|
52
|
-
return match;
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
const gaRewrite = rewrites.find((r) => r.from.includes("google-analytics.com/g/collect"));
|
|
56
|
-
if (gaRewrite) {
|
|
57
|
-
result = result.replace(
|
|
58
|
-
/"https:\/\/"\+\(.*?\)\+"\.google-analytics\.com\/g\/collect"/g,
|
|
59
|
-
`"${gaRewrite.to}"`
|
|
60
|
-
);
|
|
61
|
-
result = result.replace(
|
|
62
|
-
/"https:\/\/"\+\(.*?\)\+"\.analytics\.google\.com\/g\/collect"/g,
|
|
63
|
-
`"${gaRewrite.to}"`
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
return result;
|
|
67
|
-
}
|
package/dist/runtime/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EmptyOptionsSchema, InferIfSchema, NuxtUseScriptOptions, RegistryScriptInput, ScriptRegistry, UseFunctionType, UseScriptContext } from '#nuxt-scripts/types';
|
|
2
2
|
import type { UseScriptInput } from '@unhead/vue';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ObjectSchema, UnionSchema } from 'valibot';
|
|
4
4
|
export type MaybePromise<T> = Promise<T> | T;
|
|
5
5
|
type OptionsFn<O> = (options: InferIfSchema<O>, ctx: {
|
|
6
6
|
scriptInput?: UseScriptInput & {
|
|
@@ -9,10 +9,11 @@ type OptionsFn<O> = (options: InferIfSchema<O>, ctx: {
|
|
|
9
9
|
}) => ({
|
|
10
10
|
scriptInput?: UseScriptInput;
|
|
11
11
|
scriptOptions?: NuxtUseScriptOptions;
|
|
12
|
-
schema?: O extends ObjectSchema<any, any> ? O : undefined;
|
|
12
|
+
schema?: O extends ObjectSchema<any, any> | UnionSchema<any, any> ? O : undefined;
|
|
13
13
|
clientInit?: () => void | Promise<any>;
|
|
14
14
|
scriptMode?: 'external' | 'npm';
|
|
15
15
|
});
|
|
16
16
|
export declare function scriptRuntimeConfig<T extends keyof ScriptRegistry>(key: T): ScriptRegistry[T];
|
|
17
|
+
export declare function requireRegistryEndpoint(componentName: string, registryKey: string): void;
|
|
17
18
|
export declare function useRegistryScript<T extends Record<string | symbol, any>, O = EmptyOptionsSchema>(registryKey: keyof ScriptRegistry | string, optionsFn: OptionsFn<O>, _userOptions?: RegistryScriptInput<O>): UseScriptContext<UseFunctionType<NuxtUseScriptOptions<T>, T>>;
|
|
18
19
|
export * from './utils/pure.js';
|
package/dist/runtime/utils.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { parse } from "#nuxt-scripts-validator";
|
|
1
2
|
import { defu } from "defu";
|
|
2
|
-
import { useRuntimeConfig } from "nuxt/app";
|
|
3
|
-
import { parseURL, withQuery
|
|
3
|
+
import { createError, useRuntimeConfig } from "nuxt/app";
|
|
4
|
+
import { parseQuery, parseURL, withQuery } from "ufo";
|
|
4
5
|
import { useScript } from "./composables/useScript.js";
|
|
5
6
|
import { createNpmScriptStub } from "./npm-script-stub.js";
|
|
6
|
-
|
|
7
|
+
const URL_MATCH_RE = /https?:\/\/[^/]+\/_nuxt\/(.+\.vue)(?:\?[^)]*)?:(\d+):(\d+)/;
|
|
8
|
+
const URL_PAREN_MATCH_RE = /\(https?:\/\/[^/]+\/_nuxt\/(.+\.vue)(?:\?[^)]*)?:(\d+):(\d+)\)/;
|
|
9
|
+
const VUE_MATCH_RE = /([^/\s]+\.vue):(\d+):(\d+)/;
|
|
10
|
+
const CLEAN_CALLER_RE = /^\s*at\s+/;
|
|
7
11
|
function validateScriptInputSchema(key, schema, options) {
|
|
8
12
|
if (import.meta.dev) {
|
|
9
13
|
try {
|
|
@@ -17,9 +21,18 @@ function validateScriptInputSchema(key, schema, options) {
|
|
|
17
21
|
export function scriptRuntimeConfig(key) {
|
|
18
22
|
return (useRuntimeConfig().public.scripts || {})[key];
|
|
19
23
|
}
|
|
24
|
+
export function requireRegistryEndpoint(componentName, registryKey) {
|
|
25
|
+
const endpoints = useRuntimeConfig().public["nuxt-scripts"]?.endpoints;
|
|
26
|
+
if (!endpoints?.[registryKey]) {
|
|
27
|
+
throw createError({
|
|
28
|
+
message: `${componentName} requires \`scripts.registry.${registryKey}\` to be enabled in nuxt.config`,
|
|
29
|
+
fatal: import.meta.dev
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
20
33
|
export function useRegistryScript(registryKey, optionsFn, _userOptions) {
|
|
21
34
|
const scriptConfig = scriptRuntimeConfig(registryKey);
|
|
22
|
-
const userOptions =
|
|
35
|
+
const userOptions = defu(_userOptions || {}, typeof scriptConfig === "object" ? scriptConfig : {});
|
|
23
36
|
const options = optionsFn(userOptions, { scriptInput: userOptions.scriptInput });
|
|
24
37
|
if (options.scriptMode === "npm") {
|
|
25
38
|
return createNpmScriptStub({
|
|
@@ -45,7 +58,7 @@ export function useRegistryScript(registryKey, optionsFn, _userOptions) {
|
|
|
45
58
|
};
|
|
46
59
|
}
|
|
47
60
|
const scriptInput = defu(finalScriptInput, userOptions.scriptInput, { key: registryKey });
|
|
48
|
-
const scriptOptions =
|
|
61
|
+
const scriptOptions = { ...userOptions?.scriptOptions, ...options.scriptOptions };
|
|
49
62
|
if (import.meta.dev) {
|
|
50
63
|
const error = new Error("Stack trace for component location");
|
|
51
64
|
const stack = error.stack?.split("\n");
|
|
@@ -54,25 +67,26 @@ export function useRegistryScript(registryKey, optionsFn, _userOptions) {
|
|
|
54
67
|
);
|
|
55
68
|
let loadedFrom = "unknown";
|
|
56
69
|
if (callerLine) {
|
|
57
|
-
const urlMatch = callerLine.match(
|
|
70
|
+
const urlMatch = callerLine.match(URL_MATCH_RE) || callerLine.match(URL_PAREN_MATCH_RE);
|
|
58
71
|
if (urlMatch) {
|
|
59
72
|
const [, filePath, line, column] = urlMatch;
|
|
60
73
|
loadedFrom = `./${filePath}:${line}:${column}`;
|
|
61
74
|
} else {
|
|
62
|
-
const vueMatch = callerLine.match(
|
|
75
|
+
const vueMatch = callerLine.match(VUE_MATCH_RE);
|
|
63
76
|
if (vueMatch) {
|
|
64
77
|
const [, fileName, line, column] = vueMatch;
|
|
65
78
|
loadedFrom = `./${fileName}:${line}:${column}`;
|
|
66
79
|
} else {
|
|
67
|
-
loadedFrom = callerLine.trim().replace(
|
|
80
|
+
loadedFrom = callerLine.trim().replace(CLEAN_CALLER_RE, "");
|
|
68
81
|
}
|
|
69
82
|
}
|
|
70
83
|
}
|
|
71
84
|
scriptOptions.devtools = defu(scriptOptions.devtools, { registryKey, loadedFrom });
|
|
72
85
|
if (options.schema) {
|
|
73
86
|
const registryMeta = {};
|
|
74
|
-
|
|
75
|
-
|
|
87
|
+
const entries = "entries" in options.schema ? options.schema.entries : void 0;
|
|
88
|
+
for (const k in entries) {
|
|
89
|
+
if (entries[k]?.type !== "optional") {
|
|
76
90
|
registryMeta[k] = String(userOptions[k]);
|
|
77
91
|
}
|
|
78
92
|
}
|