nuxtseo-shared 5.3.7 → 5.3.8
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/i18n.mjs +11 -2
- package/dist/kit.mjs +27 -2
- package/dist/module.json +1 -1
- package/package.json +1 -1
package/dist/i18n.mjs
CHANGED
|
@@ -112,6 +112,14 @@ function resolveI18nModule() {
|
|
|
112
112
|
isMicro: found === "nuxt-i18n-micro"
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
+
function resolveI18nPages(config, isMicro) {
|
|
116
|
+
const routes = isMicro ? config.globalLocaleRoutes : config.pages;
|
|
117
|
+
if (!routes)
|
|
118
|
+
return void 0;
|
|
119
|
+
return Object.fromEntries(
|
|
120
|
+
Object.entries(routes).filter((entry) => typeof entry[1] === "object" && entry[1] !== null && !Array.isArray(entry[1]))
|
|
121
|
+
);
|
|
122
|
+
}
|
|
115
123
|
async function resolveI18nConfig(logger) {
|
|
116
124
|
const i18n = resolveI18nModule();
|
|
117
125
|
if (!i18n)
|
|
@@ -124,7 +132,8 @@ async function resolveI18nConfig(logger) {
|
|
|
124
132
|
}
|
|
125
133
|
const nuxtI18nConfig = await getNuxtModuleOptions(i18n.module) || {};
|
|
126
134
|
const normalisedLocales = normalizeLocales(nuxtI18nConfig);
|
|
127
|
-
const
|
|
135
|
+
const pages = resolveI18nPages(nuxtI18nConfig, i18n.isMicro);
|
|
136
|
+
const usingI18nPages = Object.keys(pages || {}).length;
|
|
128
137
|
const hasI18nConfigForAlternatives = nuxtI18nConfig.differentDomains || usingI18nPages || nuxtI18nConfig.strategy !== "no_prefix" && nuxtI18nConfig.locales;
|
|
129
138
|
if (!hasI18nConfigForAlternatives)
|
|
130
139
|
return false;
|
|
@@ -133,7 +142,7 @@ async function resolveI18nConfig(logger) {
|
|
|
133
142
|
defaultLocale: nuxtI18nConfig.defaultLocale,
|
|
134
143
|
locales: normalisedLocales,
|
|
135
144
|
strategy: nuxtI18nConfig.strategy,
|
|
136
|
-
pages
|
|
145
|
+
pages
|
|
137
146
|
};
|
|
138
147
|
}
|
|
139
148
|
function mergeOnKey(arr, key) {
|
package/dist/kit.mjs
CHANGED
|
@@ -35,8 +35,26 @@ const nitroV2Runtime = `export {
|
|
|
35
35
|
defineTask,
|
|
36
36
|
runTask,
|
|
37
37
|
} from 'nitropack/runtime'
|
|
38
|
+
export function fetchWithEvent(event, request, options) {
|
|
39
|
+
return event.$fetch(request, options)
|
|
40
|
+
}
|
|
38
41
|
`;
|
|
39
|
-
const
|
|
42
|
+
const nitroV2RuntimeTypes = `export {
|
|
43
|
+
defineNitroPlugin,
|
|
44
|
+
useNitroApp,
|
|
45
|
+
useEvent,
|
|
46
|
+
useRuntimeConfig,
|
|
47
|
+
defineCachedFunction,
|
|
48
|
+
defineCachedEventHandler,
|
|
49
|
+
useStorage,
|
|
50
|
+
defineTask,
|
|
51
|
+
runTask,
|
|
52
|
+
} from 'nitropack/runtime'
|
|
53
|
+
export function fetchWithEvent<T>(event: import('h3').H3Event, request: import('ofetch').FetchRequest, options?: import('ofetch').FetchOptions): Promise<T>
|
|
54
|
+
`;
|
|
55
|
+
const nitroV3Runtime = `import { createFetch } from 'ofetch'
|
|
56
|
+
import { fetchWithEvent as fetchRawWithEvent } from 'nitro/h3'
|
|
57
|
+
export { definePlugin as defineNitroPlugin } from 'nitro'
|
|
40
58
|
export { useNitroApp } from 'nitro/app'
|
|
41
59
|
export { useRequest as useEvent } from 'nitro/context'
|
|
42
60
|
import { useRuntimeConfig as _useRuntimeConfig } from 'nitro/runtime-config'
|
|
@@ -44,6 +62,12 @@ export function useRuntimeConfig(_event) { return _useRuntimeConfig() }
|
|
|
44
62
|
export { defineCachedFunction, defineCachedHandler as defineCachedEventHandler } from 'nitro/cache'
|
|
45
63
|
export { useStorage } from 'nitro/storage'
|
|
46
64
|
export { defineTask, runTask } from 'nitro/task'
|
|
65
|
+
export function fetchWithEvent(event, request, options) {
|
|
66
|
+
const localFetch = createFetch({
|
|
67
|
+
fetch: (input, init) => fetchRawWithEvent(event, input, init),
|
|
68
|
+
})
|
|
69
|
+
return localFetch(request, options)
|
|
70
|
+
}
|
|
47
71
|
`;
|
|
48
72
|
const nitroV3RuntimeTypes = `export { definePlugin as defineNitroPlugin } from 'nitro'
|
|
49
73
|
export { useNitroApp } from 'nitro/app'
|
|
@@ -52,6 +76,7 @@ export function useRuntimeConfig(event?: import('nitro/h3').H3Event): ReturnType
|
|
|
52
76
|
export { defineCachedFunction, defineCachedHandler as defineCachedEventHandler } from 'nitro/cache'
|
|
53
77
|
export { useStorage } from 'nitro/storage'
|
|
54
78
|
export { defineTask, runTask } from 'nitro/task'
|
|
79
|
+
export function fetchWithEvent<T>(event: import('nitro/h3').H3Event, request: import('ofetch').FetchRequest, options?: import('ofetch').FetchOptions): Promise<T>
|
|
55
80
|
`;
|
|
56
81
|
function indent(value, spaces) {
|
|
57
82
|
const padding = " ".repeat(spaces);
|
|
@@ -65,7 +90,7 @@ ${indent(contents.trim(), 4)}
|
|
|
65
90
|
}`;
|
|
66
91
|
}
|
|
67
92
|
function renderRuntimeDeclarations(compatibility) {
|
|
68
|
-
const nitroRuntime = compatibility._tag === "nitro-v3" ? nitroV3RuntimeTypes :
|
|
93
|
+
const nitroRuntime = compatibility._tag === "nitro-v3" ? nitroV3RuntimeTypes : nitroV2RuntimeTypes;
|
|
69
94
|
const h3Runtime = compatibility._tag === "nitro-v3" ? `export * from 'nitro/h3'
|
|
70
95
|
` : `export * from 'h3'
|
|
71
96
|
`;
|
package/dist/module.json
CHANGED