@uniweb/build 0.3.1 → 0.3.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 +4 -4
- package/src/prerender.js +1 -2
- package/src/site/content-collector.js +12 -3
- package/src/site/plugin.js +11 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/build",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Build tooling for the Uniweb Component Web Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"sharp": "^0.33.2"
|
|
51
51
|
},
|
|
52
52
|
"optionalDependencies": {
|
|
53
|
-
"@uniweb/content-reader": "1.0.
|
|
54
|
-
"@uniweb/runtime": "0.4.
|
|
53
|
+
"@uniweb/content-reader": "1.0.8",
|
|
54
|
+
"@uniweb/runtime": "0.4.3"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@tailwindcss/vite": "^4.0.0",
|
|
61
61
|
"@vitejs/plugin-react": "^4.0.0 || ^5.0.0",
|
|
62
62
|
"vite-plugin-svgr": "^4.0.0",
|
|
63
|
-
"@uniweb/core": "0.2.
|
|
63
|
+
"@uniweb/core": "0.2.5"
|
|
64
64
|
},
|
|
65
65
|
"peerDependenciesMeta": {
|
|
66
66
|
"vite": {
|
package/src/prerender.js
CHANGED
|
@@ -523,7 +523,6 @@ async function processPage(pagePath, pageName, siteRoot, { isIndex = false, pare
|
|
|
523
523
|
title: pageConfig.title || pageName,
|
|
524
524
|
description: pageConfig.description || '',
|
|
525
525
|
label: pageConfig.label || null, // Short label for navigation (defaults to title)
|
|
526
|
-
order: pageConfig.order,
|
|
527
526
|
lastModified: lastModified?.toISOString(),
|
|
528
527
|
|
|
529
528
|
// Dynamic route metadata
|
|
@@ -599,8 +598,9 @@ function determineIndexPage(orderConfig, availableFolders) {
|
|
|
599
598
|
|
|
600
599
|
const sorted = [...staticFolders].sort((a, b) => {
|
|
601
600
|
// Sort by order (lower first), then alphabetically
|
|
602
|
-
|
|
603
|
-
const
|
|
601
|
+
// Pages without explicit order come after ordered pages
|
|
602
|
+
const orderA = a.order ?? Infinity
|
|
603
|
+
const orderB = b.order ?? Infinity
|
|
604
604
|
if (orderA !== orderB) return orderA - orderB
|
|
605
605
|
return a.name.localeCompare(b.name)
|
|
606
606
|
})
|
|
@@ -655,6 +655,15 @@ async function collectPagesRecursive(dirPath, parentRoute, siteRoot, orderConfig
|
|
|
655
655
|
})
|
|
656
656
|
}
|
|
657
657
|
|
|
658
|
+
// Sort page folders by order (ascending), then alphabetically
|
|
659
|
+
// Pages without explicit order come after ordered pages (order ?? Infinity)
|
|
660
|
+
pageFolders.sort((a, b) => {
|
|
661
|
+
const orderA = a.order ?? Infinity
|
|
662
|
+
const orderB = b.order ?? Infinity
|
|
663
|
+
if (orderA !== orderB) return orderA - orderB
|
|
664
|
+
return a.name.localeCompare(b.name)
|
|
665
|
+
})
|
|
666
|
+
|
|
658
667
|
// Check if this directory contains version folders (versioned section)
|
|
659
668
|
const folderNames = pageFolders.map(f => f.name)
|
|
660
669
|
const detectedVersions = detectVersions(folderNames)
|
package/src/site/plugin.js
CHANGED
|
@@ -93,16 +93,20 @@ async function processDevSectionFetches(sections, cascadedData, fetchOptions) {
|
|
|
93
93
|
if (sectionFetch) {
|
|
94
94
|
const result = await executeFetch(sectionFetch, fetchOptions)
|
|
95
95
|
if (result.data && !result.error) {
|
|
96
|
-
// Merge fetched data into
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
// Merge fetched data into section's parsedContent (not cascadedData)
|
|
97
|
+
// This matches prerender behavior - section's own fetch goes to content.data
|
|
98
|
+
section.parsedContent = mergeDataIntoContent(
|
|
99
|
+
section.parsedContent || {},
|
|
100
|
+
result.data,
|
|
101
|
+
sectionFetch.schema,
|
|
102
|
+
sectionFetch.merge
|
|
103
|
+
)
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
106
|
|
|
104
|
-
// Attach cascaded data
|
|
105
|
-
|
|
107
|
+
// Attach cascaded data for components with inheritData
|
|
108
|
+
// Note: cascadedData is from page/site level only, not section's own fetch
|
|
109
|
+
section.cascadedData = cascadedData
|
|
106
110
|
|
|
107
111
|
// Process subsections recursively
|
|
108
112
|
if (section.subsections && section.subsections.length > 0) {
|