@uniweb/build 1.6.1 → 1.6.2

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/build",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "Build tooling for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "exports": {
@@ -56,15 +56,15 @@
56
56
  "js-yaml": "^4.1.0",
57
57
  "sharp": "^0.35.3",
58
58
  "yaml": "^2.5.0",
59
- "@uniweb/schemas": "~1.5.1",
60
- "@uniweb/content-writer": "~1.3.0",
61
59
  "@uniweb/semantic-parser": "~1.12.2",
62
- "@uniweb/theming": "~1.2.0",
63
60
  "@uniweb/content-reader": "~1.5.4",
64
- "@uniweb/projections": "~1.1.4"
61
+ "@uniweb/theming": "~1.2.0",
62
+ "@uniweb/schemas": "~1.5.2",
63
+ "@uniweb/content-writer": "~1.3.0",
64
+ "@uniweb/projections": "~1.1.5"
65
65
  },
66
66
  "optionalDependencies": {
67
- "@uniweb/runtime": "~1.1.11"
67
+ "@uniweb/runtime": "~1.1.12"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
@@ -73,8 +73,8 @@
73
73
  "@tailwindcss/vite": "^4.0.0",
74
74
  "@vitejs/plugin-react": "^4.0.0 || ^5.0.0",
75
75
  "vite-plugin-svgr": "^4.0.0",
76
- "@uniweb/runtime": "~1.1.11",
77
- "@uniweb/core": "~1.3.1"
76
+ "@uniweb/core": "~1.3.2",
77
+ "@uniweb/runtime": "~1.1.12"
78
78
  },
79
79
  "peerDependenciesMeta": {
80
80
  "vite": {
@@ -39,6 +39,7 @@ import { resolveExtensionUrls } from './extension-urls.js'
39
39
  import { buildTheme, extractFoundationVars } from '../theme/index.js'
40
40
  import { resolveDefaultLocale, resolvePublishableLocales, validateLanguageConfig, pageRouteQuery, currentFor } from '@uniweb/core'
41
41
  import { authoredRedirectTarget } from '@uniweb/core/resolve-route'
42
+ import { parentRouteOf } from '@uniweb/core/route-match'
42
43
  import { parseFrontmatter } from '../utils/frontmatter.js'
43
44
  import { parseGrid } from '@uniweb/schemas/grid'
44
45
  import { runtimeServicesConfig, refuseRetiredServiceKeys, refuseUnreadableServices } from '../uwx/services-request.js'
@@ -2719,8 +2720,10 @@ export async function collectSiteContent(sitePath, options = {}) {
2719
2720
  }
2720
2721
  }
2721
2722
 
2722
- // Compute parent route for each page (hierarchy declaration)
2723
- // This runs once at build time so runtime doesn't need to re-derive hierarchy
2723
+ // Compute parent route for each page (hierarchy declaration), by the one parent rule
2724
+ // (`parentRouteOf`) — so the parent declared here is the one every lane derives, past a
2725
+ // version folder included. This runs once at build time so runtime doesn't need to
2726
+ // re-derive hierarchy.
2724
2727
  const pageRouteMap = new Map()
2725
2728
  for (const page of pages) {
2726
2729
  pageRouteMap.set(page.route, page)
@@ -2728,15 +2731,10 @@ export async function collectSiteContent(sitePath, options = {}) {
2728
2731
  pageRouteMap.set(page.sourcePath, page)
2729
2732
  }
2730
2733
  }
2734
+ const hasPage = (route) => pageRouteMap.has(route)
2731
2735
  for (const page of pages) {
2732
- const segments = page.route.split('/').filter(Boolean)
2733
- if (segments.length <= 1) {
2734
- page.parent = null
2735
- continue
2736
- }
2737
- const parentRoute = '/' + segments.slice(0, -1).join('/')
2738
- const parentPage = pageRouteMap.get(parentRoute)
2739
- page.parent = parentPage ? parentPage.route : null
2736
+ const parentRoute = parentRouteOf(page.route, { has: hasPage })
2737
+ page.parent = parentRoute ? pageRouteMap.get(parentRoute).route : null
2740
2738
  }
2741
2739
 
2742
2740
  const siteFetch = parseFetchConfig(...fetchIn(siteConfig, 'site.yml', 'site'))