nuxtseo-shared 5.3.11 → 5.3.13
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/content-runtime.d.mts +43 -0
- package/dist/content-runtime.d.ts +43 -0
- package/dist/content-runtime.mjs +1 -0
- package/dist/devtools.mjs +2 -3
- package/dist/i18n-runtime.d.mts +21 -7
- package/dist/i18n-runtime.d.ts +21 -7
- package/dist/i18n-runtime.mjs +95 -27
- package/dist/i18n.d.mts +27 -7
- package/dist/i18n.d.ts +27 -7
- package/dist/i18n.mjs +105 -15
- package/dist/kit.d.mts +43 -2
- package/dist/kit.d.ts +43 -2
- package/dist/kit.mjs +38 -2
- package/dist/module.json +1 -1
- package/dist/runtime/content/comark.d.ts +0 -0
- package/dist/runtime/content/comark.js +42 -0
- package/dist/runtime/content/none.d.ts +0 -0
- package/dist/runtime/content/none.js +7 -0
- package/dist/runtime/content/nuxt-content-v3.d.ts +0 -0
- package/dist/runtime/content/nuxt-content-v3.js +15 -0
- package/package.json +8 -2
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract for `#nuxtseo/content`, the per-provider runtime shim that
|
|
3
|
+
* `setupContentRuntime()` aliases into the Nitro bundle.
|
|
4
|
+
*
|
|
5
|
+
* `@nuxt/content` and `comark-content` cannot both be imported by one build:
|
|
6
|
+
* pulling `@nuxt/content/server` into an app that does not have it fails the
|
|
7
|
+
* bundle. So provider choice is a build-time alias, and every consumer imports
|
|
8
|
+
* this one specifier instead of naming a package.
|
|
9
|
+
*/
|
|
10
|
+
type ContentRuntimeProvider = 'nuxt-content-v3' | 'comark' | 'none';
|
|
11
|
+
/**
|
|
12
|
+
* A queryable page collection, normalized across providers.
|
|
13
|
+
*
|
|
14
|
+
* The two manifests disagree in shape. `@nuxt/content` keys an object by name and
|
|
15
|
+
* carries a schema-derived `fields` map. comark returns an array and carries a
|
|
16
|
+
* per-collection sitemap flag. Both reduce to this.
|
|
17
|
+
*/
|
|
18
|
+
interface PageCollection {
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the collection declares `field`.
|
|
22
|
+
*
|
|
23
|
+
* For `@nuxt/content` this is the schema opt in, so a module can require its own
|
|
24
|
+
* field before claiming the collection. comark derives no field list from a
|
|
25
|
+
* schema, so it answers `true` and relies on frontmatter being present or absent.
|
|
26
|
+
*/
|
|
27
|
+
hasField: (field: string) => boolean;
|
|
28
|
+
/** `false` only when the collection opted out of the sitemap. */
|
|
29
|
+
inSitemap: boolean;
|
|
30
|
+
}
|
|
31
|
+
interface ContentPageQuery {
|
|
32
|
+
where: (field: string, operator: string, value?: unknown) => ContentPageQuery;
|
|
33
|
+
select: (...fields: string[]) => ContentPageQuery;
|
|
34
|
+
all: () => Promise<Record<string, any>[]>;
|
|
35
|
+
first: () => Promise<Record<string, any> | null>;
|
|
36
|
+
}
|
|
37
|
+
interface ContentRuntime {
|
|
38
|
+
provider: ContentRuntimeProvider;
|
|
39
|
+
listPageCollections: (event: unknown) => Promise<PageCollection[]>;
|
|
40
|
+
queryPages: (event: unknown, collection: string) => ContentPageQuery;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type { ContentPageQuery, ContentRuntime, ContentRuntimeProvider, PageCollection };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract for `#nuxtseo/content`, the per-provider runtime shim that
|
|
3
|
+
* `setupContentRuntime()` aliases into the Nitro bundle.
|
|
4
|
+
*
|
|
5
|
+
* `@nuxt/content` and `comark-content` cannot both be imported by one build:
|
|
6
|
+
* pulling `@nuxt/content/server` into an app that does not have it fails the
|
|
7
|
+
* bundle. So provider choice is a build-time alias, and every consumer imports
|
|
8
|
+
* this one specifier instead of naming a package.
|
|
9
|
+
*/
|
|
10
|
+
type ContentRuntimeProvider = 'nuxt-content-v3' | 'comark' | 'none';
|
|
11
|
+
/**
|
|
12
|
+
* A queryable page collection, normalized across providers.
|
|
13
|
+
*
|
|
14
|
+
* The two manifests disagree in shape. `@nuxt/content` keys an object by name and
|
|
15
|
+
* carries a schema-derived `fields` map. comark returns an array and carries a
|
|
16
|
+
* per-collection sitemap flag. Both reduce to this.
|
|
17
|
+
*/
|
|
18
|
+
interface PageCollection {
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the collection declares `field`.
|
|
22
|
+
*
|
|
23
|
+
* For `@nuxt/content` this is the schema opt in, so a module can require its own
|
|
24
|
+
* field before claiming the collection. comark derives no field list from a
|
|
25
|
+
* schema, so it answers `true` and relies on frontmatter being present or absent.
|
|
26
|
+
*/
|
|
27
|
+
hasField: (field: string) => boolean;
|
|
28
|
+
/** `false` only when the collection opted out of the sitemap. */
|
|
29
|
+
inSitemap: boolean;
|
|
30
|
+
}
|
|
31
|
+
interface ContentPageQuery {
|
|
32
|
+
where: (field: string, operator: string, value?: unknown) => ContentPageQuery;
|
|
33
|
+
select: (...fields: string[]) => ContentPageQuery;
|
|
34
|
+
all: () => Promise<Record<string, any>[]>;
|
|
35
|
+
first: () => Promise<Record<string, any> | null>;
|
|
36
|
+
}
|
|
37
|
+
interface ContentRuntime {
|
|
38
|
+
provider: ContentRuntimeProvider;
|
|
39
|
+
listPageCollections: (event: unknown) => Promise<PageCollection[]>;
|
|
40
|
+
queryPages: (event: unknown, collection: string) => ContentPageQuery;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type { ContentPageQuery, ContentRuntime, ContentRuntimeProvider, PageCollection };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/dist/devtools.mjs
CHANGED
|
@@ -177,14 +177,13 @@ function generateAndBuild(cacheDir, rootDir, installed, hooks) {
|
|
|
177
177
|
const routes = ["/", ...installed.flatMap((m) => deriveRoutes(m.layerDir, m.slug))];
|
|
178
178
|
const extendsList = [resolveBaseLayer(installed), ...installed.map((m) => m.layerDir)];
|
|
179
179
|
mkdirSync(join(cacheDir, "pages"), { recursive: true });
|
|
180
|
-
writeFileSync(join(cacheDir, "nuxt.config.ts"), `
|
|
181
|
-
export default defineNuxtConfig({
|
|
180
|
+
writeFileSync(join(cacheDir, "nuxt.config.ts"), `export default defineNuxtConfig({
|
|
182
181
|
extends: ${JSON.stringify(extendsList, null, 2)},
|
|
183
182
|
ssr: false,
|
|
184
183
|
robots: false,
|
|
185
184
|
content: false,
|
|
186
185
|
sitemap: false,
|
|
187
|
-
nitro: { prerender: { routes: ${JSON.stringify(routes)} }, output: { publicDir:
|
|
186
|
+
nitro: { prerender: { routes: ${JSON.stringify(routes)} }, output: { publicDir: ${JSON.stringify(join(cacheDir, "dist/devtools"))} } },
|
|
188
187
|
app: { baseURL: '${UNIFIED_CLIENT_ROUTE}' },
|
|
189
188
|
compatibilityDate: '2026-03-13',
|
|
190
189
|
})
|
package/dist/i18n-runtime.d.mts
CHANGED
|
@@ -7,15 +7,24 @@
|
|
|
7
7
|
* Feed it the config `toRuntimeI18nConfig()` produces.
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Resolved route paths keyed by route name, then locale code. Per-locale
|
|
11
|
+
* `false` disables that locale. A tagged unlocalized entry represents i18n's
|
|
12
|
+
* whole-route `false` after build-time materialization.
|
|
13
13
|
*
|
|
14
14
|
* ```
|
|
15
|
-
* { about: { en: '/about', fr: '/a-propos' } }
|
|
15
|
+
* { about: { en: '/about', fr: '/a-propos' }, admin: { _tag: 'unlocalized', path: '/admin' } }
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
type
|
|
18
|
+
type LocalePagePaths = Record<string, string | false>;
|
|
19
|
+
interface UnlocalizedLocalePage {
|
|
20
|
+
/** Route excluded from i18n localization by a whole-route `pages` false. */
|
|
21
|
+
_tag: 'unlocalized';
|
|
22
|
+
/** Original resolved Nuxt route pattern. */
|
|
23
|
+
path: string;
|
|
24
|
+
/** The route has children, which i18n also leaves unlocalized. */
|
|
25
|
+
subtree?: true;
|
|
26
|
+
}
|
|
27
|
+
type LocalePages = Record<string, LocalePagePaths | UnlocalizedLocalePage | undefined>;
|
|
19
28
|
interface RuntimeLocale {
|
|
20
29
|
code: string;
|
|
21
30
|
hreflang: string;
|
|
@@ -61,6 +70,11 @@ interface RuntimeRouteContext {
|
|
|
61
70
|
/** Known current locale, required to translate no_prefix routes without a locale domain. */
|
|
62
71
|
locale?: string;
|
|
63
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Resolve the canonical domain for a locale. Domainless locales are served on
|
|
75
|
+
* every domain, so their stable canonical is the default locale's domain.
|
|
76
|
+
*/
|
|
77
|
+
declare function resolveCanonicalLocaleDomain(locale: RuntimeLocale | undefined, defaultLocale?: RuntimeLocale): string | undefined;
|
|
64
78
|
/**
|
|
65
79
|
* Resolve which locale a route belongs to and the locale-stripped base path.
|
|
66
80
|
*/
|
|
@@ -80,5 +94,5 @@ declare function localePath(basePath: string, locale: string, i18n: RuntimeI18nC
|
|
|
80
94
|
declare function resolveLocaleAlternates(route: string, i18n: RuntimeI18nConfig, context?: RuntimeRouteContext): LocaleAlternateResolution;
|
|
81
95
|
declare function computeLocaleAlternates(route: string, i18n: RuntimeI18nConfig, context?: RuntimeRouteContext): LocaleAlternate[];
|
|
82
96
|
|
|
83
|
-
export { computeLocaleAlternates, localePath, resolveLocaleAlternates, resolveLocaleFromRoute };
|
|
84
|
-
export type { LocaleAlternate, LocaleAlternateResolution, LocalePages, RouteLocaleInfo, RuntimeI18nConfig, RuntimeLocale, RuntimeRouteContext };
|
|
97
|
+
export { computeLocaleAlternates, localePath, resolveCanonicalLocaleDomain, resolveLocaleAlternates, resolveLocaleFromRoute };
|
|
98
|
+
export type { LocaleAlternate, LocaleAlternateResolution, LocalePagePaths, LocalePages, RouteLocaleInfo, RuntimeI18nConfig, RuntimeLocale, RuntimeRouteContext, UnlocalizedLocalePage };
|
package/dist/i18n-runtime.d.ts
CHANGED
|
@@ -7,15 +7,24 @@
|
|
|
7
7
|
* Feed it the config `toRuntimeI18nConfig()` produces.
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Resolved route paths keyed by route name, then locale code. Per-locale
|
|
11
|
+
* `false` disables that locale. A tagged unlocalized entry represents i18n's
|
|
12
|
+
* whole-route `false` after build-time materialization.
|
|
13
13
|
*
|
|
14
14
|
* ```
|
|
15
|
-
* { about: { en: '/about', fr: '/a-propos' } }
|
|
15
|
+
* { about: { en: '/about', fr: '/a-propos' }, admin: { _tag: 'unlocalized', path: '/admin' } }
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
type
|
|
18
|
+
type LocalePagePaths = Record<string, string | false>;
|
|
19
|
+
interface UnlocalizedLocalePage {
|
|
20
|
+
/** Route excluded from i18n localization by a whole-route `pages` false. */
|
|
21
|
+
_tag: 'unlocalized';
|
|
22
|
+
/** Original resolved Nuxt route pattern. */
|
|
23
|
+
path: string;
|
|
24
|
+
/** The route has children, which i18n also leaves unlocalized. */
|
|
25
|
+
subtree?: true;
|
|
26
|
+
}
|
|
27
|
+
type LocalePages = Record<string, LocalePagePaths | UnlocalizedLocalePage | undefined>;
|
|
19
28
|
interface RuntimeLocale {
|
|
20
29
|
code: string;
|
|
21
30
|
hreflang: string;
|
|
@@ -61,6 +70,11 @@ interface RuntimeRouteContext {
|
|
|
61
70
|
/** Known current locale, required to translate no_prefix routes without a locale domain. */
|
|
62
71
|
locale?: string;
|
|
63
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Resolve the canonical domain for a locale. Domainless locales are served on
|
|
75
|
+
* every domain, so their stable canonical is the default locale's domain.
|
|
76
|
+
*/
|
|
77
|
+
declare function resolveCanonicalLocaleDomain(locale: RuntimeLocale | undefined, defaultLocale?: RuntimeLocale): string | undefined;
|
|
64
78
|
/**
|
|
65
79
|
* Resolve which locale a route belongs to and the locale-stripped base path.
|
|
66
80
|
*/
|
|
@@ -80,5 +94,5 @@ declare function localePath(basePath: string, locale: string, i18n: RuntimeI18nC
|
|
|
80
94
|
declare function resolveLocaleAlternates(route: string, i18n: RuntimeI18nConfig, context?: RuntimeRouteContext): LocaleAlternateResolution;
|
|
81
95
|
declare function computeLocaleAlternates(route: string, i18n: RuntimeI18nConfig, context?: RuntimeRouteContext): LocaleAlternate[];
|
|
82
96
|
|
|
83
|
-
export { computeLocaleAlternates, localePath, resolveLocaleAlternates, resolveLocaleFromRoute };
|
|
84
|
-
export type { LocaleAlternate, LocaleAlternateResolution, LocalePages, RouteLocaleInfo, RuntimeI18nConfig, RuntimeLocale, RuntimeRouteContext };
|
|
97
|
+
export { computeLocaleAlternates, localePath, resolveCanonicalLocaleDomain, resolveLocaleAlternates, resolveLocaleFromRoute };
|
|
98
|
+
export type { LocaleAlternate, LocaleAlternateResolution, LocalePagePaths, LocalePages, RouteLocaleInfo, RuntimeI18nConfig, RuntimeLocale, RuntimeRouteContext, UnlocalizedLocalePage };
|
package/dist/i18n-runtime.mjs
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
function isUnlocalizedLocalePage(page) {
|
|
2
|
+
return page._tag === "unlocalized" && typeof page.path === "string";
|
|
3
|
+
}
|
|
4
|
+
function matchesUnlocalizedLocalePage(page, path) {
|
|
5
|
+
if (matchPagePattern(page.path, path))
|
|
6
|
+
return true;
|
|
7
|
+
if (!page.subtree)
|
|
8
|
+
return false;
|
|
9
|
+
const subtreePattern = `${page.path === "/" ? "" : page.path.replace(/\/$/, "")}/[...__nuxtSeoSubtree]`;
|
|
10
|
+
return !!matchPagePattern(subtreePattern, path);
|
|
11
|
+
}
|
|
1
12
|
function normalizeHost(value) {
|
|
2
13
|
return value.trim().toLowerCase().replace(/^[a-z][a-z\d+.-]*:\/\//, "").split("/")[0];
|
|
3
14
|
}
|
|
@@ -18,8 +29,11 @@ function resolveLocaleFromHost(host, i18n) {
|
|
|
18
29
|
);
|
|
19
30
|
return matches.length === 1 ? matches[0] : matches.find((locale) => locale.code === i18n.defaultLocale);
|
|
20
31
|
}
|
|
21
|
-
function
|
|
22
|
-
return locale
|
|
32
|
+
function firstLocaleDomain(locale) {
|
|
33
|
+
return locale?.defaultForDomains?.[0] || locale?.domain || locale?.domains?.[0];
|
|
34
|
+
}
|
|
35
|
+
function resolveCanonicalLocaleDomain(locale, defaultLocale) {
|
|
36
|
+
return firstLocaleDomain(locale) || firstLocaleDomain(defaultLocale);
|
|
23
37
|
}
|
|
24
38
|
function splitRouteSuffix(route) {
|
|
25
39
|
const suffixIndex = route.search(/[?#]/);
|
|
@@ -37,7 +51,8 @@ function resolveLocaleFromRoute(route, i18n, context = {}) {
|
|
|
37
51
|
const matched = first ? i18n.locales.find((l) => l.code === first) : void 0;
|
|
38
52
|
if (matched) {
|
|
39
53
|
const rest = segments.slice(1).join("/");
|
|
40
|
-
|
|
54
|
+
const trailingSlash = rest && pathname.endsWith("/") ? "/" : "";
|
|
55
|
+
return { locale: matched.code, basePath: `${rest ? `/${rest}${trailingSlash}` : "/"}${suffix}` };
|
|
41
56
|
}
|
|
42
57
|
}
|
|
43
58
|
const contextLocale = context.locale ? i18n.locales.find((locale) => locale.code === context.locale) : void 0;
|
|
@@ -64,7 +79,7 @@ function localePath(basePath, locale, i18n, context = {}) {
|
|
|
64
79
|
function toSegments(path) {
|
|
65
80
|
return path.split("/").filter(Boolean);
|
|
66
81
|
}
|
|
67
|
-
const PAGE_PARAM_PATTERN = /\[\[(\.\.\.)?([^[\]]+)\]\]|\[(\.\.\.)?([^[\]]+)\]|:(\w+)(?:\((\.\*)
|
|
82
|
+
const PAGE_PARAM_PATTERN = /\[\[(\.\.\.)?([^[\]]+)\]\]|\[(\.\.\.)?([^[\]]+)\]|:(\w+)(?:\((\.\*)?\))?([?*+]?)/g;
|
|
68
83
|
function parsePageSegment(segment) {
|
|
69
84
|
const tokens = [];
|
|
70
85
|
let offset = 0;
|
|
@@ -78,11 +93,12 @@ function parsePageSegment(segment) {
|
|
|
78
93
|
tokens.push({ _tag: "param", param: { name: match[4], catchAll: !!match[3], optional: false } });
|
|
79
94
|
} else {
|
|
80
95
|
const modifier = match[7];
|
|
96
|
+
const routePattern = match[6];
|
|
81
97
|
tokens.push({
|
|
82
98
|
_tag: "param",
|
|
83
99
|
param: {
|
|
84
100
|
name: match[5],
|
|
85
|
-
catchAll: !!
|
|
101
|
+
catchAll: !!routePattern?.includes(".*") || modifier === "*" || modifier === "+",
|
|
86
102
|
optional: modifier === "?" || modifier === "*"
|
|
87
103
|
}
|
|
88
104
|
});
|
|
@@ -121,12 +137,23 @@ function compareSpecificity(a, b) {
|
|
|
121
137
|
return a.length - b.length;
|
|
122
138
|
}
|
|
123
139
|
function matchSegmentTokens(tokens, path) {
|
|
140
|
+
const failedStates = /* @__PURE__ */ new Set();
|
|
124
141
|
function visit(index, offset, params) {
|
|
125
|
-
|
|
126
|
-
|
|
142
|
+
const state = index * (path.length + 1) + offset;
|
|
143
|
+
if (failedStates.has(state))
|
|
144
|
+
return null;
|
|
145
|
+
if (index === tokens.length) {
|
|
146
|
+
if (offset === path.length)
|
|
147
|
+
return params;
|
|
148
|
+
failedStates.add(state);
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
127
151
|
const token = tokens[index];
|
|
128
152
|
if (token._tag === "static") {
|
|
129
|
-
|
|
153
|
+
const matched = path.startsWith(token.value, offset) ? visit(index + 1, offset + token.value.length, params) : null;
|
|
154
|
+
if (!matched)
|
|
155
|
+
failedStates.add(state);
|
|
156
|
+
return matched;
|
|
130
157
|
}
|
|
131
158
|
const minimumEnd = token.param.optional ? offset : offset + 1;
|
|
132
159
|
for (let end = minimumEnd; end <= path.length; end++) {
|
|
@@ -136,6 +163,7 @@ function matchSegmentTokens(tokens, path) {
|
|
|
136
163
|
if (matched)
|
|
137
164
|
return matched;
|
|
138
165
|
}
|
|
166
|
+
failedStates.add(state);
|
|
139
167
|
return null;
|
|
140
168
|
}
|
|
141
169
|
return visit(0, 0, {});
|
|
@@ -143,9 +171,17 @@ function matchSegmentTokens(tokens, path) {
|
|
|
143
171
|
function matchPagePattern(pattern, path) {
|
|
144
172
|
const patternSegments = toSegments(pattern);
|
|
145
173
|
const pathSegments = toSegments(path);
|
|
174
|
+
const failedStates = /* @__PURE__ */ new Set();
|
|
146
175
|
function visit(patternIndex, pathIndex, params) {
|
|
147
|
-
|
|
148
|
-
|
|
176
|
+
const state = patternIndex * (pathSegments.length + 1) + pathIndex;
|
|
177
|
+
if (failedStates.has(state))
|
|
178
|
+
return null;
|
|
179
|
+
if (patternIndex === patternSegments.length) {
|
|
180
|
+
if (pathIndex === pathSegments.length)
|
|
181
|
+
return params;
|
|
182
|
+
failedStates.add(state);
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
149
185
|
const tokens = parsePageSegment(patternSegments[patternIndex]);
|
|
150
186
|
const param = wholeSegmentParam(tokens);
|
|
151
187
|
if (param?.catchAll) {
|
|
@@ -153,22 +189,26 @@ function matchPagePattern(pattern, path) {
|
|
|
153
189
|
for (let end = pathSegments.length; end >= minimumEnd; end--) {
|
|
154
190
|
const value = pathSegments.slice(pathIndex, end).join("/");
|
|
155
191
|
const nextParams = value ? { ...params, [param.name]: value } : params;
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
158
|
-
return
|
|
192
|
+
const matched2 = visit(patternIndex + 1, end, nextParams);
|
|
193
|
+
if (matched2)
|
|
194
|
+
return matched2;
|
|
159
195
|
}
|
|
196
|
+
failedStates.add(state);
|
|
160
197
|
return null;
|
|
161
198
|
}
|
|
162
199
|
const segment = pathSegments[pathIndex];
|
|
163
200
|
if (segment !== void 0) {
|
|
164
201
|
const segmentParams = matchSegmentTokens(tokens, segment);
|
|
165
202
|
if (segmentParams) {
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
168
|
-
return
|
|
203
|
+
const matched2 = visit(patternIndex + 1, pathIndex + 1, { ...params, ...segmentParams });
|
|
204
|
+
if (matched2)
|
|
205
|
+
return matched2;
|
|
169
206
|
}
|
|
170
207
|
}
|
|
171
|
-
|
|
208
|
+
const matched = param?.optional ? visit(patternIndex + 1, pathIndex, params) : null;
|
|
209
|
+
if (!matched)
|
|
210
|
+
failedStates.add(state);
|
|
211
|
+
return matched;
|
|
172
212
|
}
|
|
173
213
|
return visit(0, 0, {});
|
|
174
214
|
}
|
|
@@ -193,11 +233,14 @@ function fillPagePattern(pattern, params) {
|
|
|
193
233
|
if (value)
|
|
194
234
|
filled.push(value);
|
|
195
235
|
}
|
|
196
|
-
|
|
236
|
+
if (!filled.length)
|
|
237
|
+
return "/";
|
|
238
|
+
return `/${filled.join("/")}${pattern.endsWith("/") ? "/" : ""}`;
|
|
197
239
|
}
|
|
198
240
|
function alternatesForEntry(localePaths, params, i18n, context) {
|
|
199
241
|
const untranslated = localePaths[i18n.defaultLocale];
|
|
200
242
|
const alternates = [];
|
|
243
|
+
const defaultLocale = i18n.locales.find((locale) => locale.code === i18n.defaultLocale);
|
|
201
244
|
for (const l of i18n.locales) {
|
|
202
245
|
const pattern = localePaths[l.code] ?? untranslated;
|
|
203
246
|
if (localePaths[l.code] === false)
|
|
@@ -207,7 +250,7 @@ function alternatesForEntry(localePaths, params, i18n, context) {
|
|
|
207
250
|
const path = fillPagePattern(pattern, params);
|
|
208
251
|
if (path === null)
|
|
209
252
|
continue;
|
|
210
|
-
const domain =
|
|
253
|
+
const domain = resolveCanonicalLocaleDomain(l, defaultLocale);
|
|
211
254
|
alternates.push({
|
|
212
255
|
code: l.code,
|
|
213
256
|
hreflang: l.hreflang || l.code,
|
|
@@ -217,23 +260,46 @@ function alternatesForEntry(localePaths, params, i18n, context) {
|
|
|
217
260
|
}
|
|
218
261
|
return alternates.length ? alternates : null;
|
|
219
262
|
}
|
|
220
|
-
function alternatesFromPages(basePath, locale, i18n, context) {
|
|
263
|
+
function alternatesFromPages(basePath, routePath, locale, i18n, context) {
|
|
221
264
|
const pages = i18n.pages;
|
|
222
265
|
const hasDomainLocales = i18n.differentDomains || i18n.multiDomainLocales;
|
|
223
266
|
const hasContextLocale = !!context.locale && i18n.locales.some((locale2) => locale2.code === context.locale);
|
|
224
|
-
if (!pages
|
|
267
|
+
if (!pages)
|
|
225
268
|
return null;
|
|
269
|
+
const allowLocalized = i18n.strategy !== "no_prefix" || hasDomainLocales || hasContextLocale;
|
|
226
270
|
const matches = [];
|
|
227
|
-
for (const
|
|
228
|
-
|
|
271
|
+
for (const page of Object.values(pages)) {
|
|
272
|
+
if (!page)
|
|
273
|
+
continue;
|
|
274
|
+
if (isUnlocalizedLocalePage(page)) {
|
|
275
|
+
if (matchesUnlocalizedLocalePage(page, routePath))
|
|
276
|
+
matches.push({ _tag: "unlocalized", ranks: segmentRanks(page.path) });
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
279
|
+
if (!allowLocalized)
|
|
280
|
+
continue;
|
|
281
|
+
const pattern = page[locale];
|
|
229
282
|
if (!pattern)
|
|
230
283
|
continue;
|
|
231
284
|
const params = matchPagePattern(pattern, basePath);
|
|
232
285
|
if (params)
|
|
233
|
-
matches.push({ ranks: segmentRanks(pattern), localePaths, params });
|
|
286
|
+
matches.push({ _tag: "localized", ranks: segmentRanks(pattern), localePaths: page, params });
|
|
234
287
|
}
|
|
235
288
|
matches.sort((a, b) => compareSpecificity(a.ranks, b.ranks));
|
|
236
289
|
for (const match of matches) {
|
|
290
|
+
if (match._tag === "unlocalized") {
|
|
291
|
+
const defaultLocale = i18n.locales.find((locale2) => locale2.code === i18n.defaultLocale);
|
|
292
|
+
if (defaultLocale) {
|
|
293
|
+
const domain = resolveCanonicalLocaleDomain(defaultLocale);
|
|
294
|
+
return [{
|
|
295
|
+
code: defaultLocale.code,
|
|
296
|
+
hreflang: defaultLocale.hreflang || defaultLocale.code,
|
|
297
|
+
path: routePath,
|
|
298
|
+
...domain ? { domain } : {}
|
|
299
|
+
}];
|
|
300
|
+
}
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
237
303
|
const alternates = alternatesForEntry(match.localePaths, match.params, i18n, context);
|
|
238
304
|
if (alternates)
|
|
239
305
|
return alternates;
|
|
@@ -243,17 +309,19 @@ function alternatesFromPages(basePath, locale, i18n, context) {
|
|
|
243
309
|
function resolveLocaleAlternates(route, i18n, context = {}) {
|
|
244
310
|
const { locale, basePath } = resolveLocaleFromRoute(route, i18n, context);
|
|
245
311
|
const { pathname, suffix } = splitRouteSuffix(basePath);
|
|
246
|
-
const
|
|
312
|
+
const { pathname: routePathname } = splitRouteSuffix(route);
|
|
313
|
+
const translated = alternatesFromPages(pathname, routePathname, locale, i18n, context);
|
|
247
314
|
if (translated) {
|
|
248
315
|
return {
|
|
249
316
|
_tag: "pages",
|
|
250
317
|
alternates: translated.map((alternate) => ({ ...alternate, path: `${alternate.path}${suffix}` }))
|
|
251
318
|
};
|
|
252
319
|
}
|
|
320
|
+
const defaultLocale = i18n.locales.find((locale2) => locale2.code === i18n.defaultLocale);
|
|
253
321
|
return {
|
|
254
322
|
_tag: "strategy",
|
|
255
323
|
alternates: i18n.locales.map((l) => {
|
|
256
|
-
const domain =
|
|
324
|
+
const domain = resolveCanonicalLocaleDomain(l, defaultLocale);
|
|
257
325
|
return {
|
|
258
326
|
code: l.code,
|
|
259
327
|
hreflang: l.hreflang || l.code,
|
|
@@ -267,4 +335,4 @@ function computeLocaleAlternates(route, i18n, context = {}) {
|
|
|
267
335
|
return resolveLocaleAlternates(route, i18n, context).alternates;
|
|
268
336
|
}
|
|
269
337
|
|
|
270
|
-
export { computeLocaleAlternates, localePath, resolveLocaleAlternates, resolveLocaleFromRoute };
|
|
338
|
+
export { computeLocaleAlternates, localePath, resolveCanonicalLocaleDomain, resolveLocaleAlternates, resolveLocaleFromRoute };
|
package/dist/i18n.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LocaleObject, NuxtI18nOptions } from '@nuxtjs/i18n';
|
|
2
|
-
import { RuntimeI18nConfig } from './i18n-runtime.mjs';
|
|
3
|
-
export { LocaleAlternate, LocaleAlternateResolution, LocalePages, RouteLocaleInfo, RuntimeLocale, RuntimeRouteContext } from './i18n-runtime.mjs';
|
|
2
|
+
import { UnlocalizedLocalePage, RuntimeI18nConfig } from './i18n-runtime.mjs';
|
|
3
|
+
export { LocaleAlternate, LocaleAlternateResolution, LocalePagePaths, LocalePages, RouteLocaleInfo, RuntimeLocale, RuntimeRouteContext } from './i18n-runtime.mjs';
|
|
4
4
|
|
|
5
5
|
declare const I18N_MODULES: readonly ["@nuxtjs/i18n", "nuxt-i18n-micro"];
|
|
6
6
|
type I18nModuleName = typeof I18N_MODULES[number];
|
|
@@ -15,8 +15,11 @@ interface AutoI18nConfig {
|
|
|
15
15
|
strategy: Strategies;
|
|
16
16
|
differentDomains?: boolean;
|
|
17
17
|
multiDomainLocales?: boolean;
|
|
18
|
-
|
|
18
|
+
routesNameSeparator?: string;
|
|
19
|
+
defaultLocaleRouteNameSuffix?: string;
|
|
20
|
+
pages?: Record<string, Record<string, string | false> | UnlocalizedLocalePage | false>;
|
|
19
21
|
}
|
|
22
|
+
type I18nPages = NonNullable<AutoI18nConfig['pages']>;
|
|
20
23
|
interface StrategyProps {
|
|
21
24
|
localeCode: string;
|
|
22
25
|
pageLocales: string;
|
|
@@ -50,7 +53,22 @@ declare function isCompactLocaleRoute(path: string): boolean;
|
|
|
50
53
|
*/
|
|
51
54
|
declare function expandCompactLocaleRoute(path: string, knownLocales?: string[]): ExpandedLocaleRoute[] | null;
|
|
52
55
|
declare function normalizeLocales(nuxtI18nConfig: NuxtI18nOptions): AutoI18nConfig['locales'];
|
|
53
|
-
|
|
56
|
+
interface ResolvedI18nRoute {
|
|
57
|
+
name?: string;
|
|
58
|
+
path: string;
|
|
59
|
+
children?: ResolvedI18nRoute[];
|
|
60
|
+
}
|
|
61
|
+
/** Normalize an i18n `pages` key to the corresponding resolved Nuxt route name. Build-time only. */
|
|
62
|
+
declare function normalizeI18nPageKey(key: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* Complete partial i18n `pages` entries from Nuxt's resolved route table.
|
|
65
|
+
*
|
|
66
|
+
* Route names are identifiers, not URL paths. The resolved route path is the
|
|
67
|
+
* only safe fallback for nested, dynamic, grouped, or custom Nuxt routes.
|
|
68
|
+
* Whole-route `false` becomes a tagged entry carrying that resolved path.
|
|
69
|
+
*/
|
|
70
|
+
declare function materializeI18nPages(autoI18n: AutoI18nConfig, routes: readonly ResolvedI18nRoute[]): I18nPages | undefined;
|
|
71
|
+
declare function mapPathForI18nPages(path: string, autoI18n: AutoI18nConfig, routes?: readonly ResolvedI18nRoute[]): string[] | false;
|
|
54
72
|
interface I18nModuleResolution {
|
|
55
73
|
module: I18nModuleName;
|
|
56
74
|
isMicro: boolean;
|
|
@@ -67,10 +85,12 @@ declare function resolveI18nConfig(logger?: {
|
|
|
67
85
|
/**
|
|
68
86
|
* Strip a build-time i18n config down to what `./i18n-runtime` needs, dropping
|
|
69
87
|
* the non-serializable `LocaleObject` extras so it can be handed to the runtime
|
|
70
|
-
* through `runtimeConfig`.
|
|
88
|
+
* through `runtimeConfig`. Materialize partial and whole-route-false `pages`
|
|
89
|
+
* entries before calling this function; unresolved whole-route false entries
|
|
90
|
+
* are omitted instead of becoming fabricated runtime URLs.
|
|
71
91
|
*/
|
|
72
92
|
declare function toRuntimeI18nConfig(auto: AutoI18nConfig): RuntimeI18nConfig;
|
|
73
93
|
declare function mergeOnKey<T extends Record<string, any>>(arr: T[], key: keyof T): T[];
|
|
74
94
|
|
|
75
|
-
export { RuntimeI18nConfig, expandCompactLocaleRoute, generatePathForI18nPages, isCompactLocaleRoute, mapPathForI18nPages, mergeOnKey, normalizeLocales, resolveI18nConfig, resolveI18nModule, splitPathForI18nLocales, toRuntimeI18nConfig };
|
|
76
|
-
export type { AutoI18nConfig, ExpandedLocaleRoute, I18nModuleResolution, NormalisedLocale, Strategies, StrategyProps };
|
|
95
|
+
export { RuntimeI18nConfig, UnlocalizedLocalePage, expandCompactLocaleRoute, generatePathForI18nPages, isCompactLocaleRoute, mapPathForI18nPages, materializeI18nPages, mergeOnKey, normalizeI18nPageKey, normalizeLocales, resolveI18nConfig, resolveI18nModule, splitPathForI18nLocales, toRuntimeI18nConfig };
|
|
96
|
+
export type { AutoI18nConfig, ExpandedLocaleRoute, I18nModuleResolution, NormalisedLocale, ResolvedI18nRoute, Strategies, StrategyProps };
|
package/dist/i18n.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LocaleObject, NuxtI18nOptions } from '@nuxtjs/i18n';
|
|
2
|
-
import { RuntimeI18nConfig } from './i18n-runtime.js';
|
|
3
|
-
export { LocaleAlternate, LocaleAlternateResolution, LocalePages, RouteLocaleInfo, RuntimeLocale, RuntimeRouteContext } from './i18n-runtime.js';
|
|
2
|
+
import { UnlocalizedLocalePage, RuntimeI18nConfig } from './i18n-runtime.js';
|
|
3
|
+
export { LocaleAlternate, LocaleAlternateResolution, LocalePagePaths, LocalePages, RouteLocaleInfo, RuntimeLocale, RuntimeRouteContext } from './i18n-runtime.js';
|
|
4
4
|
|
|
5
5
|
declare const I18N_MODULES: readonly ["@nuxtjs/i18n", "nuxt-i18n-micro"];
|
|
6
6
|
type I18nModuleName = typeof I18N_MODULES[number];
|
|
@@ -15,8 +15,11 @@ interface AutoI18nConfig {
|
|
|
15
15
|
strategy: Strategies;
|
|
16
16
|
differentDomains?: boolean;
|
|
17
17
|
multiDomainLocales?: boolean;
|
|
18
|
-
|
|
18
|
+
routesNameSeparator?: string;
|
|
19
|
+
defaultLocaleRouteNameSuffix?: string;
|
|
20
|
+
pages?: Record<string, Record<string, string | false> | UnlocalizedLocalePage | false>;
|
|
19
21
|
}
|
|
22
|
+
type I18nPages = NonNullable<AutoI18nConfig['pages']>;
|
|
20
23
|
interface StrategyProps {
|
|
21
24
|
localeCode: string;
|
|
22
25
|
pageLocales: string;
|
|
@@ -50,7 +53,22 @@ declare function isCompactLocaleRoute(path: string): boolean;
|
|
|
50
53
|
*/
|
|
51
54
|
declare function expandCompactLocaleRoute(path: string, knownLocales?: string[]): ExpandedLocaleRoute[] | null;
|
|
52
55
|
declare function normalizeLocales(nuxtI18nConfig: NuxtI18nOptions): AutoI18nConfig['locales'];
|
|
53
|
-
|
|
56
|
+
interface ResolvedI18nRoute {
|
|
57
|
+
name?: string;
|
|
58
|
+
path: string;
|
|
59
|
+
children?: ResolvedI18nRoute[];
|
|
60
|
+
}
|
|
61
|
+
/** Normalize an i18n `pages` key to the corresponding resolved Nuxt route name. Build-time only. */
|
|
62
|
+
declare function normalizeI18nPageKey(key: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* Complete partial i18n `pages` entries from Nuxt's resolved route table.
|
|
65
|
+
*
|
|
66
|
+
* Route names are identifiers, not URL paths. The resolved route path is the
|
|
67
|
+
* only safe fallback for nested, dynamic, grouped, or custom Nuxt routes.
|
|
68
|
+
* Whole-route `false` becomes a tagged entry carrying that resolved path.
|
|
69
|
+
*/
|
|
70
|
+
declare function materializeI18nPages(autoI18n: AutoI18nConfig, routes: readonly ResolvedI18nRoute[]): I18nPages | undefined;
|
|
71
|
+
declare function mapPathForI18nPages(path: string, autoI18n: AutoI18nConfig, routes?: readonly ResolvedI18nRoute[]): string[] | false;
|
|
54
72
|
interface I18nModuleResolution {
|
|
55
73
|
module: I18nModuleName;
|
|
56
74
|
isMicro: boolean;
|
|
@@ -67,10 +85,12 @@ declare function resolveI18nConfig(logger?: {
|
|
|
67
85
|
/**
|
|
68
86
|
* Strip a build-time i18n config down to what `./i18n-runtime` needs, dropping
|
|
69
87
|
* the non-serializable `LocaleObject` extras so it can be handed to the runtime
|
|
70
|
-
* through `runtimeConfig`.
|
|
88
|
+
* through `runtimeConfig`. Materialize partial and whole-route-false `pages`
|
|
89
|
+
* entries before calling this function; unresolved whole-route false entries
|
|
90
|
+
* are omitted instead of becoming fabricated runtime URLs.
|
|
71
91
|
*/
|
|
72
92
|
declare function toRuntimeI18nConfig(auto: AutoI18nConfig): RuntimeI18nConfig;
|
|
73
93
|
declare function mergeOnKey<T extends Record<string, any>>(arr: T[], key: keyof T): T[];
|
|
74
94
|
|
|
75
|
-
export { RuntimeI18nConfig, expandCompactLocaleRoute, generatePathForI18nPages, isCompactLocaleRoute, mapPathForI18nPages, mergeOnKey, normalizeLocales, resolveI18nConfig, resolveI18nModule, splitPathForI18nLocales, toRuntimeI18nConfig };
|
|
76
|
-
export type { AutoI18nConfig, ExpandedLocaleRoute, I18nModuleResolution, NormalisedLocale, Strategies, StrategyProps };
|
|
95
|
+
export { RuntimeI18nConfig, UnlocalizedLocalePage, expandCompactLocaleRoute, generatePathForI18nPages, isCompactLocaleRoute, mapPathForI18nPages, materializeI18nPages, mergeOnKey, normalizeI18nPageKey, normalizeLocales, resolveI18nConfig, resolveI18nModule, splitPathForI18nLocales, toRuntimeI18nConfig };
|
|
96
|
+
export type { AutoI18nConfig, ExpandedLocaleRoute, I18nModuleResolution, NormalisedLocale, ResolvedI18nRoute, Strategies, StrategyProps };
|
package/dist/i18n.mjs
CHANGED
|
@@ -8,6 +8,9 @@ import 'pkg-types';
|
|
|
8
8
|
import 'std-env';
|
|
9
9
|
|
|
10
10
|
const I18N_MODULES = ["@nuxtjs/i18n", "nuxt-i18n-micro"];
|
|
11
|
+
function isUnlocalizedLocalePage(page) {
|
|
12
|
+
return page._tag === "unlocalized" && typeof page.path === "string";
|
|
13
|
+
}
|
|
11
14
|
function generatePathForI18nPages(ctx) {
|
|
12
15
|
const { localeCode, pageLocales, nuxtI18nConfig, forcedStrategy, normalisedLocales } = ctx;
|
|
13
16
|
const locale = normalisedLocales.find((l) => l.code === localeCode);
|
|
@@ -78,28 +81,110 @@ function normalizeLocales(nuxtI18nConfig) {
|
|
|
78
81
|
return { ...locale, _hreflang, _sitemap };
|
|
79
82
|
});
|
|
80
83
|
}
|
|
81
|
-
function
|
|
84
|
+
function joinRoutePath(parentPath, path) {
|
|
85
|
+
if (path.startsWith("/"))
|
|
86
|
+
return path;
|
|
87
|
+
if (!path)
|
|
88
|
+
return parentPath || "/";
|
|
89
|
+
return `${parentPath === "/" ? "" : parentPath.replace(/\/$/, "")}/${path}`;
|
|
90
|
+
}
|
|
91
|
+
function resolveLocalizedRouteName(name, autoI18n) {
|
|
92
|
+
if (!name)
|
|
93
|
+
return { name, isDefaultTree: false };
|
|
94
|
+
const separator = autoI18n.routesNameSeparator || "___";
|
|
95
|
+
const defaultSuffix = autoI18n.defaultLocaleRouteNameSuffix || "default";
|
|
96
|
+
const segments = name.split(separator);
|
|
97
|
+
const isDefaultTree = segments.at(-1) === defaultSuffix && autoI18n.locales.some((locale2) => locale2.code === segments.at(-2));
|
|
98
|
+
if (isDefaultTree)
|
|
99
|
+
segments.pop();
|
|
100
|
+
const locale = autoI18n.locales.find((locale2) => locale2.code === segments.at(-1))?.code;
|
|
101
|
+
if (locale)
|
|
102
|
+
segments.pop();
|
|
103
|
+
return {
|
|
104
|
+
name: segments.join(separator),
|
|
105
|
+
...locale ? { locale } : {},
|
|
106
|
+
isDefaultTree
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function flattenResolvedI18nRoutes(routes, autoI18n, parentPath = "") {
|
|
110
|
+
return routes.flatMap((route) => {
|
|
111
|
+
const path = joinRoutePath(parentPath, route.path);
|
|
112
|
+
return [
|
|
113
|
+
{ ...resolveLocalizedRouteName(route.name, autoI18n), path, hasChildren: !!route.children?.length },
|
|
114
|
+
...flattenResolvedI18nRoutes(route.children || [], autoI18n, path)
|
|
115
|
+
];
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function normalizeI18nPageKey(key) {
|
|
119
|
+
return key.replace(/^\//, "").replace(/\/index$/, "").replace(/\[{1,2}(?:\.\.\.)?([^\]]+)\]{1,2}/g, "$1").split("/").filter((segment) => !/^\([^)]+\)$/.test(segment)).join("-");
|
|
120
|
+
}
|
|
121
|
+
function routeBasePath(route, autoI18n) {
|
|
122
|
+
if (!route.locale || autoI18n.strategy === "no_prefix")
|
|
123
|
+
return route.path;
|
|
124
|
+
return resolveLocaleFromRoute(route.path, toRuntimeI18nConfig(autoI18n), { locale: route.locale }).basePath;
|
|
125
|
+
}
|
|
126
|
+
function materializeI18nPages(autoI18n, routes) {
|
|
127
|
+
const pages = autoI18n.pages;
|
|
128
|
+
if (!pages)
|
|
129
|
+
return void 0;
|
|
130
|
+
const resolvedRoutes = flattenResolvedI18nRoutes(routes, autoI18n);
|
|
131
|
+
return Object.fromEntries(Object.entries(pages).map(([pageName, pageLocales]) => {
|
|
132
|
+
const normalizedPageName = normalizeI18nPageKey(pageName);
|
|
133
|
+
const namedRoutes = resolvedRoutes.filter((route) => route.name === pageName || route.name === normalizedPageName);
|
|
134
|
+
if (pageLocales === false) {
|
|
135
|
+
const route = namedRoutes.find((route2) => route2.locale === autoI18n.defaultLocale) || namedRoutes.find((route2) => !route2.locale) || namedRoutes[0];
|
|
136
|
+
return [pageName, route ? {
|
|
137
|
+
_tag: "unlocalized",
|
|
138
|
+
path: routeBasePath(route, autoI18n),
|
|
139
|
+
...route.hasChildren ? { subtree: true } : {}
|
|
140
|
+
} : false];
|
|
141
|
+
}
|
|
142
|
+
if (isUnlocalizedLocalePage(pageLocales))
|
|
143
|
+
return [pageName, pageLocales];
|
|
144
|
+
const explicitlyMatchedRoute = resolvedRoutes.find((route) => Object.values(pageLocales).some(
|
|
145
|
+
(configuredPath) => typeof configuredPath === "string" && routeBasePath(route, autoI18n) === configuredPath
|
|
146
|
+
));
|
|
147
|
+
const routeGroup = namedRoutes.length ? namedRoutes : explicitlyMatchedRoute?.name ? resolvedRoutes.filter((route) => route.name === explicitlyMatchedRoute.name) : [];
|
|
148
|
+
const defaultRoute = routeGroup.find((route) => route.locale === autoI18n.defaultLocale && route.isDefaultTree) || routeGroup.find((route) => route.locale === autoI18n.defaultLocale) || routeGroup.find((route) => !route.locale) || routeGroup.find((route) => route.locale && pageLocales[route.locale] === void 0);
|
|
149
|
+
const originalPath = defaultRoute ? routeBasePath(defaultRoute, autoI18n) : void 0;
|
|
150
|
+
const defaultPath = pageLocales[autoI18n.defaultLocale];
|
|
151
|
+
const fallbackPath = typeof defaultPath === "string" ? defaultPath : originalPath;
|
|
152
|
+
return [pageName, Object.fromEntries(autoI18n.locales.flatMap((locale) => {
|
|
153
|
+
const configuredPath = pageLocales[locale.code];
|
|
154
|
+
if (configuredPath !== void 0)
|
|
155
|
+
return [[locale.code, configuredPath]];
|
|
156
|
+
return fallbackPath === void 0 ? [] : [[locale.code, fallbackPath]];
|
|
157
|
+
}))];
|
|
158
|
+
}));
|
|
159
|
+
}
|
|
160
|
+
function mapPathForI18nPages(path, autoI18n, routes = []) {
|
|
82
161
|
const pages = autoI18n.pages;
|
|
83
162
|
if (!pages || !Object.keys(pages).length)
|
|
84
163
|
return false;
|
|
85
|
-
const materializedPages =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
164
|
+
const materializedPages = routes.length ? materializeI18nPages(autoI18n, routes) : pages;
|
|
165
|
+
const resolvedRoutes = flattenResolvedI18nRoutes(routes, autoI18n);
|
|
166
|
+
const pagesForMapping = Object.fromEntries(Object.entries(materializedPages || {}).map(([pageName, pageLocales]) => {
|
|
167
|
+
if (pageLocales !== false)
|
|
168
|
+
return [pageName, pageLocales];
|
|
169
|
+
const normalizedPageName = normalizeI18nPageKey(pageName);
|
|
170
|
+
const route = resolvedRoutes.find((route2) => route2.name === pageName || route2.name === normalizedPageName);
|
|
171
|
+
if (!route)
|
|
172
|
+
return [pageName, false];
|
|
173
|
+
const originalPath = routeBasePath(route, autoI18n);
|
|
174
|
+
return [pageName, Object.fromEntries(autoI18n.locales.map((locale) => [
|
|
175
|
+
locale.code,
|
|
176
|
+
locale.code === autoI18n.defaultLocale ? originalPath : false
|
|
177
|
+
]))];
|
|
178
|
+
}));
|
|
94
179
|
const i18n = toRuntimeI18nConfig({
|
|
95
180
|
...autoI18n,
|
|
96
181
|
strategy: autoI18n.strategy === "prefix_and_default" ? "prefix_except_default" : autoI18n.strategy,
|
|
97
|
-
pages:
|
|
182
|
+
pages: pagesForMapping
|
|
98
183
|
});
|
|
99
184
|
const resolved = resolveLocaleAlternates(path, i18n, autoI18n.strategy === "no_prefix" ? { locale: autoI18n.defaultLocale } : {});
|
|
100
185
|
if (resolved._tag === "strategy")
|
|
101
186
|
return false;
|
|
102
|
-
return resolved.alternates.
|
|
187
|
+
return resolved.alternates.map((alternate) => alternate.domain ? withHttps(withBase(alternate.path, alternate.domain)) : alternate.path);
|
|
103
188
|
}
|
|
104
189
|
function resolveI18nModule() {
|
|
105
190
|
const found = I18N_MODULES.find((m) => hasNuxtModule(m));
|
|
@@ -115,7 +200,7 @@ function resolveI18nPages(config, isMicro) {
|
|
|
115
200
|
if (!routes)
|
|
116
201
|
return void 0;
|
|
117
202
|
return Object.fromEntries(
|
|
118
|
-
Object.entries(routes).filter((entry) => typeof entry[1] === "object" && entry[1] !== null && !Array.isArray(entry[1]))
|
|
203
|
+
Object.entries(routes).filter((entry) => entry[1] === false || typeof entry[1] === "object" && entry[1] !== null && !Array.isArray(entry[1]))
|
|
119
204
|
);
|
|
120
205
|
}
|
|
121
206
|
async function resolveI18nConfig(logger) {
|
|
@@ -138,6 +223,8 @@ async function resolveI18nConfig(logger) {
|
|
|
138
223
|
return {
|
|
139
224
|
differentDomains: nuxtI18nConfig.differentDomains,
|
|
140
225
|
multiDomainLocales: nuxtI18nConfig.multiDomainLocales,
|
|
226
|
+
routesNameSeparator: nuxtI18nConfig.routesNameSeparator,
|
|
227
|
+
defaultLocaleRouteNameSuffix: nuxtI18nConfig.defaultLocaleRouteNameSuffix,
|
|
141
228
|
defaultLocale: nuxtI18nConfig.defaultLocale,
|
|
142
229
|
locales: normalisedLocales,
|
|
143
230
|
strategy: nuxtI18nConfig.strategy,
|
|
@@ -145,6 +232,9 @@ async function resolveI18nConfig(logger) {
|
|
|
145
232
|
};
|
|
146
233
|
}
|
|
147
234
|
function toRuntimeI18nConfig(auto) {
|
|
235
|
+
const pages = auto.pages && Object.fromEntries(
|
|
236
|
+
Object.entries(auto.pages).filter((entry) => entry[1] !== false)
|
|
237
|
+
);
|
|
148
238
|
return {
|
|
149
239
|
defaultLocale: auto.defaultLocale,
|
|
150
240
|
strategy: auto.strategy,
|
|
@@ -153,7 +243,7 @@ function toRuntimeI18nConfig(auto) {
|
|
|
153
243
|
// Translated route paths. Without these the runtime can only guess
|
|
154
244
|
// alternates by adding/removing a locale prefix, which is wrong for every
|
|
155
245
|
// page whose slug differs per locale.
|
|
156
|
-
...
|
|
246
|
+
...pages && Object.keys(pages).length ? { pages } : {},
|
|
157
247
|
locales: auto.locales.map((l) => {
|
|
158
248
|
const raw = l;
|
|
159
249
|
return {
|
|
@@ -182,4 +272,4 @@ function mergeOnKey(arr, key) {
|
|
|
182
272
|
return [...map.values()];
|
|
183
273
|
}
|
|
184
274
|
|
|
185
|
-
export { expandCompactLocaleRoute, generatePathForI18nPages, isCompactLocaleRoute, mapPathForI18nPages, mergeOnKey, normalizeLocales, resolveI18nConfig, resolveI18nModule, splitPathForI18nLocales, toRuntimeI18nConfig };
|
|
275
|
+
export { expandCompactLocaleRoute, generatePathForI18nPages, isCompactLocaleRoute, mapPathForI18nPages, materializeI18nPages, mergeOnKey, normalizeI18nPageKey, normalizeLocales, resolveI18nConfig, resolveI18nModule, splitPathForI18nLocales, toRuntimeI18nConfig };
|
package/dist/kit.d.mts
CHANGED
|
@@ -97,6 +97,47 @@ type UnheadMajor = 2 | 3;
|
|
|
97
97
|
* that ships both majors can use this to alias to the matching one.
|
|
98
98
|
*/
|
|
99
99
|
declare function resolveHostUnheadMajor(rootDir: string): Promise<UnheadMajor>;
|
|
100
|
+
declare const COMARK_CONTENT_MODULE = "@harlan-zw/comark-content";
|
|
101
|
+
/**
|
|
102
|
+
* The Markdown content module backing this app, if any.
|
|
103
|
+
*
|
|
104
|
+
* `@nuxt/content` and `comark-content` both fire the `content:file:beforeParse`
|
|
105
|
+
* and `content:file:afterParse` build hooks with the same context shape, so a
|
|
106
|
+
* module's frontmatter handling is written once. They differ at runtime:
|
|
107
|
+
* `@nuxt/content` queries a SQL database, comark reads Nitro server assets.
|
|
108
|
+
*/
|
|
109
|
+
type ContentProvider = {
|
|
110
|
+
_tag: 'None';
|
|
111
|
+
} | {
|
|
112
|
+
_tag: 'NuxtContent';
|
|
113
|
+
version: 2 | 3;
|
|
114
|
+
} | {
|
|
115
|
+
_tag: 'Comark';
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Detect which Markdown content module is installed.
|
|
119
|
+
*
|
|
120
|
+
* `@nuxt/content` wins when both are present: it owns the `content` config key
|
|
121
|
+
* and its runtime is the one the app's pages query.
|
|
122
|
+
*/
|
|
123
|
+
declare function resolveContentProvider(nuxt?: Nuxt): Promise<ContentProvider>;
|
|
124
|
+
/**
|
|
125
|
+
* Whether the provider fires the `content:file:*` build hooks, which is where
|
|
126
|
+
* every module maps its frontmatter field onto the parsed page.
|
|
127
|
+
*/
|
|
128
|
+
declare function hasContentFileHooks(provider: ContentProvider): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Alias `#nuxtseo/content` to the shim for the detected provider.
|
|
131
|
+
*
|
|
132
|
+
* Consumers import collection enumeration and page queries from that one
|
|
133
|
+
* specifier instead of naming `@nuxt/content/server` or
|
|
134
|
+
* `@harlan-zw/comark-content/server`. Naming a package directly would put it in
|
|
135
|
+
* every build, and a build without that package installed fails to bundle.
|
|
136
|
+
*
|
|
137
|
+
* Nuxt Content v2 has no collection model, so it resolves to the empty shim.
|
|
138
|
+
* A module that supports v2 keeps its own v2 path.
|
|
139
|
+
*/
|
|
140
|
+
declare function setupContentRuntime(provider: ContentProvider, nuxt?: Nuxt): void;
|
|
100
141
|
|
|
101
|
-
export { createNitroPromise, createPagesPromise, detectNuxtSeoModules, detectTarget, extendTypes, getNuxtModuleOptions, isNuxtGenerate, renderNitroTypeAugmentations, resolveHostUnheadMajor, resolveNitroPreset, resolveNuxtContentVersion, resolvePackageMajor, setupNitroRuntimeCompatibility, useModuleLogger };
|
|
102
|
-
export type { NitroRuntimeCompatibility, NitroTypeAugmentations, NuxtContentVersion, NuxtSeoModuleDetection, UnheadMajor };
|
|
142
|
+
export { COMARK_CONTENT_MODULE, createNitroPromise, createPagesPromise, detectNuxtSeoModules, detectTarget, extendTypes, getNuxtModuleOptions, hasContentFileHooks, isNuxtGenerate, renderNitroTypeAugmentations, resolveContentProvider, resolveHostUnheadMajor, resolveNitroPreset, resolveNuxtContentVersion, resolvePackageMajor, setupContentRuntime, setupNitroRuntimeCompatibility, useModuleLogger };
|
|
143
|
+
export type { ContentProvider, NitroRuntimeCompatibility, NitroTypeAugmentations, NuxtContentVersion, NuxtSeoModuleDetection, UnheadMajor };
|
package/dist/kit.d.ts
CHANGED
|
@@ -97,6 +97,47 @@ type UnheadMajor = 2 | 3;
|
|
|
97
97
|
* that ships both majors can use this to alias to the matching one.
|
|
98
98
|
*/
|
|
99
99
|
declare function resolveHostUnheadMajor(rootDir: string): Promise<UnheadMajor>;
|
|
100
|
+
declare const COMARK_CONTENT_MODULE = "@harlan-zw/comark-content";
|
|
101
|
+
/**
|
|
102
|
+
* The Markdown content module backing this app, if any.
|
|
103
|
+
*
|
|
104
|
+
* `@nuxt/content` and `comark-content` both fire the `content:file:beforeParse`
|
|
105
|
+
* and `content:file:afterParse` build hooks with the same context shape, so a
|
|
106
|
+
* module's frontmatter handling is written once. They differ at runtime:
|
|
107
|
+
* `@nuxt/content` queries a SQL database, comark reads Nitro server assets.
|
|
108
|
+
*/
|
|
109
|
+
type ContentProvider = {
|
|
110
|
+
_tag: 'None';
|
|
111
|
+
} | {
|
|
112
|
+
_tag: 'NuxtContent';
|
|
113
|
+
version: 2 | 3;
|
|
114
|
+
} | {
|
|
115
|
+
_tag: 'Comark';
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Detect which Markdown content module is installed.
|
|
119
|
+
*
|
|
120
|
+
* `@nuxt/content` wins when both are present: it owns the `content` config key
|
|
121
|
+
* and its runtime is the one the app's pages query.
|
|
122
|
+
*/
|
|
123
|
+
declare function resolveContentProvider(nuxt?: Nuxt): Promise<ContentProvider>;
|
|
124
|
+
/**
|
|
125
|
+
* Whether the provider fires the `content:file:*` build hooks, which is where
|
|
126
|
+
* every module maps its frontmatter field onto the parsed page.
|
|
127
|
+
*/
|
|
128
|
+
declare function hasContentFileHooks(provider: ContentProvider): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Alias `#nuxtseo/content` to the shim for the detected provider.
|
|
131
|
+
*
|
|
132
|
+
* Consumers import collection enumeration and page queries from that one
|
|
133
|
+
* specifier instead of naming `@nuxt/content/server` or
|
|
134
|
+
* `@harlan-zw/comark-content/server`. Naming a package directly would put it in
|
|
135
|
+
* every build, and a build without that package installed fails to bundle.
|
|
136
|
+
*
|
|
137
|
+
* Nuxt Content v2 has no collection model, so it resolves to the empty shim.
|
|
138
|
+
* A module that supports v2 keeps its own v2 path.
|
|
139
|
+
*/
|
|
140
|
+
declare function setupContentRuntime(provider: ContentProvider, nuxt?: Nuxt): void;
|
|
100
141
|
|
|
101
|
-
export { createNitroPromise, createPagesPromise, detectNuxtSeoModules, detectTarget, extendTypes, getNuxtModuleOptions, isNuxtGenerate, renderNitroTypeAugmentations, resolveHostUnheadMajor, resolveNitroPreset, resolveNuxtContentVersion, resolvePackageMajor, setupNitroRuntimeCompatibility, useModuleLogger };
|
|
102
|
-
export type { NitroRuntimeCompatibility, NitroTypeAugmentations, NuxtContentVersion, NuxtSeoModuleDetection, UnheadMajor };
|
|
142
|
+
export { COMARK_CONTENT_MODULE, createNitroPromise, createPagesPromise, detectNuxtSeoModules, detectTarget, extendTypes, getNuxtModuleOptions, hasContentFileHooks, isNuxtGenerate, renderNitroTypeAugmentations, resolveContentProvider, resolveHostUnheadMajor, resolveNitroPreset, resolveNuxtContentVersion, resolvePackageMajor, setupContentRuntime, setupNitroRuntimeCompatibility, useModuleLogger };
|
|
143
|
+
export type { ContentProvider, NitroRuntimeCompatibility, NitroTypeAugmentations, NuxtContentVersion, NuxtSeoModuleDetection, UnheadMajor };
|
package/dist/kit.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { pathToFileURL } from 'node:url';
|
|
2
|
-
import { getNuxtVersion, addTypeTemplate, useNuxt, useLogger, resolveModule, directoryToURL, createResolver, addTemplate, loadNuxtModuleInstance,
|
|
2
|
+
import { getNuxtVersion, addTypeTemplate, useNuxt, useLogger, resolveModule, directoryToURL, createResolver, addTemplate, loadNuxtModuleInstance, hasNuxtModule, tryUseNuxt, hasNuxtModuleCompatibility } from '@nuxt/kit';
|
|
3
3
|
import { relative, dirname } from 'pathe';
|
|
4
4
|
import { resolvePackageJSON, readPackageJSON } from 'pkg-types';
|
|
5
5
|
import { provider, env } from 'std-env';
|
|
@@ -356,5 +356,41 @@ async function resolveHostUnheadMajor(rootDir) {
|
|
|
356
356
|
}
|
|
357
357
|
return 3;
|
|
358
358
|
}
|
|
359
|
+
const COMARK_CONTENT_MODULE = "@harlan-zw/comark-content";
|
|
360
|
+
const COMARK_CONTENT_MINIMUM = [0, 1, 2];
|
|
361
|
+
async function comarkSatisfiesMinimum(nuxt) {
|
|
362
|
+
const pkg = await readPackageJSON(COMARK_CONTENT_MODULE, { url: normalizePackageUrl(nuxt.options.rootDir) }).catch(() => {
|
|
363
|
+
return null;
|
|
364
|
+
});
|
|
365
|
+
const parts = pkg?.version?.split(".").map((part) => Number.parseInt(part, 10));
|
|
366
|
+
if (!parts || parts.length < 3 || parts.some((part) => !Number.isFinite(part)))
|
|
367
|
+
return false;
|
|
368
|
+
for (const [index, minimum] of COMARK_CONTENT_MINIMUM.entries()) {
|
|
369
|
+
if (parts[index] !== minimum)
|
|
370
|
+
return parts[index] > minimum;
|
|
371
|
+
}
|
|
372
|
+
return true;
|
|
373
|
+
}
|
|
374
|
+
async function resolveContentProvider(nuxt = useNuxt()) {
|
|
375
|
+
const nuxtContent = await resolveNuxtContentVersion();
|
|
376
|
+
if (nuxtContent)
|
|
377
|
+
return { _tag: "NuxtContent", version: nuxtContent.version };
|
|
378
|
+
if (hasNuxtModule(COMARK_CONTENT_MODULE, nuxt) && await comarkSatisfiesMinimum(nuxt))
|
|
379
|
+
return { _tag: "Comark" };
|
|
380
|
+
return { _tag: "None" };
|
|
381
|
+
}
|
|
382
|
+
function hasContentFileHooks(provider2) {
|
|
383
|
+
return provider2._tag === "Comark" || provider2._tag === "NuxtContent" && provider2.version === 3;
|
|
384
|
+
}
|
|
385
|
+
function setupContentRuntime(provider2, nuxt = useNuxt()) {
|
|
386
|
+
const shim = provider2._tag === "Comark" ? "comark" : provider2._tag === "NuxtContent" && provider2.version === 3 ? "nuxt-content-v3" : "none";
|
|
387
|
+
const resolver = createResolver(import.meta.url);
|
|
388
|
+
const nitro = nuxt.options.nitro ??= {};
|
|
389
|
+
nitro.alias ??= {};
|
|
390
|
+
nitro.alias["#nuxtseo/content"] = resolver.resolve(`./runtime/content/${shim}`);
|
|
391
|
+
nitro.externals ??= {};
|
|
392
|
+
nitro.externals.inline ??= [];
|
|
393
|
+
nitro.externals.inline.push(resolver.resolve("./runtime/content/"));
|
|
394
|
+
}
|
|
359
395
|
|
|
360
|
-
export { createNitroPromise, createPagesPromise, detectNuxtSeoModules, detectTarget, extendTypes, getNuxtModuleOptions, isNuxtGenerate, renderNitroTypeAugmentations, resolveHostUnheadMajor, resolveNitroPreset, resolveNuxtContentVersion, resolvePackageMajor, setupNitroRuntimeCompatibility, useModuleLogger };
|
|
396
|
+
export { COMARK_CONTENT_MODULE, createNitroPromise, createPagesPromise, detectNuxtSeoModules, detectTarget, extendTypes, getNuxtModuleOptions, hasContentFileHooks, isNuxtGenerate, renderNitroTypeAugmentations, resolveContentProvider, resolveHostUnheadMajor, resolveNitroPreset, resolveNuxtContentVersion, resolvePackageMajor, setupContentRuntime, setupNitroRuntimeCompatibility, useModuleLogger };
|
package/dist/module.json
CHANGED
|
File without changes
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { queryCollection, queryCollectionManifest } from "@harlan-zw/comark-content/server";
|
|
2
|
+
export const provider = "comark";
|
|
3
|
+
export async function listPageCollections(event) {
|
|
4
|
+
const manifest = await queryCollectionManifest(event);
|
|
5
|
+
return manifest.map((entry) => ({
|
|
6
|
+
name: entry.name,
|
|
7
|
+
// comark derives no field list from a schema, so every field is available to ask
|
|
8
|
+
// for. A collection opts out of the sitemap on the collection itself.
|
|
9
|
+
hasField: () => true,
|
|
10
|
+
inSitemap: entry.sitemap
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
export function queryPages(event, collection) {
|
|
14
|
+
const wheres = [];
|
|
15
|
+
let selected;
|
|
16
|
+
const query = {
|
|
17
|
+
where(field, operator, value) {
|
|
18
|
+
wheres.push([field, operator, value]);
|
|
19
|
+
return query;
|
|
20
|
+
},
|
|
21
|
+
select(...fields) {
|
|
22
|
+
selected = fields;
|
|
23
|
+
return query;
|
|
24
|
+
},
|
|
25
|
+
async all() {
|
|
26
|
+
const notNull = wheres.filter(([, operator]) => operator === "IS NOT NULL").map(([field]) => field);
|
|
27
|
+
const builder = queryCollection(event, collection);
|
|
28
|
+
for (const [field, operator, value] of wheres) {
|
|
29
|
+
if (operator !== "IS NOT NULL")
|
|
30
|
+
builder.where(field, operator, value);
|
|
31
|
+
}
|
|
32
|
+
if (selected)
|
|
33
|
+
builder.select(.../* @__PURE__ */ new Set([...selected, ...notNull]));
|
|
34
|
+
const rows = await builder.all();
|
|
35
|
+
return rows.filter((row) => notNull.every((field) => row[field] !== null && row[field] !== void 0));
|
|
36
|
+
},
|
|
37
|
+
async first() {
|
|
38
|
+
return (await query.all())[0] ?? null;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return query;
|
|
42
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { queryCollection } from "@nuxt/content/server";
|
|
2
|
+
import manifest from "#content/manifest";
|
|
3
|
+
export const provider = "nuxt-content-v3";
|
|
4
|
+
export async function listPageCollections(_event) {
|
|
5
|
+
return Object.entries(manifest).map(([name, entry]) => ({
|
|
6
|
+
name,
|
|
7
|
+
hasField: (field) => !!entry.fields && field in entry.fields,
|
|
8
|
+
// @nuxt/content has no collection level sitemap opt out. The schema field is
|
|
9
|
+
// the opt in, which `hasField` answers.
|
|
10
|
+
inSitemap: true
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
export function queryPages(event, collection) {
|
|
14
|
+
return queryCollection(event, collection);
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxtseo-shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.3.
|
|
4
|
+
"version": "5.3.13",
|
|
5
5
|
"description": "Shared utilities for Nuxt SEO modules.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
"types": "./dist/content.d.mts",
|
|
29
29
|
"default": "./dist/content.mjs"
|
|
30
30
|
},
|
|
31
|
+
"./content-runtime": {
|
|
32
|
+
"types": "./dist/content-runtime.d.mts",
|
|
33
|
+
"default": "./dist/content-runtime.mjs"
|
|
34
|
+
},
|
|
31
35
|
"./kit": {
|
|
32
36
|
"types": "./dist/kit.d.mts",
|
|
33
37
|
"default": "./dist/kit.mjs"
|
|
@@ -100,6 +104,8 @@
|
|
|
100
104
|
},
|
|
101
105
|
"devDependencies": {
|
|
102
106
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
107
|
+
"@harlan-zw/comark-content": "^0.1.3",
|
|
108
|
+
"@nuxt/content": "^3.15.2",
|
|
103
109
|
"@nuxt/module-builder": "^1.0.3",
|
|
104
110
|
"@nuxt/schema": "^4.5.2",
|
|
105
111
|
"@nuxt/test-utils": "^4.1.0",
|
|
@@ -107,7 +113,7 @@
|
|
|
107
113
|
"h3": "^1.15.11",
|
|
108
114
|
"nitropack": "^2.13.4",
|
|
109
115
|
"nuxt": "^4.5.2",
|
|
110
|
-
"nuxt-site-config": "^4.
|
|
116
|
+
"nuxt-site-config": "^4.2.2",
|
|
111
117
|
"typescript": "6.0.3",
|
|
112
118
|
"vitest": "^4.1.10",
|
|
113
119
|
"vue": "^3.5.41",
|