@verbaly/next 0.82.0 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/server.js +9 -12
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<a href="https://www.npmjs.com/package/@verbaly/next"><img src="https://img.shields.io/npm/v/@verbaly/next?logo=npm&color=cb3837" alt="npm version" /></a>
|
|
9
|
+
<a href="https://verbaly-web.vercel.app/docs/frameworks/react#next"><img src="https://img.shields.io/npm/dependency-version/@verbaly/next/peer/next?logo=nextdotjs&logoColor=white&label=Next.js&color=000000" alt="supported Next.js versions" /></a>
|
|
10
|
+
<a href="https://scorecard.dev/viewer/?uri=github.com/AronSoto/verbaly"><img src="https://api.scorecard.dev/projects/github.com/AronSoto/verbaly/badge" alt="OpenSSF Scorecard" /></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/@verbaly/next#provenance"><img src="https://img.shields.io/badge/provenance-SLSA%20v1-3fb950?logo=npm" alt="published with npm provenance" /></a>
|
|
9
12
|
<a href="https://github.com/AronSoto/verbaly/blob/develop/LICENSE"><img src="https://img.shields.io/npm/l/@verbaly/next?color=blue" alt="MIT" /></a>
|
|
10
13
|
</p>
|
|
11
14
|
|
package/dist/index.cjs
CHANGED
|
@@ -202,11 +202,11 @@ function withVerbaly(nextConfig, options = {}) {
|
|
|
202
202
|
const root = verbalyConfig.root ?? process.cwd();
|
|
203
203
|
if (phase !== DEV_PHASE && phase !== BUILD_PHASE && phase !== ANALYZE_PHASE) return composeConfig(base, root);
|
|
204
204
|
const compiler = await import("@verbaly/compiler");
|
|
205
|
-
const
|
|
205
|
+
const overrides = {
|
|
206
206
|
trailingSlash: base.trailingSlash ? "always" : "never",
|
|
207
207
|
...verbalyConfig
|
|
208
208
|
};
|
|
209
|
-
const cfg = await compiler.loadConfig(root,
|
|
209
|
+
const cfg = await compiler.loadConfig(root, overrides, { plugin: true });
|
|
210
210
|
const catalogs = compiler.loadCatalogs(cfg);
|
|
211
211
|
const registry = await compiler.extractProject(cfg);
|
|
212
212
|
await compiler.reportOutsideInclude(cfg);
|
package/dist/index.js
CHANGED
|
@@ -201,11 +201,11 @@ function withVerbaly(nextConfig, options = {}) {
|
|
|
201
201
|
const root = verbalyConfig.root ?? process.cwd();
|
|
202
202
|
if (phase !== DEV_PHASE && phase !== BUILD_PHASE && phase !== ANALYZE_PHASE) return composeConfig(base, root);
|
|
203
203
|
const compiler = await import("@verbaly/compiler");
|
|
204
|
-
const
|
|
204
|
+
const overrides = {
|
|
205
205
|
trailingSlash: base.trailingSlash ? "always" : "never",
|
|
206
206
|
...verbalyConfig
|
|
207
207
|
};
|
|
208
|
-
const cfg = await compiler.loadConfig(root,
|
|
208
|
+
const cfg = await compiler.loadConfig(root, overrides, { plugin: true });
|
|
209
209
|
const catalogs = compiler.loadCatalogs(cfg);
|
|
210
210
|
const registry = await compiler.extractProject(cfg);
|
|
211
211
|
await compiler.reportOutsideInclude(cfg);
|
package/dist/server.js
CHANGED
|
@@ -16,23 +16,23 @@ function setRequestLocale(locale) {
|
|
|
16
16
|
if (routing === "no-prefix") warnOnce("setRequestLocale got a locale segment while routing is \"no-prefix\": if your urls start with the locale, set routing to 'prefix-all' or 'prefix-except-source' in your verbaly config");
|
|
17
17
|
holder().locale = locale;
|
|
18
18
|
}
|
|
19
|
+
function projectLocale(name) {
|
|
20
|
+
return localeFromPath({
|
|
21
|
+
supported: locales,
|
|
22
|
+
path: `/${name}`
|
|
23
|
+
});
|
|
24
|
+
}
|
|
19
25
|
async function declaredLocale() {
|
|
20
26
|
const raw = holder().locale;
|
|
21
27
|
if (raw !== void 0) {
|
|
22
|
-
const match =
|
|
23
|
-
supported: locales,
|
|
24
|
-
path: `/${raw}`
|
|
25
|
-
});
|
|
28
|
+
const match = projectLocale(raw);
|
|
26
29
|
if (match) return match;
|
|
27
30
|
warnOnce(`setRequestLocale was given a locale the project does not have, so it was ignored`);
|
|
28
31
|
return;
|
|
29
32
|
}
|
|
30
33
|
const segment = await rootSegment();
|
|
31
34
|
if (segment === void 0) return void 0;
|
|
32
|
-
const match =
|
|
33
|
-
supported: locales,
|
|
34
|
-
path: `/${segment}`
|
|
35
|
-
});
|
|
35
|
+
const match = projectLocale(segment);
|
|
36
36
|
if (match) return match;
|
|
37
37
|
warnOnce(`the locale segment of the url holds a locale the project does not have, so it was ignored`);
|
|
38
38
|
}
|
|
@@ -44,10 +44,7 @@ async function rootSegment() {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
function namedLocale(raw) {
|
|
47
|
-
const match =
|
|
48
|
-
supported: locales,
|
|
49
|
-
path: `/${raw}`
|
|
50
|
-
});
|
|
47
|
+
const match = projectLocale(raw);
|
|
51
48
|
if (match) return match;
|
|
52
49
|
warnOnce(`getT was asked for a locale the project does not have, so it answers in the source`);
|
|
53
50
|
return sourceLocale;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verbaly/next",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.84.0",
|
|
4
4
|
"description": "Next.js integration for Verbaly: App Router/RSC with per-request locale negotiation, Turbopack and webpack support, flash-free hydration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -68,23 +68,23 @@
|
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@verbaly/compiler": "^0.
|
|
71
|
+
"@verbaly/compiler": "^0.84.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@verbaly/react": "^0.
|
|
74
|
+
"@verbaly/react": "^0.84.0",
|
|
75
75
|
"next": "^15.0.0 || ^16.0.0",
|
|
76
76
|
"react": "^18.0.0 || ^19.0.0",
|
|
77
|
-
"verbaly": "^0.
|
|
77
|
+
"verbaly": "^0.84.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@types/react": "^19.3.0",
|
|
81
81
|
"@types/react-dom": "^19.3.0",
|
|
82
|
-
"@verbaly/react": "^0.
|
|
82
|
+
"@verbaly/react": "^0.84.0",
|
|
83
83
|
"happy-dom": "^21.0.4",
|
|
84
84
|
"next": "^16.4.6",
|
|
85
85
|
"react": "^19.3.1",
|
|
86
86
|
"react-dom": "^19.3.1",
|
|
87
|
-
"verbaly": "^0.
|
|
87
|
+
"verbaly": "^0.84.0"
|
|
88
88
|
},
|
|
89
89
|
"scripts": {
|
|
90
90
|
"build": "tsdown",
|