@uniweb/runtime 0.11.4 → 0.11.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/runtime",
3
- "version": "0.11.4",
3
+ "version": "0.11.6",
4
4
  "description": "Minimal runtime for loading Uniweb foundations",
5
5
  "type": "module",
6
6
  "exports": {
@@ -36,7 +36,7 @@
36
36
  "node": ">=20.19"
37
37
  },
38
38
  "dependencies": {
39
- "@uniweb/core": "^0.8.4",
39
+ "@uniweb/core": "^0.8.5",
40
40
  "@uniweb/theming": "^0.1.15"
41
41
  },
42
42
  "devDependencies": {
@@ -44,7 +44,7 @@
44
44
  "esbuild": "^0.21.0 || ^0.23.0 || ^0.24.0 || ^0.25.0 || ^0.27.0",
45
45
  "vite": "^7.3.1",
46
46
  "vitest": "^4.1.7",
47
- "@uniweb/build": "0.18.3"
47
+ "@uniweb/build": "0.18.5"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "react": "^19.0.0",
@@ -58,6 +58,7 @@
58
58
  "build:worker": "node build-worker.js",
59
59
  "test": "vitest run",
60
60
  "test:watch": "vitest",
61
+ "channel:publish": "node scripts/release-channel.mjs",
61
62
  "relock": "node scripts/relock.js",
62
63
  "standalone:check": "node scripts/standalone-manifest.js --check"
63
64
  }
@@ -145,10 +145,23 @@ export default function PageRenderer() {
145
145
  // Auto-redirect for content-less pages (structural containers).
146
146
  // Folders with page.yml but no markdown keep their route in the hierarchy;
147
147
  // when visited directly, redirect to the first descendant with content.
148
- const autoRedirectRoute = page && !page.redirect && !page.hasContent()
148
+ //
149
+ // The DECISION stays canonical — `getNavigableRoute()` and `page.route` are
150
+ // both canonical, and comparing a localized URL against a canonical route
151
+ // would make a folder-with-index redirect to itself forever.
152
+ const navigableRoute = page && !page.redirect && !page.hasContent()
149
153
  ? page.getNavigableRoute()
150
154
  : null
151
- const shouldAutoRedirect = !!(autoRedirectRoute && autoRedirectRoute !== page?.route)
155
+ const shouldAutoRedirect = !!(navigableRoute && navigableRoute !== page?.route)
156
+
157
+ // The DESTINATION is localized. `getNavigableRoute()` returns a canonical
158
+ // route, so navigating to it raw dropped both the slug translation and the
159
+ // `/<locale>` prefix: visiting `/fr/Guide-de-démarrage-rapide` landed on
160
+ // `/Quick-Start-Guide/From-Idea-to-Website` and served the page in ENGLISH.
161
+ // getLocaleUrl() is the same helper the language switcher uses.
162
+ const autoRedirectRoute = shouldAutoRedirect
163
+ ? website?.getLocaleUrl?.(website.activeLocale, navigableRoute) || navigableRoute
164
+ : null
152
165
 
153
166
  // If no page found, try the 404 page (do NOT fall back to activePage/homepage)
154
167
  const isNotFound = !page && !redirectTarget